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

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
2

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

shonigmann gravatar image

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

Question Tools

1 follower

Stats

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

Seen: 354 times

Last updated: May 03 '21