Skip to main content
Version: 1.0.0

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.

OutputMeaning
RectifyRectified BGR image
DifferenceDifference from the reference image
DepthDepth in millimeters
Marker2D / Marker3D2D/3D marker coordinates
Marker3DFlow3D mesh deformation vectors
Force / ForceNormDistributed 3D force and normal force
ForceResultantSix-axis resultant force
Mesh3DCurrent 3D mesh
Mesh3DInitInitial 3D mesh
TimeStampSensor timestamp in seconds

Lifecycle and utilities​

APIPurpose
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.