xrt: Add xrt_imu_sink interface

This commit is contained in:
Mateo de Mayo 2021-08-20 20:21:28 -03:00 committed by Jakob Bornecrantz
parent 92fc2784e1
commit 00a2f891a2

View file

@ -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,