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, observed_emitters)[source]¶
Bases:
objectPose of one tracked marker in world coordinates.
Units:
x/y/zandposition_rmseare in meters;rotation_rmseis in radians.The world frame is right-handed, and where its origin and axes lie is decided by the device’s extrinsics calibration. By default it is the reference sensor’s optical frame – origin at that sensor,
+Xto its right,+Ydown and+Zinto the scene, so a marker in front of the device has a positivez. Calibrating against a measured origin puts the frame there instead, and measuring a ground plane makes that planez = 0with+Zpointing up out of it. Treat the axes as a property of the calibration rather than a fixed convention: recalibrating a device can move the frame.- Parameters:
- observed_emitters: int¶
Number of marker emitters (LEDs) that contributed to this pose.
The standard marker carries four. A lower count means some were occluded or could not be decoded, so the pose was fitted from a reduced set of points and is correspondingly biased;
0means the pose was carried purely by prediction. Filter on this value to reject poses computed from a partial view.
- 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: