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
RecordingHandler.h
Go to the documentation of this file.
1
11#ifndef RECORDING_HANDLER_H
12#define RECORDING_HANDLER_H
13
14#include "../interfaces/BasicCamera.hpp"
15#include "../vision/aruco/TagDetector.h"
16#include "../vision/cameras/ZEDCam.h"
17
19#include <opencv2/opencv.hpp>
20#include <vector>
21
23
24
34class RecordingHandler : public AutonomyThread<void>
35{
36 public:
38 // Define public enumerators specific to this class.
40
41 // Enum used to select which mode the recorder should run in.
42 enum class RecordingMode
43 {
44 eCameraHandler, // Record video feeds from the CameraHandler.
45 eTagDetectionHandler, // Record video feeds from the TagDetectionHandler.
46 eObjectDetectionHandler // Record video feeds from the ObjectDetectionHandler.
47 };
48
50 // Declare public class methods and variables.
52
53 RecordingHandler(RecordingMode eRecordingMode);
55
57 // Mutators.
59
60 void SetRecordingFPS(const int nRecordingFPS);
61
63 // Accessors.
65
66 int GetRecordingFPS() const;
67
68 private:
70 // Declare private methods.
72
73 void ThreadedContinuousCode() override;
74 void PooledLinearCode() override;
79
81 // Declare private class member variables.
83
84 int m_nTotalVideoFeeds;
85 RecordingMode m_eRecordingMode;
86 std::vector<ZEDCamera*> m_vZEDCameras;
87 std::vector<BasicCamera*> m_vBasicCameras;
88 std::vector<TagDetector*> m_vTagDetectors;
89 std::vector<cv::VideoWriter> m_vCameraWriters;
90 std::vector<bool> m_vRecordingToggles;
91 std::vector<cv::Mat> m_vFrames;
92 std::vector<cv::cuda::GpuMat> m_vGPUFrames;
93 std::vector<std::future<bool>> m_vFrameFutures;
94};
95#endif
Interface class used to easily multithread a child class.
Definition AutonomyThread.hpp:38
The RecordingHandler class serves to enumerate the cameras available from the CameraHandler and retri...
Definition RecordingHandler.h:35
void SetRecordingFPS(const int nRecordingFPS)
Mutator for the desired FPS for all camera recordings.
Definition RecordingHandler.cpp:540
void ThreadedContinuousCode() override
This code will run continuously in a separate thread. New frames from the cameras that have recording...
Definition RecordingHandler.cpp:101
void UpdateRecordableTagDetectors()
This method is used internally by the class to update the number of TagDetectors that have recording ...
Definition RecordingHandler.cpp:416
void RequestAndWriteTagDetectorFrames()
This method is used internally by the RecordingHandler to request and write frames to from the TagDet...
Definition RecordingHandler.cpp:490
int GetRecordingFPS() const
Accessor for the desired FPS for all camera recordings.
Definition RecordingHandler.cpp:554
void UpdateRecordableCameras()
This method is used internally by the class to update the number of cameras that have recording enabl...
Definition RecordingHandler.cpp:152
~RecordingHandler()
Destroy the Recording Handler:: Recording Handler object.
Definition RecordingHandler.cpp:78
void RequestAndWriteCameraFrames()
This method is used internally by the RecordingHandler to request and write frames to from the camera...
Definition RecordingHandler.cpp:293
void PooledLinearCode() override
This method holds the code that is ran in the thread pool started by the ThreadedLinearCode() method....
Definition RecordingHandler.cpp:142