Ask Your Question

Use tf2 in ROS2

asked 2021-04-30 15:39:30 -0500

ugeltuff gravatar image

Hi I want to write a python node which transforms the lidar data of the turtlebot 3 from base_scan to base_link.

Unfortunately I haven't found any documentation or code snippets to do this with tf2 in ROS2.

Does anybody have an idea how to do this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-05-03 12:21:55 -0500

Your turtlebot's URDF should already have joints defined which implicitly define the base_scan -> base_link transformation. These should all be fixed joints so it will be a static transform. As long as you have a robot_state_publisher node using the URDF, that transformation will be published on /tf_static.

If you need to perform the frame conversion somewhere in your code to get the instantaneous positions in the base_link frame, you can look at tf2_ros's buffer_interface. But many applications (e.g. rviz) will be able to do these transformations automatically if the robot_state_publisher is running.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-04-30 15:34:53 -0500

Seen: 51 times

Last updated: May 03