36 tcp = tcp ? tcp : rns->getTCP();
42 for (VirtualRobot::RobotNodePtr rn : rns->getAllRobotNodes())
44 if (rn->isLimitless())
50 rn->setJointValue((rn->getJointLimitHi() + rn->getJointLimitLo()) / 2);
55 std::vector<IKStep> ikSteps;
56 Eigen::VectorXf currentJointValues = rns->getJointValuesEigen();
59 Eigen::Vector3f posDiff = positionController.
getPositionDiff(targetPose);
64 Eigen::VectorXf cartesianVel(6);
65 cartesianVel << posDiff(0), posDiff(1), posDiff(2), oriDiff(0), oriDiff(1), oriDiff(2);
67 const Eigen::VectorXf jv = velocityController.
calculate(cartesianVel, jnv, VirtualRobot::IKSolver::All);
72 Eigen::VectorXf jvClamped = jv * stepLength;
74 float infNorm = jvClamped.lpNorm<Eigen::Infinity>();
85 s.cartesianVel = cartesianVel;
89 s.jvClamped = jvClamped;
90 ikSteps.emplace_back(
s);
94 Eigen::VectorXf newJointValues = currentJointValues + jvClamped;
95 rns->setJointValues(newJointValues);
96 currentJointValues = newJointValues;
110 for (
size_t i = 0; i < rns->getSize(); i++)
112 VirtualRobot::RobotNodePtr rn = rns->getNode(i);
113 if (rn->isLimitless())
119 result.
jointLimitMargins(i) =
std::min(rn->getJointValue() - rn->getJointLimitLo(), rn->getJointLimitHi() - rn->getJointValue());
130 rns->setJointValues(initialJV);
144 : rns(rns), tcp(tcp), params(params)
164 rns->setJointValues(startJointValues);