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
ApproachingObjectState.h
Go to the documentation of this file.
1
11#ifndef APPROACHING_OBJECT_STATE_H
12#define APPROACHING_OBJECT_STATE_H
13
14#include "../interfaces/State.hpp"
15#include "../util/GeospatialOperations.hpp"
16#include "../util/states/StuckDetection.hpp"
17#include "../util/vision/ObjectDetectionUtility.hpp"
18#include "../vision/objects/ObjectDetector.h"
19
20#include <chrono>
21
22
28namespace statemachine
29{
30
38 {
39 private:
40 // Core Components
41 std::vector<std::shared_ptr<ObjectDetector>> m_vObjectDetectors;
43
44 // State tracking
45 States m_eTriggeringState;
46 bool m_bInitialized;
47 geoops::Waypoint m_stGoalWaypoint;
48
49 // Persistent tracking variables for Run()
50 double m_dHeadingSetPoint;
51 bool m_bDriveBackwards;
52
53 // Geolocation fallback
54 geoops::Waypoint m_stLastGeolocatedPosition;
55 bool m_bHasLastGeolocatedPosition;
56 bool m_bHasSeenTarget;
57
58 // Timing and logging flags
59 std::chrono::system_clock::time_point m_tmLastSeenTime;
60 std::chrono::system_clock::time_point m_tmLastLogTime;
61 bool m_bAlreadyPrintedLost;
62 bool m_bAlreadyPrintedVisualLostFallback;
63
64 protected:
65 void Start() override;
66 void Exit() override;
67
68 public:
70 void Run() override;
71 States TriggerEvent(Event eEvent) override;
72 };
73} // namespace statemachine
74
75#endif // APPROACHING_OBJECT_STATE_H
The ApproachingObjectState class implements the Approaching Object state for the Autonomy State Machi...
Definition ApproachingObjectState.h:38
void Exit() override
This method is called when the state is exited. It is used to clean up the state.
Definition ApproachingObjectState.cpp:73
void Start() override
This method is called when the state is first started. It is used to initialize the state.
Definition ApproachingObjectState.cpp:32
States TriggerEvent(Event eEvent) override
Trigger an event in the state machine. Returns the next state.
Definition ApproachingObjectState.cpp:245
ApproachingObjectState()
Construct a new State object.
Definition ApproachingObjectState.cpp:85
void Run() override
Run the state machine. Returns the next state.
Definition ApproachingObjectState.cpp:106
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