14#include "../AutonomyLogging.h"
56 eReachedGpsCoordinate,
68 eEndObstacleAvoidance,
93 case States::eIdle:
return "Idle";
94 case States::eNavigating:
return "Navigating";
95 case States::eSearchPattern:
return "Search Pattern";
96 case States::eApproachingMarker:
return "Approaching Marker";
97 case States::eApproachingObject:
return "Approaching Object";
98 case States::eVerifyingPosition:
return "Verifying Position";
99 case States::eVerifyingMarker:
return "Verifying Marker";
100 case States::eVerifyingObject:
return "Verifying Object";
101 case States::eAvoidance:
return "Avoidance";
102 case States::eReversing:
return "Reversing";
103 case States::eStuck:
return "Stuck";
104 default:
return "Unknown";
118 std::string m_szStateName;
139 virtual void Exit() {
return; }
207 virtual std::string
ToString()
const {
return m_szStateName; }
The abstract state class. All states inherit from this class.
Definition State.hpp:115
virtual bool operator!=(const State &other) const
Checks to see if the current state is not equal to the passed state.
Definition State.hpp:231
virtual std::string ToString() const
Accessor for the State private member. Returns the state as a string.
Definition State.hpp:207
virtual States TriggerEvent(Event eEvent)=0
Trigger an event in the state machine. Returns the next state.
virtual void Start()
This method is called when the state is first started. It is used to initialize the state.
Definition State.hpp:129
State(States eState)
Construct a new State object.
Definition State.hpp:150
virtual void Run()=0
Run the state machine. Returns the next state.
virtual ~State()=default
Destroy the State object.
States GetState() const
Accessor for the State private member.
Definition State.hpp:197
virtual void Exit()
This method is called when the state is exited. It is used to clean up the state.
Definition State.hpp:139
virtual bool operator==(const State &other) const
Checks to see if the current state is equal to the passed state.
Definition State.hpp:219
Namespace containing all state machine related classes.
Definition State.hpp:23
std::string StateToString(States eState)
Converts a state object to a string.
Definition State.hpp:89
Event
The events that can be triggered in the state machine.
Definition State.hpp:54
States
The states that the state machine can be in.
Definition State.hpp:31