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
BasicCam.h
Go to the documentation of this file.
1
10
11#ifndef BASICCAM_H
12#define BASICCAM_H
13
16
18#include <opencv2/opencv.hpp>
19
21
22
32class BasicCam : public BasicCamera
33{
34 public:
36 // Declare public methods and member variables.
38
39 BasicCam(const std::string szCameraPath,
40 const int nPropResolutionX,
41 const int nPropResolutionY,
42 const int nPropFramesPerSecond,
43 const PIXEL_FORMATS ePropPixelFormat,
44 const double dPropHorizontalFOV,
45 const double dPropVerticalFOV,
46 const bool bEnableRecordingFlag,
47 const int nNumFrameRetrievalThreads = 10);
48 BasicCam(const int nCameraIndex,
49 const int nPropResolutionX,
50 const int nPropResolutionY,
51 const int nPropFramesPerSecond,
52 const PIXEL_FORMATS ePropPixelFormat,
53 const double dPropHorizontalFOV,
54 const double dPropVerticalFOV,
55 const bool bEnableRecordingFlag,
56 const int nNumFrameRetrievalThreads = 10);
57 ~BasicCam();
58 std::future<bool> RequestFrameCopy(cv::Mat& cvFrame) override;
59
61 // Getters.
63
64 bool GetCameraIsOpen() override;
65 std::string GetCameraLocation() const override;
66
67 private:
69 // Declare private member variables.
71 // Basic Camera specific.
72 cv::VideoCapture m_cvCamera;
73 bool m_bCameraReopenAlreadyChecked;
74
75 // Mats for storing frames.
76 cv::Mat m_cvFrame;
77
79 // Declare private methods.
81 void ThreadedContinuousCode() override;
82 void PooledLinearCode() override;
83};
84#endif
This interface defines the base functions needed to multi-thread a class in Autonomy_Software....
Defines and implements the BasicCamera interface class.
void PooledLinearCode() override
This method holds the code that is ran in the thread pool started by the ThreadedLinearCode() method....
Definition BasicCam.cpp:287
~BasicCam()
Destroy the Basic Cam:: Basic Cam object.
Definition BasicCam.cpp:149
std::future< bool > RequestFrameCopy(cv::Mat &cvFrame) override
Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it....
Definition BasicCam.cpp:324
bool GetCameraIsOpen() override
Accessor for the camera open status.
Definition BasicCam.cpp:349
BasicCam(const std::string szCameraPath, const int nPropResolutionX, const int nPropResolutionY, const int nPropFramesPerSecond, const PIXEL_FORMATS ePropPixelFormat, const double dPropHorizontalFOV, const double dPropVerticalFOV, const bool bEnableRecordingFlag, const int nNumFrameRetrievalThreads=10)
Construct a new Basic Cam:: Basic Cam object.
Definition BasicCam.cpp:31
void ThreadedContinuousCode() override
The code inside this private method runs in a separate thread, but still has access to this*....
Definition BasicCam.cpp:183
std::string GetCameraLocation() const override
Accessor for the cameras path or video index.
Definition BasicCam.cpp:363
BasicCamera(const std::string szCameraPath, const int nPropResolutionX, const int nPropResolutionY, const int nPropFramesPerSecond, const PIXEL_FORMATS ePropPixelFormat, const double dPropHorizontalFOV, const double dPropVerticalFOV, const bool bEnableRecordingFlag, const int nNumFrameRetrievalThreads)
Construct a new Basic Camera object.
Definition BasicCamera.hpp:43