Robotics StackExchange | Archived questions

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.

Asked by sobot on 2015-06-27 08:03:17 UTC

Comments

Answers

What you describe sounds like behaviour modelling, which can be done with an hierarchical state machine (HSM) for instance, or a behaviour tree. While it can be done by starting and stopping different nodes, I'd say that a HSM which coordinates the activation of nodes would be much simpler.


Edit:

Thank you @gvdhoorn i just googled HSM + ROS and came up with SMACH. just to be clear is that the kind of approach that you are suggesting for this job?

SMACH is indeed the go-to HSM implementation in ROS. But there are probably many more.

For behaviour trees specifically, see for instance github.com/futureneer/beetree (unfinished).

For all sorts of behaviour modeling tools, see wiki/decision_making.

These are just examples, I don't necessarily particularly recommend any of these.

Asked by gvdhoorn on 2015-06-27 09:51:51 UTC

Comments

Thank you @gvdhoorn i just googled HSM + ROS and came up with SMACH. just to be clear is that the kind of approach that you are suggesting for this job?

Asked by sobot on 2015-06-27 12:07:13 UTC