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

Revision history [back]

click to hide/show revision 1
initial version

I found a one-line solution that does not require any additional packages (it was a bit tricky):

You can make use of launch-prefix feature like so:

<arg name="node_start_delay" default="1.0" />  
<node name="listener" pkg="roscpp_tutorials" type="listener" launch-prefix="bash -c 'sleep $(arg node_start_delay); $0 $@' " />

the problem with using just launch-prefix="sleep 1.0; " was that the node launching command was passed as arguments to 'sleep'