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

tf2::toMsg(tf2::Vector3) in ROS2 Foxy?

asked 2020-12-11 15:54:59 -0600

rblilja gravatar image

I'm on ROS2 Foxy and cannot find the toMsg() function for Vector3 that used to be in tf2_geometry_msgs.h. In previous versions the following function exists:

geometry_msgs::Vector3 tf2::toMsg (const tf2::Vector3 &in)

Has it been moved or removed completely? What shall I use instead? I do not really fancy to use the stamped version of Vector3.

Thanks!

edit retag flag offensive close merge delete

Comments

I have a custom message with multiple vectors and a header (with time and frame id). Therefore I don't see the necessity to use stamped vectors.

rblilja gravatar image rblilja  ( 2020-12-12 02:12:58 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-12-11 23:18:29 -0600

It's Vector3Stamped now. Most all of the ROS2 TF2 non-Stamped conversions were removed. I don't know the exact reason why, but I'm going to speculate that it has to do with TF2 in general really only supporting Stamped types so the conversions to/from messages really don't need the non-stamped versions anymore. The only exception I can find to that is Quaternion which is needed by the other functions regarding the transform message.

https://github.com/ros2/geometry2/blo....

Just as a policy, if you're using TF2, it's good to use stamped variants so you don't make silly mistakes like misassigning frames/data to their proper timestamps and frames.

edit flag offensive delete link more
0

answered 2022-06-20 17:13:58 -0600

charlie92 gravatar image

updated 2022-06-20 17:14:11 -0600

Later versions of ROS2 (galactic) brought back the non-stamped versions https://github.com/ros2/geometry2/blo...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-12-11 15:49:06 -0600

Seen: 1,697 times

Last updated: Jun 20 '22