26 #include <VirtualRobot/MathTools.h>
32 using namespace CoupledInteractionGroup;
35 CalculateApproachTablePose::SubClassRegistry
46 CalculateApproachTablePose::getYawAngle(
const Eigen::Matrix4f& pose)
const
49 VirtualRobot::MathTools::eigen4f2rpy(pose, rpy);
57 getContext<CoupledInteractionGroupStatechartContext>();
58 float approachDistance = in.getApproachDistance();
59 float finalDistance = in.getFinalDistance();
61 ARMARX_LOG <<
"Incoming Table Pose " << *tablePose;
63 approachoffset(0, 3) = approachDistance;
65 tablePose->toGlobal(context->
getRobot())->toEigen() * approachoffset;
68 finaloffset(0, 3) = finalDistance;
70 tablePose->toGlobal(context->
getRobot())->toEigen() * finaloffset;
72 Eigen::Vector3f finalplatformPosVec(
73 finalPoseGlobal(0, 3), finalPoseGlobal(1, 3), getYawAngle(finalPoseGlobal) + M_PI_2);
75 Eigen::Vector3f approachplatformPosVec(approachPoseGlobal(0, 3),
76 approachPoseGlobal(1, 3),
77 getYawAngle(approachPoseGlobal) + M_PI_2);
79 std::vector<Vector3Ptr> approachPoses;
80 approachPoses.push_back(
new Vector3(approachplatformPosVec));
81 approachPoses.push_back(
new Vector3(finalplatformPosVec));
82 out.setApproachTablePose(approachPoses);
83 emitEvApproachPoseCalculated();
180 return "CalculateApproachTablePose";