#include <mc_control/fsm/Executor.h>
of executing an FSM
The executor can works in two ways:
- managed: handles transitions through an external trigger
- self-managed: handles transitions thanks to a TransitionMap
◆ Executor() [1/3]
mc_control::fsm::Executor::Executor |
( |
| ) |
|
|
default |
Executor should not be copied or moved
After init is called, the executor has been added to the GUI/log if it's moved these entries do not refer to an existing object anymore and this will lead to a crash
◆ Executor() [2/3]
mc_control::fsm::Executor::Executor |
( |
const Executor & |
| ) |
|
|
delete |
◆ Executor() [3/3]
mc_control::fsm::Executor::Executor |
( |
Executor && |
| ) |
|
|
delete |
◆ complete()
bool mc_control::fsm::Executor::complete |
( |
| ) |
const |
|
inline |
Returns true if the executor reached the end of transition map
◆ init()
void mc_control::fsm::Executor::init |
( |
Controller & |
ctl, |
|
|
const mc_rtc::Configuration & |
config, |
|
|
const std::string & |
name = "" , |
|
|
const std::vector< std::string > & |
category = {} |
|
) |
| |
Initialize the executor
- Parameters
-
ctl | Controller using this executor |
config | Configuration of the executor |
name | Name of the executor, empty for the main executor |
category | Category under which the executor will appear in the GUI, defaults to {"FSM"} for the main executor and {"FSM", name} for other executors |
◆ interrupt()
void mc_control::fsm::Executor::interrupt |
( |
| ) |
|
|
inline |
◆ next()
bool mc_control::fsm::Executor::next |
( |
| ) |
|
Trigger next state
- Returns
- False if the FSM is not ready for next state
◆ next_state()
const std::string& mc_control::fsm::Executor::next_state |
( |
| ) |
const |
|
inline |
Returns the next state's name
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ output()
const std::string& mc_control::fsm::Executor::output |
( |
| ) |
const |
|
inline |
Returns the latest state's output
◆ read_msg()
bool mc_control::fsm::Executor::read_msg |
( |
std::string & |
msg | ) |
|
Pass message to current state (read-only)
◆ read_write_msg()
bool mc_control::fsm::Executor::read_write_msg |
( |
std::string & |
msg, |
|
|
std::string & |
out |
|
) |
| |
Pass message to current state (read-write)
◆ ready()
bool mc_control::fsm::Executor::ready |
( |
| ) |
const |
|
inline |
Returns true if the executor is ready for next transition
◆ resume()
bool mc_control::fsm::Executor::resume |
( |
const std::string & |
state | ) |
|
Resume execution to a given state
Interrupt current state execution if needed
◆ run()
bool mc_control::fsm::Executor::run |
( |
Controller & |
ctl, |
|
|
bool |
keep_state |
|
) |
| |
Run the current state
- Parameters
-
ctl | Controller using this executor |
keep_state | If true, keep the state when it finishes its run |
- Returns
- True if the execution is complete
◆ running()
bool mc_control::fsm::Executor::running |
( |
| ) |
const |
|
inline |
Returns true if the state is active
◆ state()
const std::string& mc_control::fsm::Executor::state |
( |
| ) |
const |
|
inline |
Returns the current state's name
◆ stop()
void mc_control::fsm::Executor::stop |
( |
Controller & |
ctl | ) |
|
Stop the current stat eif necessary
- Parameters
-
◆ teardown()
void mc_control::fsm::Executor::teardown |
( |
Controller & |
ctl | ) |
|
Teardown the current state if necessary
- Parameters
-
The documentation for this class was generated from the following file: