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:

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:

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: RuntimeError

Raised when a call into the Enpose library fails.

class enpose_api.DeviceInfo(ip, serial, compatible)[source]

Bases: object

One device discovered on the local network.

Parameters:
ip: str

Device IPv4 address.

serial: int

Factory serial number.

compatible: bool

True if the device’s protocol version matches this binding.

class enpose_api.MarkerPose(timestamp, marker_id, x, y, z, rotation, position_rmse, rotation_rmse, sensors)[source]

Bases: object

Pose of one tracked marker in world coordinates.

Units: x/y/z and position_rmse are in meters; rotation_rmse is in radians.

Parameters:
timestamp: int

Microseconds since the device started.

marker_id: int

Marker identifier.

x: float

World-space X position in meters (of the first model emitter).

y: float

World-space Y position in meters.

z: float

World-space Z position in meters.

rotation: tuple

Row-major 3x3 rotation (9 values), model frame to world.

position_rmse: float

RMS position error in meters (the same units as x/y/z).

rotation_rmse: float

RMS rotation error (radians, axis-angle magnitude).

sensors: int

Number of sensors that contributed to this pose.

class enpose_api.PoseStream(target, create_thread=True)[source]

Bases: object

A 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 block is false (the default), returns the poses that have arrived since the previous call (empty if none) without waiting. When block is 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. Raises Error on an unrecoverable failure.

Parameters:

block (bool)

Return type:

list

close()[source]

Disconnect and release the stream. Idempotent.

Return type:

None

enpose_api.discover()[source]

Discover Enpose devices on the local network.

Returns a list of DeviceInfo (empty if none are found). Raises Error on an I/O failure.

Return type:

list