26 #include <VirtualRobot/RobotNodeSet.h>
31 using namespace MotionControlGroup;
34 CartesianRelativePositionControl::SubClassRegistry
48 if (!in.isTcpRelativeOrientationSet() && !in.isTcpRelativePositionSet())
50 ARMARX_ERROR <<
"TcpRelativeOrientation and/or TcpRelativePosition has to be set, but none "
57 getContext<MotionControlGroupStatechartContext>();
60 robot->getRobotNodeSet(in.getKinematicChainName())->getTCP()->getPoseInRootFrame();
61 std::string rootFrameName = robot->getRootNode()->getName();
62 std::string agentName = robot->getName();
66 auto localRobot = robot->clone();
67 if (in.isTcpRelativePositionSet())
69 Eigen::Vector3f positionOffset = in.getTcpRelativePosition()->toRootEigen(localRobot);
70 Eigen::Vector3f targetPosition = currentTcpPose.block<3, 1>(0, 3) + positionOffset;
73 local.setTcpTargetPosition(targetPositionPtr);
76 if (in.isTcpRelativeOrientationSet())
78 Eigen::Matrix3f orientationOffset = in.getTcpRelativeOrientation()->toRootEigen(localRobot);
79 Eigen::Matrix3f targetOrientation = currentTcpPose.block<3, 3>(0, 0) * orientationOffset;
82 local.setTcpTargetOrientation(targetOrientationPtr);
111 getContext<MotionControlGroupStatechartContext>();
114 robot->getRobotNodeSet(in.getKinematicChainName())->getTCP()->getPoseInRootFrame();