How to use move_group to move robot in different coordinates?
Hello,
As in teach pendant by setting tool coordinate we can move robot only in that coordinates.
how can I use move_group to move robotic arm in tool0 (as in motoman robot) coordinates instead of base_link? I am using setPoseRefernceFrame() like this,
moveit::planning_interface::MoveGroupInterface::Plan my_planx1;
geometry_msgs::PoseStamped target_posex1;
move_group.setPoseReferenceFrame("tool0");
target_posex1 = move_group.getCurrentPose();
target_posex1.position.z -=0.342;
move_group.setPoseTarget(target_posex1);
move_group.setMaxVelocityScalingFactor(0.01);
move_group.plan(my_plan);
But it is still moving according to base_link coordinate. is there any other method?
Thanks.
................. I try this one,
const Eigen::Affine3d &end_effector_state = current_state->getGlobalLinkTransform("tool0");
geometry_msgs::Pose pose;
tf::poseEigenToMsg(end_effector_state, pose);
pose.position.y += 0.342;
move_group.setPoseTarget(pose);
but still It is moving in base_link coordinate.