Skip to content
Snippets Groups Projects
Commit dd2e6946 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Set complete joint angles

parent 1efa62ad
No related branches found
No related tags found
1 merge request!241Resolve "Fix bug in KinematicUnitGui controlling Torso Joint of ARMAR-DE to 0 when reconnecting"
......@@ -638,21 +638,15 @@ void KinematicUnitWidgetController::setControlModePosition()
return;
}
// currentNode->getJointValue() can we wrong after we re-connected to the robot unit.
// E.g., it can be 0 although the torso joint was at -365 before the unit disconnected.
// Therefore, we first have to fetch the actual joint values and use that one.
const NameValueMap currentJointAngles = kinematicUnitInterfacePrx->getJointAngles();
if (auto it = currentJointAngles.find(currentNode->getName()); it != currentJointAngles.end())
{
currentNode->setJointValue(it->second);
}
else
{
// Put this into else clause so the message is only constructed when necessary.
ARMARX_CHECK(false)
<< "Expected joint angles to contain '" << currentNode->getName() << ", "
<< "but contained: " << simox::alg::get_keys(currentJointAngles);
return;
// currentNode->getJointValue() can we wrong after we re-connected to the robot unit.
// E.g., it can be 0 although the torso joint was at -365 before the unit disconnected.
// Therefore, we first have to fetch the actual joint values and use that one.
// However, this should actually not be necessary, as the robot model should be updated
// via the topics.
const NameValueMap currentJointAngles = kinematicUnitInterfacePrx->getJointAngles();
robot->setJointValues(currentJointAngles);
}
float pos = currentNode->getJointValue() * conversionFactor;
......@@ -713,10 +707,7 @@ void KinematicUnitWidgetController::setControlModeVelocity()
ui.horizontalSliderKinematicUnitPos->setMinimum(lo);
ui.horizontalSliderKinematicUnitPos->blockSignals(false);
resetSlider();
}
}
void KinematicUnitWidgetController::setControlModeTorque()
......
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