Sensors Class Reference

Class for managing multiple sensors (Cameras, Lidars) and fusing their data. More...

Functions

 Sensors ()
 Sensors constructor. More...
 
 ~Sensors ()
 Sensors destructor. More...
 
SENSORS_ERROR_CODE init (const sl::InitSensorsParameters &init_parameters=InitSensorsParameters())
 Initializes the Sensors instance.
This function should be called only once and before any other function. More...
 
SENSORS_ERROR_CODE add (const sl::InitParameters &init_parameters, sl::SensorDeviceIdentifier &camera_identifier_out)
 Adds a camera to the Sensors instance.
This function starts the camera and fills the SensorDeviceIdentifier.
It should be used for each camera in the system.
It is advised to add all cameras, then enable modules. A module cannot include a camera that was not yet added. More...
 
SENSORS_ERROR_CODE add (const sl::InitParametersOne &init_parameters, sl::SensorDeviceIdentifier &camera_identifier_out)
 Adds a ZED One camera to the Sensors instance. More...
 
SENSORS_ERROR_CODE add (const sl::InitLidarParameters &init_parameters, sl::SensorDeviceIdentifier &camera_identifier_out)
 Adds a Lidar to the Sensors instance. More...
 
SENSORS_ERROR_CODE remove (sl::SensorDeviceIdentifier &unique_identifier)
 Stops a sensor and removes it from the instance.
This also removes the sensor from all module instances. More...
 
