Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Spawning multiple robots with diff_drive_controller

I am trying to spawn multiple robots, for this I group each one like so: <

arg name="paused" default="false"/>
    <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="atlas_joint_state_controller
          atlas_tri_wheel_controller
          atlas_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/atlas_tri_wheel_controller/cmd_vel"/>
      </node>
  </launch>

I insert in the first file the control.yaml. So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the botos in gazebo and rviz. </launch>

Spawning multiple robots with diff_drive_controller

I am trying to spawn multiple robots, for this I group each one like so: <

arg name="paused" default="false"/>
    <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="atlas_joint_state_controller
          atlas_tri_wheel_controller
          atlas_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/atlas_tri_wheel_controller/cmd_vel"/>
      </node>
  </launch>

I insert in the first file the control.yaml. So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the botos robots in gazebo and rviz. </launch>

Spawning multiple robots with diff_drive_controller

I am trying to spawn multiple robots, for this I group each one like so: <

arg name="paused" default="false"/>
    <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="atlas_joint_state_controller
          atlas_tri_wheel_controller
          atlas_arm_controller
args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/atlas_tri_wheel_controller/cmd_vel"/>
robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz. </launch>

Spawning multiple robots with diff_drive_controller

I am trying to spawn multiple robots, for this I group each one like so: <

arg     <arg name="paused" default="false"/>
     <arg name="use_sim_time" default="true"/>
   <arg name="gui" default="true"/>
   <arg name="headless" default="false"/>
   <arg name="debug" default="false"/>
   <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
   <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

multiple_robots_sim)/rviz/urdf.rviz"/>

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz. </launch>

Spawning multiple robots with diff_drive_controller

I am trying to spawn multiple robots, for this I group each one like so: so:

  <arg name="paused" default="false"/>
   <arg name="use_sim_time" default="true"/>
   <arg name="gui" default="true"/>
   <arg name="headless" default="false"/>
   <arg name="debug" default="false"/>
   <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
   <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz"/>

multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz. </launch>

Spawning multiple robots with diff_drive_controller

I am trying to spawn multiple robots, for this I group each one like so:

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz. </launch>rviz.

Spawning multiple robots with diff_drive_controller

I am trying to spawn multiple robots, for this I group each one like so:

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz.

I also get these errors

[ERROR] [1497949872.152710755, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controllers]
[ERROR] [1497949872.154815513, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controller_types]
[ERROR] [1497949872.154982735, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/load_controller]
[ERROR] [1497949872.155112475, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/unload_controller]
[ERROR] [1497949872.155239819, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/switch_controller]
[ERROR] [1497949872.155365523, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/reload_controller_libraries]

Spawning multiple robots with diff_drive_controller

Target: I am trying to spawn multiple robots, for this I group each one like so:in the launch files bellow. Problem(s): No odometry, tf points to only one robot: base_link, o controll on the joints

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz.

I also get these errors

[ERROR] [1497949872.152710755, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controllers]
[ERROR] [1497949872.154815513, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controller_types]
[ERROR] [1497949872.154982735, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/load_controller]
[ERROR] [1497949872.155112475, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/unload_controller]
[ERROR] [1497949872.155239819, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/switch_controller]
[ERROR] [1497949872.155365523, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/reload_controller_libraries]

Spawning multiple robots with diff_drive_controller

Target: Target: I am trying to spawn multiple robots, robots in Gazebo and also using ros_control, for this I group each one like in the launch files bellow. Problem(s): bellow.

Problem(s): No odometry, tf points to only one robot: base_link, o controll on the joints

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz.

I also get these errors

[ERROR] [1497949872.152710755, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controllers]
[ERROR] [1497949872.154815513, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controller_types]
[ERROR] [1497949872.154982735, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/load_controller]
[ERROR] [1497949872.155112475, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/unload_controller]
[ERROR] [1497949872.155239819, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/switch_controller]
[ERROR] [1497949872.155365523, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/reload_controller_libraries]

Spawning multiple robots with diff_drive_controller

Target: I am trying to spawn multiple robots in Gazebo and also using ros_control, for this I group each one like in the launch files bellow.

Problem(s): No odometry, tf points to only one robot: base_link, o controll no control on the joints

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz.

I also get these errors

[ERROR] [1497949872.152710755, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controllers]
[ERROR] [1497949872.154815513, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controller_types]
[ERROR] [1497949872.154982735, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/load_controller]
[ERROR] [1497949872.155112475, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/unload_controller]
[ERROR] [1497949872.155239819, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/switch_controller]
[ERROR] [1497949872.155365523, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/reload_controller_libraries]

