Fusion Class Reference

Holds Fusion process data and functions. More...

Functions

def init (self, InitFusionParameters init_fusion_parameters)
 Initialize the fusion module with the requested parameters. More...
 
def close (self)
 Will deactivate all the fusion modules and free internal data.
 
FUSION_ERROR_CODE subscribe (self, CameraIdentifier uuid, CommunicationParameters communication_parameters, Transform pose)
 Set the specified camera as a data provider. More...
 
FUSION_ERROR_CODE unsubscribe (self, CameraIdentifier uuid)
 Remove the specified camera from data provider. More...
 
FUSION_ERROR_CODE update_pose (self, CameraIdentifier uuid, Transform pose)
 Updates the specified camera position inside fusion WORLD. More...
 
(FUSION_ERROR_CODE, FusionMetricsget_process_metrics (self)
 Get the metrics of the Fusion process, for the fused data as well as individual camera provider data. More...
 
dict get_sender_state (self)
 Returns the state of each connected data senders. More...
 
FUSION_ERROR_CODE process (self)
 Runs the main function of the Fusion, this trigger the retrieve and synchronization of all connected senders and updates the enabled modules. More...
 
FUSION_ERROR_CODE enable_body_tracking (self, BodyTrackingFusionParameters params)
 Enables the body tracking fusion module. More...
 
FUSION_ERROR_CODE retrieve_bodies (self, Bodies bodies, BodyTrackingFusionRuntimeParameters parameters, CameraIdentifier uuid=CameraIdentifier(0))
 Retrieves the body data, can be the fused data (default), or the raw data provided by a specific sender. More...
 
FUSION_ERROR_CODE retrieve_image (self, Mat py_mat, CameraIdentifier uuid, resolution=Resolution(0, 0))
 Returns the current sl.VIEW.LEFT of the specified camera, the data is synchronized. More...
 
FUSION_ERROR_CODE retrieve_measure (self, Mat py_mat, CameraIdentifier uuid, MEASURE measure, resolution=Resolution(0, 0))
 Returns the current measure of the specified camera, the data is synchronized. More...
 
def disable_body_tracking (self)
 Disable the body fusion tracking module.
 
FUSION_ERROR_CODE enable_positionnal_tracking (self, PositionalTrackingFusionParameters parameters)
 Enables positional tracking fusion module. More...
 
def ingest_gnss_data (self, GNSSData gnss_data)
 Ingest GNSS data from an external sensor into the fusion module. More...
 
def get_position (self, Pose camera_pose, REFERENCE_FRAME reference_frame=REFERENCE_FRAME.WORLD, CameraIdentifier uuid=CameraIdentifier(), POSITION_TYPE position_type=POSITION_TYPE.FUSION)
 Get the Fused Position referenced to the first camera subscribed. More...
 
def get_current_gnss_data (self, GNSSData gnss_data)
 Returns the last synchronized gnss data. More...
 
GNSS_FUSION_STATUS get_geo_pose (self, GeoPose pose)
 Returns the current GeoPose. More...
 
GNSS_FUSION_STATUS geo_to_camera (self, LatLng input, Pose output)
 Convert latitude / longitude into position in sl::Fusion coordinate system. More...
 
GNSS_FUSION_STATUS camera_to_geo (self, Pose input, GeoPose output)
 Convert a position in sl.Fusion coordinate system in global world coordinate. More...
 
def disable_positionnal_tracking (self)
 Disable the fusion positional tracking module. More...
 
tuple[GNSS_FUSION_STATUS, float, np.array] get_current_gnss_calibration_std (self)
 Get the current calibration uncertainty obtained during calibration process. More...
 
Transform get_geo_tracking_calibration (self)
 Get the calibration found between VIO and GNSS. More...
 

Detailed Description

Holds Fusion process data and functions.

Functions

◆ init()

def init (   self,
InitFusionParameters  init_fusion_parameters 
)

Initialize the fusion module with the requested parameters.

Parameters
init_parametersInitialization parameters.
Returns
ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an ERROR_CODE.

Referenced by InitParameters.__cinit__(), InitParameters.async_grab_camera_recovery(), InitParametersOne.async_grab_camera_recovery(), InitParameters.async_image_retrieval(), InitParameters.camera_disable_self_calib(), InitParameters.camera_fps(), InitParametersOne.camera_fps(), InitParameters.camera_image_flip(), InitParameters.camera_resolution(), InitParametersOne.camera_resolution(), InitParameters.coordinate_system(), InitParametersOne.coordinate_system(), InitParameters.coordinate_units(), InitParametersOne.coordinate_units(), InitParameters.depth_maximum_distance(), InitParameters.depth_minimum_distance(), InitParameters.depth_mode(), InitParameters.depth_stabilization(), InitParameters.enable_image_enhancement(), InitParameters.enable_image_validity_check(), InitParameters.enable_right_side_measure(), InitParameters.grab_compute_capping_fps(), InitParameters.load(), InitParameters.open_timeout_sec(), InitParametersOne.open_timeout_sec(), InitParameters.optional_opencv_calibration_file(), InitParameters.optional_settings_path(), InitParametersOne.optional_settings_path(), InitParameters.save(), InitParameters.sdk_gpu_id(), InitParameters.sdk_verbose(), InitParametersOne.sdk_verbose(), InitParameters.sdk_verbose_log_file(), InitParametersOne.sdk_verbose_log_file(), InitParameters.sensors_required(), InitParameters.set_from_camera_id(), InitParametersOne.set_from_camera_id(), InitParameters.set_from_serial_number(), InitParametersOne.set_from_serial_number(), InitParameters.set_from_stream(), InitParametersOne.set_from_stream(), InitParameters.set_from_svo_file(), InitParametersOne.set_from_svo_file(), InitParameters.svo_real_time_mode(), and InitParametersOne.svo_real_time_mode().

◆ subscribe()

FUSION_ERROR_CODE subscribe (   self,
CameraIdentifier  uuid,
CommunicationParameters  communication_parameters,
Transform  pose 
)

Set the specified camera as a data provider.

Parameters
uuidThe requested camera identifier.
communication_parametersThe communication parameters to connect to the camera.
poseThe World position of the camera, regarding the other camera of the setup.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ unsubscribe()

FUSION_ERROR_CODE unsubscribe (   self,
CameraIdentifier  uuid 
)

Remove the specified camera from data provider.

Parameters
uuidThe requested camera identifier.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ update_pose()

FUSION_ERROR_CODE update_pose (   self,
CameraIdentifier  uuid,
Transform  pose 
)

Updates the specified camera position inside fusion WORLD.

Parameters
uuidThe requested camera identifier.
poseThe World position of the camera, regarding the other camera of the setup.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ get_process_metrics()

(FUSION_ERROR_CODE, FusionMetrics) get_process_metrics (   self)

Get the metrics of the Fusion process, for the fused data as well as individual camera provider data.

Parameters
metricsThe process metrics.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.
The process metrics.

◆ get_sender_state()

dict get_sender_state (   self)

Returns the state of each connected data senders.

Returns
The individual state of each connected senders.

◆ process()

FUSION_ERROR_CODE process (   self)

Runs the main function of the Fusion, this trigger the retrieve and synchronization of all connected senders and updates the enabled modules.

Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ enable_body_tracking()

FUSION_ERROR_CODE enable_body_tracking (   self,
BodyTrackingFusionParameters  params 
)

Enables the body tracking fusion module.

Parameters
paramsStructure containing all specific parameters for body tracking fusion.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ retrieve_bodies()

FUSION_ERROR_CODE retrieve_bodies (   self,
Bodies  bodies,
BodyTrackingFusionRuntimeParameters  parameters,
CameraIdentifier   uuid = CameraIdentifier(0) 
)

Retrieves the body data, can be the fused data (default), or the raw data provided by a specific sender.

Parameters
bodiesThe fused bodies will be saved into this objects.
parametersBody detection runtime settings, can be changed at each detection.
uuidThe id of the sender.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ retrieve_image()

FUSION_ERROR_CODE retrieve_image (   self,
Mat  py_mat,
CameraIdentifier  uuid,
  resolution = Resolution(0,0) 
)

Returns the current sl.VIEW.LEFT of the specified camera, the data is synchronized.

Parameters
matthe CPU BGRA image of the requested camera.
resolutionthe requested resolution of the output image, can be lower or equal (default) to the original image resolution.
uuidIf set to a sender serial number (different from 0), this will retrieve the raw data provided by this sender.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ retrieve_measure()

FUSION_ERROR_CODE retrieve_measure (   self,
Mat  py_mat,
CameraIdentifier  uuid,
MEASURE  measure,
  resolution = Resolution(0,0) 
)

Returns the current measure of the specified camera, the data is synchronized.

Parameters
matthe CPU data of the requested camera.
resolutionthe requested resolution of the output image, can be lower or equal (default) to the original image resolution.
uuidThe id of the sender.
measuremeasure: the requested measure type, by default DEPTH (F32_C1).
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ enable_positionnal_tracking()

FUSION_ERROR_CODE enable_positionnal_tracking (   self,
PositionalTrackingFusionParameters  parameters 
)

Enables positional tracking fusion module.

Parameters
parametersA structure containing all the PositionalTrackingFusionParameters that define positional tracking fusion module.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ ingest_gnss_data()

def ingest_gnss_data (   self,
GNSSData  gnss_data 
)

Ingest GNSS data from an external sensor into the fusion module.

Parameters
gnss_dataThe current GNSS data to combine with the current positional tracking data.
Returns
FUSION_ERROR_CODE.SUCCESS if it goes as it should, otherwise it returns an FUSION_ERROR_CODE.

◆ get_position()

def get_position (   self,
Pose  camera_pose,
REFERENCE_FRAME   reference_frame = REFERENCE_FRAME.WORLD,
CameraIdentifier   uuid = CameraIdentifier(),
POSITION_TYPE   position_type = POSITION_TYPE.FUSION 
)

Get the Fused Position referenced to the first camera subscribed.

If uuid is specified then project position on the referenced camera.

Parameters
camera_poseWill contain the fused position referenced by default in world (world is given by the calibration of the cameras system).
reference_frameDefines the reference from which you want the pose to be expressed. Default : REFERENCE_FRAME.WORLD.
uuidIf set to a sender serial number (different from 0), this will retrieve position projected on the requested camera if position_type is equal to POSITION_TYPE.FUSION or raw sender position if position_type is equal to POSITION_TYPE.RAW.
position_typeSelect if the position should the fused position re-projected in the camera with uuid or if the position should be the raw position (without fusion) of camera with uui.
Returns
POSITIONAL_TRACKING_STATE is the current state of the tracking process.

◆ get_current_gnss_data()

def get_current_gnss_data (   self,
GNSSData  gnss_data 
)

Returns the last synchronized gnss data.

Parameters
out[out]: Last synchronized gnss data.
Returns
POSITIONAL_TRACKING_STATE is the current state of the tracking process.

◆ get_geo_pose()

GNSS_FUSION_STATUS get_geo_pose (   self,
GeoPose  pose 
)

Returns the current GeoPose.

Parameters
pose[out]: The current GeoPose.
Returns
GNSS_FUSION_STATUS is the current state of the tracking process.

◆ geo_to_camera()

GNSS_FUSION_STATUS geo_to_camera (   self,
LatLng  input,
Pose  output 
)

Convert latitude / longitude into position in sl::Fusion coordinate system.

Parameters
input[in]: The latitude / longitude to be converted in sl::Fusion coordinate system.
out[out]: Converted position in sl.Fusion coordinate system.
Returns
GNSS_FUSION_STATUS is the current state of the tracking process.

◆ camera_to_geo()

GNSS_FUSION_STATUS camera_to_geo (   self,
Pose  input,
GeoPose  output 
)

Convert a position in sl.Fusion coordinate system in global world coordinate.

Parameters
pose[in]: Position to convert in global world coordinate.
pose[out]: Converted position in global world coordinate.
Returns
GNSS_FUSION_STATUS is the current state of the tracking process.

◆ disable_positionnal_tracking()

def disable_positionnal_tracking (   self)

Disable the fusion positional tracking module.

The positional tracking is immediately stopped. If a file path is given, saveAreaMap(area_file_path) will be called asynchronously. See getAreaExportState() to get the exportation state.

◆ get_current_gnss_calibration_std()

tuple[GNSS_FUSION_STATUS, float, np.array] get_current_gnss_calibration_std (   self)

Get the current calibration uncertainty obtained during calibration process.

Returns
sl.GNSS_FUSION_STATUS representing current initialisation status.
Output yaw uncertainty.
Output position uncertainty.

◆ get_geo_tracking_calibration()

Transform get_geo_tracking_calibration (   self)

Get the calibration found between VIO and GNSS.

Returns
sl.Transform is the calibration found between VIO and GNSS during calibration process.