Skip to content
Snippets Groups Projects
Commit 72c13a89 authored by Fabian Reister's avatar Fabian Reister
Browse files

KinematicUnitGui: if switching to velocity control mode, setting velocity to zero

parent 09137da0
No related branches found
No related tags found
No related merge requests found
......@@ -678,10 +678,15 @@ void KinematicUnitWidgetController::setControlModeVelocity()
return;
}
NameControlModeMap jointModes;
NameValueMap jointVelocities;
if (currentNode)
{
jointModes[currentNode->getName()] = eVelocityControl;
// set the velocity to zero to stop any previous controller (e.g. torque controller)
jointVelocities[currentNode->getName()] = 0;
const bool isDeg = ui.checkBoxUseDegree->isChecked();
const bool isRot = currentNode->isRotationalJoint();
QString unit = isRot ?
......@@ -697,6 +702,7 @@ void KinematicUnitWidgetController::setControlModeVelocity()
if (kinematicUnitInterfacePrx)
{
kinematicUnitInterfacePrx->switchControlMode(jointModes);
kinematicUnitInterfacePrx->setJointVelocities(jointVelocities);
}
}
catch (...)
......
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