Sensors Class Reference

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

Functions

def __cinit__ (self)
 Default constructor.
 
def __dealloc__ (self)
 Destructor.
 
SENSORS_ERROR_CODE init (self, InitSensorsParameters, init_parameters=None)
 Initializes the Sensors instance.
 
SENSORS_ERROR_CODE add (self, py_init, SensorDeviceIdentifier, camera_identifier_out=None)
 Adds a camera or LIDAR to the Sensors instance.
 
SENSORS_ERROR_CODE remove (self, SensorDeviceIdentifier, unique_identifier)
 Stops a sensor and removes it from the instance.
 
SENSORS_ERROR_CODE read (self)
 Reads the latest images and IMU from all sensors and rectifies the images.
 
SENSORS_ERROR_CODE process (self)
 Processes data from all sensors.
 
tuple get_error_codes (self)
 Gets the list of individual ERROR_CODE returned by each sensor in the last function call. More...
 
tuple get_process_error_codes (self)
 Gets the list of individual ERROR_CODE returned by each sensor in the last read/process function call. More...
 
SENSORS_ERROR_CODE set_runtime_sensors_parameters (self, RuntimeSensorsParameters, params)
 Sets the runtime parameters for Sensors. More...
 
tuple retrieve_image_batched (self, view=VIEW.LEFT, mem_type=MEM.CPU, Resolution, image_size=None, list, sensors_ids=None)
 Returns the VIEW of all the specified sensors. More...
 
tuple retrieve_measure_batched (self, measure=MEASURE.DEPTH, mem_type=MEM.CPU, Resolution, image_size=None, list, sensors_ids=None)
 Returns the MEASURE of all the specified sensors. More...
 
tuple retrieve_lidar_measure_batched (self, measure=LIDAR_MEASURE.XYZ, mem_type=MEM.CPU, Resolution, image_size=None, list, sensors_ids=None)
 Returns the LIDAR_MEASURE of all the specified sensors (Lidar). More...
 
tuple get_motion_sensors_data_batched (self, reference_time=TIME_REFERENCE.IMAGE, list, sensors_ids=None)
 Returns the SensorsData (IMU, magnetometer, barometer) of all the specified sensors. More...
 
tuple get_current_fps_batched (self, list, sensors_ids=None)
 Returns the current compute FPS of all the specified sensors. More...
 
tuple get_frame_dropped_count_batched (self, list, sensors_ids=None)
 Returns the frame dropped count of all the specified sensors. More...
 
tuple get_timestamp_batched (self, reference_time=TIME_REFERENCE.IMAGE, list, sensors_ids=None)
 Returns the timestamp of all the specified sensors. More...
 
tuple get_health_status_batched (self, list, sensors_ids=None)
 Returns the health status of all the specified sensors. More...
 
tuple get_position_batched (self, reference_frame=SENSORS_REFERENCE_FRAME.WORLD, list, sensors_ids=None)
 Returns the position and tracking state of all the specified sensors. More...
 
SENSORS_ERROR_CODE retrieve_image (self, Mat, mat, view=VIEW.LEFT, mem_type=MEM.CPU, Resolution, image_size=None, SensorDeviceIdentifier, unique_identifier=None)
 Returns the current VIEW of the specified camera.
 
SENSORS_ERROR_CODE retrieve_measure (self, Mat, mat, measure=MEASURE.DEPTH, mem_type=MEM.CPU, Resolution, image_size=None, SensorDeviceIdentifier, unique_identifier=None)
 Returns the current MEASURE of the specified camera.
 
SENSORS_ERROR_CODE set_sensor_pose (self, Transform, pose, SensorDeviceIdentifier, unique_identifier=None)
 Updates the sensor pose relative to the system frame.
 
SENSORS_ERROR_CODE get_sensor_pose (self, Transform, pose, SensorDeviceIdentifier, unique_identifier=None)
 Gets the sensor pose relative to the system frame.
 
def get_sensors_id (self)
 Gets the list of all current active sensors IDs.
 
def get_current_fps (self, SensorDeviceIdentifier, unique_identifier=None)
 Returns the current compute FPS of the specified camera.
 
def get_frame_dropped_count (self, SensorDeviceIdentifier, unique_identifier=None)
 Returns the frame dropped count of the specified camera.
 
dict get_camera_information (self, Resolution, image_size=None, SensorDeviceIdentifier, unique_identifier=None)
 Returns the CameraInformation associated with the camera being used.
 
def get_svo_position (self, SensorDeviceIdentifier, unique_identifier=None)
 Returns the current playback position in the SVO file.
 
SENSORS_ERROR_CODE set_svo_position (self, int, position, SensorDeviceIdentifier, unique_identifier=None)
 Sets the playback cursor to the desired frame number in the SVO file.
 
