State Machine  0.5.0
This repository contains packages for creating and running general purpose state machines.
state_machine_basics::task::check::SimpleCheck< StatusT > Class Template Reference

#include <SimpleCheck.hpp>

Inheritance diagram for state_machine_basics::task::check::SimpleCheck< StatusT >:
Inheritance graph

Protected Types

using Base = check_or_supervision::SimpleCheckOrSupervision< StatusT >
using SupervisionStatus = typename Base::SupervisionStatus
using SupervisionStatusMsg = typename Base::SupervisionStatusMsg
- Protected Types inherited from state_machine_basics::check_or_supervision::SimpleCheckOrSupervision< StatusT >
using StatusMsg = typename StatusT::Msg
using StatusMsgConstPtr = typename StatusMsg::ConstPtr
- Protected Types inherited from state_machine_basics::check_or_supervision::CheckOrSupervision
using SupervisionStatusMsg = state_machine_msgs::SupervisionStatus
using SupervisionStatus = SupervisionStatusMsg::_status_type
using SimulatedStatusMsg = any_msgs::State
using SimulatedStatusMsgConstPtr = SimulatedStatusMsg::ConstPtr
- Protected Types inherited from state_machine_basics::check_or_supervision::CheckOrSupervisionEnableInterface
using EnableInterfacePtr = std::shared_ptr< EnableInterface >

Protected Member Functions

 SimpleCheck (ros::NodeHandle &nodeHandle, state_machine::ContextPtr context, std::string name, const std::string &type, const std::string &reportEntryMessage, const std::string &reportEntryStatus={})
 ~SimpleCheck () override=default
std::string midExecution () override
- Protected Member Functions inherited from state_machine_basics::check_or_supervision::SimpleCheckOrSupervision< StatusT >
 SimpleCheckOrSupervision (ros::NodeHandle &nodeHandle, state_machine::ContextPtr context, std::string name, std::set< std::string > outcomes, std::string type, std::string reportEntryMessage, std::string reportEntryStatus)
 ~SimpleCheckOrSupervision () override=default
void preExecution () override
void postExecution () override
void statusCb (const StatusMsgConstPtr &status)
SupervisionStatus getSupervisionStatus ()
- Protected Member Functions inherited from state_machine_basics::check_or_supervision::CheckOrSupervision
 CheckOrSupervision (ros::NodeHandle &nodeHandle, state_machine::ContextPtr context, std::string name, std::set< std::string > outcomes, std::string type)
 ~CheckOrSupervision () override=default
void registerEnableInterface ()
bool isEnabled ()
void enable (bool enable)
void simulatedStatusCb (const SimulatedStatusMsgConstPtr &simulatedStatus)
virtual void simulatedStatusTurnedOkCb ()
virtual void simulatedStatusTurnedNotOkCb ()
bool simulatedStatusIsOk ()
bool simulatedStatusIsNotOk ()
void publishSupervisionStatus (const SupervisionStatus supervisionStatus)
void publishSupervisionStatusStarted ()
void publishSupervisionStatusUnknown ()
void publishSupervisionStatusOk ()
void publishSupervisionStatusNotOk ()
void publishSupervisionStatusStopped ()
- Protected Member Functions inherited from state_machine::State
void setId ()
void sleep (const double duration)
- Protected Member Functions inherited from state_machine_ros::RosInterface
 RosInterface (ros::NodeHandle &nodeHandle, std::string stateName)
virtual ~RosInterface ()=default

Additional Inherited Members

- Public Member Functions inherited from state_machine_ros::StateRos
 StateRos (ros::NodeHandle &nodeHandle, state_machine::ContextPtr context, std::string name, const std::set< std::string > &outcomes)
 ~StateRos () override=default
- Public Member Functions inherited from state_machine::State
 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)
StategetParent ()
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 ()
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, ProgressgetRunningStates (const bool ignoreBackgroundStates)
void printStateHierarchy ()
virtual void printStateHierarchy (const bool useNestedNames, const bool useIndentation, const unsigned int indentation) const
- Static Public Member Functions inherited from state_machine::State
static double getTimeStep ()
- Static Public Member Functions inherited from state_machine_basics::check_or_supervision::CheckOrSupervisionEnableInterface
static std::set< std::string > getRegisteredEnableInterfaceNames ()
static bool isForceDisabled (const std::string &type)
static void forceDisable (const std::string &type, bool disable)
static bool isEnabled (const std::string &type)
static void enable (const std::string &type, bool enable)
- Protected Attributes inherited from state_machine_basics::check_or_supervision::SimpleCheckOrSupervision< StatusT >
ros::CallbackQueue statusSubscriberCallbackQueue_
ros::SubscribeOptions statusSubscriberOptions_
ros::Subscriber statusSubscriber_
std::mutex statusMutex_
StatusMsgConstPtr status_
std::string reportEntryMessage_
std::string reportEntryStatus_
- Protected Attributes inherited from state_machine_basics::check_or_supervision::CheckOrSupervision
ros::Subscriber enableSubscriber_
ros::Subscriber simulatedStatusSubscriber_
ros::Publisher isEnabledPublisher_
ros::Publisher supervisionStatusPublisher_
std::mutex simulatedStatusMutex_
SimulatedStatusMsgConstPtr simulatedStatus_
std::string type_
- Protected Attributes inherited from state_machine::State
ContextPtr context_
std::string name_
std::string type_
std::set< std::string > outcomes_
unsigned int id_ = -1
std::string keyPrefix_
Stateparent_ = nullptr
std::atomic< bool > isRunning_
std::atomic< bool > preemptRequested_
Progress progress_
- Protected Attributes inherited from state_machine_ros::RosInterface
ros::NodeHandle & nodeHandle_
const std::string stateName_
- Static Protected Attributes inherited from state_machine::State
static std::mutex freeIdMutex_
static int freeId_ = 0
static double timeStep_ = 0.1
static std::atomic< bool > isPaused_
- Static Protected Attributes inherited from state_machine_ros::RosInterface
static bool isSimulation_
- Static Protected Attributes inherited from state_machine_basics::check_or_supervision::CheckOrSupervisionEnableInterface
static std::mutex enableInterfacesMutex_
static std::map< std::string, EnableInterfacePtrenableInterfaces_

Member Typedef Documentation

◆ Base

template<typename StatusT >
using state_machine_basics::task::check::SimpleCheck< StatusT >::Base = check_or_supervision::SimpleCheckOrSupervision<StatusT>

◆ SupervisionStatus

template<typename StatusT >
using state_machine_basics::task::check::SimpleCheck< StatusT >::SupervisionStatus = typename Base::SupervisionStatus

◆ SupervisionStatusMsg

template<typename StatusT >
using state_machine_basics::task::check::SimpleCheck< StatusT >::SupervisionStatusMsg = typename Base::SupervisionStatusMsg

Constructor & Destructor Documentation

◆ SimpleCheck()

template<typename StatusT >
state_machine_basics::task::check::SimpleCheck< StatusT >::SimpleCheck ( ros::NodeHandle &  nodeHandle,
state_machine::ContextPtr  context,
std::string  name,
const std::string &  type,
const std::string &  reportEntryMessage,
const std::string &  reportEntryStatus = {} 

◆ ~SimpleCheck()

template<typename StatusT >
state_machine_basics::task::check::SimpleCheck< StatusT >::~SimpleCheck ( )

Member Function Documentation

◆ midExecution()

template<typename StatusT >
std::string state_machine_basics::task::check::SimpleCheck< StatusT >::midExecution ( )

Run the mid-execution of the state.

Outcome of the execution.

Implements state_machine::State.

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