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

The TagDetectionHandler class is responsible for managing all of the different detectors that Autonomy_Software uses for AR tag detection. Whether it be for detection using OpenCV's ArUco or detection using a custom tensorflow model, the detectors are created and stored here. More...

#include <TagDetectionHandler.h>

Public Types

enum class  TagDetectors { TAGDETECTOR_START , eHeadMainCam , TAGDETECTOR_END }
 

Public Member Functions

 TagDetectionHandler ()
 Construct a new TagDetectionHandler::TagDetectionHandler object.
 
 ~TagDetectionHandler ()
 Destroy the TagDetectionHandler::TagDetectionHandler object.
 
void StartAllDetectors ()
 Signals all detectors to start their threads.
 
void StartRecording ()
 Signal the RecordingHandler to start recording video feeds from the TagDetectionHandler.
 
void StopAllDetectors ()
 Signals all detectors to stop their threads.
 
void StopRecording ()
 Signal the RecordingHandler to stop recording video feeds from the TagDetectionHandler.
 
std::shared_ptr< TagDetectorGetTagDetector (TagDetectors eDetectorName)
 Accessor for TagDetector detectors.
 

Private Attributes

std::shared_ptr< TagDetectorm_pTagDetectorMainCam
 
std::unique_ptr< RecordingHandlerm_pRecordingHandler
 

Detailed Description

The TagDetectionHandler class is responsible for managing all of the different detectors that Autonomy_Software uses for AR tag detection. Whether it be for detection using OpenCV's ArUco 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-07

Member Enumeration Documentation

◆ TagDetectors

enum class TagDetectionHandler::TagDetectors
strong
43 {
44 TAGDETECTOR_START,
45 eHeadMainCam,
46 TAGDETECTOR_END
47 };

Constructor & Destructor Documentation

◆ TagDetectionHandler()

TagDetectionHandler::TagDetectionHandler ( )

Construct a new TagDetectionHandler::TagDetectionHandler 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_pTagDetectorMainCam = std::make_shared<TagDetector>(globals::g_pCameraHandler->GetZED(CameraHandler::ZEDCamName::eHeadMainCam),
26 constants::TAGDETECT_MAINCAM_CORNER_REFINE_MAX_ITER,
27 constants::TAGDETECT_MAINCAM_CORNER_REFINE_METHOD,
28 constants::TAGDETECT_MAINCAM_MARKER_BORDER_BITS,
29 constants::TAGDETECT_MAINCAM_DETECT_INVERTED_MARKER,
30 constants::TAGDETECT_MAINCAM_USE_ARUCO3_DETECTION,
31 constants::TAGDETECT_MAINCAM_ENABLE_TRACKING,
32 constants::TAGDETECT_MAINCAM_MAX_FPS,
33 constants::TAGDETECT_MAINCAM_ENABLE_RECORDING,
34 constants::TAGDETECT_MAINCAM_DATA_RETRIEVAL_THREADS,
35 constants::ZED_MAINCAM_USE_GPU_MAT);
36
37 // Check if torch detection is enabled for main ZEDCam.
38 if (constants::TAGDETECT_MAINCAM_ENABLE_TORCH)
39 {
40 // Attempt to init torch detection.
41 if (m_pTagDetectorMainCam->InitTorchDetection(constants::TAGDETECT_MAINCAM_TORCH_MODEL))
42 {
43 // Set torch detection enabled.
44 m_pTagDetectorMainCam->EnableTorchDetection(constants::TAGDETECT_MAINCAM_TORCH_CONFIDENCE, constants::TAGDETECT_MAINCAM_TORCH_NMS_THRESH);
45 }
46 }
47
48 // Initialize recording handler for detectors.
49 m_pRecordingHandler = std::make_unique<RecordingHandler>(RecordingHandler::RecordingMode::eTagDetectionHandler);
50}

◆ ~TagDetectionHandler()

TagDetectionHandler::~TagDetectionHandler ( )

Destroy the TagDetectionHandler::TagDetectionHandler 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
60{
61 // Signal and wait for cameras to stop.
62 this->StopAllDetectors();
63}
void StopAllDetectors()
Signals all detectors to stop their threads.
Definition TagDetectionHandler.cpp:98
Here is the call graph for this function:

Member Function Documentation

◆ StartAllDetectors()

void TagDetectionHandler::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
73{
74 // Start ZED maincam detector.
75 m_pTagDetectorMainCam->Start();
76}
Here is the caller graph for this function:

◆ StartRecording()

void TagDetectionHandler::StartRecording ( )

Signal the RecordingHandler to start recording video feeds from the TagDetectionHandler.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-12-31
86{
87 // Start recording handler.
88 m_pRecordingHandler->Start();
89}
Here is the caller graph for this function:

◆ StopAllDetectors()

void TagDetectionHandler::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
99{
100 // Stop recording handler.
101 m_pRecordingHandler->RequestStop();
102 m_pRecordingHandler->Join();
103
104 // Stop ZED detectors.
105 m_pTagDetectorMainCam->RequestStop();
106 m_pTagDetectorMainCam->Join();
107}
Here is the caller graph for this function:

◆ StopRecording()

void TagDetectionHandler::StopRecording ( )

Signal the RecordingHandler to stop recording video feeds from the TagDetectionHandler.

Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2024-01-01
117{
118 // Stop recording handler.
119 m_pRecordingHandler->RequestStop();
120 m_pRecordingHandler->Join();
121}

◆ GetTagDetector()

std::shared_ptr< TagDetector > TagDetectionHandler::GetTagDetector ( TagDetectors  eDetectorName)

Accessor for TagDetector detectors.

Parameters
eDetectorName- The name of the detector to retrieve. An enum defined in and specific to this class.
Returns
std::shared_ptr<TagDetector> - 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
133{
134 // Determine which tag detector should be returned.
135 switch (eDetectorName)
136 {
137 case TagDetectors::eHeadMainCam: return m_pTagDetectorMainCam; break;
138 default: return m_pTagDetectorMainCam; break;
139 }
140}
Here is the caller graph for this function:

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