def get_svo_number_of_frames (self, SensorDeviceIdentifier, unique_identifier=None)
 Returns the number of frames in the SVO file.
 
SENSORS_ERROR_CODE sync_svo (self, Timestamp, timestamp=None)
 Synchronizes all sensors when the input used is SVO/OSF files.
 
SENSORS_ERROR_CODE enable_recording (self, RecordingSensorsParameters, recording_parameters)
 Enables the recording module.
 
RecordingStatus get_recording_status (self, SensorDeviceIdentifier, sensors_id=None)
 Returns the recording status for a specific sensor.
 
def pause_recording (self, bool, status=True, SensorDeviceIdentifier, sensors_id=None)
 Pauses or resumes the recording.
 
def disable_recording (self, list, sensors_ids=None)
 Disables recording for the specified sensors.
 
SENSORS_ERROR_CODE enable_streaming (self, StreamingSensorsParameters, streaming_parameters=None)
 Enables the streaming module.
 
def disable_streaming (self, list, cameras_ids=None)
 Disables streaming for the specified sensors.
 
SENSORS_ERROR_CODE enable_object_detection (self, ObjectDetectionSensorsParameters, object_detection_parameters)
 Enables the object detection module.
 
SENSORS_ERROR_CODE set_object_detection_runtime_parameters (self, ObjectDetectionRuntimeParameters, params, unsigned, int, instance_id=0, list, cam_identifiers=None)
 Sets the runtime parameters of the object detection module.
 
SENSORS_ERROR_CODE retrieve_objects (self, Objects, objects, SensorDeviceIdentifier, sensors_id=None, unsigned, int, instance_module_id=0)
 Retrieves the objects data of the specified object detection instance and sensor.
 
SENSORS_ERROR_CODE disable_object_detection (self, unsigned, int, instance_module_id=0)
 Disables the object detection module instance.
 
SENSORS_ERROR_CODE enable_body_tracking (self, BodyTrackingSensorsParameters, body_tracking_parameters)
 Enables the body tracking module.
 
SENSORS_ERROR_CODE set_body_tracking_runtime_parameters (self, BodyTrackingSensorsRuntimeParameters, params, unsigned, int, instance_id=0, list, cam_identifiers=None)
 Sets the runtime parameters of the body tracking module.
 
SENSORS_ERROR_CODE retrieve_bodies (self, Bodies, bodies, SensorDeviceIdentifier, sensors_id=None, unsigned, int, instance_module_id=0)
 Retrieves the bodies data of the specified body tracking instance and sensor.
 
SENSORS_ERROR_CODE disable_body_tracking (self, unsigned, int, instance_module_id=0)
 Disables the body tracking module instance.
 
SENSORS_ERROR_CODE enable_positional_tracking (self, PositionalTrackingSensorsParameters, tracking_parameters=PositionalTrackingSensorsParameters(), list, sensors_id=None)
 Enables positional tracking for the sensors in the Sensors instance.
 
POSITIONAL_TRACKING_STATE get_position (self, Pose, camera_pose, reference_frame=SENSORS_REFERENCE_FRAME.WORLD, SensorDeviceIdentifier, unique_identifier=None)
 Gets the position of the specified camera.
 
SENSORS_ERROR_CODE reset_positional_tracking (self, Transform, path, list, sensors_ids=None)
 Resets positional tracking for the specified sensors.
 
PositionalTrackingStatus get_positional_tracking_status (self, SensorDeviceIdentifier, sensors_id=None)
 Returns the positional tracking status for a specific sensor.
 
SENSORS_ERROR_CODE save_area_map (self, str, area_file_path, SensorDeviceIdentifier, sensors_id=None)
 Saves the current area learning file.
 
AREA_EXPORTING_STATE get_area_export_state (self, SensorDeviceIdentifier, sensors_id=None)
 Returns the state of the spatial memory export process.
 
SENSORS_ERROR_CODE get_motion_sensors_data (self, SensorsData, data, reference_time=TIME_REFERENCE.IMAGE, SensorDeviceIdentifier, unique_identifier=None)
 Returns the SensorsData (IMU, magnetometer, barometer) of the specified sensor.
 
def update_self_calibration (self, SensorDeviceIdentifier, unique_identifier=None)
 Performs a new self-calibration process for the specified camera.
 
def get_camera_settings (self, settings, SensorDeviceIdentifier, sensors_id=None)
 Returns the current value of the requested camera setting.
 
def get_camera_settings_range (self, settings, SensorDeviceIdentifier, sensors_id=None)
 Returns the range for the specified camera setting.
 
def is_camera_setting_supported (self, setting, SensorDeviceIdentifier, sensors_id=None)
 Checks if the video setting is supported by the camera.
 
