SMACC2
Public Types | Public Member Functions | Public Attributes | List of all members
sm_dance_bot_strikes_back::SmDanceBotStrikesBack Struct Reference

Advanced example of state machine with smacc that shows multiple techniques for the development of state machines. More...

#include <sm_dance_bot_strikes_back.hpp>

Inheritance diagram for sm_dance_bot_strikes_back::SmDanceBotStrikesBack:
Inheritance graph
Collaboration diagram for sm_dance_bot_strikes_back::SmDanceBotStrikesBack:
Collaboration graph

Public Types

typedef mpl::bool_< false > shallow_history
 
typedef mpl::bool_< false > deep_history
 
typedef mpl::bool_< false > inherited_deep_history
 

Public Member Functions

void onInitialize () override
 this function should be implemented by the user to create the orthogonals More...
 
- Public Member Functions inherited from smacc2::SmaccStateMachineBase< SmDanceBotStrikesBack, MsDanceBotRunMode >
 SmaccStateMachineBase (my_context ctx, SignalDetector *signalDetector)
 
virtual ~SmaccStateMachineBase ()
 
void reset () override
 
void stop () override
 
void eStop () override
 
void initiate_impl () override
 
- Public Member Functions inherited from smacc2::ISmaccStateMachine
 ISmaccStateMachine (std::string stateMachineName, SignalDetector *signalDetector)
 
virtual ~ISmaccStateMachine ()
 
virtual void reset ()
 
virtual void stop ()
 
virtual void eStop ()
 
template<typename TOrthogonal >
TOrthogonal * getOrthogonal ()
 
const std::map< std::string, std::shared_ptr< smacc2::ISmaccOrthogonal > > & getOrthogonals () const
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage)
 
template<typename EventType >
void postEvent (EventType *ev, EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)
 
template<typename EventType >
void postEvent (EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)
 
template<typename T >
bool getGlobalSMData (std::string name, T &ret)
 
template<typename T >
void setGlobalSMData (std::string name, T value)
 
template<typename StateField , typename BehaviorType >
void mapBehavior ()
 
std::string getStateMachineName ()
 
void state_machine_visualization ()
 
std::shared_ptr< SmaccStateInfogetCurrentStateInfo ()
 
void publishTransition (const SmaccTransitionInfo &transitionInfo)
 
virtual void onInitialize ()
 this function should be implemented by the user to create the orthogonals More...
 
void getTransitionLogHistory (const std::shared_ptr< rmw_request_id_t > request_header, const std::shared_ptr< smacc2_msgs::srv::SmaccGetTransitionHistory::Request > req, std::shared_ptr< smacc2_msgs::srv::SmaccGetTransitionHistory::Response > res)
 
template<typename TSmaccSignal , typename TMemberFunctionPrototype , typename TSmaccObjectType >
boost::signals2::connection createSignalConnection (TSmaccSignal &signal, TMemberFunctionPrototype callback, TSmaccObjectType *object)
 
template<typename StateType >
void notifyOnStateEntryStart (StateType *state)
 
template<typename StateType >
void notifyOnStateEntryEnd (StateType *state)
 
template<typename StateType >
void notifyOnRuntimeConfigured (StateType *state)
 
template<typename StateType >
void notifyOnStateExitting (StateType *state)
 
template<typename StateType >
void notifyOnStateExited (StateType *state)
 
void disposeStateAndDisconnectSignals ()
 
template<typename StateType >
void notifyOnRuntimeConfigurationFinished (StateType *state)
 
unsigned long getCurrentStateCounter () const
 
ISmaccStategetCurrentState () const
 
const SmaccStateMachineInfogetStateMachineInfo ()
 
template<typename InitialStateType >
void buildStateMachineInfo ()
 
rclcpp::Node::SharedPtr getNode ()
 
rclcpp::Logger getLogger ()
 
std::recursive_mutex & getMutex ()
 

Public Attributes

int counter_1
 
bool rt_ready_flag
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::ISmaccStateMachine
void checkStateMachineConsistence ()
 
void initializeROS (std::string smshortname)
 
void onInitialized ()
 
template<typename TOrthogonal >
void createOrthogonal ()
 
- Protected Attributes inherited from smacc2::ISmaccStateMachine
rclcpp::Node::SharedPtr nh_
 
rclcpp::TimerBase::SharedPtr timer_
 
rclcpp::Publisher< smacc2_msgs::msg::SmaccStateMachine >::SharedPtr stateMachinePub_
 
rclcpp::Publisher< smacc2_msgs::msg::SmaccStatus >::SharedPtr stateMachineStatusPub_
 
rclcpp::Publisher< smacc2_msgs::msg::SmaccTransitionLogEntry >::SharedPtr transitionLogPub_
 
rclcpp::Service< smacc2_msgs::srv::SmaccGetTransitionHistory >::SharedPtr transitionHistoryService_
 
ISmaccStatecurrentState_
 
std::shared_ptr< SmaccStateInfocurrentStateInfo_
 
smacc2_msgs::msg::SmaccStatus status_msg_
 
std::map< std::string, std::shared_ptr< smacc2::ISmaccOrthogonal > > orthogonals_
 
std::shared_ptr< SmaccStateMachineInfostateMachineInfo_
 

Detailed Description

Advanced example of state machine with smacc that shows multiple techniques for the development of state machines.

Definition at line 141 of file sm_dance_bot_strikes_back.hpp.

Member Typedef Documentation

◆ deep_history

Definition at line 148 of file sm_dance_bot_strikes_back.hpp.

◆ inherited_deep_history

Definition at line 149 of file sm_dance_bot_strikes_back.hpp.

◆ shallow_history

Definition at line 147 of file sm_dance_bot_strikes_back.hpp.

Member Function Documentation

◆ onInitialize()

void sm_dance_bot_strikes_back::SmDanceBotStrikesBack::onInitialize ( )
inlineoverridevirtual

this function should be implemented by the user to create the orthogonals

Reimplemented from smacc2::ISmaccStateMachine.

Definition at line 153 of file sm_dance_bot_strikes_back.hpp.

154 {
155 this->setGlobalSMData("counter_1", counter_1);
156 this->setGlobalSMData("rt_ready_flag", rt_ready_flag);
157
158 this->createOrthogonal<OrNavigation>();
159 this->createOrthogonal<OrObstaclePerception>();
160 this->createOrthogonal<OrLED>();
161 this->createOrthogonal<OrTemperatureSensor>();
162 this->createOrthogonal<OrStringPublisher>();
163 this->createOrthogonal<OrService3>();
164 this->createOrthogonal<OrTimer>();
165 this->createOrthogonal<OrUpdatablePublisher>();
166 }
void setGlobalSMData(std::string name, T value)

References smacc2::ISmaccStateMachine::setGlobalSMData().

Here is the call graph for this function:

Member Data Documentation

◆ counter_1

int sm_dance_bot_strikes_back::SmDanceBotStrikesBack::counter_1

Definition at line 144 of file sm_dance_bot_strikes_back.hpp.

◆ rt_ready_flag

bool sm_dance_bot_strikes_back::SmDanceBotStrikesBack::rt_ready_flag

Definition at line 145 of file sm_dance_bot_strikes_back.hpp.


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