launch_ros icon indicating copy to clipboard operation
launch_ros copied to clipboard

Launch delay argument for nodes or other launch files

Open pepisg opened this issue 3 years ago • 3 comments

Feature request

Feature description

Hi! it would be great if an argument could be added to add a delay for launching a given node or launch file. I think this could be useful to control the CPU load of the computing platform when launching a relatively big number of nodes (~40) by preventing all of them from launching at the same time.

If this feature already exits or can be easily implemented please point me in the right direction.

Thanks in advance for your help!

pepisg avatar Nov 16 '21 20:11 pepisg

in python launch files I implemented this by wrapping each node to delay with a launch.action.TimerAction.

It would be nicer to just be able to add the delay as an argument argument though!

eg. launch_ros.actions.Node could emit a TimerAction wrapping what it does now

joncppl avatar Dec 01 '21 22:12 joncppl

I'd rather stick to proper feature composition than to add (yet more) options to the Node action.

As @joncppl says, you can use a TimerAction. Alternatively, you could implement a group-like action to help cap the amount of processes simultaneously brought up (e.g. via ProcessStart events). That could be an addition to launch, if enough people find that useful. FYI @ros2/team.

hidmic avatar Dec 08 '21 16:12 hidmic

Yeah, I'd rather see examples of people using TimerAction to accomplish this task and we can later consider adding a utility (or simply an example) to launch as common patterns arise.

jacobperron avatar Jan 06 '22 23:01 jacobperron