running several nodes automatically and as per need
Hello,
I am looking to figure out how to setup an Automatic Launch method for a project in ROS involving several nodes in different packages. Idea is that those nodes need to be executed at different times, as per need or pause and re-run if a certain condition arose.
I can be wrong but as far as i know with a Launch file you can start the the nodes at one time or - somewhere in this website i read - nodes could be launched conditionally through the launch file.
What i am looking to figure out is how to go about to achieve the following type of automatic Execution of nodes:
Run the initial node (node A) from a package and then when there is the right time (depending on; a condition is met or an interesting information is received or a job is done by another node) Node B starts and deals with its own assignment and sleeps again waiting to be called again or not. project could have more nodes and different orders of executions.
Lets say there is a Patrol Robot that starts its job, then when it receives an alarm or detects an abnormality in the area it enters a Sweep mode (node from another package) to thoroughly explore that certain part of the perimeter and when it clears the area, robot pause or stops the Sweeping and goes back to normal Patrolling mode unless there is another alarm, etc. (Something like this or more complex in terms of number of nodes)
Would be nice if you could either explain the way to go about it or link resources for me read.