SENSORS_ERROR_CODE set_camera_settings (self, settings, int, value=-1, SensorDeviceIdentifier, sensors_id=None)
 Sets the value of the requested camera setting.
 
def get_camera_settings_min_max (self, settings, SensorDeviceIdentifier, sensors_id=None)
 Returns the current min/max values of the requested camera setting. More...
 
SENSORS_ERROR_CODE set_camera_settings_min_max (self, settings, int, min_val, int, max_val, SensorDeviceIdentifier, sensors_id=None)
 Sets the min/max values for the requested camera setting. More...
 
SENSORS_ERROR_CODE get_camera_settings_roi (self, settings, Rect, roi, side=SIDE.BOTH, SensorDeviceIdentifier, sensors_id=None)
 Returns the AEC_AGC_ROI for the specified camera setting. More...
 
SENSORS_ERROR_CODE set_camera_settings_roi (self, settings, Rect, roi, side=SIDE.BOTH, bool, reset=False, SensorDeviceIdentifier, sensors_id=None)
 Sets the AEC_AGC_ROI for the specified camera setting. More...
 
SENSORS_ERROR_CODE set_region_of_interest (self, Mat, roi_mask, list, modules=None, SensorDeviceIdentifier, unique_identifier=None)
 Defines a region of interest to focus on for all the SDK.
 
SENSORS_ERROR_CODE get_region_of_interest (self, Mat, roi_mask, Resolution, image_size=None, module=MODULE.ALL, SensorDeviceIdentifier, unique_identifier=None)
 Gets the previously set or computed region of interest.
 
SENSORS_ERROR_CODE start_region_of_interest_auto_detection (self, RegionOfInterestParameters, roi_param=None, SensorDeviceIdentifier, unique_identifier=None)
 Starts the auto detection of a region of interest.
 
def get_region_of_interest_auto_detection_status (self, SensorDeviceIdentifier, unique_identifier=None)
 Returns the status of the automatic Region of Interest Detection.
 
def get_svo_position_at_timestamp (self, Timestamp, timestamp, SensorDeviceIdentifier, unique_identifier=None)
 Retrieves the frame index within the SVO file corresponding to the provided timestamp.
 
SENSORS_ERROR_CODE set_svo_position_at_timestamp (self, Timestamp, timestamp)
 Seeks all sensors to a specific timestamp.
 
SENSORS_ERROR_CODE ingest_data_into_svo (self, SVOData, data, SensorDeviceIdentifier, unique_identifier=None)
 Ingest custom user SVOData in a SVO file.
 
def disable_positional_tracking (self, str, area_file_path="")
 Disables positional tracking.
 
bool is_positional_tracking_enabled (self)
 Checks if positional tracking is enabled.
 
SENSORS_ERROR_CODE close (self)
 Closes the Sensors instance, releasing all resources and cameras.
 

Static Functions

SensorList get_sensor_list ()
 Returns the list of available sensors.
 
StreamingSensorList get_streaming_sensor_list ()
 Returns the list of available streaming sensors.
 

Detailed Description

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

Python class for unified sensor management (cameras and LiDAR).

Functions

◆ get_error_codes()

tuple get_error_codes (   self)

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

Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, ERROR_CODE]).

◆ get_process_error_codes()

tuple get_process_error_codes (   self)

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

Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, ERROR_CODE]).

◆ set_runtime_sensors_parameters()

SENSORS_ERROR_CODE set_runtime_sensors_parameters (   self,
  RuntimeSensorsParameters,
  params 
)

Sets the runtime parameters for Sensors.

Parameters
params: The runtime parameters.
Returns
SENSORS_ERROR_CODE indicating success or failure.

◆ retrieve_image_batched()

tuple retrieve_image_batched (   self,
  view = VIEW.LEFT,
  mem_type = MEM.CPU,
  Resolution,
  image_size = None,
  list,
  sensors_ids = None 
)

Returns the VIEW of all the specified sensors.

Parameters
view: The view to retrieve.
mem_type: The memory type (CPU/GPU).
image_size: The resolution of the output images.
sensors_ids: List of sensor identifiers to retrieve. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, Mat]).

◆ retrieve_measure_batched()

tuple retrieve_measure_batched (   self,
  measure = MEASURE.DEPTH,
  mem_type = MEM.CPU,
  Resolution,
  image_size = None,
  list,
  sensors_ids = None 
)

Returns the MEASURE of all the specified sensors.

Parameters
measure: The measure to retrieve.
mem_type: The memory type (CPU/GPU).
image_size: The resolution of the output measures.
sensors_ids: List of sensor identifiers to retrieve. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, Mat]).

◆ retrieve_lidar_measure_batched()

tuple retrieve_lidar_measure_batched (   self,
  measure = LIDAR_MEASURE.XYZ,
  mem_type = MEM.CPU,
  Resolution,
  image_size = None,
  list,
  sensors_ids = None 
)

