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

Revision history [back]

click to hide/show revision 1
initial version

To translate a pose in the same frame of reference just add the translation offsets for each axis. For instance:

initial_pose = Pose()
initial_pose.position.x = 0
initial_pose.position.y = 0
initial_pose.position.z = 0

# translate +5 in x-axis, +2 in y-axis and -10 in z-axis
initial_pose.position.x += 5
initial_pose.position.y += 2
initial_pose.position.z += 0-10

To translate a pose in the same frame of reference just add the translation offsets for each axis. For instance:

initial_pose = Pose()
initial_pose.position.x = 0
initial_pose.position.y = 0
initial_pose.position.z = 0

# translate +5 in x-axis, +2 in y-axis and -10 in z-axis
initial_pose.position.x += 5
initial_pose.position.y += 2
initial_pose.position.z += 0-10
-10

To translate a pose in the same frame of reference just add the translation offsets for each axis. For instance:

initial_pose = Pose()
initial_pose.position.x = 0
initial_pose.position.y = 0
initial_pose.position.z = 0

# translate +5 in x-axis, +2 in y-axis and -10 in z-axis
initial_pose.position.x += 5
initial_pose.position.y += 2
initial_pose.position.z += -10

tf2 is used to transform between multiple coordinate frames, which you said isn't what you want to do. So no need to use tf2 here.