SENSORS_ERROR_CODE setSensorPose (const sl::Transform &pose, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Updates the sensor pose relative to the system frame. More...
 
SENSORS_ERROR_CODE getSensorPose (sl::Transform &pose, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Gets the sensor pose relative to the system frame. More...
 
SENSORS_ERROR_CODE getSensorsID (std::set< SensorDeviceIdentifier > &sensors_identifier)
 Gets the list of all current active sensors IDs. More...
 
SENSORS_ERROR_CODE read ()
 Reads the latest images and IMU from all sensors and rectifies the images.
This function is meant to be called before Sensors::process(). More...
 
SENSORS_ERROR_CODE process ()
 Processes data from all sensors.
This method will call read() if it hasn't been called, then call each sensor's grab in parallel to compute all measures and fused data.
This is the main function to be called in a loop. More...
 
SENSORS_ERROR_CODE getErrorCodes (BatchedData< sl::ERROR_CODE > &errs)
 Gets the list of individual ERROR_CODE returned by each sensor in the last function call. More...
 
SENSORS_ERROR_CODE getProcessErrorCodes (BatchedData< sl::ERROR_CODE > &errs)
 Gets the list of individual ERROR_CODE returned by each sensor in the last read/process function call. More...
 
SENSORS_ERROR_CODE setRuntimeSensorsParameters (const RuntimeSensorsParameters &params=RuntimeSensorsParameters())
 Sets the runtime parameters of Sensors used by process. More...
 
SENSORS_ERROR_CODE syncSVO (sl::Timestamp t=sl::Timestamp())
 Synchronizes all sensors when the input used is SVO/OSF files.
It finds the earliest common timestamp across all camera SVOs and LiDAR OSFs,
then sets the playback position of each sensor to that common timestamp.
This ensures all sensors start playback from the same point in time. More...
 
SENSORS_ERROR_CODE setSVOPositionAtTimestamp (const sl::Timestamp &timestamp)
 Seeks all sensors to a specific timestamp.
This function sets the playback position of all SVO/OSF files to the frame closest to the specified timestamp.
It's useful for jumping to a specific point in time during multi-sensor playback. More...
 
SENSORS_ERROR_CODE retrieveImage (sl::Mat &mat, const sl::VIEW view=VIEW::LEFT, const sl::MEM type=MEM::CPU, const sl::Resolution image_size=Resolution(0, 0), sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the current VIEW of the specified camera. More...
 
SENSORS_ERROR_CODE retrieveMeasure (sl::Mat &mat, const sl::MEASURE measure=MEASURE::DEPTH, const sl::MEM type=MEM::CPU, const sl::Resolution image_size=Resolution(0, 0), sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the current MEASURE of the specified camera. More...
 
SENSORS_ERROR_CODE getMotionSensorsData (sl::SensorsData &data, sl::TIME_REFERENCE reference_time, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the current SensorsData (IMU, magnetometer, barometer) of the specified sensor. More...
 
CameraInformation getCameraInformation (Resolution image_size=Resolution(0, 0), sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the CameraInformation associated the camera being used. More...
 
void updateSelfCalibration (sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Performs a new self-calibration process for the specified camera.
In some cases, due to temperature changes or strong vibrations, the stereo calibration becomes less accurate.
Use this method to update the self-calibration data and get more reliable depth values. More...
 
SENSORS_ERROR_CODE retrieveImage (BatchedData< sl::Mat > &mat_list, const sl::VIEW view=VIEW::LEFT, const sl::MEM type=MEM::CPU, const sl::Resolution image_size=Resolution(0, 0), std::set< SensorDeviceIdentifier > sensors_ids={})
 Returns the VIEW of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return images from all the sensors of the system. More...
 
SENSORS_ERROR_CODE retrieveMeasure (BatchedData< sl::Mat > &mat_list, const sl::MEASURE measure=MEASURE::DEPTH, const sl::MEM type=MEM::CPU, const sl::Resolution image_size=Resolution(0, 0), std::set< SensorDeviceIdentifier > sensors_ids={})
 Returns the MEASURE of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return measures from all the sensors of the system. More...
 
SENSORS_ERROR_CODE retrieveMeasure (BatchedData< sl::Mat > &mat_list, const sl::LIDAR_MEASURE measure=LIDAR_MEASURE::XYZ, const sl::MEM type=MEM::CPU, const sl::Resolution image_size=Resolution(0, 0), std::set< SensorDeviceIdentifier > sensors_ids={})
 Returns the LIDAR_MEASURE of all the specified sensors (Lidar).
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return measures from all the sensors of the system (if applicable). More...
 
SENSORS_ERROR_CODE getMotionSensorsData (BatchedData< sl::SensorsData > &data, sl::TIME_REFERENCE reference_time, std::set< SensorDeviceIdentifier > sensors_ids={})
 Returns the SensorsData (IMU, magnetometer, barometer) of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return SensorsData from all the sensors of the system. More...
 
SENSORS_ERROR_CODE getCurrentFPS (BatchedData< float > &data, std::set< SensorDeviceIdentifier > sensors_ids={})
 Returns the current compute FPS of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return the data from all the sensors of the system. More...
 
SENSORS_ERROR_CODE getCurrentFPS (float &fps, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the current compute FPS of the specified camera. More...
 
SENSORS_ERROR_CODE getFrameDroppedCount (BatchedData< unsigned int > &data, std::set< SensorDeviceIdentifier > sensors_ids={})
 Returns the frame dropped count of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return the data from all the sensors of the system. More...
 
SENSORS_ERROR_CODE getFrameDroppedCount (unsigned int &count, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the frame dropped count of the specified sensor. More...
 
SENSORS_ERROR_CODE getTimestamp (BatchedData< Timestamp > &data, sl::TIME_REFERENCE reference_time, std::set< SensorDeviceIdentifier > sensors_ids={})
 Returns the timestamp of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return the data from all the sensors of the system. More...
 
SENSORS_ERROR_CODE getHealthStatus (BatchedData< HealthStatus > &data, std::set< SensorDeviceIdentifier > sensors_ids={})
 Returns the health status of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return the data from all the sensors of the system. More...
 
SENSORS_ERROR_CODE setRegionOfInterest (sl::Mat &roi_mask, std::unordered_set< MODULE > module={MODULE::ALL}, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Defines a region of interest to focus on for all the SDK, discarding other parts for the specified camera. More...
 
SENSORS_ERROR_CODE getRegionOfInterest (sl::Mat &roi_mask, sl::Resolution image_size=Resolution(0, 0), MODULE module=MODULE::ALL, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Gets the previously set or computed region of interest. More...
 
SENSORS_ERROR_CODE startRegionOfInterestAutoDetection (sl::RegionOfInterestParameters roi_param=sl::RegionOfInterestParameters(), sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Starts the auto detection of a region of interest to focus on for all the SDK, discarding other parts for the specified camera.
This detection is based on the general motion of the camera combined with the motion in the scene.
The camera must move for this process, as an internal motion detector is used (based on the Positional Tracking module).
It requires a few hundreds frames of motion to compute the mask. More...
 
SENSORS_ERROR_CODE getRegionOfInterestAutoDetectionStatus (REGION_OF_INTEREST_AUTO_DETECTION_STATE &status, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the status of the automatic Region of Interest Detection for the specified camera.
The automatic Region of Interest Detection is enabled by using startRegionOfInterestAutoDetection. More...
 
SENSORS_ERROR_CODE getCameraSettings (VIDEO_SETTINGS settings, int &setting, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Returns the current value of the requested camera setting (gain, brightness, hue, exposure, etc.). More...
 
SENSORS_ERROR_CODE getCameraSettings (VIDEO_SETTINGS settings, int &min_val, int &max_val, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Returns the current range of the requested settings for settings that support min/max values. More...
 
SENSORS_ERROR_CODE getCameraSettings (VIDEO_SETTINGS settings, Rect &roi, sl::SIDE side=sl::SIDE::BOTH, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Overloaded method for VIDEO_SETTINGS::AEC_AGC_ROI which takes a Rect as parameter. More...
 
SENSORS_ERROR_CODE getCameraSettingsRange (VIDEO_SETTINGS settings, int &min, int &max, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Returns the range for the specified VIDEO_SETTINGS as min/max value. More...
 
SENSORS_ERROR_CODE isCameraSettingSupported (VIDEO_SETTINGS setting, bool &is_supported_list, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Checks if the video setting is supported by the camera. More...
 
SENSORS_ERROR_CODE setCameraSettings (VIDEO_SETTINGS settings, int value=VIDEO_SETTINGS_VALUE_AUTO, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc.). More...
 
SENSORS_ERROR_CODE setCameraSettings (VIDEO_SETTINGS settings, int min, int max, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Sets the value of the requested camera setting that supports two values (min/max). More...
 
SENSORS_ERROR_CODE setCameraSettings (VIDEO_SETTINGS settings, Rect roi, sl::SIDE side=sl::SIDE::BOTH, bool reset=false, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Overloaded method for VIDEO_SETTINGS::AEC_AGC_ROI which takes a Rect as parameter. More...
 
SENSORS_ERROR_CODE enableObjectDetection (const sl::ObjectDetectionSensorsParameters &param)
 Initializes and starts object detection module instance.
This function should be called after all cameras are added and before any other function of the module. More...
 
SENSORS_ERROR_CODE setObjectDetectionRuntimeParameters (const ObjectDetectionRuntimeParameters &params, const unsigned int instance_id=0, std::set< sl::SensorDeviceIdentifier > cam_identifiers={})
 Sets the runtime parameters of the object detection module.
By default the object detection module will use the parameters set in the ObjectDetectionRuntimeParameters constructor.
This can be changed at any time and will be used for the specified cameras of the instance. Since the processing is done in parallel, the parameters will be used for the next inference. More...
 
SENSORS_ERROR_CODE setCustomObjectDetectionRuntimeParameters (const CustomObjectDetectionRuntimeParameters &params, const unsigned int instance_id=0, std::set< sl::SensorDeviceIdentifier > cam_identifiers={})
 Sets the custom runtime parameters of the object detection module.
By default the object detection module will use the parameters set in the CustomObjectDetectionRuntimeParameters constructor.
This can be changed at any time and will be used for the specified cameras of the instance. Since the processing is done in parallel, the parameters will be used for the next inference. More...
 
SENSORS_ERROR_CODE ingestCustomBoxObjects (const std::vector< CustomBoxObjectData > &objects_in, const unsigned int instance_id=0, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Feeds the 3D Object tracking method with your own 2D bounding boxes from your own detection algorithm. More...
 
SENSORS_ERROR_CODE ingestCustomMaskObjects (const std::vector< CustomMaskObjectData > &objects_in, const unsigned int instance_id=0, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Feeds the 3D Object tracking method with your own 2D masks from your own detection algorithm. More...
 
SENSORS_ERROR_CODE retrieveObjects (sl::Objects &objects, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier(), unsigned int instance_module_id=0)
 Retrieves the raw objects data of the specified object detection instance and sensor. More...
 
SENSORS_ERROR_CODE disableObjectDetection (unsigned int instance_module_id=0)
 Disables the object detection module instance. More...
 
SENSORS_ERROR_CODE enableBodyTracking (const sl::BodyTrackingSensorsParameters &param)
 Initializes and starts body tracking module instance.
This function should be called after all cameras are added and before any other function of the module. More...
 
SENSORS_ERROR_CODE setBodyTrackingRuntimeParameters (const BodyTrackingSensorsRuntimeParameters &params, const unsigned int instance_id=0, std::set< sl::SensorDeviceIdentifier > cam_identifiers={})
 Sets the runtime parameters of the body tracking module.
By default the body tracking module will use the parameters set in the BodyTrackingRuntimeParameters constructor.
This can be changed at any time and will be used for the specified cameras of the instance. Since the processing is done in parallel, the parameters will be used for the next inference. More...
 
SENSORS_ERROR_CODE retrieveBodies (sl::Bodies &bodies, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier(), unsigned int instance_module_id=0)
 Retrieves the raw tracked bodies of the specified sensor of the specified instance. More...
 
SENSORS_ERROR_CODE disableBodyTracking (unsigned int instance_module_id=0)
 Disables the body tracking module instance. More...
 
SENSORS_ERROR_CODE enablePositionalTracking (const PositionalTrackingSensorsParameters &tracking_parameters=PositionalTrackingSensorsParameters(), std::set< SensorDeviceIdentifier > sensors_id={})
 Initializes and starts the positional tracking processes. More...
 
POSITIONAL_TRACKING_STATE getPosition (Pose &camera_pose, SENSORS_REFERENCE_FRAME reference_frame=SENSORS_REFERENCE_FRAME::WORLD, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Retrieves the estimated position and orientation of the sensor in the specified referenceframe". More...
 
SENSORS_ERROR_CODE getPosition (BatchedData< std::pair< Pose, POSITIONAL_TRACKING_STATE >> &camera_poses, SENSORS_REFERENCE_FRAME reference_frame=SENSORS_REFERENCE_FRAME::WORLD, std::set< SensorDeviceIdentifier > sensors_id={})
 Retrieves the position and orientation of each sensor in the specified reference frame. More...
 
SENSORS_ERROR_CODE resetPositionalTracking (const Transform &path, std::set< SensorDeviceIdentifier > sensors_ids={})
 Resets the tracking, and re-initializes the position with the given transformation matrix for the specified cameras. More...
 
void disablePositionalTracking (String area_file_path="")
 Disables the positional tracking. More...
 
bool isPositionalTrackingEnabled ()
 Returns whether the positional tracking module is enabled. More...
 
sl::PositionalTrackingStatus getPositionalTrackingStatus (SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Returns the current status of positional tracking module. More...
 
SENSORS_ERROR_CODE saveAreaMap (String area_file_path, SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Saves the current area learning file. The file will contain spatial memory data generated by the tracking. More...
 
AREA_EXPORTING_STATE getAreaExportState (SensorDeviceIdentifier sensors_id=defaultSensorDeviceIdentifier())
 Returns the state of the spatial memory export process. As saveAreaMap() only starts the exportation, this method allows you to know when the exportation finished or if it failed. More...
 
SENSORS_ERROR_CODE enableRecording (const RecordingSensorsParameters &recording_parameters)
 Enable recording module to creates an SVO file for the specified cameras. More...
 
RecordingStatus getRecordingStatus (const SensorDeviceIdentifier &sensors_id=defaultSensorDeviceIdentifier())
 Returns the recording status information. More...
 
void pauseRecording (bool status, const SensorDeviceIdentifier &sensors_id=defaultSensorDeviceIdentifier())
 Pauses or resumes the recording. More...
 
void disableRecording (const std::set< SensorDeviceIdentifier > &sensors_ids={})
 Disables the recording initiated by enableRecording() and closes the generated file. More...
 
SENSORS_ERROR_CODE getSVOPosition (int &svo_position, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the current playback position in the SVO file. The position corresponds to the number of frames already read from the SVO file, starting from 0 to n.
Each read() call increases this value by one (except when using SVO real-time mode). More...
 
SENSORS_ERROR_CODE getSVOPositionAtTimestamp (int &svo_position, const sl::Timestamp &timestamp, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Retrieves the frame index within the SVO file corresponding to the provided timestamp. More...
 
SENSORS_ERROR_CODE setSVOPosition (int svo_position, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Sets the playback cursor to the desired frame number in the SVO file. This method allows you to move around within a played-back SVO file. After calling, the next call to read() will read the provided frame number. More...
 
SENSORS_ERROR_CODE getSVONumberOfFrames (int &number_of_frames, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Returns the number of frames in the SVO file. More...
 
SENSORS_ERROR_CODE ingestDataIntoSVO (const sl::SVOData &data, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Ingest custom user SVOData in a SVO file. More...
 
SENSORS_ERROR_CODE retrieveSVOData (const std::string &key, std::map< sl::Timestamp, sl::SVOData > &data, sl::Timestamp ts_begin=0, sl::Timestamp ts_end=0, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Retrieves SVO data from the SVO file at the given channel key and in the given timestamp range. More...
 
SENSORS_ERROR_CODE getSVODataKeys (std::vector< std::string > &keys, sl::SensorDeviceIdentifier unique_identifier=defaultSensorDeviceIdentifier())
 Get the external (custom data) channels that can be retrieved from the SVO file. More...
 
SENSORS_ERROR_CODE enableStreaming (const StreamingSensorsParameters &streaming_parameters=StreamingSensorsParameters())
 Creates a streaming pipeline. More...
 
void disableStreaming (const std::set< SensorDeviceIdentifier > &sensors_ids={})
 Disables the streaming initiated by enableStreaming(). More...
 
SENSORS_ERROR_CODE close ()
 Closes the Sensors instance, releasing all resources and cameras. More...
 
 Sensors (const Sensors &)=delete
 The Sensors object cannot be copied. Therefore, its copy constructor is disabled. More...
 
Sensorsoperator= (const Sensors &)=delete
 The Sensors object cannot be copied. Therefore, its copy assignment operator is disabled. More...
 

Static Functions

static SensorList getSensorList ()
 List all the connected sensor devices (cameras and lidars) with their associated information. More...
 
static StreamingSensorList getStreamingSensorList ()
 List all the streaming sensor devices (cameras and lidars) with their associated information. More...
 

Detailed Description

Class for managing multiple sensors (Cameras, Lidars) and fusing their data.

Note
Beta: The Sensors API is currently in beta. Interfaces and behavior may change in future SDK releases.

The Sensors class allows you to:

  • Add multiple cameras and lidars.
  • Synchronize their data.
  • Retrieve fused data (if available).
  • Manage settings for each device.

Constructor and Destructor

◆ Sensors() [1/2]

Sensors ( )

Sensors constructor.

◆ ~Sensors()

~Sensors ( )

Sensors destructor.

◆ Sensors() [2/2]

Sensors ( const Sensors )
delete

The Sensors object cannot be copied. Therefore, its copy constructor is disabled.

Functions

◆ getSensorList()

static SensorList getSensorList ( )
static

List all the connected sensor devices (cameras and lidars) with their associated information.

This method aggregates results from:

Returns
A SensorList containing device properties for each sensor type.
Warning
As this method returns std::vectors, it is only safe to use in Release or ReleaseWithDebugInfos mode (not Debug).
This is due to a known compatibility issue between release (the SDK) and debug (your app) implementations of std::vector.

◆ getStreamingSensorList()

static StreamingSensorList getStreamingSensorList ( )
static

List all the streaming sensor devices (cameras and lidars) with their associated information.

This method aggregates results from:

Returns
A StreamingSensorList containing streaming properties for each sensor type.
Warning
As this method returns std::vectors, it is only safe to use in Release or ReleaseWithDebugInfos mode (not Debug).
This is due to a known compatibility issue between release (the SDK) and debug (your app) implementations of std::vector.
This method takes around 2 seconds to make sure all network information has been captured. Make sure to run this method in a thread.

◆ init()

Initializes the Sensors instance.
This function should be called only once and before any other function.

Parameters
init_parameters: The initialization parameters.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ add() [1/3]

SENSORS_ERROR_CODE add ( const sl::InitParameters init_parameters,
sl::SensorDeviceIdentifier camera_identifier_out 
)

Adds a camera to the Sensors instance.
This function starts the camera and fills the SensorDeviceIdentifier.
It should be used for each camera in the system.
It is advised to add all cameras, then enable modules. A module cannot include a camera that was not yet added.

Parameters
init_parameters: The initialization parameters for the camera.
[out]camera_identifier_out: The identifier of the added camera.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ add() [2/3]

SENSORS_ERROR_CODE add ( const sl::InitParametersOne init_parameters,
sl::SensorDeviceIdentifier camera_identifier_out 
)

Adds a ZED One camera to the Sensors instance.

Parameters
init_parameters: The initialization parameters for the ZED One camera.
[out]camera_identifier_out: The identifier of the added camera.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ add() [3/3]

SENSORS_ERROR_CODE add ( const sl::InitLidarParameters init_parameters,
sl::SensorDeviceIdentifier camera_identifier_out 
)

Adds a Lidar to the Sensors instance.

Parameters
init_parameters: The initialization parameters for the Lidar.
[out]camera_identifier_out: The identifier of the added Lidar.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ remove()

SENSORS_ERROR_CODE remove ( sl::SensorDeviceIdentifier unique_identifier)

Stops a sensor and removes it from the instance.
This also removes the sensor from all module instances.

Parameters
unique_identifier: The identifier of the sensor to remove.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setSensorPose()

SENSORS_ERROR_CODE setSensorPose ( const sl::Transform pose,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Updates the sensor pose relative to the system frame.

Parameters
pose: The new pose.
unique_identifier: The identifier of the sensor.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getSensorPose()

SENSORS_ERROR_CODE getSensorPose ( sl::Transform pose,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Gets the sensor pose relative to the system frame.

Parameters
[out]pose: The retrieved pose.
unique_identifier: The identifier of the sensor.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getSensorsID()

SENSORS_ERROR_CODE getSensorsID ( std::set< SensorDeviceIdentifier > &  sensors_identifier)

Gets the list of all current active sensors IDs.

Parameters
[out]sensors_identifier: The set of active sensor identifiers.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ read()

Reads the latest images and IMU from all sensors and rectifies the images.
This function is meant to be called before Sensors::process().

Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ process()

SENSORS_ERROR_CODE process ( )

Processes data from all sensors.
This method will call read() if it hasn't been called, then call each sensor's grab in parallel to compute all measures and fused data.
This is the main function to be called in a loop.

Returns
SENSORS_ERROR_CODE::SUCCESS if successful.
Note
In pipelined mode (execution_mode == PIPELINED):
  • First call: Runs synchronously (setup phase — learns which outputs the user needs)
  • After the first process()+retrieve*() cycle: subsequent process() calls return immediately (worker threads running in background)

◆ getErrorCodes()

SENSORS_ERROR_CODE getErrorCodes ( BatchedData< sl::ERROR_CODE > &  errs)

Gets the list of individual ERROR_CODE returned by each sensor in the last function call.

Parameters
[out]errs: A map of sensor ID to error code.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getProcessErrorCodes()

SENSORS_ERROR_CODE getProcessErrorCodes ( BatchedData< sl::ERROR_CODE > &  errs)

Gets the list of individual ERROR_CODE returned by each sensor in the last read/process function call.

Parameters
[out]errs: A map of sensor ID to error code.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setRuntimeSensorsParameters()

SENSORS_ERROR_CODE setRuntimeSensorsParameters ( const RuntimeSensorsParameters params = RuntimeSensorsParameters())

Sets the runtime parameters of Sensors used by process.

Parameters
params: The runtime parameters.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ syncSVO()

Synchronizes all sensors when the input used is SVO/OSF files.
It finds the earliest common timestamp across all camera SVOs and LiDAR OSFs,
then sets the playback position of each sensor to that common timestamp.
This ensures all sensors start playback from the same point in time.

Note
This function should be called once all sensors are added and they have SVO/OSF input type.
Parameters
t: The timestamp to sync to. If 0 (default), automatically finds the latest start timestamp among all files.
Returns
SENSORS_ERROR_CODE::SUCCESS if all sensors were synchronized successfully.

◆ setSVOPositionAtTimestamp()

SENSORS_ERROR_CODE setSVOPositionAtTimestamp ( const sl::Timestamp timestamp)

Seeks all sensors to a specific timestamp.
This function sets the playback position of all SVO/OSF files to the frame closest to the specified timestamp.
It's useful for jumping to a specific point in time during multi-sensor playback.

Note
The method works only for sensors opened with SVO/OSF input.
Warning
Using this function creates a jump in time which will reset modules like positional tracking.
Parameters
timestamp: The timestamp to seek to.
Returns
SENSORS_ERROR_CODE::SUCCESS if all sensors were repositioned successfully.

◆ retrieveImage() [1/2]

SENSORS_ERROR_CODE retrieveImage ( sl::Mat mat,
const sl::VIEW  view = VIEW::LEFT,
const sl::MEM  type = MEM::CPU,
const sl::Resolution  image_size = Resolution(0, 0),
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the current VIEW of the specified camera.

Parameters
[out]mat: The retrieved image.
view: The view to retrieve.
type: The memory type (CPU/GPU).
image_size: The resolution of the output image.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ retrieveMeasure() [1/3]

SENSORS_ERROR_CODE retrieveMeasure ( sl::Mat mat,
const sl::MEASURE  measure = MEASURE::DEPTH,
const sl::MEM  type = MEM::CPU,
const sl::Resolution  image_size = Resolution(0, 0),
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the current MEASURE of the specified camera.

Parameters
[out]mat: The retrieved measure.
measure: The measure to retrieve.
type: The memory type (CPU/GPU).
image_size: The resolution of the output measure.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getMotionSensorsData() [1/2]

SENSORS_ERROR_CODE getMotionSensorsData ( sl::SensorsData data,
sl::TIME_REFERENCE  reference_time,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the current SensorsData (IMU, magnetometer, barometer) of the specified sensor.

Parameters
[out]data: The retrieved motion sensors data.
reference_time: The time reference.
unique_identifier: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getCameraInformation()

CameraInformation getCameraInformation ( Resolution  image_size = Resolution(0, 0),
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the CameraInformation associated the camera being used.

Parameters
image_size: The resolution for the calibration parameters.
unique_identifier: The camera identifier.
Returns
The camera information.

◆ updateSelfCalibration()

void updateSelfCalibration ( sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier())

Performs a new self-calibration process for the specified camera.
In some cases, due to temperature changes or strong vibrations, the stereo calibration becomes less accurate.
Use this method to update the self-calibration data and get more reliable depth values.

Note
The self calibration will occur at the next process() call.
Warning
New values will then be available in getCameraInformation(), be sure to get them to still have consistent 2D <-> 3D conversion.
Parameters
unique_identifier: The camera identifier.

◆ retrieveImage() [2/2]

SENSORS_ERROR_CODE retrieveImage ( BatchedData< sl::Mat > &  mat_list,
const sl::VIEW  view = VIEW::LEFT,
const sl::MEM  type = MEM::CPU,
const sl::Resolution  image_size = Resolution(0, 0),
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Returns the VIEW of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return images from all the sensors of the system.

Parameters
[out]mat_list: The retrieved images.
view: The view to retrieve.
type: The memory type (CPU/GPU).
image_size: The resolution of the output images.
sensors_ids: The set of sensor identifiers to retrieve.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ retrieveMeasure() [2/3]

SENSORS_ERROR_CODE retrieveMeasure ( BatchedData< sl::Mat > &  mat_list,
const sl::MEASURE  measure = MEASURE::DEPTH,
const sl::MEM  type = MEM::CPU,
const sl::Resolution  image_size = Resolution(0, 0),
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Returns the MEASURE of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return measures from all the sensors of the system.

Parameters
[out]mat_list: The retrieved measures.
measure: The measure to retrieve.
type: The memory type (CPU/GPU).
image_size: The resolution of the output measures.
sensors_ids: The set of sensor identifiers to retrieve.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ retrieveMeasure() [3/3]

SENSORS_ERROR_CODE retrieveMeasure ( BatchedData< sl::Mat > &  mat_list,
const sl::LIDAR_MEASURE  measure = LIDAR_MEASURE::XYZ,
const sl::MEM  type = MEM::CPU,
const sl::Resolution  image_size = Resolution(0, 0),
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Returns the LIDAR_MEASURE of all the specified sensors (Lidar).
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return measures from all the sensors of the system (if applicable).

Parameters
[out]mat_list: The retrieved measures.
measure: The lidar measure to retrieve.
type: The memory type (CPU/GPU).
image_size: The resolution of the output measures.
sensors_ids: The set of sensor identifiers to retrieve.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getMotionSensorsData() [2/2]

SENSORS_ERROR_CODE getMotionSensorsData ( BatchedData< sl::SensorsData > &  data,
sl::TIME_REFERENCE  reference_time,
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Returns the SensorsData (IMU, magnetometer, barometer) of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return SensorsData from all the sensors of the system.

Parameters
[out]data: The retrieved sensors data.
reference_time: The time reference.
sensors_ids: The set of sensor identifiers to retrieve.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getCurrentFPS() [1/2]

SENSORS_ERROR_CODE getCurrentFPS ( BatchedData< float > &  data,
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Returns the current compute FPS of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return the data from all the sensors of the system.

Parameters
[out]data: The retrieved FPS.
sensors_ids: The set of sensor identifiers query.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getCurrentFPS() [2/2]

SENSORS_ERROR_CODE getCurrentFPS ( float &  fps,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the current compute FPS of the specified camera.

Parameters
[out]fps: The retrieved FPS.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getFrameDroppedCount() [1/2]

SENSORS_ERROR_CODE getFrameDroppedCount ( BatchedData< unsigned int > &  data,
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Returns the frame dropped count of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return the data from all the sensors of the system.

Parameters
[out]data: The retrieved dropped frame counts.
sensors_ids: The set of sensor identifiers query.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getFrameDroppedCount() [2/2]

SENSORS_ERROR_CODE getFrameDroppedCount ( unsigned int &  count,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the frame dropped count of the specified sensor.

Parameters
[out]count: The retrieved dropped frame count.
unique_identifier: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getTimestamp()

SENSORS_ERROR_CODE getTimestamp ( BatchedData< Timestamp > &  data,
sl::TIME_REFERENCE  reference_time,
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Returns the timestamp of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return the data from all the sensors of the system.

Parameters
[out]data: The retrieved timestamps.
reference_time: The time reference (IMAGE or CURRENT).
sensors_ids: The set of sensor identifiers query.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getHealthStatus()

SENSORS_ERROR_CODE getHealthStatus ( BatchedData< HealthStatus > &  data,
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Returns the health status of all the specified sensors.
If sensors_ids is empty or if the set contains defaultSensorDeviceIdentifier(), it will return the data from all the sensors of the system.

Parameters
[out]data: The retrieved health statuses.
sensors_ids: The set of sensor identifiers query.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setRegionOfInterest()

SENSORS_ERROR_CODE setRegionOfInterest ( sl::Mat roi_mask,
std::unordered_set< MODULE module = {MODULE::ALL},
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Defines a region of interest to focus on for all the SDK, discarding other parts for the specified camera.

Parameters
[in]roi_mask: The mask defining the region of interest.
module: The module to apply the ROI to.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getRegionOfInterest()

SENSORS_ERROR_CODE getRegionOfInterest ( sl::Mat roi_mask,
sl::Resolution  image_size = Resolution(0, 0),
MODULE  module = MODULE::ALL,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Gets the previously set or computed region of interest.

Parameters
[out]roi_mask: The mask defining the region of interest.
image_size: The size of the mask.
module: The module the ROI applies to.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ startRegionOfInterestAutoDetection()

Starts the auto detection of a region of interest to focus on for all the SDK, discarding other parts for the specified camera.
This detection is based on the general motion of the camera combined with the motion in the scene.
The camera must move for this process, as an internal motion detector is used (based on the Positional Tracking module).
It requires a few hundreds frames of motion to compute the mask.

Parameters
roi_param: Parameters for ROI auto detection.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getRegionOfInterestAutoDetectionStatus()

SENSORS_ERROR_CODE getRegionOfInterestAutoDetectionStatus ( REGION_OF_INTEREST_AUTO_DETECTION_STATE status,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the status of the automatic Region of Interest Detection for the specified camera.
The automatic Region of Interest Detection is enabled by using startRegionOfInterestAutoDetection.

Parameters
[out]status: The current status of the auto detection.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getCameraSettings() [1/3]

SENSORS_ERROR_CODE getCameraSettings ( VIDEO_SETTINGS  settings,
int &  setting,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Returns the current value of the requested camera setting (gain, brightness, hue, exposure, etc.).

Parameters
settings: The setting to retrieve.
[out]setting: The retrieved value.
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.
Possible values (range) of each setting are available here.

◆ getCameraSettings() [2/3]

SENSORS_ERROR_CODE getCameraSettings ( VIDEO_SETTINGS  settings,
int &  min_val,
int &  max_val,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Returns the current range of the requested settings for settings that support min/max values.

This method only works with the following VIDEO_SETTINGS:

Note
Works only with ZED X that supports low-level controls.
Parameters
settings: The setting to retrieve.
[out]min_val: The retrieved minimum value.
[out]max_val: The retrieved maximum value.
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getCameraSettings() [3/3]

SENSORS_ERROR_CODE getCameraSettings ( VIDEO_SETTINGS  settings,
Rect roi,
sl::SIDE  side = sl::SIDE::BOTH,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Overloaded method for VIDEO_SETTINGS::AEC_AGC_ROI which takes a Rect as parameter.

Note
Works only if the camera is open in LIVE or STREAM mode with VIDEO_SETTINGS::AEC_AGC_ROI.
It will return SENSORS_ERROR_CODE::INVALID_FUNCTION_CALL or SENSORS_ERROR_CODE::INVALID_FUNCTION_PARAMETERS otherwise.
Parameters
settings: The setting to retrieve.
[out]roi: The retrieved ROI.
side: The side (Left/Right/Both).
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getCameraSettingsRange()

SENSORS_ERROR_CODE getCameraSettingsRange ( VIDEO_SETTINGS  settings,
int &  min,
int &  max,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Returns the range for the specified VIDEO_SETTINGS as min/max value.

Parameters
settings: The setting to retrieve range for.
[out]min: The retrieved minimum value.
[out]max: The retrieved maximum value.
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ isCameraSettingSupported()

SENSORS_ERROR_CODE isCameraSettingSupported ( VIDEO_SETTINGS  setting,
bool &  is_supported_list,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Checks if the video setting is supported by the camera.

Parameters
setting: The setting to check.
[out]is_supported_list: True if supported.
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setCameraSettings() [1/3]

SENSORS_ERROR_CODE setCameraSettings ( VIDEO_SETTINGS  settings,
int  value = VIDEO_SETTINGS_VALUE_AUTO,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Sets the value of the requested camera setting (gain, brightness, hue, exposure, etc.).

This method only applies for VIDEO_SETTINGS that require a single value.

Warning
Setting VIDEO_SETTINGS::EXPOSURE or VIDEO_SETTINGS::GAIN to default will automatically sets the other to default.
Note
The method works only if the camera is open in LIVE or STREAM mode.
Parameters
settings: The setting to set.
value: The value to set (default: VIDEO_SETTINGS_VALUE_AUTO).
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setCameraSettings() [2/3]

SENSORS_ERROR_CODE setCameraSettings ( VIDEO_SETTINGS  settings,
int  min,
int  max,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Sets the value of the requested camera setting that supports two values (min/max).

This method only works with the following VIDEO_SETTINGS:

◆ setCameraSettings() [3/3]

SENSORS_ERROR_CODE setCameraSettings ( VIDEO_SETTINGS  settings,
Rect  roi,
sl::SIDE  side = sl::SIDE::BOTH,
bool  reset = false,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Overloaded method for VIDEO_SETTINGS::AEC_AGC_ROI which takes a Rect as parameter.

Parameters
settings: The setting to set.
roi: The ROI to set.
side: The side (Left/Right/Both).
reset: Whether to reset the ROI.
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ enableObjectDetection()

SENSORS_ERROR_CODE enableObjectDetection ( const sl::ObjectDetectionSensorsParameters param)

Initializes and starts object detection module instance.
This function should be called after all cameras are added and before any other function of the module.

Note
The object detection module can be used with multiple instances.
Parameters
param: The object detection parameters.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setObjectDetectionRuntimeParameters()

SENSORS_ERROR_CODE setObjectDetectionRuntimeParameters ( const ObjectDetectionRuntimeParameters params,
const unsigned int  instance_id = 0,
std::set< sl::SensorDeviceIdentifier cam_identifiers = {} 
)

Sets the runtime parameters of the object detection module.
By default the object detection module will use the parameters set in the ObjectDetectionRuntimeParameters constructor.
This can be changed at any time and will be used for the specified cameras of the instance. Since the processing is done in parallel, the parameters will be used for the next inference.

Parameters
params: The runtime parameters.
instance_id: The instance ID.
cam_identifiers: The set of camera identifiers to apply parameters to.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setCustomObjectDetectionRuntimeParameters()

SENSORS_ERROR_CODE setCustomObjectDetectionRuntimeParameters ( const CustomObjectDetectionRuntimeParameters params,
const unsigned int  instance_id = 0,
std::set< sl::SensorDeviceIdentifier cam_identifiers = {} 
)

Sets the custom runtime parameters of the object detection module.
By default the object detection module will use the parameters set in the CustomObjectDetectionRuntimeParameters constructor.
This can be changed at any time and will be used for the specified cameras of the instance. Since the processing is done in parallel, the parameters will be used for the next inference.

Parameters
params: The custom runtime parameters.
instance_id: The instance ID.
cam_identifiers: The set of camera identifiers to apply parameters to.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ ingestCustomBoxObjects()

SENSORS_ERROR_CODE ingestCustomBoxObjects ( const std::vector< CustomBoxObjectData > &  objects_in,
const unsigned int  instance_id = 0,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Feeds the 3D Object tracking method with your own 2D bounding boxes from your own detection algorithm.

Note
The detection should be done on the current grabbed left image as the internal process will use all currently available data to extract 3D informations and perform object tracking.
It's strongly advised to use the read() function, retrieving the left image, running the inference and the ingest, then calling the process() method.
Parameters
objects_in: The input custom objects.
instance_id: The instance ID.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ ingestCustomMaskObjects()

SENSORS_ERROR_CODE ingestCustomMaskObjects ( const std::vector< CustomMaskObjectData > &  objects_in,
const unsigned int  instance_id = 0,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Feeds the 3D Object tracking method with your own 2D masks from your own detection algorithm.

Note
The detection should be done on the current grabbed left image as the internal process will use all currently available data to extract 3D informations and perform object tracking.
It's strongly advised to use the read() function, retrieving the left image, running the inference and the ingest, then calling the process() method.
Parameters
objects_in: The input custom objects.
instance_id: The instance ID.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ retrieveObjects()

SENSORS_ERROR_CODE retrieveObjects ( sl::Objects objects,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier(),
unsigned int  instance_module_id = 0 
)

Retrieves the raw objects data of the specified object detection instance and sensor.

Parameters
[out]objects: The retrieved objects.
sensors_id: The sensor identifier.
instance_module_id: The instance ID.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ disableObjectDetection()

SENSORS_ERROR_CODE disableObjectDetection ( unsigned int  instance_module_id = 0)

Disables the object detection module instance.

Parameters
instance_module_id: The instance ID.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ enableBodyTracking()

SENSORS_ERROR_CODE enableBodyTracking ( const sl::BodyTrackingSensorsParameters param)

Initializes and starts body tracking module instance.
This function should be called after all cameras are added and before any other function of the module.

Note
The body tracking module can be used with multiple instances.
Parameters
param: The body tracking parameters.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setBodyTrackingRuntimeParameters()

SENSORS_ERROR_CODE setBodyTrackingRuntimeParameters ( const BodyTrackingSensorsRuntimeParameters params,
const unsigned int  instance_id = 0,
std::set< sl::SensorDeviceIdentifier cam_identifiers = {} 
)

Sets the runtime parameters of the body tracking module.
By default the body tracking module will use the parameters set in the BodyTrackingRuntimeParameters constructor.
This can be changed at any time and will be used for the specified cameras of the instance. Since the processing is done in parallel, the parameters will be used for the next inference.

Parameters
params: The runtime parameters.
instance_id: The instance ID.
cam_identifiers: The set of camera identifiers to apply parameters to.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ retrieveBodies()

SENSORS_ERROR_CODE retrieveBodies ( sl::Bodies bodies,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier(),
unsigned int  instance_module_id = 0 
)

Retrieves the raw tracked bodies of the specified sensor of the specified instance.

Parameters
[out]bodies: The retrieved bodies.
sensors_id: The sensor identifier.
instance_module_id: The instance ID.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ disableBodyTracking()

SENSORS_ERROR_CODE disableBodyTracking ( unsigned int  instance_module_id = 0)

Disables the body tracking module instance.

Parameters
instance_module_id: The instance ID.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ enablePositionalTracking()

SENSORS_ERROR_CODE enablePositionalTracking ( const PositionalTrackingSensorsParameters tracking_parameters = PositionalTrackingSensorsParameters(),
std::set< SensorDeviceIdentifier sensors_id = {} 
)

Initializes and starts the positional tracking processes.

Parameters
tracking_parameters: The positional tracking parameters.
sensors_id: The set of sensor identifiers to enable tracking for.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getPosition() [1/2]

POSITIONAL_TRACKING_STATE getPosition ( Pose camera_pose,
SENSORS_REFERENCE_FRAME  reference_frame = SENSORS_REFERENCE_FRAME::WORLD,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Retrieves the estimated position and orientation of the sensor in the specified referenceframe".

Warning
This method requires the tracking to be enabled. enablePositionalTracking() .
Note
The position is provided in the InitSensorsParameters::coordinate_system . See COORDINATE_SYSTEM for its physical origin.
Parameters
[out]camera_pose: The retrieved pose.
reference_frame: The reference frame for the pose.
sensors_id: The sensor identifier.
Returns
The positional tracking state.

◆ getPosition() [2/2]

SENSORS_ERROR_CODE getPosition ( BatchedData< std::pair< Pose, POSITIONAL_TRACKING_STATE >> &  camera_poses,
SENSORS_REFERENCE_FRAME  reference_frame = SENSORS_REFERENCE_FRAME::WORLD,
std::set< SensorDeviceIdentifier sensors_id = {} 
)

Retrieves the position and orientation of each sensor in the specified reference frame.

Parameters
[out]camera_poses: The retrieved poses and tracking states.
reference_frame: The reference frame for the poses.
sensors_id: The set of sensor identifiers to retrieve.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ resetPositionalTracking()

SENSORS_ERROR_CODE resetPositionalTracking ( const Transform path,
std::set< SensorDeviceIdentifier sensors_ids = {} 
)

Resets the tracking, and re-initializes the position with the given transformation matrix for the specified cameras.

Parameters
path: Position of the camera in the world frame when the method is called.
sensors_ids: The set of sensor identifiers to reset tracking for.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.
Note
Please note that this method will also flush the accumulated or loaded spatial memory.

◆ disablePositionalTracking()

void disablePositionalTracking ( String  area_file_path = "")

Disables the positional tracking.

The positional tracking is immediately stopped. If a file path is given, saveAreaMap() will be called asynchronously. See getAreaExportState() to get the exportation state.
If the tracking has been enabled, this function will automatically be called by close() .

Parameters
area_file_path: The path to save the area map to.

◆ isPositionalTrackingEnabled()

bool isPositionalTrackingEnabled ( )

Returns whether the positional tracking module is enabled.

Returns
True if positional tracking is enabled.

◆ getPositionalTrackingStatus()

Returns the current status of positional tracking module.

Parameters
sensors_id: The sensor identifier.
Returns
The positional tracking status.

◆ saveAreaMap()

SENSORS_ERROR_CODE saveAreaMap ( String  area_file_path,
SensorDeviceIdentifier  sensors_id = defaultSensorDeviceIdentifier() 
)

Saves the current area learning file. The file will contain spatial memory data generated by the tracking.

If the tracking has been initialized with PositionalTrackingSensorsParameters::enable_area_memory to true (default), the method allows you to export the spatial memory.
Reloading the exported file in a future session with PositionalTrackingSensorsParameters::area_file_path initializes the tracking within the same referential.
This method is asynchronous, and only triggers the file generation. You can use getAreaExportState() to get the export state. The positional tracking keeps running while exporting.

◆ getAreaExportState()

Returns the state of the spatial memory export process. As saveAreaMap() only starts the exportation, this method allows you to know when the exportation finished or if it failed.

◆ enableRecording()

SENSORS_ERROR_CODE enableRecording ( const RecordingSensorsParameters recording_parameters)

Enable recording module to creates an SVO file for the specified cameras.


SVO files are custom video files containing the un-rectified images from the camera along with some meta-data like timestamps or IMU orientation (if applicable).
They can be used to simulate a live ZED and test a sequence with various SDK parameters.
Depending on the application, various compression modes are available. See SVO_COMPRESSION_MODE.

◆ getRecordingStatus()

RecordingStatus getRecordingStatus ( const SensorDeviceIdentifier sensors_id = defaultSensorDeviceIdentifier())

Returns the recording status information.

Parameters
sensors_id: The sensor identifier.
Returns
The recording status.

◆ pauseRecording()

void pauseRecording ( bool  status,
const SensorDeviceIdentifier sensors_id = defaultSensorDeviceIdentifier() 
)

Pauses or resumes the recording.

Parameters
status: If true, the recording is paused. If false, the recording is resumed.
sensors_id: The sensor identifier.

◆ disableRecording()

void disableRecording ( const std::set< SensorDeviceIdentifier > &  sensors_ids = {})

Disables the recording initiated by enableRecording() and closes the generated file.

Note
This method will automatically be called by close() if enableRecording() was called.
Parameters
sensors_ids: The set of sensor identifiers to stop recording for.

◆ getSVOPosition()

SENSORS_ERROR_CODE getSVOPosition ( int &  svo_position,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the current playback position in the SVO file. The position corresponds to the number of frames already read from the SVO file, starting from 0 to n.
Each read() call increases this value by one (except when using SVO real-time mode).

Note
The method works only if the camera is open in SVO playback mode.
Parameters
[out]svo_position: The current frame position.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getSVOPositionAtTimestamp()

SENSORS_ERROR_CODE getSVOPositionAtTimestamp ( int &  svo_position,
const sl::Timestamp timestamp,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Retrieves the frame index within the SVO file corresponding to the provided timestamp.

Parameters
[out]svo_position: The retrieved SVO position.
timestamp: The timestamp to search for.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ setSVOPosition()

SENSORS_ERROR_CODE setSVOPosition ( int  svo_position,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Sets the playback cursor to the desired frame number in the SVO file. This method allows you to move around within a played-back SVO file. After calling, the next call to read() will read the provided frame number.

Note
The method works only if the camera is open in SVO playback mode.
Warning
Using this function is not a standard behavior as it creates a jump in time, backward or forward (which can not happen in live conditions). This function will then reset many modules such as positional tracking or spatial mapping.
Parameters
svo_position: The frame number to jump to.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getSVONumberOfFrames()

SENSORS_ERROR_CODE getSVONumberOfFrames ( int &  number_of_frames,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Returns the number of frames in the SVO file.

Note
The method works only if the camera is open in SVO playback mode.
Parameters
[out]number_of_frames: The total number of frames in the SVO file.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ ingestDataIntoSVO()

SENSORS_ERROR_CODE ingestDataIntoSVO ( const sl::SVOData data,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Ingest custom user SVOData in a SVO file.

Note
The method works only if the camera is recording.
Parameters
data: The SVO data to ingest.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ retrieveSVOData()

SENSORS_ERROR_CODE retrieveSVOData ( const std::string &  key,
std::map< sl::Timestamp, sl::SVOData > &  data,
sl::Timestamp  ts_begin = 0,
sl::Timestamp  ts_end = 0,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Retrieves SVO data from the SVO file at the given channel key and in the given timestamp range.

Note
The method works only if the camera is in SVO reading mode.
Parameters
key: The key of the SVOData that is going to be retrieved.
[out]data: The map to be filled with SVOData objects, with timestamps as keys.
ts_begin: The beginning of the range.
ts_end: The end of the range.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ getSVODataKeys()

SENSORS_ERROR_CODE getSVODataKeys ( std::vector< std::string > &  keys,
sl::SensorDeviceIdentifier  unique_identifier = defaultSensorDeviceIdentifier() 
)

Get the external (custom data) channels that can be retrieved from the SVO file.

Note
The method works only if the camera is in SVO reading mode.
Parameters
[out]keys: The list of available keys.
unique_identifier: The camera identifier.
Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ enableStreaming()

SENSORS_ERROR_CODE enableStreaming ( const StreamingSensorsParameters streaming_parameters = StreamingSensorsParameters())

Creates a streaming pipeline.

Parameters
streaming_parameters: A structure containing all the specific parameters for the streaming. Default: a reset of StreamingParameters .
Returns
SENSORS_ERROR_CODE::SUCCESS if streaming was successfully started.
SENSORS_ERROR_CODE::INVALID_FUNCTION_CALL if open() was not successfully called before.
SENSORS_ERROR_CODE::FAILURE if streaming RTSP protocol was not able to start.
SENSORS_ERROR_CODE::NO_GPU_COMPATIBLE if streaming codec is not supported (in this case, use H264 codec which is supported on all NVIDIA GPU the ZED SDK supports).

◆ disableStreaming()

void disableStreaming ( const std::set< SensorDeviceIdentifier > &  sensors_ids = {})

Disables the streaming initiated by enableStreaming().

Note
This method will automatically be called by close() if enableStreaming() was called.
Parameters
sensors_ids: The set of sensor identifiers to stop streaming for.

◆ close()

SENSORS_ERROR_CODE close ( )

Closes the Sensors instance, releasing all resources and cameras.

Returns
SENSORS_ERROR_CODE::SUCCESS if successful.

◆ operator=()

Sensors& operator= ( const Sensors )
delete

The Sensors object cannot be copied. Therefore, its copy assignment operator is disabled.