launch_ros
launch_ros copied to clipboard
Launch delay argument for nodes or other launch files
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!
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
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.
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.