Home | Tutorials | Wiki | Issues
Ask Your Question
0

Multi-robot controller-manager for different robot_descripion?

asked 2015-09-13 23:34:20 -0500

webvenky gravatar image

updated 2015-09-15 21:25:27 -0500

I am simulating a multi-robot system. I have a different name for the robot descriptions for different robots. When I tried to start the controller manager.

 <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="camera_position_controller joint_state_controller">
        <remap from="robot_description" to="robot1_description" />
    </node>

It gives the error:

[INFO] [WallTime: 1442100763.719533] [0.533000] Loading controller: camera_position_controller
[ERROR] [1442100763.811078289, 0.621000000]: Could not find parameter robot_description on parameter server
[ERROR] [1442100763.811171897, 0.621000000]: Failed to parse urdf file
[ERROR] [1442100763.811233707, 0.621000000]: Failed to initialize the controller
[ERROR] [1442100763.811282445, 0.621000000]: Initializing controller 'camera_position_controller' failed

The .yaml file for controller params.

robot1:
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 10  

  # Position Controllers ---------------------------------------
  camera_position_controller:
    type: effort_controllers/JointPositionController
    joint: camera_joint
    pid: {p: 100.0, i: 0.01, d: 10.0}

Kindly help.


Update 1:

Here is the complete launch file.

<launch>
    <!-- these are the arguments you can pass this launch file, for example 
        paused:=true -->
    <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" />

    <!-- We resume the logic in empty_world.launch, changing only the name of 
        the world to be launched -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(find mrp_p3dx_gazebo)/worlds/mrp_p3dx.world" />
        <arg name="debug" value="$(arg debug)" />
        <arg name="gui" value="$(arg gui)" />
        <arg name="paused" value="$(arg paused)" />
        <arg name="use_sim_time" value="$(arg use_sim_time)" />
        <arg name="headless" value="$(arg headless)" />
    </include>

    <!-- BEGIN ROBOT 1-->
    <group ns="robot1">
        <!-- <param name="tf_prefix" value="robot1" />  -->

        <!-- Load joint controller configurations from YAML file to parameter server -->
        <rosparam file="$(find mrp_p3dx_control)/config/mrp_p3dx.yaml" command="load"
            ns="/robot1" /> 

        <param name="robot_description"
        command="$(find xacro)/xacro.py '$(find mrp_p3dx_description)/urdf/robot1.xacro'" />

        <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
            respawn="false" output="screen" args="-urdf -x 5.5 -y 8 -z 0 -model robot1 -param robot_description" />

        <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher">
               <!-- <remap from="robot_description" to="robot_description" /> -->
              <param name="publish_frequency" type="double" value="30.0"/>
              <param name="tf_prefix" type="string" value="robot1"/>
        </node>

        <!-- load the controllers -->
        <node name="controller_spawner" pkg="controller_manager" type="spawner"
            respawn="false" ns="/robot1" output="screen" args="camera_position_controller joint_state_controller">
        </node>  

        <param name="publish_frequency" type="double" value="30.0"/>

    </group>

    <!-- BEGIN ROBOT 2-->
    <group ns="robot2">
        <!-- <param name="tf_prefix" value="robot2" /> -->
        <param name="robot_description"
        command="$(find xacro)/xacro.py '$(find mrp_p3dx_description)/urdf/robot2.xacro'" />

        <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
            respawn="false" output="screen" args="-urdf -x 5 -y 5 -z 0 -model robot2
            -param robot_description" />

         <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher">
              <!-- <remap from="robot_description" to="robot_description" /> -->
              <param name="publish_frequency" type="double" value="30.0"/>
              <param name="tf_prefix" type="string" value="robot2"/>
        </node>

        <param name="publish_frequency" type="double" value="30.0"/>

    </group>

    <node pkg="tf" type="static_transform_publisher" name="base_to_odom_r1" 
     args="0.0 -0.0 0.0 0.0 0.0 0.0 map robot1/odom 200" />

    <node pkg="tf" type="static_transform_publisher" name="base_to_odom_r2" 
     args="0.0  0.0 0.0 0.0 ...
(more)
edit retag flag offensive close merge delete

Comments

can you try adding -robot_namespace robot_1 to the args of your spawn_model call?(I am not sure if that helps)

evilBiber gravatar imageevilBiber ( 2015-09-16 02:17:04 -0500 )edit

Tried. It didn't work. The problem still remains.

webvenky gravatar imagewebvenky ( 2015-09-16 03:51:05 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-09-14 02:16:27 -0500

In my multi-robot environment I use groups/Namespaces to avoid such problems

This means all nodes,params,topics and services of the robot are started in <robotname>/<node-or-param-name>.

In this way you can easily distinguish between the different robots...

try putting a

<group ns="<namespace-name>">
... everything you would like to launch for one robot instance...
</group>

But beware you will also have to take care of the TF-prefixes for somenodes if your robots have identical link names(which is the case for most robots...)

edit flag offensive delete link more

Comments

Thanks. I did exactly what you said. But now I'm facing the exact problem that's stated in this question: http://answers.ros.org/question/198929/running-controllermanager-spawner-with-mybotrobotdescription/

webvenky gravatar imagewebvenky ( 2015-09-14 13:00:20 -0500 )edit

It might be helpful to show the complete launchfile... Where is the parameter robot_description on the paramterer server?

evilBiber gravatar imageevilBiber ( 2015-09-15 02:06:47 -0500 )edit

@evilBiber I have updated the question with the complete launchfile. The robot_description resides in the corresponding robot namespace.. for example, /robot1/robot_description

webvenky gravatar imagewebvenky ( 2015-09-15 03:32:16 -0500 )edit

Did you find any solution to this? I got the same problem.

voliro gravatar imagevoliro ( 2017-02-27 13:14:26 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2015-09-13 23:34:20 -0500

Seen: 2,604 times

Last updated: Sep 15 '15