Getting the position of TurtleBot3 using transforms
I'm pretty new to ROS2, and I'm having trouble understanding frames and how to work with them.
I'm running the TurtleBot3 bringup on a real turtlebot and have the turtlebot3cartographer node running on a different computer. The transforms map -> odom
and `odom -> basefootprint` are published. Are these enough to determine the position of the robot in the map? When the two transforms are added up, shouldn't that be the position of the base_footprint, or the robot? Having tried this, this doesn't seem to work correctly.
The transforms base_link -> wheel_left_link
and base_link -> wheel_right_link
are also published. As far as I understand, baselink is the robot itself, but there seem to be no transforms to baselink. Is base_link only used to get the relative distance between various parts of the robot, or is this also used for positioning of the robot itself?
Am I on the right track trying to get the position of the turtlebot in the map using transforms, or is there another method I'm missing?
Thanks in advance!
Asked by Jona Verdonk on 2021-04-21 02:28:12 UTC
Answers
Hi,
The transform map -> odom
is being published by the cartographer node, while odom -> base_footprint
by the turtlebot. And yes, these transforms are enough to determine the position of the robot with respect to the map.
The base_footprint
transform is at the "center" of the robot, so the if you add the transforms from map -> odom -> base_footprint
you should be able to obtain the position of the robot.
You can listen to the transforms with the following command:
ros2 run tf2_ros tf2_echo map base footprint
If you want to look at an in-depth explanation of what I explained above, you can take a look at the video I made: https://youtu.be/45WiB3QH3wU
Asked by rodrigo55 on 2021-08-12 03:05:47 UTC
Comments