State Machine  0.5.0
This repository contains packages for creating and running general purpose state machines.
state_machine_basics::check_or_supervision::CheckOrSupervision Class Reference

#include <CheckOrSupervision.hpp>

Inheritance diagram for state_machine_basics::check_or_supervision::CheckOrSupervision:
Inheritance graph

Protected Types

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

 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 preExecution () override
 
void postExecution () override
 
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
 

Protected Attributes

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_
 

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 ()
 
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, 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)
 
- 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

◆ SimulatedStatusMsg

◆ SimulatedStatusMsgConstPtr

◆ SupervisionStatus

using state_machine_basics::check_or_supervision::CheckOrSupervision::SupervisionStatus = SupervisionStatusMsg::_status_type
protected

◆ SupervisionStatusMsg

using state_machine_basics::check_or_supervision::CheckOrSupervision::SupervisionStatusMsg = state_machine_msgs::SupervisionStatus
protected

Constructor & Destructor Documentation

◆ CheckOrSupervision()

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 
)
protected

◆ ~CheckOrSupervision()

state_machine_basics::check_or_supervision::CheckOrSupervision::~CheckOrSupervision ( )
overrideprotecteddefault

Member Function Documentation

◆ enable()

void state_machine_basics::check_or_supervision::CheckOrSupervision::enable ( bool  enable)
protected

◆ isEnabled()

bool state_machine_basics::check_or_supervision::CheckOrSupervision::isEnabled ( )
protected

◆ postExecution()

void state_machine_basics::check_or_supervision::CheckOrSupervision::postExecution ( )
overrideprotectedvirtual

Run the post-execution of the state.

Reimplemented from state_machine::State.

Reimplemented in state_machine_basics::check_or_supervision::SimpleCheckOrSupervision< StatusT >.

◆ preExecution()

void state_machine_basics::check_or_supervision::CheckOrSupervision::preExecution ( )
overrideprotectedvirtual

Run the pre-execution of the state.

Reimplemented from state_machine::State.

Reimplemented in state_machine_basics::check_or_supervision::SimpleCheckOrSupervision< StatusT >.

◆ publishSupervisionStatus()

void state_machine_basics::check_or_supervision::CheckOrSupervision::publishSupervisionStatus ( const SupervisionStatus  supervisionStatus)
protected

◆ publishSupervisionStatusNotOk()

void state_machine_basics::check_or_supervision::CheckOrSupervision::publishSupervisionStatusNotOk ( )
protected

◆ publishSupervisionStatusOk()

void state_machine_basics::check_or_supervision::CheckOrSupervision::publishSupervisionStatusOk ( )
protected

◆ publishSupervisionStatusStarted()

void state_machine_basics::check_or_supervision::CheckOrSupervision::publishSupervisionStatusStarted ( )
protected

◆ publishSupervisionStatusStopped()

void state_machine_basics::check_or_supervision::CheckOrSupervision::publishSupervisionStatusStopped ( )
protected

◆ publishSupervisionStatusUnknown()

void state_machine_basics::check_or_supervision::CheckOrSupervision::publishSupervisionStatusUnknown ( )
protected

◆ registerEnableInterface()

void state_machine_basics::check_or_supervision::CheckOrSupervision::registerEnableInterface ( )
protected

◆ simulatedStatusCb()

void state_machine_basics::check_or_supervision::CheckOrSupervision::simulatedStatusCb ( const SimulatedStatusMsgConstPtr simulatedStatus)
protected

◆ simulatedStatusIsNotOk()

bool state_machine_basics::check_or_supervision::CheckOrSupervision::simulatedStatusIsNotOk ( )
protected

◆ simulatedStatusIsOk()

bool state_machine_basics::check_or_supervision::CheckOrSupervision::simulatedStatusIsOk ( )
protected

◆ simulatedStatusTurnedNotOkCb()

virtual void state_machine_basics::check_or_supervision::CheckOrSupervision::simulatedStatusTurnedNotOkCb ( )
inlineprotectedvirtual

◆ simulatedStatusTurnedOkCb()

virtual void state_machine_basics::check_or_supervision::CheckOrSupervision::simulatedStatusTurnedOkCb ( )
inlineprotectedvirtual

Member Data Documentation

◆ enableSubscriber_

ros::Subscriber state_machine_basics::check_or_supervision::CheckOrSupervision::enableSubscriber_
protected

◆ isEnabledPublisher_

ros::Publisher state_machine_basics::check_or_supervision::CheckOrSupervision::isEnabledPublisher_
protected

◆ simulatedStatus_

SimulatedStatusMsgConstPtr state_machine_basics::check_or_supervision::CheckOrSupervision::simulatedStatus_
protected

◆ simulatedStatusMutex_

std::mutex state_machine_basics::check_or_supervision::CheckOrSupervision::simulatedStatusMutex_
protected

◆ simulatedStatusSubscriber_

ros::Subscriber state_machine_basics::check_or_supervision::CheckOrSupervision::simulatedStatusSubscriber_
protected

◆ supervisionStatusPublisher_

ros::Publisher state_machine_basics::check_or_supervision::CheckOrSupervision::supervisionStatusPublisher_
protected

◆ type_

std::string state_machine_basics::check_or_supervision::CheckOrSupervision::type_
protected

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