InitSensorsParameters Struct Reference

Attributes

UNIT coordinate_units = sl::UNIT::MILLIMETER
 This parameter allows you to select the unit to be used for all metric values of the SDK (depth, point cloud, tracking, mesh, and others). More...
 
COORDINATE_SYSTEM coordinate_system = sl::COORDINATE_SYSTEM::IMAGE
 Positional tracking, point clouds and many other features require a given COORDINATE_SYSTEM to be used as reference. This parameter allows you to select the COORDINATE_SYSTEM used by the Camera to return its measures. More...
 
bool output_performance_metrics = false
 It allows users to extract some stats of the Fusion API like drop frame of each camera, latency, etc... More...
 
int verbose = 0
 Enable the verbosity mode of the SDK. More...
 
CUdevice sdk_gpu_id = -1
 NVIDIA graphics card to use. More...
 
CUcontext sdk_cuda_ctx = CUcontext()
 CUcontext to be used. More...
 
sl::Resolution maximum_working_resolution = sl::Resolution(0, 0)
 Set a maximum size for all SDK output, like retrieveImage and retrieveMeasure functions. More...
 
SENSORS_EXECUTION_MODE execution_mode = SENSORS_EXECUTION_MODE::EAGER
 Execution mode for the Sensors pipeline. More...
 
SENSORS_SYNC_POLICY sync_policy = SENSORS_SYNC_POLICY::NONE
 Synchronization policy for pipelined mode retrieval. More...
 
sl::Timestamp sync_tolerance = sl::Timestamp::fromMilliseconds(50)
 Maximum timestamp difference for synchronized retrieval in pipelined mode. More...
 

Variables

◆ coordinate_units

UNIT coordinate_units = sl::UNIT::MILLIMETER

This parameter allows you to select the unit to be used for all metric values of the SDK (depth, point cloud, tracking, mesh, and others).

Default : UNIT::MILLIMETER

◆ coordinate_system

Positional tracking, point clouds and many other features require a given COORDINATE_SYSTEM to be used as reference. This parameter allows you to select the COORDINATE_SYSTEM used by the Camera to return its measures.

This defines the order and the direction of the axis of the coordinate system.
Default : COORDINATE_SYSTEM::IMAGE

◆ output_performance_metrics

bool output_performance_metrics = false

It allows users to extract some stats of the Fusion API like drop frame of each camera, latency, etc...

◆ verbose

int verbose = 0

Enable the verbosity mode of the SDK.

◆ sdk_gpu_id

CUdevice sdk_gpu_id = -1

NVIDIA graphics card to use.

By default the SDK will use the most powerful NVIDIA graphics card found.
However, when running several applications, or using several cameras at the same time, splitting the load over available GPUs can be useful.
This parameter allows you to select the GPU used by the sl::Camera using an ID from 0 to n-1 GPUs in your PC.
Default: -1

Note
A non-positive value will search for all CUDA capable devices and select the most powerful.

◆ sdk_cuda_ctx

CUcontext sdk_cuda_ctx = CUcontext()

CUcontext to be used.

If your application uses another CUDA-capable library, giving its CUDA context to the ZED SDK can be useful when sharing GPU memories.
This parameter allows you to set the CUDA context to be used by the ZED SDK.
Leaving this parameter empty asks the SDK to create its own context.
Default: (empty)

Note
When creating you own CUDA context, you have to define the device you will use. Do not forget to also specify it on sdk_gpu_id.
On Jetson, you have to set the flag CU_CTX_SCHED_YIELD, during CUDA context creation.
You can also let the SDK create its own context, and use sl::Camera::getCUDAContext() to use it.

◆ maximum_working_resolution

sl::Resolution maximum_working_resolution = sl::Resolution(0, 0)

Set a maximum size for all SDK output, like retrieveImage and retrieveMeasure functions.

This will override the default (0,0) and instead of outputting native image size sl::Mat, the ZED SDK will take this size as default. A custom lower size can also be used at runtime, but not bigger. This is used for internal optimization of compute and memory allocations.

The default is similar to previous versions where (0,0) meant the native image size.

Note
If maximum_working_resolution dimensions are lower than 64, it will be interpreted as a dividing scale factor;

◆ execution_mode

SENSORS_EXECUTION_MODE execution_mode = SENSORS_EXECUTION_MODE::EAGER

Execution mode for the Sensors pipeline.

Controls whether process() runs synchronously (EAGER) or spawns a pipelined producer/consumer architecture with dedicated worker threads (PIPELINED).

In PIPELINED mode:

  • All modules (Object Detection, Body Tracking, Positional Tracking) must be enabled BEFORE first process()
  • The first process() + retrieve*() cycle is the setup phase: it runs synchronously while learning which outputs the user needs (device + view/measure + resolution + memory type)
  • On the next process() call, dedicated worker threads are spawned (one per device). Each worker continuously calls grab() at the device's native frame rate and writes into triple-buffered outputs (lock-free mailbox)
  • Subsequent process() calls return immediately (non-blocking); they only check worker health
  • retrieve*() reads from the latest completed buffer
  • Use sync_policy to control temporal alignment across devices


Default: SENSORS_EXECUTION_MODE::EAGER

Note
Can be overridden by env var ZED_SDK_SENSORS_EXECUTION_MODE ("pipelined"/"eager").
Warning
Enabling PIPELINED mode changes the threading model — each device gets its own worker thread.
Mat returned from retrieve*() in PIPELINED mode are shallow copies (read-only). Do not modify them.

◆ sync_policy

SENSORS_SYNC_POLICY sync_policy = SENSORS_SYNC_POLICY::NONE

Synchronization policy for pipelined mode retrieval.

Controls how data from devices running at different frequencies is synchronized:

  • NONE: Each retrieve returns the device's latest data (no temporal alignment)
  • CLOSEST: Align all devices to a common sync timestamp (oldest "latest")
  • DROP_STALE: Same as CLOSEST, but returns error if any device data exceeds sync_tolerance


Default: SENSORS_SYNC_POLICY::NONE

Note
Only effective when execution_mode is PIPELINED; EAGER mode has no per-device buffers/queues, so the SDK cannot apply cross-device temporal alignment or stale-frame rejection.

◆ sync_tolerance

Maximum timestamp difference for synchronized retrieval in pipelined mode.

When sync_policy is CLOSEST or DROP_STALE, frames with timestamp difference greater than this value from the sync timestamp are considered stale.


Default: 50ms

Note
Only effective when execution_mode is PIPELINED and sync_policy != NONE (EAGER mode does not maintain the buffered history needed for sync alignment).