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
containers::FrameFetchContainer< T > Struct Template Reference

This struct is used to carry references to camera frames for scheduling and copying. It is constructed so that a reference to a frame is passed into the container and the pointer to that reference is stored internally. Then a shared_pointer to a new std::promise<bool> is created, which allows the programmer to return a future from whatever method created this container. The future can then be waited on before the passed in frame is used. The future will return a true or false. More...

#include <FetchContainers.hpp>

Public Member Functions

 FrameFetchContainer (T &tFrame, PIXEL_FORMATS eFrameType)
 Construct a new Frame Fetch Container object.
 
 FrameFetchContainer (const FrameFetchContainer &stOtherFrameContainer)
 Copy Construct a new Frame Fetch Container object.
 
FrameFetchContaineroperator= (const FrameFetchContainer &stOtherFrameContainer)
 Operator equals for FrameFetchContainer. Shallow Copy.
 

Public Attributes

T * pFrame
 
PIXEL_FORMATS eFrameType
 
std::shared_ptr< std::promise< bool > > pCopiedFrameStatus
 

Detailed Description

template<typename T>
struct containers::FrameFetchContainer< T >

This struct is used to carry references to camera frames for scheduling and copying. It is constructed so that a reference to a frame is passed into the container and the pointer to that reference is stored internally. Then a shared_pointer to a new std::promise<bool> is created, which allows the programmer to return a future from whatever method created this container. The future can then be waited on before the passed in frame is used. The future will return a true or false.

The idea is that any threads that call a grab/retrieve method of a camera object (which also runs in a different thread) will have the empty frame that they passed in be put into the camera queues and then the grab/retrieve method will immediately return. This allows BOTH threads to continue processing other things or request multiple frame copies non-sequentially/serially.

Template Parameters
T- The mat type that the struct will be containing.
Author
ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-09-08

Constructor & Destructor Documentation

◆ FrameFetchContainer() [1/2]

template<typename T >
containers::FrameFetchContainer< T >::FrameFetchContainer ( T &  tFrame,
PIXEL_FORMATS  eFrameType 
)
inline

Construct a new Frame Fetch Container object.

Parameters
tFrame- A reference to the frame object to store.
eFrameType- The image or measure type to store in the frame. This is used to determine what is copied to the given frame object.
Author
ClayJay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-09-09
103 : pFrame(&tFrame), eFrameType(eFrameType), pCopiedFrameStatus(std::make_shared<std::promise<bool>>())
104 {}

◆ FrameFetchContainer() [2/2]

template<typename T >
containers::FrameFetchContainer< T >::FrameFetchContainer ( const FrameFetchContainer< T > &  stOtherFrameContainer)
inline

Copy Construct a new Frame Fetch Container object.

Parameters
stOtherFrameContainer- FrameFetchContainer to copy pointers and values from.
Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-09-26
114 :
115 pFrame(stOtherFrameContainer.pFrame), eFrameType(stOtherFrameContainer.eFrameType), pCopiedFrameStatus(stOtherFrameContainer.pCopiedFrameStatus)
116 {}

Member Function Documentation

◆ operator=()

template<typename T >
FrameFetchContainer & containers::FrameFetchContainer< T >::operator= ( const FrameFetchContainer< T > &  stOtherFrameContainer)
inline

Operator equals for FrameFetchContainer. Shallow Copy.

Parameters
stOtherFrameContainer- FrameFetchContainer to copy pointers and values from.
Returns
FrameFetchContainer& - A reference to this object.
Author
clayjay3 (clayt.nosp@m.onra.nosp@m.ycowe.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om)
Date
2023-09-26
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 }

The documentation for this struct was generated from the following file: