3 #include <SimoxUtility/math/convert/mat4f_to_quat.h>
4 #include <VirtualRobot/IK/DifferentialIK.h>
5 #include <VirtualRobot/IK/JacobiProvider.h>
6 #include <VirtualRobot/MathTools.h>
7 #include <VirtualRobot/Nodes/RobotNode.h>
8 #include <VirtualRobot/Robot.h>
9 #include <VirtualRobot/RobotNodeSet.h>
24 const VirtualRobot::RobotNodeSetPtr& rtRns)
28 rtTCP = rtRns->getTCP();
30 ik.reset(
new VirtualRobot::DifferentialIK(
31 rtRns, rtRns->getRobot()->getRootNode(), VirtualRobot::JacobiProvider::eSVDDamped));
80 c.desiredPose.block<3, 3>(0, 0) * rtStatus.
currentPose.block<3, 3>(0, 0).transpose();
93 if ((
c.desiredPose.block<3, 1>(0, 3) - rtStatus.
currentPose.block<3, 1>(0, 3)).norm() >
94 c.safeDistanceMMToGoal or
97 VirtualRobot::MathTools::deg2rad(
c.safeRotAngleDegreeToGoal))
113 c.desiredTwist.setZero();
114 c.kmAdmittance.setZero();
119 ik->getJacobianMatrix(
rtTCP, VirtualRobot::IKSolver::CartesianSelection::All);
126 ik->computePseudoInverseJacobianMatrix(rtStatus.
jacobi.transpose(), lambda);
161 VirtualRobot::MathTools::rpy2eigen3f(
162 rtStatus.
pos(3), rtStatus.
pos(4), rtStatus.
pos(5)) *
171 rtStatus.
currentPose.block<3, 3>(0, 0).transpose();
185 c.kpNullspace.cwiseProduct(
c.desiredNullspaceJointAngles.value() - rtStatus.
jointPos) -
258 currentPose = currentTCPPose;
259 desiredPose = currentTCPPose;
260 accumulateTime = 0.0;