XenseSDK API Reference
Sensor.create
Sensor.create(
cam_id=0,
config_path=None,
use_gpu=True,
api=None,
infer_size=(144, 240),
check_serial=True,
rectify_size=None,
ip_address=None,
video_path=None,
raw_size=None,
mac_addr=None,
)
cam_id may be a camera index, serial number, or video source. config_path can point to a directory containing calibration configurations keyed by serial number. rectify_size and raw_size control rectified-image and raw-image dimensions respectively. For remote connections, prefer mac_addr, which maps to the remote compute-unit address.
selectSensorInfo
rectify, depth, force = sensor.selectSensorInfo(
Sensor.OutputType.Rectify,
Sensor.OutputType.Depth,
Sensor.OutputType.Force,
)
The number and order of return values match the arguments. A value may be None before that output is available. Request related outputs in one call so they are computed from the same frame.
| Output | Meaning |
|---|---|
Rectify | Rectified BGR image |
Difference | Difference from the reference image |
Depth | Depth in millimeters |
Marker2D / Marker3D | 2D/3D marker coordinates |
Marker3DFlow | 3D mesh deformation vectors |
Force / ForceNorm | Distributed 3D force and normal force |
ForceResultant | Six-axis resultant force |
Mesh3D | Current 3D mesh |
Mesh3DInit | Initial 3D mesh |
TimeStamp | Sensor timestamp in seconds |
Lifecycle and utilities
| API | Purpose |
|---|---|
Sensor.scanSerialNumber() | Scan serial-number-to-camera-ID mappings |
sensor.getCameraID() | Read the current camera ID |
sensor.calibrateSensor() | Refresh the unloaded reference image |
sensor.exportRuntimeConfig(save_dir, binary=False) | Export runtime_<serial>; return bytes directly when binary=True |
Sensor.createSolver(runtime_path) | Create an offline solver |
sensor.release() | Close the device and release resources |
call_service(service, action, *args, **kwargs) | Call a service on a compute unit |
Remote calls
The underlying service name and action for call_service are provided by the compute-unit firmware. Use EzROS to query devices and services before calling a specific action.