Autonomy Software Binder

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.

Object Detection Handler

The ObjectDetectionHandler (src/handlers/ObjectDetectionHandler.h & ObjectDetectionHandler.cpp) orchestrates all deep-learning prop and obstacle detection pipelines across active camera feeds.


1. Primary Responsibilities

  1. Model Loading and Management: Loads custom LibTorch YOLO models (OBJECTDETECT_TORCH_MODEL) onto GPU memory via CUDA (supporting both baseline bmp_v6 and competition-tuned bmp_v7 Tucumcari weights).
  2. Detector Lifecycle Management: Instantiates and initializes ObjectDetector instances for assigned cameras (eHeadMainCam, eRearCam).
  3. Bounding Box Tracking Integration: Coordinates OpenCV CSRT/KCF multi-object trackers between neural network inferences to reduce compute load.
  4. Debug Overlay Streaming: Generates annotated frames (RequestDetectionOverlayFrame()) displaying bounding boxes, class labels, and confidence scores.
  5. Video Recording: Houses an internal RecordingHandler configured in RecordingType::eObjectDetectionHandler mode to record annotated detection video.

2. Managed Detectors

Access to detector instances is provided via the ObjectDetectors enumeration:


3. Concurrency and Integration


4. Usage Example

// Initialization in main.cpp
globals::g_pObjectDetectionHandler = new ObjectDetectionHandler();
globals::g_pObjectDetectionHandler->StartAllDetectors();
globals::g_pObjectDetectionHandler->StartRecording();

// Querying detection overlay for UI streaming:
cv::Mat cvAnnotatedFrame = globals::g_pObjectDetectionHandler->RequestDetectionOverlayFrame(
    ObjectDetectionHandler::ObjectDetectors::eHeadMainCam
);