Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Multi robot simulation in ROS

Hello everybody,

I have a problem with multi-robot simulation.

I have a launch file that launches two xacro files

<node name="spawn_quad0" pkg="gazebo" type="spawn_model" args="-urdf -param quad_urdf -model quad0 -x 0 -y 0 -z 3" respawn="false" output="screen"> </node>

<node name="spawn_quad1" pkg="gazebo" type="spawn_model" args="-urdf -param quad_urdf -model quad1 -x 1 -y 1 -z 3" respawn="false" output="screen"> </node>

The file quadrotorWithCamera.xacro loads a camera that publishes on /ptz/camera_info (as example of a topic).

Obviously, both quadrotors will publish on this topic and that's wrong. I see two solutions:

1) rename topic with remap. But it doesn't work. I set <remap from="ptz/camera_info" to="ptz/camera_info2"/> in both node but if I run rostopic list /ptz/camera_info is still on while /ptz/camera_info2 has no topic published on it.

2) Try to give as input to xacro file the robot name but it seems no input is available.

Any suggestion?

Thanks for any reply,

Neostek

Multi robot simulation in ROS

Hello everybody,

I have a problem with multi-robot simulation.

I have a launch file that launches two xacro files

 <param name="quad_urdf"
    command="$(find xacro)/xacro.py
    '$(find package)/models/quadrotorWithCamera.xacro'"
 />

<node name="spawn_quad0"  pkg="gazebo" type="spawn_model" type="spawn_model"
  args="-urdf -param quad_urdf -model quad0 -x 0 -y 0 -z 3" 3"
  respawn="false" output="screen">
</node>

</node> <node name="spawn_quad1" pkg="gazebo" type="spawn_model" type="spawn_model" args="-urdf -param quad_urdf -model quad1 -x 1 -y 1 -z 3" 3" respawn="false" output="screen"> </node>

</node>

The file quadrotorWithCamera.xacro loads a camera that publishes on /ptz/camera_info (as example of a topic).

Obviously, both quadrotors will publish on this topic and that's wrong. I see two solutions:

1) rename topic with remap. But it doesn't work. I set <remap from="ptz/camera_info" to="ptz/camera_info2"/> in both node but if I run rostopic list /ptz/camera_info is still on while /ptz/camera_info2 has no topic published on it.

2) Try to give as input to xacro file the robot name but it seems no input is available.

Any suggestion?

Thanks for any reply,

Neostek