# 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 turtlebot3_cartographer node running on a different computer. The transforms map -> odom and odom -> base_footprint 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, base_link is the robot itself, but there seem to be no transforms to base_link. 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?

edit retag close merge delete

Sort by » oldest newest most voted

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

more

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

## Stats

Asked: 2021-04-21 02:28:12 -0500

Seen: 327 times

Last updated: Aug 12 '21