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,
)
| Parameter | Description |
|---|---|
cam_id | Local camera index or sensor serial number |
config_path | Local configuration file or directory |
mac_addr | Connects to a remote sensor on a compute unit |
infer_mode | Inference mode |
rectify_size | Overrides the rectified image dimensions |
raw_size | Overrides the raw image dimensions |
disable_infer | Whether to disable the inference pipeline |
seeds | Configuration merged before context construction |
overrides | Final parameter overrides applied after configuration loading |
check_serial | Whether to enable sensor serial-number validation |
hook_modules | Extension hook modules to preload |
disable_cache | Whether 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 type | Meaning |
|---|---|
Rectify | Rectified BGR image |
Difference | Difference image against the reference |
Depth | Depth map in mm |
Marker2D / Marker3D | 2D/3D marker positions |
Marker3DFlow | 3D marker displacement |
Force / ForceNorm | Distributed 3D force and normal force |
ForceResultant | Six-axis resultant force vector |
Mesh3D | Current 3D mesh |
Mesh3DFlow | 3D mesh deformation |
Mesh3DInit | Initial 3D mesh |
TimeStamp | Sensor timestamp (seconds) |
Lifecycle and helper methods
| Method | Description |
|---|---|
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.