Gazebo | Ignition | Community
Ask Your Question

Robot-Plugin is Loaded again when spawning another Robot

asked 2013-07-29 07:52:59 -0500


I recognized that every time I spawn more than one robot using gazebo_ros_pkgs the Plugins of the already spawned robots are reloaded (load is called again...). Is this supposed to happen, or am I doing something wrong?

For a very small test I reduced my current launch file to this:

And start it with:

roslaunch my_bot_gazebo test.launch robot_name:=test1 robot_namespace:=test1 x:=10

roslaunch my_bot_gazebo test.launch robot_name:=test2 robot_namespace:=test2 x:=-10

I'm working with Gazebo1.9.5/ROS-Groovy

edit retag flag offensive close merge delete


I know this might be not the best thread to post this, but the multi-instance problem is probably related to a namespace (topic name) in your robot URDF file. You will need to override this when adding more than one instance, either by overriding certain parameters in the call, or by creating slightly modified URDF files to override the namespace settings.

Nevik gravatar imageNevik ( 2013-07-29 07:56:12 -0500 )edit

This happens with all of my robots even if I put the robotNamespace in the urdf explizitly and even with different urdfs(different robots all using different namespaces for their plugins).

btw: you can avoid the robotNamespace in the URDF-plugin part by using the -robot_namespace argument when calling spawn_model

evilBiber gravatar imageevilBiber ( 2013-07-29 08:27:07 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-08-13 10:35:18 -0500

The Problem was related to a Bug in the SDFFormat's urdf parser

Seems like Plugin Elements referencing the robot itself had been copied to all other robots...

The Problem is fixed in the current release...

I will mark this question as solved...

edit flag offensive delete link more

answered 2013-07-29 18:54:32 -0500

bit-pirate gravatar image

(In my opinion) This is suppose to happen. How else do you want to control your robot in the simulation, if its controller is not loaded?

I ran into the same issue and solved it - as @Nevik already suggested - by alternating model and topic names. (At least that was true some versions ago.)

edit flag offensive delete link more


This happens with different Robots and different Topics. In my Opinion it is very strange that a robots plugin is loaded multiple times when I load multiple robots. For my robots this means that they are trying to advertise ROS-services again. Creating Callback-Funktions twice etc... I have not writen those plugins myself and don't want to fix everyone of them! and as mentioned this also happens when I run completly diffrent robots in different ros and gazebo namespaces!!

evilBiber gravatar imageevilBiber ( 2013-07-30 01:21:13 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2013-07-29 07:52:59 -0500

Seen: 374 times

Last updated: Aug 13 '13