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
BasicCamera.hpp
Go to the documentation of this file.
1
11#ifndef BASICCAMERA_HPP
12#define BASICCAMERA_HPP
13
14#include "Camera.hpp"
15
17
19
20
27class BasicCamera : public Camera<cv::Mat>
28{
29 public:
30
43 BasicCamera(const std::string szCameraPath,
44 const int nPropResolutionX,
45 const int nPropResolutionY,
46 const int nPropFramesPerSecond,
47 const PIXEL_FORMATS ePropPixelFormat,
48 const double dPropHorizontalFOV,
49 const double dPropVerticalFOV,
50 const bool bEnableRecordingFlag,
51 const int nNumFrameRetrievalThreads) :
52 Camera(nPropResolutionX,
53 nPropResolutionY,
54 nPropFramesPerSecond,
55 ePropPixelFormat,
56 dPropHorizontalFOV,
57 dPropVerticalFOV,
58 bEnableRecordingFlag,
59 nNumFrameRetrievalThreads)
60 {
61 // Initialize member variables.
62 m_nCameraIndex = -1;
63 m_szCameraPath = szCameraPath;
64 m_bCameraIsConnectedOnVideoIndex = false;
65 }
66
67
80 BasicCamera(const int nCameraIndex,
81 const int nPropResolutionX,
82 const int nPropResolutionY,
83 const int nPropFramesPerSecond,
84 const PIXEL_FORMATS ePropPixelFormat,
85 const double dPropHorizontalFOV,
86 const double dPropVerticalFOV,
87 const bool bEnableRecordingFlag,
88 const int nNumFrameRetrievalThreads) :
89 Camera(nPropResolutionX,
90 nPropResolutionY,
91 nPropFramesPerSecond,
92 ePropPixelFormat,
93 dPropHorizontalFOV,
94 dPropVerticalFOV,
95 bEnableRecordingFlag,
96 nNumFrameRetrievalThreads)
97 {
98 // Initialize member variables.
99 m_nCameraIndex = nCameraIndex;
100 m_szCameraPath = "";
101 m_bCameraIsConnectedOnVideoIndex = true;
102 }
103
104
111 virtual ~BasicCamera() {}
112
113
123 virtual void ThreadedContinuousCode() {}
124
125
134 virtual void PooledLinearCode() {}
135
136
147 std::future<bool> RequestFrameCopy(cv::Mat& cvFrame) override = 0;
148
149
157 virtual std::string GetCameraLocation() const { return ""; }
158
159 protected:
160 // Declare protected methods and member variables.
161 int m_nCameraIndex;
162 std::string m_szCameraPath;
163 bool m_bCameraIsConnectedOnVideoIndex;
164
165 private:
166 // Declare private methods and member variables.
167};
168
169#endif // BASIC_CAMERA_HPP
Defines the Camera base interface class.
This class serves as a middle inheritor between the Camera interface and the BasicCam class....
Definition BasicCamera.hpp:28
virtual std::string GetCameraLocation() const
Accessor for the cameras path or video index.
Definition BasicCamera.hpp:157
virtual ~BasicCamera()
Destroy the Basic Camera object.
Definition BasicCamera.hpp:111
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
virtual void ThreadedContinuousCode()
The code inside this private method runs in a separate thread, but still has access to this*....
Definition BasicCamera.hpp:123
BasicCamera(const int nCameraIndex, 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. Overloaded for dev/video indexes.
Definition BasicCamera.hpp:80
std::future< bool > RequestFrameCopy(cv::Mat &cvFrame) override=0
Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it....
virtual void PooledLinearCode()
This method holds the code that is ran in the thread pool started by the ThreadedLinearCode() method....
Definition BasicCamera.hpp:134
This interface class serves as a base for all other classes that will implement and interface with a ...
Definition Camera.hpp:34