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.
This section describes the high-level software architecture of the Autonomy Software, detailing data pathways, inter-thread synchronization, external hardware communication, and coordinate transformations across navigation frames.
The software operates as a modular, multithreaded architecture organized around a centralized state machine. The primary data pipeline proceeds through five stages:
[Sensors & Hardware]
|
v (RoveComm UDP / USB / CUDA)
[Drivers & Handlers] (NavBoard, DriveBoard, CameraHandler, LiDARHandler)
|
v (Thread-safe Queues / Shared Memory)
[Perception & Geolocation] (TagDetector, ObjectDetector, GeolocateBox)
|
v (UTM Waypoints & Sensor Fusion)
[State Machine] (StateMachineHandler -> Active State)
|
v (Goal Coordinates & Costmap Lookups)
[Path Planning] (GeoPlanner / A* / Search Patterns)
|
v (Target Waypoints & Speed Profile)
[Controllers & Kinematics] (Predictive Stanley / Pure Pursuit / PID / DifferentialDrive)
|
v (RoveComm UDP)
[Core & Motor Controllers]
ZEDCam.cpp) or virtual WebRTC pipes (SIMZEDCam.cpp).LiDARHandler.cpp).TagDetectionHandler and ObjectDetectionHandler.TagDetector runs OpenCV ArUco dictionary matching (DICT_4X4_50) and an optional LibTorch YOLO model in parallel.ObjectDetector runs custom LibTorch YOLO models (.pt TorchScript) with CUDA acceleration, followed by non-maximum suppression (NMS) and OpenCV CSRT/KCF bounding-box tracking.GeolocateBox() queries the corresponding 3D camera point cloud (CV_32FC4), applies statistical depth filtering (20th percentile surface extraction), and projects the vector into global UTM space using the fused rover pose.StateMachineHandler executes at a controlled frequency (STATEMACHINE_MAX_IPS, typically 60 Hz).SmartRetrieveRoverPose(), fusing low-frequency GPS heading and position with high-frequency ZED IMU angular rates and dynamic drift correction.eNavigating, the state machine passes the fused rover UTM position and the target destination to GeoPlanner.GeoPlanner calculates a 2.5D costmap using USGS terrain data from LiDARHandler, applies obstacle inflation, and computes a collision-free path using Kinematically Constrained Weighted A*.eSearchPattern, the system mathematically constructs expanding spiral, zigzag, or snake patterns around the search radius.PredictiveStanleyController, PurePursuitController, or the heading PID controller.DifferentialDrive.hpp (Arcade Drive or Curvature Drive) translate linear and angular requests into normalized left and right track power commands (-1.0 to 1.0).DRIVELEFTRIGHT packet and transmitted to the Core motor controller board.To avoid latency in control loops, compute-intensive processes are separated into dedicated asynchronous worker threads:
AutonomyThread<T> Interface: Fundamental base class for long-running worker loops (CameraHandler, TagDetector, ObjectDetector, StateMachineHandler, VisualizationHandler, RoveCommUDP). Each instance runs an independent OS thread, manages thread states (eStarting, eRunning, eStopping, eStopped), enforces iteration-per-second (IPS) rate limits, and safely cleans up in its destructor.BS::thread_pool): Each AutonomyThread instantiates an internal Barak Shoshany thread pool. This is used for bursting tasks without thread allocation overhead, such as dispatching asynchronous frame copies across multiple subscriber buffers (RequestFrameCopy()) or evaluating parallelized search loops.std::shared_mutex is used throughout the codebase for read-heavy resources (such as WaypointHandler lists and LiDARHandler database connections). Multiple consumers can acquire shared read locks (std::shared_lock) simultaneously, while mutations require an exclusive unique lock (std::unique_lock).std::atomic<bool>) are utilized for fast state toggles and lifecycle management without mutex lock contention.Communication between the Jetson computing platform and distributed rover subsystems uses the MRDT RoveComm protocol.
DRIVELEFTRIGHT), GPS telemetry (GPSLATLON), IMU heading packets (IMUDATA), lighting controls (STATEDISPLAY, LEDRGB), and console log streaming.ADDPOSITIONLEG, ADDMARKERLEG, ADDOBJECTLEG), queue clears (CLEARWAYPOINTS), and logging level reconfigurations (SETLOGGINGLEVELS).All communication relies on RoveCommManifest.h. Packet headers define:
unDataId: Unique 16-bit identifier for the command or telemetry stream.unDataCount: Number of elements contained in the payload array.eDataType: Primitive type (UINT8_T, INT32_T, FLOAT_T, DOUBLE_T).
Payload bytes are converted to and from network byte order using endianness helper macros (htonll, ntohll).Navigational calculations span three distinct reference frames. Maintaining mathematical consistency across these frames is essential for accurate geolocation and tracking.
sl::COORDINATE_SYSTEM::LEFT_HANDED_Y_UP.