Spawn 2 Different Robots in Gazebo - Set the Launch file properly

Hi experts @staff
I have spent all day long trying to spawn 2 different robots in Gazebo (2 urdf). I could spawn them separately, so their model are correct. However when I try to spawn the both models with a customized world it is not posible. I would like to make one robot follow another using TF for my final project…

I have read and modified the files from this link https://www.theconstructsim.com/ros-qa-130-how-to-launch-multiple-robots-in-gazebo-simulator/
I 've tried to adapt from 2 different robots, however did not have success.
Could you please give me a tutorial how to perform that.
Below is my errors:

And my launch files

And the main launch file

For several instances of the same robot it works…but I wish to use distinct robots…

Thanks in advance

Have a look at this video: TWOROBOTSGazebo

1 Like

Yes I had seen…it is inside the link I have written above. But is just for 2 similar robots…when for 2 different so the launch file needs to be changed…but I got it. thanks

Hey bro! I have the same problem as you, have you fix this issue? Can you kindly post how you achieve two different robots?

2 Likes

Yes now I am going to sleep. Tomorrow I will look for the files and see if they still exist…Did you still solve already or still facing this issue? Let me know please…I just see your question today.

Hi,

Did you manage to launch two different urdf’s in one Gazebo simulation?

If so, would you mind showing me how it was achieved.

Thank you in advance.

Hi @gdong.hu I should have pasted the code here …well the problem is that I lost my files after I needed to format my computer that completely crashed and I could not do a backup. However as far as I remember I used 2 different Namespaces for the robots…ns = robot a…and wrote all the launch file parameters under this ns…and another ns in the same launch file ns =robot b…and wrote again all the launch file parameters of this robot under this other namespace.
There are some classes to work with urdf that they launch simultaneously 3 or 4 different robots ( I think is the introduction class - the first of urdf…) you can try by the name access the directories of this simulation of this class and figure out how they did it…or look in The Construct Bitbucktet here https://bitbucket.org/theconstructcore/workspace/projects/PS and then you can see all the files they used to write this URDF course…looking for Mira, jibo robot and others…
Wish you lucky. If I find this launch file in some lost github or pendrive I share here…but I am not confident about this…
Bye