Central engineering reference and operations manual for the MRDT Autonomy Software.
View the Project on GitHub MissouriMRDT/Autonomy_Software
Return to RoveSoDocs Guides for Today, Tomorrow, and Forever.
The WaypointHandler (src/handlers/WaypointHandler.h & WaypointHandler.cpp) is a thread-safe registry that stores, sequences, and manages mission waypoints, intermediate planned paths, and permanent obstacle coordinates.
std::vector<geoops::Waypoint>) commanding autonomous rover movement.ADDPOSITIONLEG, ADDMARKERLEG, ADDOBJECTLEG, CLEARWAYPOINTS).StorePath(), RetrievePath()) allowing GeoPlanner to save generated A* routes.m_vPermanentObstacles), ensuring the path planner retains obstacle awareness across mission legs.The handler intercepts incoming RoveComm packets transmitted by the Basestation GUI:
ADDPOSITIONLEG)[Latitude, Longitude, LegID]geoops::Waypoint with type geoops::WaypointType::eNavigationWaypoint and appends it to the queue.ADDMARKERLEG)[Latitude, Longitude, MarkerID, SearchRadius]geoops::WaypointType::eTagWaypoint, and appends the marker waypoint with the specified ArUco ID.ADDOBJECTLEG)[Latitude, Longitude, ObjectID, SearchRadius]ObjectID using manifest::Autonomy::AUTONOMYWAYPOINTTYPES:
MALLET $\rightarrow$ geoops::WaypointType::eMalletWaypointWATERBOTTLE $\rightarrow$ geoops::WaypointType::eWaterBottleWaypointROCKPICK $\rightarrow$ geoops::WaypointType::eRockPickWaypointCLEARWAYPOINTS)std::shared_mutex:
m_muWaypointsMutex protects the mission queue.m_muPathMutex protects stored A* paths.m_muObstaclesMutex protects declared obstacle coordinates.GeoPlanner, VisualizationHandler, and NavigatingState) can read waypoints simultaneously using std::shared_lock, while incoming RoveComm callbacks acquire exclusive std::unique_lock.// Queue Manipulation
void AddWaypoint(const geoops::Waypoint& stWaypoint);
geoops::Waypoint PeekNextWaypoint();
geoops::Waypoint PopNextWaypoint();
void ClearWaypoints();
int GetWaypointCount();
const std::vector<geoops::Waypoint> GetAllWaypoints();
// Path Storage (GeoPlanner)
void StorePath(const std::string& szPathName, const std::vector<geoops::Waypoint>& vWaypointPath);
const std::vector<geoops::Waypoint> RetrievePath(const std::string& szPathName);
// Obstacle Management
void AddObstacle(const geoops::Waypoint& stObstacle);
const std::vector<geoops::Waypoint> GetAllObstacles();
The WaypointHandler provides key-value storage for computed navigation paths via StorePath(szPathName, vWaypointPath) and RetrievePath(szPathName). The autonomy system standardizes on two primary path keys to coordinate state machine operations:
| Path Key Name | Generating / Owning State | Description & Usage |
|---|---|---|
"GeoPlannerPath" |
GeoPlanner / SearchPatternState / StuckState |
Primary Active Navigation Path. Stores the global A* path generated between the rover’s starting pose and the current target destination waypoint. In SearchPatternState, stores the first half (vFirstHalf) of the Archimedean spiral trajectory representing outward expansion. In StuckState, obstacle avoidance splices are applied directly into this path, replacing previous node sequences with obstacle coordinates and rover pose fallback points. |
"GeoPlannerPathReverse" |
SearchPatternState / StuckState |
Inward Spiral Sweep Path. Stores the second half (vSecondHalf) of the Archimedean spiral trajectory generated by SearchPattern::GenerateSpiral(). Once the outward expansion is fully traversed, SearchPatternState loads this trajectory into the controller to navigate the rover back to the search pattern origin center. If an obstacle is detected during the reverse inward sweep, StuckState modifies this path directly. |
[!NOTE] Legacy Key Deprecation Previous implementations utilized transient path keys such as
"stuckPath","unstuckPath", and"RevSpiralPath". These have been deprecated and removed. All path tracking, obstacle splicing, and state transitions now operate exclusively and symmetrically on"GeoPlannerPath"and"GeoPlannerPathReverse".