Map building model setup

After finishing the ROS2 Navigation course I am trying to setup my own gazebo simulation with a robot (Ackermann steering) and try to build a map of the world using the cartographer_ros package. What I am struggling with unfortunately is the setup of frames - do I need to publish the map in the world gazebo model and then bridge that to ROS2 for rviz to register it? Also with the odom does that have to be linked to the robot or is that linked automatically between the map and base_footprint?

My setup is currently both world and robot model in gazebo, is that the right way of doing things or should it be world in gazebo and robot model in urdf/xacro?


Hello @roman.smid,

The map coordinate frame is published by AMCL (assuming you are running AMCL as the course does). Then, in the course the odom TF frame is broadcasted by the Gazebo differential drive plugin. In your case you have an Ackermann steering robot, so you are probably using a different plugin for sending steering and velocity commands so you have to check if that plugin broadcasts the odom transform. That will purely depend on the plugin that you are using. It is also worth mentioning that you might have to check AMCL’s configuration if your frame names have changed.

Hope this helps,