Spawning multiple robots with diff_drive_controller

Target: I am trying to spawn multiple robots in Gazebo and also using ros_control, for this I group each one like in the launch files bellow.

Problem(s): No odometry, tf points to only one robot: base_link, no control on the joints

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame is no longer published. The cmd_vel is but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. I would like to see the robots in gazebo and rviz.

I also get these errors

[ERROR] [1497949872.152710755, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controllers]
[ERROR] [1497949872.154815513, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controller_types]
[ERROR] [1497949872.154982735, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/load_controller]
[ERROR] [1497949872.155112475, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/unload_controller]
[ERROR] [1497949872.155239819, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/switch_controller]
[ERROR] [1497949872.155365523, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/reload_controller_libraries]

Spawning multiple robots with diff_drive_controller

Target: I am trying to spawn multiple robots in Gazebo and also using ros_control, for this I group each one like in the launch files bellow.

Problem(s): No odometry, tf points to only one robot: base_link, no control on the joints

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the odom frame controller is no longer published. The cmd_vel accounted for.

There is a problem zith namespaces but does not work. Also the topic looks like /robot1/robot1/diff_drive_controller/cmd_vel, so adding at the namespace the name of the model too. i cannot figure it out.

I would like to see the robots in gazebo and rviz.

I also get these errors

[ERROR] [1497949872.152710755, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controllers]
[ERROR] [1497949872.154815513, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controller_types]
[ERROR] [1497949872.154982735, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/load_controller]
[ERROR] [1497949872.155112475, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/unload_controller]
[ERROR] [1497949872.155239819, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/switch_controller]
[ERROR] [1497949872.155365523, 0.048000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/reload_controller_libraries]

Spawning multiple robots with diff_drive_controller

Target: I am trying to spawn multiple robots in Gazebo and also using ros_control, for this I group each one like in the launch files bellow.

Problem(s): No odometry, tf points to only one robot: base_link, no control on the joints

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the controller is no longer accounted for.

There is a problem zith with namespaces but i cannot figure it out.

I would like to see the robots in gazebo and rviz.

Spawning multiple robots with diff_drive_controller

Target: I am trying to spawn multiple robots in Gazebo and also using ros_control, for this I group each one like in the launch files bellow.

Problem(s): No odometry, tf points to only one robot: base_link, no control on the joints

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the controller is no longer accounted for.

There is a problem with namespaces but i cannot figure it out.

I would like to see the robots in gazebo and rviz.

UPDATE I anaged to resolve the controllers problem; See here.

But I still have the odometry problem for multiple robots in rviz. DO i need to do some transforms?

Spawning multiple robots with diff_drive_controller

Target: I am trying to spawn multiple robots in Gazebo and also using ros_control, for this I group each one like in the launch files bellow.

Problem(s): No odometry, tf points to only one robot: base_link, no control on the joints

  <arg name="paused" default="false"/>
  <arg name="use_sim_time" default="true"/>
  <arg name="gui" default="true"/>
  <arg name="headless" default="false"/>
  <arg name="debug" default="false"/>
  <arg name="model" default="$(find multiple_robots_sim)/urdf/robot.xacro"/>
  <arg name="rvizconfig" default="$(find multiple_robots_sim)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
  <rosparam command="load" file="$(find multiple_robots_sim)/config/control.yaml" />

  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" />
    <!-- BEGIN ROBOT 1-->
<group ns="robot1">
    <!--param name="tf_prefix" value="atlas1_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
  </group>

  <!-- BEGIN ROBOT 2-->
  <group ns="robot2">
    <!--param name="tf_prefix" value="atlas2_tf" /-->
    <include file="$(find multiple_robots_sim)/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 2.0 -z 1.0" />
      <arg name="robot_name"  value="robot2" />
    </include>
</group>

and one_robot.launch looks like

<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description" respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
      <param name="publish_frequency" type="double" value="30.0" />
    </node>

   <node name="controller_spawner" pkg="controller_manager" type="spawner" 
        args="robot_joint_state_controller
          robot_diff_drive_controller
          robot_arm_controller
          --shutdown-timeout 3"/>

      <node name="rqt_robot_steering" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="$(arg robot_name)/robot_dif_drive_controller/cmd_vel"/>
      </node>
  </launch>

So everything works if i have just one robot and no grouping. I can get the odometry and the controller can control the joints. After I add the groups the controller is no longer accounted for.

There is a problem with namespaces but i cannot figure it out.

I would like to see the robots in gazebo and rviz.

UPDATE I anaged managed to resolve the controllers problem; See here.

But I still have the odometry problem for multiple robots in rviz. DO i need to do some transforms?