14#include "../AutonomyLogging.h"
54 eReachedGpsCoordinate,
89 case States::eIdle:
return "Idle";
90 case States::eNavigating:
return "Navigating";
91 case States::eSearchPattern:
return "Search Pattern";
92 case States::eApproachingMarker:
return "Approaching Marker";
93 case States::eApproachingObject:
return "Approaching Object";
94 case States::eVerifyingPosition:
return "Verifying Position";
95 case States::eVerifyingMarker:
return "Verifying Marker";
96 case States::eVerifyingObject:
return "Verifying Object";
97 case States::eReversing:
return "Reversing";
98 case States::eStuck:
return "Stuck";
99 default:
return "Unknown";
113 std::string m_szStateName;
134 virtual void Exit() {
return; }
202 virtual std::string
ToString()
const {
return m_szStateName; }
The abstract state class. All states inherit from this class.
Definition State.hpp:110
virtual bool operator!=(const State &other) const
Checks to see if the current state is not equal to the passed state.
Definition State.hpp:226
virtual std::string ToString() const
Accessor for the State private member. Returns the state as a string.
Definition State.hpp:202
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:124
State(States eState)
Construct a new State object.
Definition State.hpp:145
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:192
virtual void Exit()
This method is called when the state is exited. It is used to clean up the state.
Definition State.hpp:134
virtual bool operator==(const State &other) const
Checks to see if the current state is equal to the passed state.
Definition State.hpp:214
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:85
Event
The events that can be triggered in the state machine.
Definition State.hpp:52
States
The states that the state machine can be in.
Definition State.hpp:31