diff --git a/src/xrt/include/xrt/xrt_tracking.h b/src/xrt/include/xrt/xrt_tracking.h index 619f9809d..e048bd89f 100644 --- a/src/xrt/include/xrt/xrt_tracking.h +++ b/src/xrt/include/xrt/xrt_tracking.h @@ -133,6 +133,24 @@ struct xrt_imu_sample double ax, ay, az, wx, wy, wz; }; +/*! + * @interface xrt_imu_sink + * + * An object that is sent IMU samples. + * + * Similar to @ref xrt_frame_sink but the interface implementation must manage + * its own resources, not through a context graph. + * + * @todo Make @ref xrt_tracked_psmv and @ref xrt_tracked_psvr implement this + */ +struct xrt_imu_sink +{ + /*! + * Push an IMU sample into the sink + */ + void (*push_imu)(struct xrt_imu_sink *, struct xrt_imu_sample *sample); +}; + /*! * @interface xrt_tracked_psmv * @@ -244,6 +262,13 @@ struct xrt_tracked_hand * */ +//! @public @memberof xrt_imu_sink +static inline void +xrt_sink_push_imu(struct xrt_imu_sink *sink, struct xrt_imu_sample *sample) +{ + sink->push_imu(sink, sample); +} + //! @public @memberof xrt_tracked_psmv static inline void xrt_tracked_psmv_get_tracked_pose(struct xrt_tracked_psmv *psmv,