Gazebo_ros_control does not detect /namespace/robot_description in multi-robot simulation
I am running a multi-robot simulation platform with each robot's nodes,parameters,topics,etc. in a separate namespace (eg. /robot1/robot_description).
I also want to control a joint for panning a camera on each of these robots. But when I try to start the controller manager, 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.
# 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}
The launch file:
<launch> <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 0.0 0.0 map robot2/odom 200" />
</launch>
The gazeboroscontrol plugin in robot1.gazebo file
<!-- ros_control plugin -->
<gazebo ...
There have been some recent discussions as well: http://github.com/ipa320/care-o-bot/issues/11