Enpose API — Python¶
Pythonic wrapper over the enpose_api C ABI using cffi in ABI (dlopen) mode: it loads the prebuilt
shared library at run time, so no C compiler or build step is needed.
It covers the full client workflow:
discover()finds Enpose devices on the local network.PoseStreamconnects to a device and yields liveMarkerPoseupdates.
API reference¶
Python binding for the Enpose 6-DoF tracking API.
A thin, Pythonic wrapper over the enpose_api C ABI using cffi in ABI (dlopen) mode: it loads the prebuilt
shared library at run time, so no C compiler or build step is needed — only the
library and cffi (pip install cffi).
It mirrors the other bindings and covers the full client workflow:
discover()finds Enpose devices on the local network.PoseStreamconnects to a device and yields liveMarkerPoseupdates.
Locating the shared library: by default the loader searches a lib/ directory
alongside the unpacked SDK and then the system loader path (LD_LIBRARY_PATH
etc.). Set ENPOSE_API_LIB to an explicit path to override.
- exception enpose_api.Error[source]¶
Bases:
RuntimeErrorRaised when a call into the Enpose library fails.
- class enpose_api.DeviceInfo(ip, serial, compatible)[source]¶
Bases:
objectOne device discovered on the local network.
- class enpose_api.MarkerPose(timestamp, marker_id, x, y, z, rotation, position_rmse, rotation_rmse, sensors)[source]¶
Bases:
objectPose of one tracked marker in world coordinates.
Units:
x/y/zandposition_rmseare in meters;rotation_rmseis in radians.- Parameters:
- class enpose_api.PoseStream(target, create_thread=True)[source]¶
Bases:
objectA live pose stream from one device.
Closes itself when used as a context manager or garbage-collected; call
close()to release it eagerly.- Parameters:
create_thread (bool)
- receive(block=False)[source]¶
Return poses received from the stream.
When
blockis false (the default), returns the poses that have arrived since the previous call (empty if none) without waiting. Whenblockis true, waits for at least one pose update, up to a 3-second timeout — so the result is still empty if none arrives in that window. RaisesErroron an unrecoverable failure.
- enpose_api.discover()[source]¶
Discover Enpose devices on the local network.
Returns a list of
DeviceInfo(empty if none are found). RaisesErroron an I/O failure.- Return type: