ASCO Aerial Autonomy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
BaseStateMachine< RobotSystemT > Class Template Reference

Base state machine. More...

#include <base_state_machine.h>

Inheritance diagram for BaseStateMachine< RobotSystemT >:
Inheritance graph
[legend]

Public Member Functions

std::type_index get_no_transition_event_index () const
 Returns the index of the event that did not trigger any transition. More...
 
 BaseStateMachine (RobotSystemT &robot_system)
 Constructor with arguments to store robot system. More...
 
template<class FSM , class Event >
void no_transition (Event const &e, FSM &, int state_index)
 Print event typeid if no action present for the corresponding event. More...
 

Public Attributes

RobotSystemContainer
< RobotSystemT > 
robot_system_container_
 robot system container used by states to get sensor data and send commands Use the operator function robot_system_container_() to retrieve robot system in Action, Guard Functors. Other classes cannot access the robot system More...
 

Protected Attributes

std::type_index no_transition_event_index_ = typeid(NULL)
 type index to store the event that did not trigger any transition More...
 

Detailed Description

template<class RobotSystemT>
class BaseStateMachine< RobotSystemT >

Base state machine.

Constructor & Destructor Documentation

template<class RobotSystemT>
BaseStateMachine< RobotSystemT >::BaseStateMachine ( RobotSystemT &  robot_system)
inline

Constructor with arguments to store robot system.

Parameters
uav_systemrobot system that is stored internally and shared with events

Member Function Documentation

template<class RobotSystemT>
std::type_index BaseStateMachine< RobotSystemT >::get_no_transition_event_index ( ) const
inline

Returns the index of the event that did not trigger any transition.

Returns
The no-transition event index
template<class RobotSystemT>
template<class FSM , class Event >
void BaseStateMachine< RobotSystemT >::no_transition ( Event const &  e,
FSM &  ,
int  state_index 
)
inline

Print event typeid if no action present for the corresponding event.

Template Parameters
FSMBackend to trigger events etc
EventEvent type that triggered no transition
Parameters
eevent instance
state_indexThe index of the state where the no transition event is received

Member Data Documentation

template<class RobotSystemT>
std::type_index BaseStateMachine< RobotSystemT >::no_transition_event_index_ = typeid(NULL)
protected

type index to store the event that did not trigger any transition

template<class RobotSystemT>
RobotSystemContainer<RobotSystemT> BaseStateMachine< RobotSystemT >::robot_system_container_

robot system container used by states to get sensor data and send commands Use the operator function robot_system_container_() to retrieve robot system in Action, Guard Functors. Other classes cannot access the robot system

Decision Logic: The robot system container ensures that robot system is available to only few friend classes such as action functor, guard functors and is not available to others. This is necessary since we do not expect the logic state machine to contain the robot system. This was the only reasonable way found to share robot system across action and guard functors.


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