31 using namespace CoupledInteractionGroup;
47 getContext<CoupledInteractionGroupStatechartContext>();
48 float liftOffset = in.getLiftOffset();
50 context->
getRobot()->getRobotNode(in.getLeftHandName())->getPoseInRootFrame();
52 context->
getRobot()->getRobotNode(in.getRightHandName())->getPoseInRootFrame();
53 FramedPosePtr initialLeftTcpPoseBase = in.getInitialLeftTcpPose();
54 FramedPosePtr initialRightTcpPoseBase = in.getInitialRightTcpPose();
56 Eigen::Matrix4f initLeftTcpPoseBase = initialLeftTcpPoseBase->toEigen();
57 Eigen::Matrix4f initRightTcpPoseBase = initialRightTcpPoseBase->toEigen();
58 Eigen::Vector3f leftOrientationVel;
59 leftOrientationVel(0) = 0.0;
60 leftOrientationVel(1) = 0.0;
61 leftOrientationVel(2) = 0.0;
62 Eigen::Vector3f rightOrientationVel;
63 rightOrientationVel(0) = 0.0;
64 rightOrientationVel(1) = 0.0;
65 rightOrientationVel(2) = 0.0;
66 Eigen::Vector3f leftPositionVel;
67 leftPositionVel(0) = 0.0;
68 leftPositionVel(1) = 0.0;
69 leftPositionVel(2) = liftOffset + initLeftTcpPoseBase(2, 3) - leftTcpPoseBase(2, 3);
70 ARMARX_INFO <<
"in check lift height init and current" << initLeftTcpPoseBase(2, 3) <<
" "
71 << leftTcpPoseBase(2, 3);
72 Eigen::Vector3f rightPositionVel;
73 rightPositionVel(0) = 0.0;
74 rightPositionVel(1) = 0.0;
75 rightPositionVel(2) = liftOffset + initRightTcpPoseBase(2, 3) - rightTcpPoseBase(2, 3);
77 if (fabs(rightPositionVel(2)) < 30.0 || fabs(leftPositionVel(2)) < 30.0)
79 leftPositionVel(2) = 0;
80 rightPositionVel(2) = 0;
81 out.setCurrentLeftOrientationVel(
83 out.setCurrentRightOrientationVel(
85 out.setCurrentLeftPositionVel(
FramedDirection(leftPositionVel,
"Armar3_Base",
"Armar3"));
86 out.setCurrentRightPositionVel(
FramedDirection(rightPositionVel,
"Armar3_Base",
"Armar3"));
87 emitEvLiftHeightReached();
91 out.setCurrentLeftOrientationVel(
93 out.setCurrentRightOrientationVel(
95 out.setCurrentLeftPositionVel(
FramedDirection(leftPositionVel,
"Armar3_Base",
"Armar3"));
96 out.setCurrentRightPositionVel(
FramedDirection(rightPositionVel,
"Armar3_Base",
"Armar3"));
97 emitEvLiftHeightNotReached();
128 return "CheckLiftHeight";