State Machine
Tools for creating and running general purpose state machines.
|
#include <StateRos.hpp>
Public Member Functions | |
StateRos (ros::NodeHandle &nodeHandle, state_machine::ContextPtr context, std::string name, const std::set< std::string > &outcomes) | |
~StateRos () override=default | |
![]() | |
State (ContextPtr context, std::string name, std::set< std::string > outcomes) | |
virtual | ~State ()=default |
ContextPtr | getContext () const |
void | setName (const std::string &name) |
const std::string & | getName () const |
NestedName | getNestedName () const |
const std::set< std::string > & | getOutcomes () const |
const std::string & | getType () const |
void | resetIds () |
const std::string & | getKeyPrefix () const |
void | setParent (State *parent) |
State * | getParent () |
void | resetParent () |
virtual void | loadSettings (const Settings &settings) |
virtual void | saveSettings (Settings &settings) const |
virtual void | getAvailableInitialStateNestedNames (std::set< NestedName > &nestedNames) const |
virtual bool | setInitialStateByNestedName (const NestedName &nestedName) |
virtual bool | isConsistent (std::vector< std::string > &inconsistencies) const |
std::string | execute () |
virtual std::string | midExecution ()=0 |
bool | isRunning () const |
void | requestPause () |
virtual bool | requestPauseAfterExecution () |
virtual void | recallPauseAfterExecution () |
virtual bool | pauseAfterExecutionRequested () |
void | requestResume () |
bool | isPaused () |
virtual void | requestPreempt () |
virtual void | recallPreempt () |
void | servicePreempt () |
bool | preemptRequested () const |
void | sleepOnce () |
void | sleepWhilePaused () |
virtual Progress | getProgress () |
virtual std::map< NestedName, Progress > | getRunningStates (const bool ignoreBackgroundStates) |
void | printStateHierarchy () |
virtual void | printStateHierarchy (const bool useNestedNames, const bool useIndentation, const unsigned int indentation) const |
Additional Inherited Members | |
![]() | |
static double | getTimeStep () |
![]() | |
void | setId () |
virtual void | preExecution () |
virtual void | postExecution () |
void | sleep (const double duration) |
![]() | |
RosInterface (ros::NodeHandle &nodeHandle, std::string stateName) | |
virtual | ~RosInterface ()=default |
![]() | |
ContextPtr | context_ |
std::string | name_ |
std::string | type_ |
std::set< std::string > | outcomes_ |
unsigned int | id_ = -1 |
std::string | keyPrefix_ |
State * | parent_ = nullptr |
std::atomic< bool > | isRunning_ |
std::atomic< bool > | preemptRequested_ |
Progress | progress_ |
![]() | |
ros::NodeHandle & | nodeHandle_ |
const std::string | stateName_ |
![]() | |
static std::mutex | freeIdMutex_ |
static int | freeId_ = 0 |
static double | timeStep_ = 0.1 |
static std::atomic< bool > | isPaused_ |
![]() | |
static bool | isSimulation_ |
state_machine_ros::StateRos::StateRos | ( | ros::NodeHandle & | nodeHandle, |
state_machine::ContextPtr | context, | ||
std::string | name, | ||
const std::set< std::string > & | outcomes | ||
) |
|
overridedefault |