How to correctly translate a pose along an axis?
I have a pose of my robot base_link
in the map
frame. I'd like to translate this 0.2 m
along the robot x-axis
so the
point is in front of the robot. To do this I've tried the following but all it seems to do is give the transformed_pose
the same position in the x-axis
of my transforms x-axis
translation. How might I fix this?
transform = TransformStamped()
transform.transform.translation.x = 0.2
transformed_pose = tf2_geometry_msgs.do_transform_pose(pose, transform)
transformed_pose:
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: ''
pose:
position:
x: 0.4
y: 0.0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.5
w: 0.0
I've tried to troubleshoot this issue in this question, which may be a useful reference.
This answer might be helpful https://answers.ros.org/question/2223...
I use this method to get the pose of my robot
base_link
in themap
frame actually and it works great. How would I adapt this method to get the pose of the robotbase_link
+ 0.2 m in thex-axis
in themap
frame?