Skip to content
Snippets Groups Projects
Commit 843b1137 authored by Mirko Wächter's avatar Mirko Wächter
Browse files

fixed race condition in TCPControllerSubUnit

parent 9183f045
No related branches found
No related tags found
No related merge requests found
......@@ -120,11 +120,21 @@ void TCPControllerSubUnit::setTCPVelocity(const std::string& nodeSetName, const
}
ARMARX_DEBUG << "CartesianSelection-Mode: " << (int)mode;
auto controllerName = this->getName() + "_" + tcp + "_" + nodeSetName + "_mode_" + std::to_string((int)mode);
auto activeNJointControllers = robotUnit->getNJointControllersNotNull(robotUnit->getNJointControllerNames());
auto NJointControllers = robotUnit->getNJointControllerNames();
NJointCartesianVelocityControllerWithRampPtr tcpController;
bool nodeSetAlreadyControlled = false;
for (NJointControllerPtr controller : activeNJointControllers)
for (auto& name : NJointControllers)
{
NJointControllerPtr controller;
try
{
controller = robotUnit->getNJointControllerNotNull(name);
}
catch (...)
{
continue;
}
tcpController = NJointCartesianVelocityControllerWithRampPtr::dynamicCast(controller);
if (!tcpController)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment