Run ros2 node using launch file with delay
Let's suppose we want to have a single launch file for our project. Some of our nodes are just sensor handlers. Moreover, sensor need some time to return proper data. The idea is to put some delay before running main node to use only correct data. Does launch files design provides some way to put delay on node? Of course we can put delay directly in Node
constructor or process data to wait for proper values but this functionality may be useful as a parameter in launch file.
Shouldn't deterministic system initialisation and startup be achieved by using managed nodes with a lifecycle? Time-based coordination doesn't really work very well. State-based will be much more reliable.
To re-enforce what @gvdhoorn is saying: you don't want to design a ros system with startup order dependencies. That is unreliable, and makes restarting individual nodes difficult. Almost always a node should wait to see a particular message published (e.g Sensor data or Transform Frame or some state message), so it knows it is OK to proceed.