Skip to main content

API Reference

Sensor.create​

Sensor.create(
cam_id=0,
config_path=None,
mac_addr=None,
infer_mode=None,
rectify_size=None,
raw_size=None,
disable_infer=None,
seeds=None,
overrides=None,
check_serial=True,
hook_modules=None,
disable_cache=None,
)
ParameterDescription
cam_idLocal camera index or sensor serial number
config_pathLocal configuration file or directory
mac_addrConnects to a remote sensor on a compute unit
infer_modeInference mode
rectify_sizeOverrides the rectified image dimensions
raw_sizeOverrides the raw image dimensions
disable_inferWhether to disable the inference pipeline
seedsConfiguration merged before context construction
overridesFinal parameter overrides applied after configuration loading
check_serialWhether to enable sensor serial-number validation
hook_modulesExtension hook modules to preload
disable_cacheWhether to disable the device-configuration cache

selectSensorInfo​

rectify, depth, force = sensor.selectSensorInfo(
Sensor.OutputType.Rectify,
Sensor.OutputType.Depth,
Sensor.OutputType.Force,
)

The call synchronously acquires or computes the requested data. When one output is requested, the corresponding result is returned directly; when multiple outputs are requested, they are returned as a tuple in argument order. Data acquisition or computation failures raise an exception. Request all outputs needed from the same frame in a single call to avoid repeated acquisition.

Output typeMeaning
RectifyRectified BGR image
DifferenceDifference image against the reference
DepthDepth map in mm
Marker2D / Marker3D2D/3D marker positions
Marker3DFlow3D marker displacement
Force / ForceNormDistributed 3D force and normal force
ForceResultantSix-axis resultant force vector
Mesh3DCurrent 3D mesh
Mesh3DFlow3D mesh deformation
Mesh3DInitInitial 3D mesh
TimeStampSensor timestamp (seconds)

Lifecycle and helper methods​

MethodDescription
Sensor.scanSerialNumber()Scan the serial-number-to-camera-ID mapping
sensor.getCameraID()Get the current camera ID
sensor.calibrateSensor()Refresh the reference image when unloaded
sensor.exportRuntimeConfig(save_dir, binary=False)Export runtime_<serial>; returns bytes directly when binary=True
Sensor.createSolver(runtime_path)Create an offline solver from a runtime
sensor.release()Close the device and release resources
call_service(service, action, *args, **kwargs)Call a compute-unit service
Remote calls

The underlying service name and action used by call_service are provided by the compute-unit firmware. Use EzROS to query the device and available services before calling a specific action.