#include <mc_control/fsm/states/Parallel.h>
Classes | |
struct | DelayedState |
Public Member Functions | |
void | start (Controller &) override |
bool | run (Controller &) override |
void | stop (Controller &) override |
void | teardown (Controller &) override |
bool | read_msg (std::string &msg) override |
bool | read_write_msg (std::string &msg, std::string &out) override |
std::vector< std::string > | states () const |
std::map< std::string, mc_rtc::Configuration > | configs () const |
Public Member Functions inherited from mc_control::fsm::State | |
virtual | ~State () |
void | configure_ (const mc_rtc::Configuration &config) |
void | start_ (Controller &ctl) |
void | teardown_ (Controller &ctl) |
const std::string & | output () const noexcept |
const std::string & | name () |
void | name (const std::string &n) |
Protected Attributes | |
double | time_ = 0 |
std::vector< DelayedState > | states_ |
std::vector< std::string > | outputStates_ |
bool | finished_first_ = false |
Protected Attributes inherited from mc_control::fsm::State | |
mc_rtc::Configuration | add_contacts_config_ |
mc_rtc::Configuration | remove_contacts_config_ |
mc_rtc::Configuration | add_contacts_after_config_ |
mc_rtc::Configuration | remove_contacts_after_config_ |
mc_rtc::Configuration | add_collisions_config_ |
mc_rtc::Configuration | remove_collisions_config_ |
mc_rtc::Configuration | add_collisions_after_config_ |
mc_rtc::Configuration | remove_collisions_after_config_ |
mc_rtc::Configuration | constraints_config_ |
mc_rtc::Configuration | tasks_config_ |
mc_rtc::Configuration | remove_posture_task_ |
mc_rtc::Configuration | config_ |
std::vector< mc_solver::ConstraintSetPtr > | constraints_ |
std::vector< std::pair< mc_tasks::MetaTaskPtr, mc_rtc::Configuration > > | tasks_ |
std::vector< mc_tasks::PostureTaskPtr > | postures_ |
Additional Inherited Members | |
Protected Member Functions inherited from mc_control::fsm::State | |
void | output (const std::string &o) |
virtual void | configure (const mc_rtc::Configuration &config) |
Implements parallel states
This states plays multiple states at once. Strictly speaking those states are not played in parallel but rather sequentially.
If this state plays {state_1, ..., state_N}. The state is completed when all state_i::run() function returns true and its output is state_N output.
Configuration entries:
Example:
{ "states": [ "StateA", "StateB", "StateC" ], // Play StateA, StateB and StateC "delays": { "StateA": 1.0 }, // StateA will start one second after StateB and StateC "configs: { "StateB": {} } }
std::map<std::string, mc_rtc::Configuration> mc_control::fsm::ParallelState::configs | ( | ) | const |
|
overridevirtual |
Handle read service call
Reimplemented from mc_control::fsm::State.
|
overridevirtual |
Handle read/write service call
Reimplemented from mc_control::fsm::State.
|
overridevirtual |
Called every iteration until it returns true
Implements mc_control::fsm::State.
|
overridevirtual |
Called before the state starts being run
This will be called only once with the state fully configured.
Implements mc_control::fsm::State.
std::vector<std::string> mc_control::fsm::ParallelState::states | ( | ) | const |
|
overridevirtual |
Called if the state is interrupted
Reimplemented from mc_control::fsm::State.
|
overridevirtual |
Called right before destruction
Implements mc_control::fsm::State.
|
protected |
|
protected |
States used to generate the output. If multiple states output are used, they will generated according to the following pattern: State1: (State1 output), State2: (State2 output)
|
protected |
|
protected |