0
$\begingroup$

Rosanswers logo

I'm trying to launch nodes in one combined launch file.

If I launch nodes separately using the two files below, calls to the IK services work fine (i.e. call the second node's service ik_trajectory, which uses the first node's ik solver) :

ik_solver.launch:

<launch>  
  <include file="$(find pr2_arm_navigation_kinematics)/launch/pr2_ik_rarm_node.launch"/>  
</launch>

cartesian_ik_trajectory.launch:

<launch>  
  <node pkg="ik_trajectory" type="ik_trajectory" name="ik_trajectory"/>  
</launch>  

The IK also works if I run the first launch file and use "rosrun ik_trajectory ik_trajectory" in place of the second launch file.

However, if I combine the two commands in one launch file, the service calls fail even though the input / starting arm state for IK is the same:

combined.launch:

<launch>  
   <include file="$(find pr2_arm_navigation_kinematics)/launch/pr2_ik_rarm_node.launch"/>   
   <node pkg="ik_trajectory" type="ik_trajectory" name="ik_trajectory"/>   
</launch>  

The node in the second launch file was written by someone else, so I'm trying to look into those details. However, I don't understand why the behavior should be different. Is there an ordering or timing issue with the IK solver? I can even launch the separate launch files in reverse order without problem. It's only when I combine the commands in one launch file that the service fails.

Note that there's no failure when I actually run the launch files, only when I call the service provided by the second ik_trajectory node. I checked rosservice list to see that the same services are available in either case.


Originally posted by elsey on ROS Answers with karma: 76 on 2011-07-11

Post score: 1


Original comments

Comment by hsu on 2011-07-11:
nothing wrong :) very minor cosmetic update, I made the launch xml blocks into formatted syntax-colored quotations (by indenting 4 white spaces in front).

Comment by elsey on 2011-07-11:
@hsu, What was updated by you about my posting? Was there something wrong about my formatting? I'd like to know for the next time I post.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There is no guaranteed ordering in roslaunch. All programs should behave nicely to work.

I'm assuming your second program just calls a service? What probably happens is that the service call is done before the service is up. To fix that you should wait until a service becomes available in the other program and then go into the processing part.


Originally posted by dornhege with karma: 31395 on 2011-07-11

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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