combining launch files doesn't give same behavior: order / timing of ik solver
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.