![]() |
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.
|
This class implements and interfaces with the most common ZEDSDK cameras and features. It is designed in such a way that multiple other classes/threads can safely call any method of an object of this class withing resource corruption or slowdown of the camera. More...
#include <ZEDCam.h>
Public Member Functions | |
ZEDCam (const int nPropResolutionX, const int nPropResolutionY, const int nPropFramesPerSecond, const double dPropHorizontalFOV, const double dPropVerticalFOV, const bool bEnableRecordingFlag, const float fMinSenseDistance=constants::ZED_DEFAULT_MINIMUM_DISTANCE, const float fMaxSenseDistance=constants::ZED_DEFAULT_MAXIMUM_DISTANCE, const bool bMemTypeGPU=false, const bool bUseHalfDepthPrecision=false, const bool bEnableFusionMaster=false, const int nNumFrameRetrievalThreads=10, const unsigned int unCameraSerialNumber=0) | |
Construct a new Zed Cam:: Zed Cam object. | |
~ZEDCam () | |
Destroy the Zed Cam:: Zed Cam object. | |
std::future< bool > | RequestFrameCopy (cv::Mat &cvFrame) override |
Requests a regular BGRA image from the LEFT eye of the zed camera. Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it. Remember this code will be ran in whatever class/thread calls it. | |
std::future< bool > | RequestFrameCopy (cv::cuda::GpuMat &cvGPUFrame) override |
Grabs a regular BGRA image from the LEFT eye of the zed camera and stores it in a GPU mat. Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it. Remember this code will be ran in whatever class/thread calls it. | |
std::future< bool > | RequestDepthCopy (cv::Mat &cvDepth, const bool bRetrieveMeasure=true) override |
Requests a depth measure or image from the camera. Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it. This image has the same shape as a grayscale image, but the values represent the depth in MILLIMETERS. The ZEDSDK will always return this measure in MILLIMETERS. | |
std::future< bool > | RequestDepthCopy (cv::cuda::GpuMat &cvGPUDepth, const bool bRetrieveMeasure=true) override |
Requests a depth measure or image from the camera. Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it. This image has the same shape as a grayscale image, but the values represent the depth in MILLIMETERS. The ZEDSDK will always return this measure in MILLIMETERS. | |
std::future< bool > | RequestPointCloudCopy (cv::Mat &cvPointCloud) override |
Requests a point cloud image from the camera. This image has the same resolution as a normal image but with three XYZ values replacing the old color values in the 3rd dimension. The units and sign of the XYZ values are determined by ZED_MEASURE_UNITS and ZED_COORD_SYSTEM constants set in AutonomyConstants.h. | |
std::future< bool > | RequestPointCloudCopy (cv::cuda::GpuMat &cvGPUPointCloud) override |
Grabs a point cloud image from the camera. This image has the same resolution as a normal image but with three XYZ values replacing the old color values in the 3rd dimension. The units and sign of the XYZ values are determined by ZED_MEASURE_UNITS and ZED_COORD_SYSTEM constants set in AutonomyConstants.h. | |
sl::ERROR_CODE | ResetPositionalTracking () override |
Resets the cameras X,Y,Z translation and Roll,Pitch,Yaw orientation back to 0. THINK CAREFULLY! Do you actually want to reset this? It will also realign the coordinate system to whichever way the camera happens to be facing. | |
sl::ERROR_CODE | TrackCustomBoxObjects (std::vector< ZedObjectData > &vCustomObjects) override |
A vector containing CustomBoxObjectData objects. These objects simply store information about your detected objects from an external object detection model. You will need to take your inference results and package them into a sl::CustomBoxObjectData so the the ZEDSDK can properly interpret your detections. | |
sl::ERROR_CODE | RebootCamera () override |
Performs a hardware reset of the ZED2 or ZED2i camera. | |
sl::FUSION_ERROR_CODE | SubscribeFusionToCameraUUID (sl::CameraIdentifier &slCameraUUID) override |
Give a UUID for another ZEDCam, subscribe that camera to this camera's Fusion instance. This will tell this camera's Fusion instance to start ingesting and fusing data from the other camera. | |
sl::CameraIdentifier | PublishCameraToFusion () override |
Signal this camera to make its data available to the Fusion module and retrieve a UUID for this class's sl::Camera instance that can be used to subscribe an sl::Fusion instance to this camera later. | |
sl::FUSION_ERROR_CODE | IngestGPSDataToFusion (geoops::GPSCoordinate stNewGPSLocation) override |
If this camera is the fusion instance master, this method can be used to ingest/process/fuse the current GNSS position of the camera with the ZEDSDK positional tracking. This allows the use of RequestGeoPose to get a high resolution and highly accurate GNSS/VIO camera pose. | |
sl::ERROR_CODE | EnablePositionalTracking (const float fExpectedCameraHeightFromFloorTolerance=constants::ZED_DEFAULT_FLOOR_PLANE_ERROR) override |
Enable the positional tracking functionality of the camera. | |
void | DisablePositionalTracking () override |
Disable to positional tracking functionality of the camera. | |
void | SetPositionalPose (const double dX, const double dY, const double dZ, const double dXO, const double dYO, const double dZO) override |
Sets the pose of the positional tracking of the camera. XYZ will point in their respective directions according to ZED_COORD_SYSTEM defined in AutonomyConstants.h. | |
sl::ERROR_CODE | EnableSpatialMapping () override |
Enabled the spatial mapping feature of the camera. Pose tracking will be enabled if it is not already. | |
void | DisableSpatialMapping () override |
Disabled the spatial mapping feature of the camera. | |
sl::ERROR_CODE | EnableObjectDetection (const bool bEnableBatching=false) override |
Enables the object detection and tracking feature of the camera. | |
void | DisableObjectDetection () override |
Disables the object detection and tracking feature of the camera. | |
bool | GetCameraIsOpen () override |
Accessor for the current status of the camera. | |
bool | GetUsingGPUMem () const override |
Accessor for if this ZED is storing it's frames in GPU memory. | |
std::string | GetCameraModel () override |
Accessor for the model enum from the ZEDSDK and represents the camera model as a string. | |
unsigned int | GetCameraSerial () override |
Accessor for the camera's serial number. | |
std::future< bool > | RequestPositionalPoseCopy (Pose &stPose) override |
Requests the current pose of the camera relative to it's start pose or the origin of the set pose. Puts a Pose pointer into a queue so a copy of a pose from the camera can be written to it. If positional tracking is not enabled, this method will return false and the ZEDCam::Pose may be uninitialized. | |
std::future< bool > | RequestFusionGeoPoseCopy (sl::GeoPose &slGeoPose) override |
Requests the current geo pose of the camera. This method should be used to retrieve ONLY the GNSS data from the ZEDSDK's Fusion module. Puts a GeoPose pointer into a queue so a copy of a GeoPose from the camera can be written to it. If positional tracking or fusion is disabled for this camera, then this method will return false and the sl::GeoPose may be uninitialized. | |
std::future< bool > | RequestFloorPlaneCopy (sl::Plane &slPlane) override |
Requests the current floor plane of the camera relative to it's current pose. Puts a Plane pointer into a queue so a copy of the floor plane from the camera can be written to it. If positional tracking is not enabled, this method will return false and the sl::Plane may be uninitialized. | |
bool | GetPositionalTrackingEnabled () override |
Accessor for if the positional tracking functionality of the camera has been enabled and functioning. | |
sl::PositionalTrackingStatus | GetPositionalTrackingState () override |
Accessor for the current positional tracking status of the camera. | |
sl::FusedPositionalTrackingStatus | GetFusedPositionalTrackingState () override |
Accessor for the current positional tracking status of the fusion instance. | |
sl::SPATIAL_MAPPING_STATE | GetSpatialMappingState () override |
Accessor for the current state of the camera's spatial mapping feature. | |
sl::SPATIAL_MAPPING_STATE | ExtractSpatialMapAsync (std::future< sl::Mesh > &fuMeshFuture) override |
Retrieve the built spatial map from the camera. Spatial mapping must be enabled. This method takes in an std::future<sl::FusedPointCloud> to eventually store the map in. It returns a enum code representing the successful scheduling of building the map. Any code other than SPATIAL_MAPPING_STATE::OK means the future will never be filled. | |
bool | GetObjectDetectionEnabled () override |
Accessor for if the cameras object detection and tracking feature is enabled. | |
std::future< bool > | RequestObjectsCopy (std::vector< sl::ObjectData > &vObjectData) override |
Requests a current copy of the tracked objects from the camera. Puts a pointer to a vector containing sl::ObjectData into a queue so a copy of a frame from the camera can be written to it. | |
std::future< bool > | RequestBatchedObjectsCopy (std::vector< sl::ObjectsBatch > &vBatchedObjectData) override |
If batching is enabled, this requests the normal objects and passes them to the the internal batching queue of the zed api. This performs short-term re-identification with deep learning and trajectories filtering. Batching must have been set to enabled when EnableObjectDetection() was called. Most of the time the vector will be empty and will be filled every ZED_OBJDETECTION_BATCH_LATENCY. | |
![]() | |
ZEDCamera (const int nPropResolutionX, const int nPropResolutionY, const int nPropFramesPerSecond, const double dPropHorizontalFOV, const double dPropVerticalFOV, const bool bEnableRecordingFlag, const bool bMemTypeGPU, const bool bUseHalfDepthPrecision, const bool bEnableFusionMaster, const int nNumFrameRetrievalThreads, const unsigned int unCameraSerialNumber) | |
Construct a new ZEDCamera object. | |
virtual | ~ZEDCamera ()=default |
Destroy the ZEDCamera object. | |
virtual bool | GetIsFusionMaster () const |
Accessor for if this ZED is running a fusion instance. | |
![]() | |
Camera (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=5) | |
Construct a new Camera object. | |
virtual | ~Camera () |
Destroy the Camera object. | |
cv::Size | GetPropResolution () const |
Accessor for the Prop Resolution private member. | |
int | GetPropFramesPerSecond () const |
Accessor for the Prop Frames Per Second private member. | |
PIXEL_FORMATS | GetPropPixelFormat () const |
Accessor for the Prop Pixel Format private member. | |
double | GetPropHorizontalFOV () const |
Accessor for the Prop Horizontal F O V private member. | |
double | GetPropVerticalFOV () const |
Accessor for the Prop Vertical F O V private member. | |
bool | GetEnableRecordingFlag () const |
Accessor for the Enable Recording Flag private member. | |
void | SetEnableRecordingFlag (const bool bEnableRecordingFlag) |
Mutator for the Enable Recording Flag private member. | |
![]() | |
AutonomyThread () | |
Construct a new Autonomy Thread object. | |
virtual | ~AutonomyThread () |
Destroy the Autonomy Thread object. If the parent object or main thread is destroyed or exited while this thread is still running, a race condition will occur. Stopping and joining the thread here insures that the main program can't exit if the user forgot to stop and join the thread. | |
void | Start () |
When this method is called, it starts a new thread that runs the code within the ThreadedContinuousCode method. This is the users main code that will run the important and continuous code for the class. | |
void | RequestStop () |
Signals threads to stop executing user code, terminate. DOES NOT JOIN. This method will not force the thread to exit, if the user code is not written properly and contains WHILE statement or any other long-executing or blocking code, then the thread will not exit until the next iteration. | |
void | Join () |
Waits for thread to finish executing and then closes thread. This method will block the calling code until thread is finished. | |
bool | Joinable () const |
Check if the code within the thread and all pools created by it are finished executing and the thread is ready to be closed. | |
AutonomyThreadState | GetThreadState () const |
Accessor for the Threads State private member. | |
IPS & | GetIPS () |
Accessor for the Frame I P S private member. | |
Private Member Functions | |
void | ThreadedContinuousCode () override |
The code inside this private method runs in a separate thread, but still has access to this*. This method continuously calls the grab() function of the ZEDSDK, which updates all frames (RGB, depth, cloud) and all other data such as positional and spatial mapping. Then a thread pool is started and joined once per iteration to mass copy the frames and/or measure to any other thread waiting in the queues. | |
void | PooledLinearCode () override |
This method holds the code that is ran in the thread pool started by the ThreadedLinearCode() method. It copies the data from the different data objects to references of the same type stored in a queue filled by the Request methods. | |
Private Attributes | |
sl::Camera | m_slCamera |
std::shared_mutex | m_muCameraMutex |
sl::InitParameters | m_slCameraParams |
sl::RuntimeParameters | m_slRuntimeParams |
sl::RecordingParameters | m_slRecordingParams |
sl::Fusion | m_slFusionInstance |
std::shared_mutex | m_muFusionMutex |
sl::InitFusionParameters | m_slFusionParams |
sl::MEASURE | m_slDepthMeasureType |
sl::PositionalTrackingParameters | m_slPoseTrackingParams |
sl::PositionalTrackingFusionParameters | m_slFusionPoseTrackingParams |
sl::Pose | m_slCameraPose |
sl::GeoPose | m_slFusionGeoPose |
sl::Plane | m_slFloorPlane |
sl::Transform | m_slFloorTrackingTransform |
sl::SpatialMappingParameters | m_slSpatialMappingParams |
sl::ObjectDetectionParameters | m_slObjectDetectionParams |
sl::BatchParameters | m_slObjectDetectionBatchParams |
sl::Objects | m_slDetectedObjects |
std::vector< sl::ObjectsBatch > | m_slDetectedObjectsBatched |
sl::MEM | m_slMemoryType |
sl::MODEL | m_slCameraModel |
float | m_fExpectedCameraHeightFromFloorTolerance |
double | m_dPoseOffsetX |
double | m_dPoseOffsetY |
double | m_dPoseOffsetZ |
double | m_dPoseOffsetXO |
double | m_dPoseOffsetYO |
double | m_dPoseOffsetZO |
geoops::GPSCoordinate | m_stCurrentGPSBasedPosition |
sl::Mat | m_slFrame |
sl::Mat | m_slDepthImage |
sl::Mat | m_slDepthMeasure |
sl::Mat | m_slPointCloud |
std::queue< containers::FrameFetchContainer< cv::cuda::GpuMat > > | m_qGPUFrameCopySchedule |
std::queue< containers::DataFetchContainer< std::vector< ZedObjectData > > > | m_qCustomBoxIngestSchedule |
std::queue< containers::DataFetchContainer< Pose > > | m_qPoseCopySchedule |
std::queue< containers::DataFetchContainer< sl::GeoPose > > | m_qGeoPoseCopySchedule |
std::queue< containers::DataFetchContainer< sl::Plane > > | m_qFloorCopySchedule |
std::queue< containers::DataFetchContainer< std::vector< sl::ObjectData > > > | m_qObjectDataCopySchedule |
std::queue< containers::DataFetchContainer< std::vector< sl::ObjectsBatch > > > | m_qObjectBatchedDataCopySchedule |
std::shared_mutex | m_muCustomBoxIngestMutex |
std::shared_mutex | m_muPoseCopyMutex |
std::shared_mutex | m_muGeoPoseCopyMutex |
std::shared_mutex | m_muFloorCopyMutex |
std::shared_mutex | m_muObjectDataCopyMutex |
std::shared_mutex | m_muObjectBatchedDataCopyMutex |
std::atomic< bool > | m_bNormalFramesQueued |
std::atomic< bool > | m_bDepthFramesQueued |
std::atomic< bool > | m_bPointCloudsQueued |
std::atomic< bool > | m_bPosesQueued |
std::atomic< bool > | m_bGeoPosesQueued |
std::atomic< bool > | m_bFloorsQueued |
std::atomic< bool > | m_bObjectsQueued |
std::atomic< bool > | m_bBatchedObjectsQueued |
Additional Inherited Members | |
![]() | |
enum | AutonomyThreadState |
![]() | |
void | RunPool (const unsigned int nNumTasksToQueue, const unsigned int nNumThreads=2, const bool bForceStopCurrentThreads=false) |
When this method is called, it starts/adds tasks to a thread pool that runs nNumTasksToQueue copies of the code within the PooledLinearCode() method using nNumThreads number of threads. This is meant to be used as an internal utility of the child class to further improve parallelization. Default value for nNumThreads is 2. | |
void | RunDetachedPool (const unsigned int nNumTasksToQueue, const unsigned int nNumThreads=2, const bool bForceStopCurrentThreads=false) |
When this method is called, it starts a thread pool full of threads that don't return std::futures (like a placeholder for the thread return type). This means the thread will not have a return type and there is no way to determine if the thread has finished other than calling the Join() method. Only use this if you want to 'set and forget'. It will be faster as it doesn't return futures. Runs PooledLinearCode() method code. This is meant to be used as an internal utility of the child class to further improve parallelization. | |
void | ParallelizeLoop (const int nNumThreads, const N tTotalIterations, F &&tLoopFunction) |
Given a ref-qualified looping function and an arbitrary number of iterations, this method will divide up the loop and run each section in a thread pool. This function must not return anything. This method will block until the loop has completed. | |
void | ClearPoolQueue () |
Clears any tasks waiting to be ran in the queue, tasks currently running will remain running. | |
void | JoinPool () |
Waits for pool to finish executing tasks. This method will block the calling code until thread is finished. | |
bool | PoolJoinable () const |
Check if the internal pool threads are done executing code and the queue is empty. | |
void | SetMainThreadIPSLimit (int nMaxIterationsPerSecond=0) |
Mutator for the Main Thread Max I P S private member. | |
int | GetPoolNumOfThreads () |
Accessor for the Pool Num Of Threads private member. | |
int | GetPoolQueueLength () |
Accessor for the Pool Queue Size private member. | |
std::vector< void > | GetPoolResults () |
Accessor for the Pool Results private member. The action of getting results will destroy and remove them from this object. This method blocks if the thread is not finished, so no need to call JoinPool() before getting results. | |
int | GetMainThreadMaxIPS () const |
Accessor for the Main Thread Max I P S private member. | |
![]() | |
const std::memory_order | ATOMIC_MEMORY_ORDER_METHOD = std::memory_order_relaxed |
unsigned int | m_unCameraSerialNumber |
bool | m_bCameraIsFusionMaster |
![]() | |
int | m_nPropResolutionX |
int | m_nPropResolutionY |
int | m_nPropFramesPerSecond |
int | m_nNumFrameRetrievalThreads |
PIXEL_FORMATS | m_ePropPixelFormat |
double | m_dPropHorizontalFOV |
double | m_dPropVerticalFOV |
std::atomic_bool | m_bEnableRecordingFlag |
std::queue< containers::FrameFetchContainer< cv::Mat > > | m_qFrameCopySchedule |
std::shared_mutex | m_muPoolScheduleMutex |
std::shared_mutex | m_muFrameCopyMutex |
![]() | |
IPS | m_IPS |
This class implements and interfaces with the most common ZEDSDK cameras and features. It is designed in such a way that multiple other classes/threads can safely call any method of an object of this class withing resource corruption or slowdown of the camera.
ZEDCam::ZEDCam | ( | const int | nPropResolutionX, |
const int | nPropResolutionY, | ||
const int | nPropFramesPerSecond, | ||
const double | dPropHorizontalFOV, | ||
const double | dPropVerticalFOV, | ||
const bool | bEnableRecordingFlag, | ||
const float | fMinSenseDistance = constants::ZED_DEFAULT_MINIMUM_DISTANCE , |
||
const float | fMaxSenseDistance = constants::ZED_DEFAULT_MAXIMUM_DISTANCE , |
||
const bool | bMemTypeGPU = false , |
||
const bool | bUseHalfDepthPrecision = false , |
||
const bool | bEnableFusionMaster = false , |
||
const int | nNumFrameRetrievalThreads = 10 , |
||
const unsigned int | unCameraSerialNumber = 0 |
||
) |
Construct a new Zed Cam:: Zed Cam object.
nPropResolutionX | - X res of camera. Must be smaller than ZED_BASE_RESOLUTION. |
nPropResolutionY | - Y res of camera. Must be smaller than ZED_BASE_RESOLUTION. |
nPropFramesPerSecond | - FPS camera is running at. |
dPropHorizontalFOV | - The horizontal field of view. |
dPropVerticalFOV | - The vertical field of view. |
bEnableRecordingFlag | - Whether or not this camera should be recorded. |
fMinSenseDistance | - The minimum distance to include in depth measures. |
fMaxSenseDistance | - The maximum distance to include in depth measures. |
bMemTypeGPU | - Whether or not to use the GPU memory for operations. |
bUseHalfPrecision | - Whether or not to use a float16 instead of float32 for depth measurements. |
bEnableFusionMaster | - Enables ZEDSDK Fusion integration for this camera. This camera will serve as the master instance for all fusion functions. |
nNumFrameRetrievalThreads | - The number of threads to use for copying frames/data to requests. |
unCameraSerialNumber | - The serial number of the camera to open. |
ZEDCam::~ZEDCam | ( | ) |
Destroy the Zed Cam:: Zed Cam object.
|
overridevirtual |
Requests a regular BGRA image from the LEFT eye of the zed camera. Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it. Remember this code will be ran in whatever class/thread calls it.
cvFrame | - A reference to the cv::Mat to copy the normal frame to. |
Implements ZEDCamera.
|
overridevirtual |
Grabs a regular BGRA image from the LEFT eye of the zed camera and stores it in a GPU mat. Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it. Remember this code will be ran in whatever class/thread calls it.
cvGPUFrame | - A reference to the cv::Mat to copy the normal frame to. |
Reimplemented from ZEDCamera.
|
overridevirtual |
Requests a depth measure or image from the camera. Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it. This image has the same shape as a grayscale image, but the values represent the depth in MILLIMETERS. The ZEDSDK will always return this measure in MILLIMETERS.
cvDepth | - A reference to the cv::Mat to copy the depth frame to. |
bRetrieveMeasure | - False to get depth IMAGE instead of MEASURE. Do not use the 8-bit grayscale depth image purposes other than displaying depth. |
Implements ZEDCamera.
|
overridevirtual |
Requests a depth measure or image from the camera. Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it. This image has the same shape as a grayscale image, but the values represent the depth in MILLIMETERS. The ZEDSDK will always return this measure in MILLIMETERS.
cvGPUDepth | - A reference to the cv::Mat to copy the depth frame to. |
bRetrieveMeasure | - False to get depth IMAGE instead of MEASURE. Do not use the 8-bit grayscale depth image purposes other than displaying depth. |
Reimplemented from ZEDCamera.
|
overridevirtual |
Requests a point cloud image from the camera. This image has the same resolution as a normal image but with three XYZ values replacing the old color values in the 3rd dimension. The units and sign of the XYZ values are determined by ZED_MEASURE_UNITS and ZED_COORD_SYSTEM constants set in AutonomyConstants.h.
A 4th value in the 3rd dimension exists as a float32 storing the BGRA values. Each color value is 8-bits and is in this order: 00000000 00000000 00000000 00000000 = 32 bits (float32) B G R A
Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it.
cvPointCloud | - A reference to the cv::Mat to copy the point cloud frame to. |
Implements ZEDCamera.
|
overridevirtual |
Grabs a point cloud image from the camera. This image has the same resolution as a normal image but with three XYZ values replacing the old color values in the 3rd dimension. The units and sign of the XYZ values are determined by ZED_MEASURE_UNITS and ZED_COORD_SYSTEM constants set in AutonomyConstants.h.
A 4th value in the 3rd dimension exists as a float32 storing the BGRA values. Each color value is 8-bits and is in this order: 00000000 00000000 00000000 00000000 = 32 bits (float32) B G R A
Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it.
cvGPUPointCloud | - A reference to the cv::Mat to copy the point cloud frame to. |
Reimplemented from ZEDCamera.
|
overridevirtual |
Resets the cameras X,Y,Z translation and Roll,Pitch,Yaw orientation back to 0. THINK CAREFULLY! Do you actually want to reset this? It will also realign the coordinate system to whichever way the camera happens to be facing.
Implements ZEDCamera.
|
overridevirtual |
A vector containing CustomBoxObjectData objects. These objects simply store information about your detected objects from an external object detection model. You will need to take your inference results and package them into a sl::CustomBoxObjectData so the the ZEDSDK can properly interpret your detections.
Giving the bounding boxes of your detected objects to the ZEDSDK will enable positional tracking and velocity estimation for each object. Even when not in view. The IDs of objects will also become persistent.
vCustomObjects | - A vector of sl::CustomBoxObjectData objects. |
Reimplemented from ZEDCamera.
|
overridevirtual |
Performs a hardware reset of the ZED2 or ZED2i camera.
Implements ZEDCamera.
|
overridevirtual |
Give a UUID for another ZEDCam, subscribe that camera to this camera's Fusion instance. This will tell this camera's Fusion instance to start ingesting and fusing data from the other camera.
slCameraUUID | - The Camera unique identifier given by the other camera's PublishCameraToFusion() method. |
Implements ZEDCamera.
|
overridevirtual |
Signal this camera to make its data available to the Fusion module and retrieve a UUID for this class's sl::Camera instance that can be used to subscribe an sl::Fusion instance to this camera later.
Implements ZEDCamera.
|
overridevirtual |
If this camera is the fusion instance master, this method can be used to ingest/process/fuse the current GNSS position of the camera with the ZEDSDK positional tracking. This allows the use of RequestGeoPose to get a high resolution and highly accurate GNSS/VIO camera pose.
stNewGPSLocation | - The current GPS location, this must be up-to-date or the realtime position of the camera in the GPS space. |
Reimplemented from ZEDCamera.
|
overridevirtual |
Enable the positional tracking functionality of the camera.
fExpectedCameraHeightFromFloorTolerance | - The expected height of the camera from the floor. This aids with floor plane detection. |
Implements ZEDCamera.
|
overridevirtual |
Disable to positional tracking functionality of the camera.
Implements ZEDCamera.
|
overridevirtual |
Sets the pose of the positional tracking of the camera. XYZ will point in their respective directions according to ZED_COORD_SYSTEM defined in AutonomyConstants.h.
Warning: This method is slow and should not be called in a loop. Setting the pose will temporarily block the entire camera from grabbed or copying frames to new threads. This method should only be called occasionally when absolutely needed.
dX | - The X position of the camera in ZED_MEASURE_UNITS. |
dY | - The Y position of the camera in ZED_MEASURE_UNITS. |
dZ | - The Z position of the camera in ZED_MEASURE_UNITS. |
dXO | - The tilt of the camera around the X axis in degrees. (0-360) |
dYO | - The tilt of the camera around the Y axis in degrees. (0-360) |
dZO | - The tilt of the camera around the Z axis in degrees. (0-360) |
Implements ZEDCamera.
|
overridevirtual |
Enabled the spatial mapping feature of the camera. Pose tracking will be enabled if it is not already.
Reimplemented from ZEDCamera.
|
overridevirtual |
Disabled the spatial mapping feature of the camera.
Reimplemented from ZEDCamera.
|
overridevirtual |
Enables the object detection and tracking feature of the camera.
Reimplemented from ZEDCamera.
|
overridevirtual |
Disables the object detection and tracking feature of the camera.
Reimplemented from ZEDCamera.
|
overridevirtual |
Accessor for the current status of the camera.
Implements Camera< cv::Mat >.
|
overridevirtual |
Accessor for if this ZED is storing it's frames in GPU memory.
Reimplemented from ZEDCamera.
|
overridevirtual |
Accessor for the model enum from the ZEDSDK and represents the camera model as a string.
Implements ZEDCamera.
|
overridevirtual |
Accessor for the camera's serial number.
Reimplemented from ZEDCamera.
|
overridevirtual |
Requests the current pose of the camera relative to it's start pose or the origin of the set pose. Puts a Pose pointer into a queue so a copy of a pose from the camera can be written to it. If positional tracking is not enabled, this method will return false and the ZEDCam::Pose may be uninitialized.
stPose | - A reference to the ZEDCam::Pose object to copy the current camera pose to. |
Implements ZEDCamera.
|
overridevirtual |
Requests the current geo pose of the camera. This method should be used to retrieve ONLY the GNSS data from the ZEDSDK's Fusion module. Puts a GeoPose pointer into a queue so a copy of a GeoPose from the camera can be written to it. If positional tracking or fusion is disabled for this camera, then this method will return false and the sl::GeoPose may be uninitialized.
slGeoPose | - A reference to the sl::GeoPose object to copy the current geo pose to. |
Implements ZEDCamera.
|
overridevirtual |
Requests the current floor plane of the camera relative to it's current pose. Puts a Plane pointer into a queue so a copy of the floor plane from the camera can be written to it. If positional tracking is not enabled, this method will return false and the sl::Plane may be uninitialized.
slPlane | - A reference to the sl::Plane object to copy the current camera floor plane to. |
Reimplemented from ZEDCamera.
|
overridevirtual |
Accessor for if the positional tracking functionality of the camera has been enabled and functioning.
Implements ZEDCamera.
|
overridevirtual |
Accessor for the current positional tracking status of the camera.
Reimplemented from ZEDCamera.
|
overridevirtual |
Accessor for the current positional tracking status of the fusion instance.
Reimplemented from ZEDCamera.
|
overridevirtual |
Accessor for the current state of the camera's spatial mapping feature.
Reimplemented from ZEDCamera.
|
overridevirtual |
Retrieve the built spatial map from the camera. Spatial mapping must be enabled. This method takes in an std::future<sl::FusedPointCloud> to eventually store the map in. It returns a enum code representing the successful scheduling of building the map. Any code other than SPATIAL_MAPPING_STATE::OK means the future will never be filled.
std::future<sl::Mesh> | - The future to eventually store the map in. |
Reimplemented from ZEDCamera.
|
overridevirtual |
Accessor for if the cameras object detection and tracking feature is enabled.
Reimplemented from ZEDCamera.
|
overridevirtual |
Requests a current copy of the tracked objects from the camera. Puts a pointer to a vector containing sl::ObjectData into a queue so a copy of a frame from the camera can be written to it.
vObjectData | - A vector that will have data copied to it containing sl::ObjectData objects. |
Reimplemented from ZEDCamera.
|
overridevirtual |
If batching is enabled, this requests the normal objects and passes them to the the internal batching queue of the zed api. This performs short-term re-identification with deep learning and trajectories filtering. Batching must have been set to enabled when EnableObjectDetection() was called. Most of the time the vector will be empty and will be filled every ZED_OBJDETECTION_BATCH_LATENCY.
vBatchedObjectData | - A vector containing objects of sl::ObjectsBatch object that will have object data copied to. |
Reimplemented from ZEDCamera.
|
overrideprivatevirtual |
The code inside this private method runs in a separate thread, but still has access to this*. This method continuously calls the grab() function of the ZEDSDK, which updates all frames (RGB, depth, cloud) and all other data such as positional and spatial mapping. Then a thread pool is started and joined once per iteration to mass copy the frames and/or measure to any other thread waiting in the queues.
Implements AutonomyThread< void >.
|
overrideprivatevirtual |
This method holds the code that is ran in the thread pool started by the ThreadedLinearCode() method. It copies the data from the different data objects to references of the same type stored in a queue filled by the Request methods.
Implements AutonomyThread< void >.