Rosanswers logo

Hi, I edited my question.

I want to simulate multiple robots in gazebo and started with namespace settings. I'm following this tutorial with separated launch files for each robot.

but Controller Spawner couldn't find controller_manager ROS interface:

[INFO] [WallTime: 1462190862.012295] [0.000000] Controller Spawner: Waiting for service controller_manager/load_controller


[WARN] [WallTime: 1462189886.211852] [209.507000] Controller Spawner couldn't find the expected controller_manager ROS interface.

~$ rosservice list | grep controller_manager:


~$ rosnode list:

/robot1/controller_spawner ### also quits after error above


    <group ns="robot1">
        <param name="tf_prefix" value="robot1_tf" />
        <include file="$(find mrp2_gazebo)/launch/include/single_mrp2.launch" >
            <arg name="init_pose" value="-x 3.0 -y 0.0 -z 0.0 -R 0.0 -P 0.0 -Y 0.0" />
            <arg name="robot_name"  value="robot1" />

        <include file="$(find mrp2_control)/launch/controls.launch" />
        <rosparam command="load" file="$(find mrp2_gazebo)/config/controls.yaml" />

        <!--include file="$(find mrp2_control)/launch/teleop.launch" /-->

controls.launch(working without namespace variables for one robot):

    <group ns="robot1">
        <rosparam command="load" file="$(find mrp2_control)/config/controls.yaml" />

        <node name="controller_spawner" pkg="controller_manager" type="spawner" output="screen"
                args="mrp2_joint_publisher mobile_base_controller --shutdown-timeout 1  --namespace robot1" />

        <!--node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" /-->

gazebo.urdf.xacro's plugin lines:

<plugin filename="libgazebo_ros_control.so" name="ros_control">


    <arg name="robot_name"/>
    <arg name="init_pose"/>
   <arg name="robot"  default="full"/>
    <include file="$(find mrp2_gazebo)/launch/include/mrp2.launch">
        <arg name="robot_name" default="$(arg robot_name)"/>
        <arg name="robot"  value="$(arg robot)"/>
        <arg name="gzpose" value="$(arg init_pose)"/>


  <arg name="robot_name"/>
  <arg name="init_pose" default="-x 0.0 -y 0.0 -z 0.0 -R 0.0 -P 0.0 -Y 0.0"/>
  <arg name="robot"  default="full"/>
  <arg name="model"  default="mrp2"/>
  <arg name="gzpose" default="$(arg init_pose)"/>

  <!-- Robot model -->
  <include file="$(find mrp2_description)/launch/description.launch" >
    <arg name="robot" value="$(arg robot)"/>

  <!-- Spawn robot in Gazebo -->
  <node pkg="gazebo_ros" type="spawn_model" name="$(anon spawn_model)"
    args="-urdf -param robot_description $(arg gzpose) -model $(arg model)" />


  <arg name="config" default="base" />
  <arg name="robot" default="full" />

  <param name="robot_description" command="$(find xacro)/xacro.py '$(find mrp2_description)/robots/mrp2_$(arg robot).urdf.xacro'" />

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">
    <param name="use_tf_static" value="true"/>

Any suggestions will be appreciated. Thanks!

Originally posted by Orhan on ROS Answers with karma: 856 on 2016-05-02

Post score: 0


1 Answer 1


Rosanswers logo

I made a mistake in controls.launch. Correct one of control_spawner's node tag;

<node name="controller_spawner_$(arg robot_name)" pkg="controller_manager" type="spawner" ns="/$(arg robot_name)" args="--namespace=/$(arg robot_name) agv_joint_publisher mobile_base_controller --shutdown-timeout 1" />

Originally posted by Orhan with karma: 856 on 2016-06-09

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.