ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How do I cartesin plan along the axis of the interactive marker?

asked 2020-05-18 03:08:26 -0500

whitecatshiro gravatar image
wpose = group.get_current_pose().pose
wpose.position.z -= scale * 0.1  # First move up (z)
wpose.position.x += scale * 0.1  # and sideways (y)
waypoints.append(copy.deepcopy(wpose))

the code above (from the move_group_python_interface.py script) I believe plans on a Cartesian plane defined by the origin xyz axis in moveit, but doesn't plan in the direction of the arrows of the interactive marker. Is there another way to plan and move specifically in the directions of the arrows of the interactive marker, specifically the red arrow of the marker shown in the image?

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-18 03:41:48 -0500

fvd gravatar image

You seem to be asking how to apply relative targets in the end effector frame (or whichever you interactive marker is placed on), so I'll repost part of this old question.

You will want to use a PoseStamped object, transform it to the end effector frame in which you want to apply the offset, and then (if necessary) transform it back to the planning frame (usually world or the robot base).

tf::TransformListener tf_listener; // Declared in advance

...

geometry_msgs::PoseStamped pose0 = group.getCurrentPose();
geometry_msgs::PoseStamped pose_in_ee_frame;
tf_listener.transformPose("your_end_effector_frame", pose0, pose_in_ee_frame);
pose_in_ee_frame.pose.position.y -= .05;
tf_listener.transformPose(pose0.header.frame_id, pose_in_ee_frame, pose0);

waypoints.push_back(pose0.pose)
...

PS: From Noetic, you will find a convenient checkbox saying "Use Cartesian Path" in the Rviz plugin. You can also get it by compiling MoveIt from source (which should still be possible on Kinetic at the moment).

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-05-18 03:08:26 -0500

Seen: 162 times

Last updated: May 18 '20