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 eTensorflowDetection,
54 eTorchDetection,
55 eUNKNOWN
56};
57
59
60
68namespace containers
69{
70
87 template<typename T>
89 {
90 public:
91 // Declare and define public struct member variables.
92 T* pFrame;
93 PIXEL_FORMATS eFrameType;
94 std::shared_ptr<std::promise<bool>> pCopiedFrameStatus;
95
96
106 FrameFetchContainer(T& tFrame, PIXEL_FORMATS eFrameType) : pFrame(&tFrame), eFrameType(eFrameType), pCopiedFrameStatus(std::make_shared<std::promise<bool>>())
107 {}
108
109
117 FrameFetchContainer(const FrameFetchContainer& stOtherFrameContainer) :
118 pFrame(stOtherFrameContainer.pFrame), eFrameType(stOtherFrameContainer.eFrameType), pCopiedFrameStatus(stOtherFrameContainer.pCopiedFrameStatus)
119 {}
120
121
130 FrameFetchContainer& operator=(const FrameFetchContainer& stOtherFrameContainer)
131 {
132 // Check if the passed in container is the same as this one.
133 if (this != &stOtherFrameContainer)
134 {
135 // Copy struct attributes.
136 this->pFrame = stOtherFrameContainer.pFrame;
137 this->eFrameType = stOtherFrameContainer.eFrameType;
138 this->pCopiedFrameStatus = stOtherFrameContainer.pCopiedFrameStatus;
139 }
140
141 // Return pointer to this object which now contains the copied values.
142 return *this;
143 }
144 };
145
146
163 template<typename T>
165 {
166 public:
167 // Declare and define public struct member variables.
168 T* pData;
169 std::shared_ptr<std::promise<bool>> pCopiedDataStatus;
170
171
179 DataFetchContainer(T& tData) : pData(&tData), pCopiedDataStatus(std::make_shared<std::promise<bool>>()) {}
180
181
189 DataFetchContainer(const DataFetchContainer& stOtherDataContainer) :
190 pData(stOtherDataContainer.pData), pCopiedDataStatus(stOtherDataContainer.pCopiedDataStatus)
191 {}
192
193
202 DataFetchContainer& operator=(const DataFetchContainer& stOtherDataContainer)
203 {
204 // Check if the passed in container is the same as this one.
205 if (this != &stOtherDataContainer)
206 {
207 // Copy struct attributes.
208 this->pData = stOtherDataContainer.pData;
209 this->pCopiedDataStatus = stOtherDataContainer.pCopiedDataStatus;
210 }
211
212 // Return pointer to this object which now contains the copied values.
213 return *this;
214 }
215 };
216} // namespace containers
217
218#endif
Namespace containing functions or objects/struct used to aid in data storage and passage between thre...
Definition FetchContainers.hpp:69
This struct is used to carry references to any datatype for scheduling and copying....
Definition FetchContainers.hpp:165
DataFetchContainer & operator=(const DataFetchContainer &stOtherDataContainer)
Operator equals for FrameFetchContainer. Shallow Copy.
Definition FetchContainers.hpp:202
DataFetchContainer(const DataFetchContainer &stOtherDataContainer)
Copy Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:189
DataFetchContainer(T &tData)
Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:179
This struct is used to carry references to camera frames for scheduling and copying....
Definition FetchContainers.hpp:89
FrameFetchContainer(T &tFrame, PIXEL_FORMATS eFrameType)
Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:106
FrameFetchContainer(const FrameFetchContainer &stOtherFrameContainer)
Copy Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:117
FrameFetchContainer & operator=(const FrameFetchContainer &stOtherFrameContainer)
Operator equals for FrameFetchContainer. Shallow Copy.
Definition FetchContainers.hpp:130