0
$\begingroup$

Rosanswers logo

I followed PR2PluggingIn doc.

For example, I have a runable launch file:

  <launch>
     <!-- Set params for sim -->
    <param name="detect_wall_norm/sim" value="True" type="bool"/>
    <param name="detect_outlet/sim" value="True" type="bool"/>
  
    <param name="r_gripper_controller/gripper_action_node/stall_velocity_threshold" value="0.01" type="double"/>
  
    <!-- Start PR and load the plug and outlet in the world -->
    <include file="$(find pr2_plugs_gazebo_demo)/launch/pr2_plug_outlet.launch"/>
  
    <!-- Start the plugs app -->
    <include file="$(find pr2_plugs_actions)/launch/plug_actions.launch"/>
    
    <!-- ik action -->
    <node pkg="pr2_arm_move_ik" type="arm_ik" name="r_arm_ik" output="screen">
      <param name="joint_trajectory_action" value="r_arm_controller/joint_trajectory_generator" />
      <param name="arm" value="r" />
      <param name="free_angle" value="2" />
      <param name="search_discretization" value="0.01" />
      <param name="ik_timeout" value="5.0" />
    </node>
  
    <!-- Trajectory generator -->
    <node pkg="joint_trajectory_generator" type="joint_trajectory_generator" output="screen" 
          name="joint_trajectory_generator" ns="r_arm_controller" >
      <param name="max_acc" value="2.0" />
      <param name="max_vel" value="2.5" />
    </node>
    <node pkg="joint_trajectory_generator" type="joint_trajectory_generator" output="screen" 
          name="joint_trajectory_generator" ns="l_arm_controller" >
      <param name="max_acc" value="2.0" />
      <param name="max_vel" value="2.5" />
    </node>
  
    <!-- tuckarm action -->
    <node pkg="pr2_tuck_arms_action" type="tuck_arms.py" name="tuck_arms_action" output="screen">
      <param name="r_joint_trajectory_action" value="r_arm_controller/joint_trajectory_generator" />
      <param name="l_joint_trajectory_action" value="l_arm_controller/joint_trajectory_generator" />
      <param name="move_duration" value="0.0" />
    </node>
  
  
  
  </launch>      

But when I add the following lines:

    <!-- navstack -->
    <include file="$(find pr2_2dnav)/pr2_2dnav.launch" />

I will get error when I running:

  sam@sam:~/code/ros/temp$ optirun roslaunch ./t2.launch 
  ... logging to /home/sam/.ros/log/68f97e50-42ad-11e2-8d06-e0b9a5f829db/roslaunch-sam-26744.log
  Checking log directory for disk usage. This may take awhile.
  Press Ctrl-C to interrupt
  Done checking log file disk usage. Usage is <1GB.
  
  roslaunch file contains multiple nodes named [/r_arm_controller/joint_trajectory_generator].
  Please check all <node> 'name' attributes to make sure they are unique.
  Also check that $(anon id) use different ids.
  sam@sam:~/code/ros/temp$ 

How could that possible?

I try to trace pr2_2dnav.launch.

  <launch>
    <include file="$(find pr2_machine)/$(env ROBOT).machine" />
    <include file="$(find pr2_navigation_global)/amcl_node.xml" />
    <include file="$(find pr2_navigation_teleop)/teleop.xml" />
    <include file="$(find pr2_navigation_perception)/lasers_and_filters.xml" />
    <include file="$(find pr2_navigation_perception)/ground_plane.xml" />
    <include file="$(find pr2_navigation_global)/move_base.xml" />
  </launch>      

It seems very normal.

I am confused what situation I met.

Is there anything I missing?

How to fix it?

Thank you~


Originally posted by sam on ROS Answers with karma: 2570 on 2012-12-09

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The same node occurs twice in the overall launch. This can happen if you include something that defines the same node. You can use roslaunch --find-node to figure out where/if your launch file and the include define this node.

You should disabled/comment the node from one of the launches, so it is only started once.


Originally posted by dornhege with karma: 31395 on 2012-12-09

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by sam on 2012-12-11:
I can't use --find-node or --nodes or --args to find the node name that happen twice. But I find the xml have the same structure with launch file... Why launch file structure not use the launch extension but use xml extension? Thank you~

$\endgroup$

Your Answer

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