Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

Give unique names to the plugins

<plugin name="camera_x" filename="libgazebo_ros_camera.so">

as well as camera names

<cameraName>camera_x</cameraName>

Give unique names to the plugins

<plugin name="camera_x" filename="libgazebo_ros_camera.so">

as well as camera names

<cameraName>camera_x</cameraName>


Edit:

To spawn multiple instances of your model, you need to remove the robotNamespace parameter from the model. Then you can spawn unique models by adding a namespace to the spawn_model node:

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model $(arg robot_name) -param robot_description" ns="$(arg robot_name)" />

Alternatively, although not recommended, you can add an argument for the robot name in your urdf:

<xacro:arg name="robot_name" default="robot_0" />
<plugin name="camera_controller" filename="libgazebo_ros_camera.so">
  ...
  <robotNamespace>$(arg robot_name)</robotNamespace>    
</plugin>

Then, you need to create individual urdf descriptions for each robot:

<param name="$(arg robot_name)/robot_description" command="rosrun xacro xacro /path/to/xacro/file robot_name:=$(arg robot_name)" />
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model $(arg robot_name) -param $(arg robot_name)/robot_description" />