[ros-users] Multi robot simulation

marco.cognetti at libero.it marco.cognetti at libero.it
Sat Jun 30 15:37:13 UTC 2012


Hello everybody,
Hello to everybody. I know this might be a question for rosanswer but anybody 
answered to me. SO, I try with this newsletter. 

I want to emulate multi-robot system with some robots equipped with cameras. I 
found gazebo_ros_prosilica is perfect for me since it uses opencv.

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"
  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 the same topic and that's wrong. I 
see two solutions:

1) rename topic with remap. But it doesn't work. I set 
	<node name="spawn_quad0" 
	  pkg="gazebo" type="spawn_model"
	  args="-urdf -param quad_urdf -model quad0 -x 0 -y 0 -z 3 -robotName quad0"
	  respawn="false" output="screen">
	<remap from="ptz/camera_info" to="ptz/camera_info2"/>
	</node>
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.

I also tried to modify the "from" field with /gazebo/camera_info, 
~/gazebo/camera_info ~/camera_info without any result.

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

Does anyone has the same problem? Could someone help me?
I think it is a common problem using multi-robot simulation in ROS and I guess 
someone finds a solution. The trivial solution is to rewrite the controller 
using the parent->getName() as root for the publisher but I want to avoid it 
since it means I have to rewrite all the controller that are in ROS that I want 
to use.

Thanks for any reply,

Neostek



More information about the ros-users mailing list