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

TF2 how to translate vector in Python?

asked 2017-10-23 06:38:06 -0500

Hendrik Wiese gravatar image

Hi everyone,

I think I'm experiencing a severe blackout right now...

A short one: in Python, how do I translate a 3D vector (a numpy array) from one TF2 frame to another considering position and orientation of the reference frames?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-24 02:27:28 -0500

Hendrik Wiese gravatar image

Figured it out myself: by using tf2_geometry_msgs.do_transform_vector3 and its respective siblings for geometry_msgs/Point and so on.

  1. lookup a transform for the desired coordinate transformation
  2. create the point/vector you want to translate
  3. do_transform_point/vector on the point/vector
  4. returns the original point/vector in the new coordinate frame
  5. ...
  6. profit!
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-10-23 06:38:06 -0500

Seen: 1,175 times

Last updated: Oct 24 '17