Record, Export, and Replay
Record online data
If you only need to save structured data supported by the SDK, use the recorder API:
from xensesdk import Sensor
sensor = Sensor.create("OP000064")
sensor.startSaveSensorInfo(
"./recording",
[Sensor.OutputType.Rectify, Sensor.OutputType.Depth],
)
try:
for _ in range(300):
sensor.selectSensorInfo(Sensor.OutputType.Rectify)
finally:
sensor.stopSaveSensorInfo()
sensor.release()
Passing None as the second argument records all output types. Check available disk space and the target frame rate before long sessions.
Export a runtime
sensor.exportRuntimeConfig("./recording")
# creates ./recording/runtime_<sensor serial number>
The encrypted runtime contains the configuration and reference image. Do not edit it manually or commit it to a public repository.
Replay offline
solver = Sensor.createSolver("./recording/runtime_OP000064")
try:
depth, force = solver.selectSensorInfo(
Sensor.OutputType.Depth,
Sensor.OutputType.Force,
rectify_image=rectify_image,
)
finally:
solver.release()
Offline mode is suitable for regression testing and algorithm tuning. For reproducible results, preserve input frame order and record the SDK, model, and configuration versions.