Robot Devastation
Public Member Functions | Static Public Attributes | List of all members
rd::YarpStateDirector Class Reference

StateDirector based on YARP, creates a separate thread.

#include <YarpStateDirector.hpp>

Inheritance diagram for rd::YarpStateDirector:
rd::StateDirector

Public Member Functions

 YarpStateDirector (State *state)
 
virtual bool Start ()
 Function that starts the State execution using YARP. More...
 
virtual bool Stop ()
 Function to stop the attached State. More...
 
void run ()
 Function called periodically by YARP, that calls the State.loop() method.
 
- Public Member Functions inherited from rd::StateDirector
 StateDirector (State *state)
 Creates a StateDirector attached to a State.
 
std::string getStateId () const
 Allows access to the id of the attached State.
 
virtual bool addTransition (StateDirector *nextState, int condition)
 Adds a transition to a given state depending on a given condition. More...
 
virtual bool isActive () const
 Returns the current state of the State.
 

Static Public Attributes

static const int DEFAULT_RATE_MS = 100
 Period of the calls to the State loop() function.
 

Additional Inherited Members

- Protected Attributes inherited from rd::StateDirector
Statestate
 
bool active
 
std::map< int, StateDirector * > nextStates
 

Member Function Documentation

◆ Start()

bool rd::YarpStateDirector::Start ( )
virtual

It launches a yarp::os::PeriodicThread thread after State.setup().

Implements rd::StateDirector.

◆ Stop()

bool rd::YarpStateDirector::Stop ( )
virtual

This should stop thread running the State.loop() function and call the State.cleanup() function.

Implements rd::StateDirector.


The documentation for this class was generated from the following files: