Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
ApproachingMarkerState.h
Go to the documentation of this file.
1
11#ifndef APPROACHING_MARKER_STATE_H
12#define APPROACHING_MARKER_STATE_H
13
14#include "../interfaces/State.hpp"
15#include "../util/GeospatialOperations.hpp"
16#include "../util/states/StuckDetection.hpp"
17#include "../util/vision/TagDetectionUtilty.hpp"
18#include "../vision/aruco/TagDetector.h"
19
21#include <chrono>
22
24
25
31namespace statemachine
32{
33
41 {
42 private:
43 // Core Components
44 std::vector<std::shared_ptr<TagDetector>> m_vTagDetectors;
46
47 // State tracking
48 States m_eTriggeringState;
49 bool m_bInitialized;
50 geoops::Waypoint m_stGoalWaypoint;
51
52 // Persistent tracking variables for Run()
53 double m_dHeadingSetPoint;
54 double m_dDistanceFromTag;
55 bool m_bDriveBackwards;
56
57 // Geolocation fallback
58 geoops::Waypoint m_stLastGeolocatedPosition;
59 bool m_bHasLastGeolocatedPosition;
60 bool m_bHasSeenTarget;
61
62 // Timing and logging flags
63 std::chrono::system_clock::time_point m_tmLastSeenTime;
64 std::chrono::system_clock::time_point m_tmLastLogTime;
65 bool m_bAlreadyPrintedLost;
66 bool m_bAlreadyPrintedVisualLostFallback;
67
68 protected:
69 void Start() override;
70 void Exit() override;
71
72 public:
74 void Run() override;
75 States TriggerEvent(Event eEvent) override;
76 };
77} // namespace statemachine
78
79#endif // APPROACHING_MARKER_STATE_H
The ApproachingMarkerState class implements the Approaching Marker state for the Autonomy State Machi...
Definition ApproachingMarkerState.h:41
void Start() override
This method is called when the state is first started. It is used to initialize the state.
Definition ApproachingMarkerState.cpp:33
void Exit() override
This method is called when the state is exited. It is used to clean up the state.
Definition ApproachingMarkerState.cpp:77
ApproachingMarkerState()
Accessor for the State private member. Returns the state as a string.
Definition ApproachingMarkerState.cpp:89
States TriggerEvent(Event eEvent) override
Trigger an event in the state machine. Returns the next state.
Definition ApproachingMarkerState.cpp:412
void Run() override
Run the state machine. Returns the next state.
Definition ApproachingMarkerState.cpp:110
The abstract state class. All states inherit from this class.
Definition State.hpp:110
This class should be instantiated within another state to be used for detection of if the rover is st...
Definition StuckDetection.hpp:43
Namespace containing all state machine related classes.
Definition State.hpp:23
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
This struct is used by the WaypointHandler class to store location, size, and type information about ...
Definition GeospatialOperations.hpp:423