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
ObjectDetectionHandler Class Reference

The ObjectDetectionHandler class is responsible for managing all of the different detectors that Autonomy_Software uses for object and obstacle detection. (excluding AR tags) Whether it be for simple detection using a depth measure and blobs or detection using a custom tensorflow model, the detectors are created and stored here. More...

#include <ObjectDetectionHandler.h>

Public Types

enum class  ObjectDetectors { OBJECTDETECTOR_START , eHeadMainCam , OBJECTDETECTOR_END }
 

Public Member Functions

 ObjectDetectionHandler ()
 Construct a new ObjectDetectionHandler::ObjectDetectionHandler object.
 
 ~ObjectDetectionHandler ()
 Destroy the ObjectDetectionHandler::ObjectDetectionHandler object.
 
void StartAllDetectors ()
 Signals all detectors to start their threads.
 
void StartRecording ()
 Signal the RecordingHandler to start recording feeds from the detectors.
 
void StopAllDetectors ()
 Signals all detectors to stop their threads.
 
void StopRecording ()
 Signal the RecordingHandler to stop recording feeds from the detectors.
 
std::shared_ptr< ObjectDetectorGetObjectDetector (ObjectDetectors eDetectorName)
 Accessor for ObjectDetector detectors.
 

Private Attributes

std::shared_ptr< ObjectDetectorm_pObjectDetectorMainCam
 
std::unique_ptr< RecordingHandlerm_pRecordingHandler
 

Detailed Description

The ObjectDetectionHandler class is responsible for managing all of the different detectors that Autonomy_Software uses for object and obstacle detection. (excluding AR tags) Whether it be for simple detection using a depth measure and blobs or detection using a custom tensorflow model, the detectors are created and stored here.

Author
ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-10-23

Member Enumeration Documentation

◆ ObjectDetectors

enum class ObjectDetectionHandler::ObjectDetectors
strong
43 {
44 OBJECTDETECTOR_START,
45 eHeadMainCam,
46 OBJECTDETECTOR_END
47 };

Constructor & Destructor Documentation

◆ ObjectDetectionHandler()

ObjectDetectionHandler::ObjectDetectionHandler ( )

Construct a new ObjectDetectionHandler::ObjectDetectionHandler object.

Author
ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-10-07
23{
24 // Initialize detector for main ZEDCam.
25 m_pObjectDetectorMainCam = std::make_shared<ObjectDetector>(globals::g_pCameraHandler->GetZED(CameraHandler::ZEDCamName::eHeadMainCam),
26 constants::OBJECTDETECT_MAINCAM_ENABLE_TRACKING,
27 constants::OBJECTDETECT_MAINCAM_MAX_FPS,
28 constants::OBJECTDETECT_MAINCAM_ENABLE_RECORDING,
29 constants::OBJECTDETECT_MAINCAM_DATA_RETRIEVAL_THREADS,
30 constants::ZED_MAINCAM_USE_GPU_MAT);
31
32 // Check if torch detection is enabled for main ZEDCam.
33 if (constants::OBJECTDETECT_MAINCAM_ENABLE_TORCH)
34 {
35 // Attempt to init torch detection.
36 if (m_pObjectDetectorMainCam->InitTorchDetection(constants::OBJECTDETECT_MAINCAM_TORCH_MODEL))
37 {
38 // Set torch detection enabled.
39 m_pObjectDetectorMainCam->EnableTorchDetection(constants::OBJECTDETECT_MAINCAM_TORCH_CONFIDENCE, constants::OBJECTDETECT_MAINCAM_TORCH_NMS_THRESH);
40 }
41 }
42
43 // Initialize recording handler for detectors.
44 m_pRecordingHandler = std::make_unique<RecordingHandler>(RecordingHandler::RecordingMode::eObjectDetectionHandler);
45}

◆ ~ObjectDetectionHandler()

ObjectDetectionHandler::~ObjectDetectionHandler ( )

Destroy the ObjectDetectionHandler::ObjectDetectionHandler object.

Author
ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-10-07
55{
56 // Signal and wait for cameras to stop.
57 this->StopAllDetectors();
58}
void StopAllDetectors()
Signals all detectors to stop their threads.
Definition ObjectDetectionHandler.cpp:93
Here is the call graph for this function:

Member Function Documentation

◆ StartAllDetectors()

void ObjectDetectionHandler::StartAllDetectors ( )

Signals all detectors to start their threads.

Author
ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-10-07
68{
69 // Start ZED maincam detector.
70 m_pObjectDetectorMainCam->Start();
71}
Here is the caller graph for this function:

◆ StartRecording()

void ObjectDetectionHandler::StartRecording ( )

Signal the RecordingHandler to start recording feeds from the detectors.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-05-05
81{
82 // Start recording for all detectors.
83 m_pRecordingHandler->Start();
84}
Here is the caller graph for this function:

◆ StopAllDetectors()

void ObjectDetectionHandler::StopAllDetectors ( )

Signals all detectors to stop their threads.

Author
ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-10-07
94{
95 // Stop recording handler.
96 m_pRecordingHandler->RequestStop();
97 m_pRecordingHandler->Join();
98
99 // Stop ZED maincam detector.
100 m_pObjectDetectorMainCam->RequestStop();
101 m_pObjectDetectorMainCam->Join();
102}
Here is the caller graph for this function:

◆ StopRecording()

void ObjectDetectionHandler::StopRecording ( )

Signal the RecordingHandler to stop recording feeds from the detectors.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2025-05-05
112{
113 // Stop recording handler.
114 m_pRecordingHandler->RequestStop();
115 m_pRecordingHandler->Join();
116}

◆ GetObjectDetector()

std::shared_ptr< ObjectDetector > ObjectDetectionHandler::GetObjectDetector ( ObjectDetectors  eDetectorName)

Accessor for ObjectDetector detectors.

Parameters
eDetectorName- The name of the detector to retrieve. An enum defined in and specific to this class.
Returns
std::shared_ptr<ObjectDetector> - A pointer to the detector pertaining to the given name.
Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-10-07
128{
129 // Determine which object detector should be returned.
130 switch (eDetectorName)
131 {
132 case ObjectDetectors::eHeadMainCam: return m_pObjectDetectorMainCam; break;
133 default: return m_pObjectDetectorMainCam; break;
134 }
135}
Here is the caller graph for this function:

The documentation for this class was generated from the following files: