Use tf2 in ROS2
Hi I want to write a python node which transforms the lidar data of the turtlebot 3 from basescan to baselink.
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?
Asked by ugeltuff on 2021-04-30 15:34:53 UTC
Answers
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.
Asked by shonigmann on 2021-05-03 12:21:55 UTC
Comments