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 eDepthDetection,
51 eTensorflowDetection,
52 eUNKNOWN
53};
54
56
57
65namespace containers
66{
67
84 template<typename T>
86 {
87 public:
88 // Declare and define public struct member variables.
89 T* pFrame;
90 PIXEL_FORMATS eFrameType;
91 std::shared_ptr<std::promise<bool>> pCopiedFrameStatus;
92
93
103 FrameFetchContainer(T& tFrame, PIXEL_FORMATS eFrameType) : pFrame(&tFrame), eFrameType(eFrameType), pCopiedFrameStatus(std::make_shared<std::promise<bool>>())
104 {}
105
106
114 FrameFetchContainer(const FrameFetchContainer& stOtherFrameContainer) :
115 pFrame(stOtherFrameContainer.pFrame), eFrameType(stOtherFrameContainer.eFrameType), pCopiedFrameStatus(stOtherFrameContainer.pCopiedFrameStatus)
116 {}
117
118
127 FrameFetchContainer& operator=(const FrameFetchContainer& stOtherFrameContainer)
128 {
129 // Check if the passed in container is the same as this one.
130 if (this != &stOtherFrameContainer)
131 {
132 // Copy struct attributes.
133 this->pFrame = stOtherFrameContainer.pFrame;
134 this->eFrameType = stOtherFrameContainer.eFrameType;
135 this->pCopiedFrameStatus = stOtherFrameContainer.pCopiedFrameStatus;
136 }
137
138 // Return pointer to this object which now contains the copied values.
139 return *this;
140 }
141 };
142
143
160 template<typename T>
162 {
163 public:
164 // Declare and define public struct member variables.
165 T* pData;
166 std::shared_ptr<std::promise<bool>> pCopiedDataStatus;
167
168
176 DataFetchContainer(T& tData) : pData(&tData), pCopiedDataStatus(std::make_shared<std::promise<bool>>()) {}
177
178
186 DataFetchContainer(const DataFetchContainer& stOtherDataContainer) :
187 pData(stOtherDataContainer.pData), pCopiedDataStatus(stOtherDataContainer.pCopiedDataStatus)
188 {}
189
190
199 DataFetchContainer& operator=(const DataFetchContainer& stOtherDataContainer)
200 {
201 // Check if the passed in container is the same as this one.
202 if (this != &stOtherDataContainer)
203 {
204 // Copy struct attributes.
205 this->pData = stOtherDataContainer.pData;
206 this->pCopiedDataStatus = stOtherDataContainer.pCopiedDataStatus;
207 }
208
209 // Return pointer to this object which now contains the copied values.
210 return *this;
211 }
212 };
213} // namespace containers
214
215#endif
Namespace containing functions or objects/struct used to aid in data storage and passage between thre...
Definition FetchContainers.hpp:66
This struct is used to carry references to any datatype for scheduling and copying....
Definition FetchContainers.hpp:162
DataFetchContainer & operator=(const DataFetchContainer &stOtherDataContainer)
Operator equals for FrameFetchContainer. Shallow Copy.
Definition FetchContainers.hpp:199
DataFetchContainer(const DataFetchContainer &stOtherDataContainer)
Copy Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:186
DataFetchContainer(T &tData)
Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:176
This struct is used to carry references to camera frames for scheduling and copying....
Definition FetchContainers.hpp:86
FrameFetchContainer(T &tFrame, PIXEL_FORMATS eFrameType)
Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:103
FrameFetchContainer(const FrameFetchContainer &stOtherFrameContainer)
Copy Construct a new Frame Fetch Container object.
Definition FetchContainers.hpp:114
FrameFetchContainer & operator=(const FrameFetchContainer &stOtherFrameContainer)
Operator equals for FrameFetchContainer. Shallow Copy.
Definition FetchContainers.hpp:127