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
FetchContainers.hpp
Go to the documentation of this file.
1
14#ifndef FETCH_CONTAINERS_HPP
15#define FETCH_CONTAINERS_HPP
16
18#include <future>
19#include <opencv2/opencv.hpp>
20#include <sl/Camera.hpp>
21
23
24// Declare global/file-scope enumerator.
25enum class PIXEL_FORMATS
26{
27 eRGB,
28 eBGR,
29 eRGBA,
30 eBGRA,
31 eARGB,
32 eABGR,
33 eRGBE,
34 eXYZ,
35 eXYZBGRA,
36 eXYZRGBA,
37 eZED,
38 eGrayscale,
39 eDepthImage,
40 eDepthMeasure,
41 eCMYK,
42 eYUV,
43 eYUYV,
44 eYUVJ,
45 eHSV,
46 eHSL,
47 eSRGB,
48 eLAB,
49 eArucoDetection,
50 eObjectDetection,
51 eObstacleDetection,
52 eDepthDetection,
53 eTorchDetection,
54 eUNKNOWN
55};
56
58
59
67namespace containers
68{
69
86 template<typename T>
88 {
89 public:
90 // Declare and define public struct member variables.
91 T* pFrame;
92 PIXEL_FORMATS eFrameType;
93 std::shared_ptr<std::promise<bool>> pCopiedFrameStatus;
94
95
105 FrameFetchContainer(T& tFrame, PIXEL_FORMATS eFrameType) : pFrame(&tFrame), eFrameType(eFrameType), pCopiedFrameStatus(std::make_shared<std::promise<bool>>())
106 {}
107
108
116 FrameFetchContainer(const FrameFetchContainer& stOtherFrameContainer) :
117 pFrame(stOtherFrameContainer.pFrame), eFrameType(stOtherFrameContainer.eFrameType), pCopiedFrameStatus(stOtherFrameContainer.pCopiedFrameStatus)
118 {}
119
120
129 FrameFetchContainer& operator=(const FrameFetchContainer& stOtherFrameContainer)
130 {
131 // Check if the passed in container is the same as this one.
132 if (this != &stOtherFrameContainer)
133 {
134 // Copy struct attributes.
135 this->pFrame = stOtherFrameContainer.pFrame;
136 this->eFrameType = stOtherFrameContainer.eFrameType;
137 this->pCopiedFrameStatus = stOtherFrameContainer.pCopiedFrameStatus;
138 }
139
140 // Return pointer to this object which now contains the copied values.
141 return *this;
142 }
143 };
144
145
162 template<typename T>
164 {
165 public:
166 // Declare and define public struct member variables.
167 T* pData;
168 std::shared_ptr<std::promise<bool>> pCopiedDataStatus;
169
170
178 DataFetchContainer(T& tData) : pData(&tData), pCopiedDataStatus(std::make_shared<std::promise<bool>>()) {}
179
180
188 DataFetchContainer(const DataFetchContainer& stOtherDataContainer) :
189 pData(stOtherDataContainer.pData), pCopiedDataStatus(stOtherDataContainer.pCopiedDataStatus)
190 {}
191
192
201 DataFetchContainer& operator=(const DataFetchContainer& stOtherDataContainer)
202 {
203 // Check if the passed in container is the same as this one.
204 if (this != &stOtherDataContainer)
205 {
206 // Copy struct attributes.
207 this->pData = stOtherDataContainer.pData;
208 this->pCopiedDataStatus = stOtherDataContainer.pCopiedDataStatus;
209 }
210
211 // Return pointer to this object which now contains the copied values.
212 return *this;
213 }
214 };
215} // namespace containers
216
217#endif
Namespace containing functions or objects/struct used to aid in data storage and passage between thre...
Definition FetchContainers.hpp:68
This struct is used to carry references to any datatype for scheduling and copying....
Definition FetchContainers.hpp:164
DataFetchContainer & operator=(const DataFetchContainer &stOtherDataContainer)
Operator equals for FrameFetchContainer. Shallow Copy.
Definition FetchContainers.hpp:201
DataFetchContainer(const DataFetchContainer &stOtherDataContainer)
Copy Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:188
DataFetchContainer(T &tData)
Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:178
This struct is used to carry references to camera frames for scheduling and copying....
Definition FetchContainers.hpp:88
FrameFetchContainer(T &tFrame, PIXEL_FORMATS eFrameType)
Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:105
FrameFetchContainer(const FrameFetchContainer &stOtherFrameContainer)
Copy Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:116
FrameFetchContainer & operator=(const FrameFetchContainer &stOtherFrameContainer)
Operator equals for FrameFetchContainer. Shallow Copy.
Definition FetchContainers.hpp:129