Skip to content
Snippets Groups Projects
Commit c9d8b1b3 authored by jsi's avatar jsi
Browse files
parents 1e3f3d28 8b175382
No related branches found
No related tags found
No related merge requests found
......@@ -202,23 +202,28 @@ namespace armarx
ikSolver.enableJointLimitAvoidance(true);
auto globalPos = targetPosition->toGlobal(localRobot);
ARMARX_VERBOSE << deactivateSpam(1) << "Calculating IK for target position " << globalPos->output();
ARMARX_VERBOSE << "Calculating IK for target position " << globalPos->output();
if (!ikSolver.solve(globalPos->toEigen()))
{
ARMARX_WARNING << "IKSolver found no solution!";
}
else
{
ARMARX_DEBUG << "Solution found";
NameValueMap targetJointAngles;
NameControlModeMap controlModes;
for (int i = 0; i < (signed int)kinematicChain->getSize(); i++)
{
if (kinematicChain->getNode(i)->getName().compare("VirtualCentralGaze") != 0)
{
targetJointAngles[kinematicChain->getNode(i)->getName()] = kinematicChain->getNode(i)->getJointValue();
controlModes[kinematicChain->getNode(i)->getName()] = ePositionControl;
}
ARMARX_DEBUG << kinematicChain->getNode(i)->getName() << ": " << kinematicChain->getNode(i)->getJointValue();
}
try
{
kinematicUnitPrx->switchControlMode(controlModes);
kinematicUnitPrx->setJointAngles(targetJointAngles);
} 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