Public Member Functions | Protected Attributes | List of all members
rsm::BaseState Class Referenceabstract

#include <BaseState.h>

Inheritance diagram for rsm::BaseState:
Inheritance graph
[legend]

Public Member Functions

 BaseState ()
 
std::string getName ()
 
StateInterfacegetStateInterface ()
 
virtual void onActive ()=0
 
virtual void onEntry ()
 
virtual void onExit ()
 
virtual void onExplorationStart (bool &success, std::string &message)
 
virtual void onExplorationStop (bool &success, std::string &message)
 
virtual void onInterrupt (int interrupt)
 Called when an operation mode interrupt was received. More...
 
virtual void onSetup ()
 
virtual void onWaypointFollowingStart (bool &success, std::string &message)
 
virtual void onWaypointFollowingStop (bool &success, std::string &message)
 
void setStateInterface (StateInterface *stateinterface)
 
virtual ~BaseState ()
 

Protected Attributes

bool _interrupt_occured
 Shows if an interupt occured. More...
 
std::string _name
 Name of the state. More...
 
StateInterface_stateinterface
 Pointer to State Interface handling all state transitions. More...
 

Detailed Description

Definition at line 26 of file BaseState.h.

Constructor & Destructor Documentation

◆ BaseState()

rsm::BaseState::BaseState ( )

Constructor

Definition at line 5 of file BaseState.cpp.

◆ ~BaseState()

rsm::BaseState::~BaseState ( )
virtual

Default destructor

Definition at line 10 of file BaseState.cpp.

Member Function Documentation

◆ getName()

std::string rsm::BaseState::getName ( )

Getter for the state's name

Returns
Name of the state

Definition at line 22 of file BaseState.cpp.

◆ getStateInterface()

StateInterface * rsm::BaseState::getStateInterface ( )

Get state interface of state. Default is NULL, when no state interface is assigned.

Returns
pointer to StateInterface instance.

Definition at line 18 of file BaseState.cpp.

◆ onActive()

virtual void rsm::BaseState::onActive ( )
pure virtual

◆ onEntry()

virtual void rsm::BaseState::onEntry ( )
inlinevirtual

Called once when activated

Reimplemented in rsm::WaypointFollowingState, rsm::BootState, rsm::IdleState, rsm::TeleoperationState, and rsm::EmergencyStopState.

Definition at line 61 of file BaseState.h.

◆ onExit()

virtual void rsm::BaseState::onExit ( )
inlinevirtual

Called once when left

Reimplemented in rsm::WaypointFollowingState, rsm::BootState, rsm::IdleState, rsm::TeleoperationState, and rsm::EmergencyStopState.

Definition at line 73 of file BaseState.h.

◆ onExplorationStart()

virtual void rsm::BaseState::onExplorationStart ( bool &  success,
std::string &  message 
)
inlinevirtual

Called when exploration was started manually

Reimplemented in rsm::WaypointFollowingState, rsm::BootState, rsm::IdleState, rsm::TeleoperationState, and rsm::EmergencyStopState.

Definition at line 80 of file BaseState.h.

◆ onExplorationStop()

virtual void rsm::BaseState::onExplorationStop ( bool &  success,
std::string &  message 
)
inlinevirtual

Called when exploration was stopped manually

Reimplemented in rsm::WaypointFollowingState, rsm::BootState, rsm::IdleState, rsm::TeleoperationState, and rsm::EmergencyStopState.

Definition at line 88 of file BaseState.h.

◆ onInterrupt()

virtual void rsm::BaseState::onInterrupt ( int  interrupt)
inlinevirtual

Called when an operation mode interrupt was received.

Parameters
interruptKind of interrupt (1=EmergencyStop, 2=TeleoperationInterupt)

Reimplemented in rsm::WaypointFollowingState, rsm::IdleState, rsm::TeleoperationState, rsm::EmergencyStopState, and rsm::BootState.

Definition at line 110 of file BaseState.h.

◆ onSetup()

virtual void rsm::BaseState::onSetup ( )
inlinevirtual

Called once when registered at StateInterface

Reimplemented in rsm::WaypointFollowingState, rsm::BootState, rsm::IdleState, rsm::TeleoperationState, and rsm::EmergencyStopState.

Definition at line 54 of file BaseState.h.

◆ onWaypointFollowingStart()

virtual void rsm::BaseState::onWaypointFollowingStart ( bool &  success,
std::string &  message 
)
inlinevirtual

Called when waypoint following was started/paused manually

Reimplemented in rsm::WaypointFollowingState, rsm::IdleState, rsm::TeleoperationState, and rsm::EmergencyStopState.

Definition at line 95 of file BaseState.h.

◆ onWaypointFollowingStop()

virtual void rsm::BaseState::onWaypointFollowingStop ( bool &  success,
std::string &  message 
)
inlinevirtual

Called when waypoint following was stopped manually

Reimplemented in rsm::WaypointFollowingState, rsm::IdleState, rsm::TeleoperationState, and rsm::EmergencyStopState.

Definition at line 102 of file BaseState.h.

◆ setStateInterface()

void rsm::BaseState::setStateInterface ( StateInterface stateinterface)

Set state interface of state. This is called by the state interface at state transitions.

Parameters
StateInterfaceInstance

Definition at line 14 of file BaseState.cpp.

Member Data Documentation

◆ _interrupt_occured

bool rsm::BaseState::_interrupt_occured
protected

Shows if an interupt occured.

Definition at line 129 of file BaseState.h.

◆ _name

std::string rsm::BaseState::_name
protected

Name of the state.

Definition at line 133 of file BaseState.h.

◆ _stateinterface

StateInterface* rsm::BaseState::_stateinterface
protected

Pointer to State Interface handling all state transitions.

Definition at line 125 of file BaseState.h.


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


rsm_core
Author(s): Marco Steinbrink
autogenerated on Mon Feb 28 2022 23:28:16