14#include "../AutonomyLogging.h"
15#include "../util/GeospatialOperations.hpp"
19#include <sl/Camera.hpp>
20#include <sl/Fusion.hpp>
52 std::string szObjectUUID = sl::generate_unique_id().get();
61 bool bObjectRemainsOnFloorPlane =
false;
64 std::string GetObjectUUID() {
return szObjectUUID; };
115 Pose(
const double dX = 0.0,
const double dY = 0.0,
const double dZ = 0.0,
const double dXO = 0.0,
const double dYO = 0.0,
const double dZO = 0.0)
118 stTranslation.dX = dX;
119 stTranslation.dY = dY;
120 stTranslation.dZ = dZ;
121 stEulerAngles.dXO = dXO;
122 stEulerAngles.dYO = dYO;
123 stEulerAngles.dZO = dZO;
151 const int nPropResolutionY,
152 const int nPropFramesPerSecond,
153 const double dPropHorizontalFOV,
154 const double dPropVerticalFOV,
155 const bool bEnableRecordingFlag,
156 const bool bMemTypeGPU,
157 const bool bUseHalfDepthPrecision,
158 const int nNumFrameRetrievalThreads,
159 const unsigned int unCameraSerialNumber) :
162 nPropFramesPerSecond,
166 bEnableRecordingFlag,
167 nNumFrameRetrievalThreads)
171 (void) bUseHalfDepthPrecision;
172 m_unCameraSerialNumber = unCameraSerialNumber;
210 std::promise<bool> pmPromise;
211 std::future<bool> fuFuture = pmPromise.get_future();
214 pmPromise.set_value(
false);
217 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestFrameCopy(cv::cuda::GpuMat& cvGPUFrame) not implemented. If SIM_MODE use cv::Mat version instead.");
248 (void) bRetrieveMeasure;
249 std::promise<bool> pmPromise;
252 pmPromise.set_value(
false);
255 LOG_ERROR(logging::g_qSharedLogger,
256 "ZEDCamera::RequestDepthCopy(cv::cuda::GpuMat& cvGPUDepth, const bool bRetrieveMeasure = true) not implemented. If SIM_MODE use cv::Mat version "
259 return pmPromise.get_future();
285 (void) cvGPUPointCloud;
286 std::promise<bool> pmPromise;
289 pmPromise.set_value(
false);
292 LOG_ERROR(logging::g_qSharedLogger,
293 "ZEDCamera::RequestPointCloudCopy(cv::cuda::GpuMat& cvGPUPointCloud) not implemented. If SIM_MODE use cv::Mat version instead.");
295 return pmPromise.get_future();
322 std::promise<bool> pmPromise;
325 pmPromise.set_value(
false);
328 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestFloorPlaneCopy(sl::Plane& slFloorPlane) not implemented.");
330 return pmPromise.get_future();
345 (void) slSensorsData;
346 std::promise<bool> pmPromise;
349 pmPromise.set_value(
false);
352 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestSensorsCopy(sl::SensorsData& slSensorsData) not implemented.");
354 return pmPromise.get_future();
370 std::promise<bool> pmPromise;
373 pmPromise.set_value(
false);
376 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestObjectsCopy(std::vector<sl::ObjectData>& vObjectData) not implemented.");
378 return pmPromise.get_future();
393 (void) vBatchedObjectData;
394 std::promise<bool> pmPromise;
397 pmPromise.set_value(
false);
400 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestBatchedObjectsCopy(std::vector<sl::ObjectsBatch>& vBatchedObjectData) not implemented.");
402 return pmPromise.get_future();
427 (void) vCustomObjects;
430 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::TrackCustomBoxObjects(const std::vector<ZedObjectData>& vCustomObjects) not implemented.");
432 return sl::ERROR_CODE::FAILURE;
458 virtual sl::ERROR_CODE
EnablePositionalTracking(
const float fExpectedCameraHeightFromFloorTolerance = constants::ZED_DEFAULT_FLOOR_PLANE_ERROR) = 0;
482 virtual void SetPositionalPose(
const double dX,
const double dY,
const double dZ,
const double dXO,
const double dYO,
const double dZO) = 0;
495 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::EnableSpatialMapping() not implemented.");
497 return sl::ERROR_CODE::FAILURE;
510 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::DisableSpatialMapping() not implemented.");
525 (void) bEnableBatching;
528 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::EnableObjectDetection(const bool bEnableBatching = false) not implemented.");
530 return sl::ERROR_CODE::FAILURE;
543 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::DisableObjectDetection() not implemented.");
603 sl::PositionalTrackingStatus stStatus;
606 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::GetPositionalTrackingState() not implemented.");
636 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::ExtractSpatialMapAsync(std::future<sl::Mesh>& fuMeshFuture) not implemented.");
638 return sl::SPATIAL_MAPPING_STATE::NOT_ENABLED;
657 const std::memory_order ATOMIC_MEMORY_ORDER_METHOD = std::memory_order_relaxed;
664 unsigned int m_unCameraSerialNumber;
Defines the Camera base interface class.
This interface class serves as a base for all other classes that will implement and interface with a ...
Definition Camera.hpp:34
This class serves as a middle inheritor between the Camera interface and the ZEDCam class....
Definition ZEDCamera.hpp:33
virtual sl::SPATIAL_MAPPING_STATE ExtractSpatialMapAsync(std::future< sl::Mesh > &fuMeshFuture)
Puts a Mesh pointer into a queue so a copy of a spatial mapping mesh from the camera can be written t...
Definition ZEDCamera.hpp:630
virtual unsigned int GetCameraSerial()
Accessor for the Camera Serial private member.
Definition ZEDCamera.hpp:579
virtual sl::ERROR_CODE RebootCamera()=0
Reboots the camera.
virtual std::future< bool > RequestBatchedObjectsCopy(std::vector< sl::ObjectsBatch > &vBatchedObjectData)
Puts a vector of ObjectsBatch pointers into a queue so a copy of a vector of ObjectsBatch from the ca...
Definition ZEDCamera.hpp:390
virtual std::future< bool > RequestObjectsCopy(std::vector< sl::ObjectData > &vObjectData)
Puts a vector of ObjectData pointers into a queue so a copy of a vector of ObjectData from the camera...
Definition ZEDCamera.hpp:366
virtual void DisablePositionalTracking()=0
Disables the position tracking of the camera.
virtual std::future< bool > RequestDepthCopy(cv::Mat &cvDepth, const bool bRetrieveMeasure=true)=0
Puts a frame pointer into a queue so a copy of a depth frame from the camera can be written to it.
virtual void DisableSpatialMapping()
Disables spatial mapping.
Definition ZEDCamera.hpp:507
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 int nNumFrameRetrievalThreads, const unsigned int unCameraSerialNumber)
Construct a new ZEDCamera object.
Definition ZEDCamera.hpp:150
virtual std::future< bool > RequestFloorPlaneCopy(sl::Plane &slFloorPlane)
Puts a FloorPlane pointer into a queue so a copy of a FloorPlane from the camera can be written to it...
Definition ZEDCamera.hpp:318
virtual ~ZEDCamera()=default
Destroy the ZEDCamera object.
virtual sl::PositionalTrackingStatus GetPositionalTrackingState()
Accessor for the Positional Tracking State private member.
Definition ZEDCamera.hpp:600
virtual sl::ERROR_CODE EnableObjectDetection(const bool bEnableBatching=false)
Enables object detection.
Definition ZEDCamera.hpp:522
virtual sl::ERROR_CODE EnableSpatialMapping()
Enables spatial mapping.
Definition ZEDCamera.hpp:492
virtual void SetPositionalPose(const double dX, const double dY, const double dZ, const double dXO, const double dYO, const double dZO)=0
Mutator for the Positional Pose private member.
virtual std::future< bool > RequestDepthCopy(cv::cuda::GpuMat &cvGPUDepth, const bool bRetrieveMeasure=true)
Puts a frame pointer into a queue so a copy of a depth frame from the camera can be written to it.
Definition ZEDCamera.hpp:244
virtual bool GetUsingGPUMem() const
Accessor for the Using G P U Memory private member.
Definition ZEDCamera.hpp:559
virtual sl::ERROR_CODE TrackCustomBoxObjects(std::vector< ZedObjectData > &vCustomObjects)
Tracks custom bounding boxes in the camera's field of view.
Definition ZEDCamera.hpp:424
virtual sl::ERROR_CODE ResetPositionalTracking()=0
Resets the positional tracking of the camera.
virtual std::string GetCameraModel()=0
Accessor for the Camera Model private member.
virtual bool GetPositionalTrackingEnabled()=0
Accessor for the Positional Tracking Enabled private member.
virtual sl::ERROR_CODE EnablePositionalTracking(const float fExpectedCameraHeightFromFloorTolerance=constants::ZED_DEFAULT_FLOOR_PLANE_ERROR)=0
Enables the position tracking of the camera.
virtual std::future< bool > RequestFrameCopy(cv::cuda::GpuMat &cvGPUFrame)
Puts a frame pointer into a queue so a copy of a frame from the camera can be written to it.
Definition ZEDCamera.hpp:206
virtual std::future< bool > RequestPositionalPoseCopy(Pose &stPose)=0
Puts a Pose pointer into a queue so a copy of a Pose from the camera can be written to it.
virtual std::future< bool > RequestPointCloudCopy(cv::Mat &cvPointCloud)=0
Puts a frame pointer into a queue so a copy of a point cloud from the camera can be written to it.
virtual std::future< bool > RequestPointCloudCopy(cv::cuda::GpuMat &cvGPUPointCloud)
Puts a frame pointer into a queue so a copy of a point cloud from the camera can be written to it.
Definition ZEDCamera.hpp:282
virtual std::future< bool > RequestSensorsCopy(sl::SensorsData &slSensorsData)
Puts a SensorsData pointer into a queue so a copy of a SensorsData from the camera can be written to ...
Definition ZEDCamera.hpp:342
virtual void DisableObjectDetection()
Disables object detection.
Definition ZEDCamera.hpp:540
virtual bool GetObjectDetectionEnabled()
Accessor for the Object Detection Enabled private member.
Definition ZEDCamera.hpp:650
std::future< bool > RequestFrameCopy(cv::Mat &cvFrame) override=0
virtual sl::SPATIAL_MAPPING_STATE GetSpatialMappingState()
Accessor for the Spatial Mapping State private member.
Definition ZEDCamera.hpp:619
Definition ZEDCamera.hpp:90
Definition ZEDCamera.hpp:81
This struct is used within the ZEDCam class to store the camera pose with high precision....
Definition ZEDCamera.hpp:77
Pose(const double dX=0.0, const double dY=0.0, const double dZ=0.0, const double dXO=0.0, const double dYO=0.0, const double dZO=0.0)
Construct a new Pose object.
Definition ZEDCamera.hpp:115
This struct is part of the ZEDCam class and is used as a container for all bounding box data that is ...
Definition ZEDCamera.hpp:49