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

Getting the position of TurtleBot3 using transforms

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

Jona Verdonk gravatar image

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?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-08-12 03:05:47 -0500

rodrigo55 gravatar image

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

edit flag offensive delete link more

Question Tools

2 followers

Stats

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

Seen: 1,184 times

Last updated: Aug 12 '21