Ask Your Question

Multiple turtlebot 3 simulation in ROS2

asked 2020-06-15 18:34:53 -0600

JulioEsteban gravatar image

I've been trying to simulate multiple turtlebot3 in ROS2 dashing to no avail. If anyone knows how to do this that could answer my question I'd be really grateful.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-17 15:10:12 -0600


I've been working on this also, but It's quite cumbersome.

As far as I know, the tb3 models are spawned as .sdf models directly on the turtlebot3_gazebo world files () whereas the tf is created by a robot publisher that uses a urdf on the trutlebot_description

What I've done is the following:

  • Create copies of the tb3 models with a different name (I.e tb_1_burger, tb_2_buger)

  • Edit the model.sdf files on the new copies by adding the namespace tags according.

  • Edit the world file that you are launching to add the new models.

At this point you will have the two robots on gazebo, but the tf tree will be duplicated, so now it's time to edit the .urdf. For this it's possible to create a .xacro file, but depending on which ros2 version you are using that can change quite a lot. So a long and boring way to do this is to

  • Create copies of the .urdf files for the new robots/models. You can find them in the turtlebot_description/urdf and there you need to manually change the links, joints to include the prefix.

  • Finally, you need to update the robot_state_publisher.launch to launch the different .urdf files you just created.

At this point, the multiple tb3 models should work, but it may still be some issues I haven't detected yet.

Hope this helps!


edit flag offensive delete link more



Hi I was trying to follow your instructions but I kind of confused what to exactly edit. Like in the part where we have to add the namespaces what do we exactly have to fill it in with?

quadcopter gravatar image quadcopter  ( 2021-03-01 06:21:11 -0600 )edit

Are you able to provide an example for changing the links in the urdf files, along with how to update the robot_state_publisher.launch file? Thanks so much!

Neubist gravatar image Neubist  ( 2021-03-04 12:38:28 -0600 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2020-06-15 18:34:53 -0600

Seen: 385 times

Last updated: Jun 17 '20