From 88bd7a669d74699a857cb900db76f0b9995ad9fc Mon Sep 17 00:00:00 2001 From: Mateo de Mayo <mateo.demayo@collabora.com> Date: Thu, 3 Mar 2022 17:10:15 -0300 Subject: [PATCH] xrt: Add pose sink interface --- src/xrt/include/xrt/xrt_tracking.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/xrt/include/xrt/xrt_tracking.h b/src/xrt/include/xrt/xrt_tracking.h index 2887eef4c..9e7b24a95 100644 --- a/src/xrt/include/xrt/xrt_tracking.h +++ b/src/xrt/include/xrt/xrt_tracking.h @@ -145,7 +145,7 @@ struct xrt_imu_sample /*! * @interface xrt_imu_sink * - * An object that is sent IMU samples. + * An object to send IMU samples to. * * Similar to @ref xrt_frame_sink but the interface implementation must manage * its own resources, not through a context graph. @@ -160,6 +160,16 @@ struct xrt_imu_sink void (*push_imu)(struct xrt_imu_sink *, struct xrt_imu_sample *sample); }; +/*! + * @interface xrt_pose_sink + * + * An object to send pairs of timestamps and poses to. @see xrt_imu_sink. + */ +struct xrt_pose_sink +{ + void (*push_pose)(struct xrt_pose_sink *, timepoint_ns ts, struct xrt_pose *pose); +}; + /*! * Container of pointers to sinks that could be used for a SLAM system. Sinks * are considered disabled if they are null. @@ -307,6 +317,13 @@ xrt_sink_push_imu(struct xrt_imu_sink *sink, struct xrt_imu_sample *sample) sink->push_imu(sink, sample); } +//! @public @memberof xrt_pose_sink +static inline void +xrt_sink_push_pose(struct xrt_pose_sink *sink, timepoint_ns ts, struct xrt_pose *pose) +{ + sink->push_pose(sink, ts, pose); +} + //! @public @memberof xrt_tracked_psmv static inline void xrt_tracked_psmv_get_tracked_pose(struct xrt_tracked_psmv *psmv,