ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

combining launch files doesn't give same behavior: order / timing of ik solver

asked 2011-07-11 13:22:52 -0500

elsey gravatar image

updated 2011-07-11 13:39:06 -0500

hsu gravatar image

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.

edit retag flag offensive close merge delete

Comments

@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.
elsey gravatar image elsey  ( 2011-07-11 13:59:07 -0500 )edit
nothing wrong :) very minor cosmetic update, I made the launch xml blocks into formatted syntax-colored quotations (by indenting 4 white spaces in front).
hsu gravatar image hsu  ( 2011-07-11 14:05:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-07-11 21:28:30 -0500

dornhege gravatar image

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-07-11 13:22:52 -0500

Seen: 659 times

Last updated: Jul 11 '11