ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I have managed to make it working following Stefan's and Adolfo's suggestions. I will summarise two important points for anybody in the future who would like to combine two robots together which have separate controllers.
In Stephan's solution the description of the robot components are in a single .yaml file. We can however keep the description of both robots in two separate catkin projects and combine them in a third project. My robots.launch file changed as follows (see the original problem description for the previous form):
<launch>
<!-- LWR KUKA & HAND ROBOT -->
<group ns="lwr">
<param name="robot_description" command="$(find xacro)/xacro.py $(find table_world)/urdf/lwr_ahand_init.xacro" />
<include file="$(find table_world)/launch/launch/lwr_ahand.launch" >
<arg name="init_pose" value="-x 0 -y 0 -z 0" />
<arg name="robot_name" value="lwr" />
</include>
</group>
</launch>
This is the first part. The second involves loading the two .yaml control files of each respective robot and spawn them in control manager.
<launch>
<rosparam ns="lwr" file="$(find lwr_control)/config/lwr_control.yaml" command="load"/>
<rosparam ns="lwr" file="$(find ahand_control)/config/ahand_control.yaml" command="load"/>
<node ns="lwr" name="controller_spawner" pkg="controller_manager" type="spawner"
output="screen"
args="lwr/joint_state_controller lwr/OneTaskInverseKinematics
ahand/TaskInverseKinematics" />
<node name="controller_spawner_stopped" pkg="controller_manager" type="spawner"
output="screen" args="--stopped $(arg stopped_controllers)"/>
</launch>
I loaded the two config files into there own namespace /lwr and /ahand respectively. I tried to have a different namespace for the controller_spawner but nothing else than lwr seems to work. In this setting I can control both the hand and the robot with their own controllers and I don't need to merge the .yaml files. The control topics (rostopic list) are now: