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();
81 bool bObjectRemainsOnFloorPlane =
false;
84 std::string GetObjectUUID() {
return szObjectUUID; };
135 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)
138 stTranslation.dX = dX;
139 stTranslation.dY = dY;
140 stTranslation.dZ = dZ;
141 stEulerAngles.dXO = dXO;
142 stEulerAngles.dYO = dYO;
143 stEulerAngles.dZO = dZO;
172 const int nPropResolutionY,
173 const int nPropFramesPerSecond,
174 const double dPropHorizontalFOV,
175 const double dPropVerticalFOV,
176 const bool bEnableRecordingFlag,
177 const bool bMemTypeGPU,
178 const bool bUseHalfDepthPrecision,
179 const bool bEnableFusionMaster,
180 const int nNumFrameRetrievalThreads,
181 const unsigned int unCameraSerialNumber) :
184 nPropFramesPerSecond,
188 bEnableRecordingFlag,
189 nNumFrameRetrievalThreads)
193 (void) bUseHalfDepthPrecision;
194 (void) bEnableFusionMaster;
195 m_bCameraIsFusionMaster = bEnableFusionMaster;
196 m_unCameraSerialNumber = unCameraSerialNumber;
234 std::promise<bool> pmPromise;
235 std::future<bool> fuFuture = pmPromise.get_future();
238 pmPromise.set_value(
false);
241 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestFrameCopy(cv::cuda::GpuMat& cvGPUFrame) not implemented. If SIM_MODE use cv::Mat version instead.");
272 (void) bRetrieveMeasure;
273 std::promise<bool> pmPromise;
276 pmPromise.set_value(
false);
279 LOG_ERROR(logging::g_qSharedLogger,
280 "ZEDCamera::RequestDepthCopy(cv::cuda::GpuMat& cvGPUDepth, const bool bRetrieveMeasure = true) not implemented. If SIM_MODE use cv::Mat version "
283 return pmPromise.get_future();
309 (void) cvGPUPointCloud;
310 std::promise<bool> pmPromise;
313 pmPromise.set_value(
false);
316 LOG_ERROR(logging::g_qSharedLogger,
317 "ZEDCamera::RequestPointCloudCopy(cv::cuda::GpuMat& cvGPUPointCloud) not implemented. If SIM_MODE use cv::Mat version instead.");
319 return pmPromise.get_future();
344 (void) vCustomObjects;
347 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::TrackCustomBoxObjects(const std::vector<ZedObjectData>& vCustomObjects) not implemented.");
349 return sl::ERROR_CODE::FAILURE;
395 (void) stNewGPSLocation;
398 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::IngestGPSDataToFusion(geoops::GPSCoordinate stNewGPSLocation) not implemented.");
400 return sl::FUSION_ERROR_CODE::FAILURE;
416 virtual sl::ERROR_CODE
EnablePositionalTracking(
const float fExpectedCameraHeightFromFloorTolerance = constants::ZED_DEFAULT_FLOOR_PLANE_ERROR) = 0;
440 virtual void SetPositionalPose(
const double dX,
const double dY,
const double dZ,
const double dXO,
const double dYO,
const double dZO) = 0;
453 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::EnableSpatialMapping() not implemented.");
455 return sl::ERROR_CODE::FAILURE;
468 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::DisableSpatialMapping() not implemented.");
483 (void) bEnableBatching;
486 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::EnableObjectDetection(const bool bEnableBatching = false) not implemented.");
488 return sl::ERROR_CODE::FAILURE;
501 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::DisableObjectDetection() not implemented.");
585 std::promise<bool> pmPromise;
588 pmPromise.set_value(
false);
591 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestFloorPlaneCopy(sl::Plane& slFloorPlane) not implemented.");
593 return pmPromise.get_future();
618 sl::PositionalTrackingStatus stStatus;
621 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::GetPositionalTrackingState() not implemented.");
637 sl::FusedPositionalTrackingStatus stStatus;
640 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::GetFusedPositionalTrackingState() not implemented.");
670 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::ExtractSpatialMapAsync(std::future<sl::Mesh>& fuMeshFuture) not implemented.");
672 return sl::SPATIAL_MAPPING_STATE::NOT_ENABLED;
699 std::promise<bool> pmPromise;
702 pmPromise.set_value(
false);
705 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestObjectsCopy(std::vector<sl::ObjectData>& vObjectData) not implemented.");
707 return pmPromise.get_future();
722 (void) vBatchedObjectData;
723 std::promise<bool> pmPromise;
726 pmPromise.set_value(
false);
729 LOG_ERROR(logging::g_qSharedLogger,
"ZEDCamera::RequestBatchedObjectsCopy(std::vector<sl::ObjectsBatch>& vBatchedObjectData) not implemented.");
731 return pmPromise.get_future();
739 const std::memory_order ATOMIC_MEMORY_ORDER_METHOD = std::memory_order_relaxed;
746 unsigned int m_unCameraSerialNumber;
747 bool m_bCameraIsFusionMaster;
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:664
virtual unsigned int GetCameraSerial()
Accessor for the Camera Serial private member.
Definition ZEDCamera.hpp:548
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:719
virtual sl::CameraIdentifier PublishCameraToFusion()=0
Publishes the camera to the fusion object.
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:695
virtual bool GetIsFusionMaster() const
Accessor for if this ZED is running a fusion instance.
Definition ZEDCamera.hpp:528
virtual void DisablePositionalTracking()=0
Disables the position tracking of the camera.
virtual sl::FUSION_ERROR_CODE SubscribeFusionToCameraUUID(sl::CameraIdentifier &slCameraUUID)=0
Subscribes the fusion object to the camera with the given UUID.
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:465
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:581
virtual ~ZEDCamera()=default
Destroy the ZEDCamera object.
virtual sl::PositionalTrackingStatus GetPositionalTrackingState()
Accessor for the Positional Tracking State private member.
Definition ZEDCamera.hpp:615
virtual sl::ERROR_CODE EnableObjectDetection(const bool bEnableBatching=false)
Enables object detection.
Definition ZEDCamera.hpp:480
virtual sl::ERROR_CODE EnableSpatialMapping()
Enables spatial mapping.
Definition ZEDCamera.hpp:450
virtual sl::FUSION_ERROR_CODE IngestGPSDataToFusion(geoops::GPSCoordinate stNewGPSLocation)
Ingests GPS data into the fusion object.
Definition ZEDCamera.hpp:392
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:268
virtual bool GetUsingGPUMem() const
Accessor for the Using G P U Memory private member.
Definition ZEDCamera.hpp:517
virtual sl::ERROR_CODE TrackCustomBoxObjects(std::vector< ZedObjectData > &vCustomObjects)
Tracks custom bounding boxes in the camera's field of view.
Definition ZEDCamera.hpp:341
virtual std::future< bool > RequestFusionGeoPoseCopy(sl::GeoPose &slGeoPose)=0
Puts a GeoPose pointer into a queue so a copy of a GeoPose from the camera can be written to it.
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:230
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.
Definition ZEDCamera.hpp:171
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:306
virtual void DisableObjectDetection()
Disables object detection.
Definition ZEDCamera.hpp:498
virtual bool GetObjectDetectionEnabled()
Accessor for the Object Detection Enabled private member.
Definition ZEDCamera.hpp:684
std::future< bool > RequestFrameCopy(cv::Mat &cvFrame) override=0
virtual sl::FusedPositionalTrackingStatus GetFusedPositionalTrackingState()
Accessor for the Fused Positional Tracking State private member.
Definition ZEDCamera.hpp:634
virtual sl::SPATIAL_MAPPING_STATE GetSpatialMappingState()
Accessor for the Spatial Mapping State private member.
Definition ZEDCamera.hpp:653
Definition ZEDCamera.hpp:110
Definition ZEDCamera.hpp:101
This struct is used within the ZEDCam class to store the camera pose with high precision....
Definition ZEDCamera.hpp:97
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:135
This struct is internal to the ZedObjectData struct is used to store an X and Y value for the corners...
Definition ZEDCamera.hpp:64
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
This struct stores/contains information about a GPS data.
Definition GeospatialOperations.hpp:148