Change the robot in a simulation

Hi everyone,
I’m new in this world and I’m a beginner in ROS. I discovered ROS a couple of months ago for a school project. Now i know a little bit more but it still very poor and I hope that someone could help me.

I have the following problem.
I can use the TurtleBot simulation and the swar_robot_ros_sim ( In this latest, In the aggregation simulation, they use a two wheel Robot but I would like to change it in a TurtleBot Robot (Burger). I know that’s not easy, but can I do this change without changing all the code files? My idea was to create a new package with the robot and the simulation only.

best regards


By changing the robot, what do you mean exactly?

  1. If its only the meshes, is just a meter of chnging them in the XACRO or URDF file visual tags.
  2. If you want to change it completely, its just spawning the turtlebot3 instead of the other one.

I would recommend you to create a rosject and share it here so that we can test and help you better.

@duckfrost thank you for your response. Since my topic I changed the URDF file to have the burger robot. I had to change the old file and keep the same link names and it works. However the robots (burger) cannot move. With the old robots the had a swarm behaviour but now it doesn’t work anymore.

when i launch the node "rosrun swarm_robot_simulation two_wheel_robot_aggregation _sensing_range:=1.5 “I have the following errors “the robot model not found when set left wheel vel” (and the same with the right wheel”. I searched in the cpp file which part generates the error and i found it but I don’t know to much in c++.
Also I have en error with the connection with gazebo server when I launch gazebo (without moving the robots).

this is the part in the cpp file



I’m not sure, but it could be related to the namespaces of multiple robots. Check that the joints names are exactly that. You might have to check the robot descriptions and see what loaded there exctly.
Also try to execute that service call manually and see what you need to give, maybe that gives you a clue.

Also try using the differential drive plugin instead of your own code, if what you are showing me is your own code of course

Hi @duckfrost I created a rosject so you can see and manipulate it.
Rosject Name : SWARM Behaviour (wassim97it).

The nodes to launch :

  1. roslaunch swarm_robot_description two_wheel_robot.launch robot_quantity:=10 half_range:=2.0
    I already modified the xml file “two_wheel_roobot.urdf” to have the turtlebot burger. This file is located in catkin_ws/src/swarm_robot_ros_sim/swarm_robot_description/urdf in this folder you can also find the original one (whit this one the aggregation works, but you have to rename it two_wheel_roobot.urdf as in the launch file).
  2. rosrun swarm_robot_simulation two_wheel_robot_aggregation _sensing_range:=1.5 i have the previous problem with this node. the robots cannot move and I have the following error :

It is not my code, I’m just using these packages for a school project. Let me know if you need more information and thank you for your time.