157#if defined(UINTPTR_MAX) && UINTPTR_MAX == 0xFFFFFFFFFFFFFFFFULL
159#if defined(__cplusplus)
160#define ENPOSE_STATIC_ASSERT(cond, msg) static_assert(cond, msg)
161#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
162#define ENPOSE_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
167#define ENPOSE_STATIC_ASSERT(cond, msg) extern int enpose_static_assert_unavailable
170ENPOSE_STATIC_ASSERT(
sizeof(
EnposeStatus) ==
sizeof(
int),
"EnposeStatus is a C int");
171ENPOSE_STATIC_ASSERT(
sizeof(
bool) == 1,
"bool crosses the ABI as one byte");
174#define ENPOSE_ASSERT_FIELD(type, field, off, width) \
175 ENPOSE_STATIC_ASSERT(offsetof(type, field) == (off), #type "." #field " offset"); \
176 ENPOSE_STATIC_ASSERT(sizeof(((type *)0)->field) == (width), #type "." #field " width")
178ENPOSE_STATIC_ASSERT(
sizeof(
EnposeDeviceInfo) == 56,
"EnposeDeviceInfo size");
183ENPOSE_STATIC_ASSERT(
sizeof(
EnposeMarkerPose) == 136,
"EnposeMarkerPose size");
195#undef ENPOSE_ASSERT_FIELD
197#undef ENPOSE_STATIC_ASSERT
EnposeStatus enpose_discover(EnposeDeviceInfo **out_devices, size_t *out_count)
Discover Enpose devices on the local network.
void enpose_pose_stream_free(EnposePoseStream *stream)
Disconnect and free a pose stream handle.
EnposePoseStream * enpose_pose_stream_connect(const char *ip, bool create_thread)
Connect a pose stream to the device at ip (an IPv4 string).
void enpose_marker_pose_array_free(EnposeMarkerPose *poses, size_t count)
Release an array returned by enpose_pose_stream_receive().
EnposeStatus enpose_pose_stream_receive(EnposePoseStream *stream, bool block, EnposeMarkerPose **out_poses, size_t *out_count)
Return the poses received from the stream.
EnposeStatus
Result code returned by the fallible functions.
Definition enpose_api.h:37
struct EnposePoseStream EnposePoseStream
Opaque handle to a live pose stream.
Definition enpose_api.h:87
void enpose_device_info_array_free(EnposeDeviceInfo *devices, size_t count)
Release an array returned by enpose_discover().
@ ENPOSE_ERR_PANIC
Internal error; the call was aborted cleanly.
Definition enpose_api.h:41
@ ENPOSE_OK
The call succeeded.
Definition enpose_api.h:38
@ ENPOSE_ERR_IO
An I/O error occurred (e.g.
Definition enpose_api.h:40
@ ENPOSE_ERR_INVALID_ARG
A required argument was null/invalid.
Definition enpose_api.h:39
C view of one discovered device.
Definition enpose_api.h:45
char ip[46]
Null-terminated IPv4 address string.
Definition enpose_api.h:46
uint32_t serial
Factory serial number.
Definition enpose_api.h:47
bool compatible
True if the device's protocol version matches.
Definition enpose_api.h:48
Pose of one tracked marker in world coordinates.
Definition enpose_api.h:66
double rotation[9]
Row-major 3x3 rotation, model frame to world.
Definition enpose_api.h:72
uint64_t timestamp
Microseconds since the device started.
Definition enpose_api.h:67
uint16_t marker_id
Marker identifier.
Definition enpose_api.h:68
double z
Definition enpose_api.h:71
uint8_t sensors
Number of sensors that contributed.
Definition enpose_api.h:75
double x
World position in meters (first model emitter).
Definition enpose_api.h:69
double position_rmse
RMS position error, in meters (units of x/y/z).
Definition enpose_api.h:73
double rotation_rmse
RMS rotation error (radians, axis-angle magnitude).
Definition enpose_api.h:74
uint8_t observed_emitters
Number of marker emitters (LEDs) whose measurements contributed to this pose.
Definition enpose_api.h:83
double y
Definition enpose_api.h:70