control multiple robots in gazebo

asked 2016-04-25 06:48:23 -0500

Merolla Safwat gravatar image

updated 2016-04-25 07:33:51 -0500


at first, I could control one robot.

now, I could spawn multiple robot with same description in gazebo but I can't control them


  <arg name="robot_name"/>
  <arg name="init_pose"/>
  <node name="spawn_minibot_model" pkg="gazebo_ros" type="spawn_model"
     args="$(arg init_pose) -sdf -param /robot_description -model $(arg robot_name)"
     respawn="false" output="screen" />
  <node pkg="robot_state_publisher" type="state_publisher" 
  name="robot_state_publisher" output="screen"/> 


<group ns="robot1">
<param name="tf_prefix" value="robot1_tf" />
<include file="$(find maasndt_gazebo)/launch/one_robot.launch" >
<arg name="init_pose" value="-x 1 -y 1 -z 0" />
<arg name="robot_name"  value="Robot1" />

<group ns="robot2">
<param name="tf_prefix" value="robot2_tf" />
<include file="$(find maasndt_gazebo)/launch/one_robot.launch" >
<arg name="init_pose" value="-x -1 -y 1 -z 0" />
<arg name="robot_name"  value="Robot2" />


 <rosparam file="$(find maasndt_control)/config/maasndt_control.yaml" command="load"/>
 <node name="controller_spawner"
 type="spawner" respawn="false"
 output="screen" ns="/maasndt"
  LeftWheel_Motor  RightWheel_Motor"  />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"   respawn="false"        output="screen">


   <include file="$(find gazebo_ros)/launch/empty_world.launch">
   <arg name="world_name" value="$(find maasndt_gazebo)/worlds/"/>

   <include file="$(find maasndt_gazebo)/launch/robots.launch"/> <include file="$(find maasndt_control)/launch/maasndt_control.launch"/>

Thank you :)

edit retag flag offensive close merge delete


Could you please format your launch file xml using the Preformatted text button on the toolbar (it's the one with 101010 on it)? Just select the text, and either press the button, or ctrl+k.

gvdhoorn gravatar image gvdhoorn  ( 2016-04-25 07:07:10 -0500 )edit

format in done :)

Merolla Safwat gravatar image Merolla Safwat  ( 2016-04-25 07:25:14 -0500 )edit

Can you control one of them or none of them ? Do you have an error message ? What is in your maasndt_control.yaml file ?

F.Brosseau gravatar image F.Brosseau  ( 2016-04-25 09:59:43 -0500 )edit