ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Launching different robots in Gazebo at the same time

asked 2012-07-20 03:11:13 -0500

RaulC gravatar image

updated 2012-07-20 07:18:55 -0500

joq gravatar image

Hi guys,

I'm trying to write a launch file to simulate two different robots in gazebo at the same time. I've tried many things and changes in my launch file but I can get it working. Sometimes I get two (visual) copies of the same robot. This is part of my launch file

<arg name="model" default="$(find hector_quadrotor_urdf)/urdf/quadrotor.urdf.xacro"/>

<node name="spawn_robot" pkg="gazebo" type="spawn_model" args="-param quadrotor_description -urdf -z 0.5 -model quadrotor" respawn="false" output="screen"/>

<node name="spawn_object" pkg="gazebo" type="spawn_model" args="-urdf -param ugv_description -x 2.0 -y 0.0 -z 0.6 -model summit_xl" respawn="false" output="screen"/>

Is the parameter "robot_description" unique or something like that so that just one robot description parameter can be set? Am I missing something? I've tried to include parameters such as:

<node pkg="robot_state_publisher" type="state_publisher" name="quadrotor_state_pulisher" output="screen" &gt;="" <param="" name="publish_frequency" type="double" value="50.0"/> <remap from="robot_description" to="quadrotor_description"/> <remap from="joint_states" to="quadrotor_joint_states"/> </node>

Also tried to create different groups for each robot (<group ns="quadrotor"> xxxxxx </group>, and include "-namespace quadrotor" in the spawn node parameters, but nothing.

Any help?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-07-20 09:40:21 -0500

mcevoyandy gravatar image

updated 2012-07-20 09:43:02 -0500

Here's a portion of a launch file I have where I spawn two robots. I use this format to spawn multiple robots using the same *.urdf or different robots like shown below.

also roscd gazebo_worlds/launch and look how the table.urdf.xacro is launched. I don't think what you have is right.

Hope it helps.

<param name="passive_cubelet_1" textfile="/home/andy/ros-fuerte/workspace/Cubelet/urdf/passive.urdf"/> 
<node args="-urdf -param passive_cubelet_1 -x 0.58 -y 0.0 -z 0.585 -R 0.0 -P 0.0 -Y 0.0 -model passive_cubelet_1" name="spawn_passive_cubelet_1" output="screen" pkg="gazebo" respawn="false" type="spawn_model"/>
<param name="inverse_cubelet_2" textfile="/home/andy/ros-fuerte/workspace/Cubelet/urdf/inverse.urdf"/>
<node args="-urdf -param inverse_cubelet_2 -x 0.748 -y 0.0 -z 0.585 -R 0.0 -P 0.0 -Y 0.0 -model inverse_cubelet_2" name="spawn_inverse_cubelet_2" output="\screen" pkg="gazebo" respawn="false" type="spawn_model"/>
edit flag offensive delete link more

Question Tools


Asked: 2012-07-20 03:11:13 -0500

Seen: 2,042 times

Last updated: Jul 20 '12