Robot Devastation
YarpStateDirector.hpp
1 // Authors: see AUTHORS.md at project root.
2 // CopyPolicy: released under the terms of the LGPLv2.1, see LICENSE at project root.
3 // URL: https://github.com/asrob-uc3m/robotDevastation
4 
5 #ifndef __RD_YARP_STATE_DIRECTOR_HPP__
6 #define __RD_YARP_STATE_DIRECTOR_HPP__
7 
8 #include <yarp/os/PeriodicThread.h>
9 
10 #include "StateDirector.hpp"
11 #include "State.hpp"
12 
13 namespace rd {
14 
20 class YarpStateDirector : public StateDirector, private yarp::os::PeriodicThread
21 {
22 public:
23  YarpStateDirector(State * state);
24 
30  virtual bool Start();
31  virtual bool Stop();
32 
34  void run();
35 
37  static const int DEFAULT_RATE_MS;
38 
39 };
40 
41 }
42 #endif // __RD_YARP_STATE_DIRECTOR_HPP__
rd
The main, catch-all namespace for Robot Devastation.
Definition: groups.dox:4
rd::YarpStateDirector::Start
virtual bool Start()
Function that starts the State execution using YARP.
Definition: YarpStateDirector.cpp:18
rd::YarpStateDirector::run
void run()
Function called periodically by YARP, that calls the State.loop() method.
Definition: YarpStateDirector.cpp:52
rd::State
Base class for each of the states of a FiniteStateMachine.
Definition: State.hpp:18
rd::YarpStateDirector::Stop
virtual bool Stop()
Function to stop the attached State.
Definition: YarpStateDirector.cpp:37
rd::YarpStateDirector::DEFAULT_RATE_MS
static const int DEFAULT_RATE_MS
Period of the calls to the State loop() function.
Definition: YarpStateDirector.hpp:37
rd::YarpStateDirector
StateDirector based on YARP, creates a separate thread.
Definition: YarpStateDirector.hpp:20
rd::StateDirector
A base class for controlling flow of States of a Finite State Machine.
Definition: StateDirector.hpp:19