Re: [ros-users] Switch behaviours in ROS

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Brian Gerkey
Date:  
To: ros-users
Subject: Re: [ros-users] Switch behaviours in ROS
On Mon, Jun 14, 2010 at 6:06 AM, Roderick de Nijs
<> wrote:
> I wanted to know what mechanisms you use to switch from one behaviour to
> another. For instance, an autonomous robot may want to stop the
> exploration behaviour(a node that sends goals to move_base) when certain
> conditions are met,  like some feature detected in the environment.
> Later on, we might want to continue running the exploration.
>
> Essentially I want to decide which node runs at each moment. What are
> the options for implementing such behaviour-switching abilities?


hi Roderick,

Most ROS nodes are written in a way that they can run all the time,
but don't make the robot do anything unless they've been specifically
triggered. This is true of move_base, which won't move the robot base
unless it is sent a goal. I recommend following this pattern with
your own nodes; e.g., if you have a node that's doing exploration by
sending goals to move_base, then make sure your exploration node
offers a ROS API that allows you to turn it on and off.

We implement this pattern using actionlib
(http://www.ros.org/wiki/actionlib), which makes it easy wrap a piece
of functionality with a goal-triggering mechanism.

    brian.