ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Controller Manager Problem for Multiple Robots in Simulation

asked 2016-05-02 07:25:56 -0500

Orhan gravatar image

updated 2016-05-04 08:53:31 -0500

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="" 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)/ '$(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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-09 04:53:16 -0500

Orhan gravatar image

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" />
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-05-02 07:25:56 -0500

Seen: 1,243 times

Last updated: Jun 09 '16