Returns the LIDAR_MEASURE of all the specified sensors (Lidar).

Parameters
measure: The lidar measure to retrieve.
mem_type: The memory type (CPU/GPU).
image_size: The resolution of the output measures.
sensors_ids: List of sensor identifiers to retrieve. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, Mat]).

◆ get_motion_sensors_data_batched()

tuple get_motion_sensors_data_batched (   self,
  reference_time = TIME_REFERENCE.IMAGE,
  list,
  sensors_ids = None 
)

Returns the SensorsData (IMU, magnetometer, barometer) of all the specified sensors.

Parameters
reference_time: The time reference.
sensors_ids: List of sensor identifiers to retrieve. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, SensorsData]).

◆ get_current_fps_batched()

tuple get_current_fps_batched (   self,
  list,
  sensors_ids = None 
)

Returns the current compute FPS of all the specified sensors.

Parameters
sensors_ids: List of sensor identifiers to query. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, float]).

◆ get_frame_dropped_count_batched()

tuple get_frame_dropped_count_batched (   self,
  list,
  sensors_ids = None 
)

Returns the frame dropped count of all the specified sensors.

Parameters
sensors_ids: List of sensor identifiers to query. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, int]).

◆ get_timestamp_batched()

tuple get_timestamp_batched (   self,
  reference_time = TIME_REFERENCE.IMAGE,
  list,
  sensors_ids = None 
)

Returns the timestamp of all the specified sensors.

Parameters
reference_time: The time reference (IMAGE or CURRENT).
sensors_ids: List of sensor identifiers to query. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, Timestamp]).

◆ get_health_status_batched()

tuple get_health_status_batched (   self,
  list,
  sensors_ids = None 
)

Returns the health status of all the specified sensors.

Parameters
sensors_ids: List of sensor identifiers to query. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, HealthStatus]).

◆ get_position_batched()

tuple get_position_batched (   self,
  reference_frame = SENSORS_REFERENCE_FRAME.WORLD,
  list,
  sensors_ids = None 
)

Returns the position and tracking state of all the specified sensors.

Parameters
reference_frame: The reference frame (WORLD or CAMERA).
sensors_ids: List of sensor identifiers to query. Empty list means all sensors.
Returns
A tuple of (SENSORS_ERROR_CODE, dict[SensorDeviceIdentifier, tuple[Pose, POSITIONAL_TRACKING_STATE]]).

◆ get_camera_settings_min_max()

def get_camera_settings_min_max (   self,
  settings,
  SensorDeviceIdentifier,
  sensors_id = None 
)

Returns the current min/max values of the requested camera setting.


Works with AUTO_EXPOSURE_TIME_RANGE, AUTO_ANALOG_GAIN_RANGE, AUTO_DIGITAL_GAIN_RANGE.

Parameters
settings: The setting to retrieve.
sensors_id: The sensor identifier.
Returns
A tuple of (SENSORS_ERROR_CODE, min_val, max_val).

◆ set_camera_settings_min_max()

SENSORS_ERROR_CODE set_camera_settings_min_max (   self,
  settings,
  int,
  min_val,
  int,
  max_val,
  SensorDeviceIdentifier,
  sensors_id = None 
)

Sets the min/max values for the requested camera setting.


Works with AUTO_EXPOSURE_TIME_RANGE, AUTO_ANALOG_GAIN_RANGE, AUTO_DIGITAL_GAIN_RANGE.

Parameters
settings: The setting to set.
min_val: The minimum value.
max_val: The maximum value.
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE indicating success or failure.

◆ get_camera_settings_roi()

SENSORS_ERROR_CODE get_camera_settings_roi (   self,
  settings,
  Rect,
  roi,
  side = SIDE.BOTH,
  SensorDeviceIdentifier,
  sensors_id = None 
)

Returns the AEC_AGC_ROI for the specified camera setting.

Parameters
settings: The setting to retrieve (should be AEC_AGC_ROI).
roi: The Rect object to store the ROI.
side: The side (LEFT, RIGHT, or BOTH).
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE indicating success or failure.

◆ set_camera_settings_roi()

SENSORS_ERROR_CODE set_camera_settings_roi (   self,
  settings,
  Rect,
  roi,
  side = SIDE.BOTH,
  bool,
  reset = False,
  SensorDeviceIdentifier,
  sensors_id = None 
)

Sets the AEC_AGC_ROI for the specified camera setting.

Parameters
settings: The setting to set (should be AEC_AGC_ROI).
roi: The ROI to set.
side: The side (LEFT, RIGHT, or BOTH).
reset: Whether to reset the ROI to default.
sensors_id: The sensor identifier.
Returns
SENSORS_ERROR_CODE indicating success or failure.