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.
During testing operations and competition runs, reviewing raw camera perspectives alongside real-time neural network and detector inferences is essential for diagnostic analysis. Video recording is managed by the RecordingHandler, an asynchronous recording subsystem that runs independently of sensor capture and machine vision inference pipelines.
H.264 video compression and disk I/O are computationally heavy operations. If detector threads or camera acquisition threads encoded and wrote video frames synchronously, perception loop frequencies would drop significantly.
To isolate the critical path:
RecordingHandler runs in a dedicated thread derived from AutonomyThread<void>.CameraHandler, TagDetectionHandler, and ObjectDetectionHandler.RecordingHandler requests frames asynchronously from its parent cameras or detectors using non-blocking futures (std::future<bool>), leaving the parent processing pipelines completely unhindered.cv::VideoWriter pipelines initialized with four-character code H264 or mp4v targeting .mp4 container files.+-------------------------+ +-------------------------------+ +---------------------------------+
| CameraHandler | | TagDetectionHandler | | ObjectDetectionHandler |
| (Raw Frame Acquisition) | | (ArUco Detection + Overlays) | | (YOLO Model + Overlays) |
+-------------------------+ +-------------------------------+ +---------------------------------+
| | |
v v v
+-------------------------+ +-------------------------------+ +---------------------------------+
| RecordingHandler | | RecordingHandler | | RecordingHandler |
| Mode: eCameraHandler | | Mode: eTagDetectionHandler | | Mode: eObjectDetectionHandler |
| (Raw Video Streams) | | (Tag Overlay Video) | | (Object Overlay Video) |
+-------------------------+ +-------------------------------+ +---------------------------------+
\ | /
\---------------------------------+-------------------------------------/
|
v
+---------------------------------+
| Disk Output Directory: |
| logs/<timestamp>/ |
| *.mp4 encoded at RECORDER_FPS |
+---------------------------------+
The RecordingHandler::RecordingMode enum configures the nature of the frames captured:
eCameraHandlerZEDCamera instances or BasicCam USB devices).eTagDetectionHandlerTagDetector::RequestOverlayFrameCopyAsync().eObjectDetectionHandlerObjectDetector::RequestOverlayFrameCopyAsync().At startup, AutonomyLogging::InitializeLoggers() establishes a unified run folder based on the session timestamp:
logs/
+-- 2026-09-08_15-30-00/
|-- console_output.log
|-- console_output.csv
|-- visualization.html
|-- spatial_map.ply
|-- MainCam_Raw.mp4
|-- RearCam_Raw.mp4
|-- MainCam_TagOverlay.mp4
|-- RearCam_TagOverlay.mp4
|-- MainCam_ObjectOverlay.mp4
+-- RearCam_ObjectOverlay.mp4
Videos are written at the resolution established by constants::ZED_MAINCAM_RESOLUTIONX and constants::ZED_MAINCAM_RESOLUTIONY (typically 1280x720) and throttled to constants::RECORDER_FPS.
Recording behavior is selectively controlled in src/AutonomyConstants.cpp:
| Constant Name | Type | Default | Description |
|---|---|---|---|
RECORDER_FPS |
int |
15 |
Target framerate for video encoding. Lower values conserve GPU encoder capacity and disk bandwidth. |
ZED_MAINCAM_ENABLE_RECORDING |
bool |
true |
Toggles raw video recording on the forward ZED camera. |
ZED_REARCAM_ENABLE_RECORDING |
bool |
true |
Toggles raw video recording on the rear ZED camera. |
TAGDETECT_MAINCAM_ENABLE_RECORDING |
bool |
true |
Toggles overlay recording on the forward ArUco tag detector. |
TAGDETECT_REARCAM_ENABLE_RECORDING |
bool |
false |
Toggles overlay recording on the rear ArUco tag detector. |
OBJECTDETECT_MAINCAM_ENABLE_RECORDING |
bool |
true |
Toggles overlay recording on the forward YOLO object detector. |
OBJECTDETECT_REARCAM_ENABLE_RECORDING |
bool |
false |
Toggles overlay recording on the rear YOLO object detector. |
RecordingHandler instances upon construction.src/main.cpp, recording is formally enabled after hardware verification:
globals::g_pCameraHandler->StartRecording();
globals::g_pTagDetectionHandler->StartRecording();
globals::g_pObjectDetectionHandler->StartRecording();
Q key), the parent handler stop calls signal the RecordingHandler thread to finish writing remaining frames, close the cv::VideoWriter streams cleanly, and finalize file containers on disk.