83 int64_t at_timestamp_ns,
115 int64_t *out_time_ns,
161 typedef m_relation_history_result Result;
170 RelationHistory(
struct m_relation_history_filters *motion_vector_filters)
noexcept { m_relation_history_create(&mPtr, motion_vector_filters); }
171 ~RelationHistory() { m_relation_history_destroy(&mPtr); }
175 RelationHistory(RelationHistory
const &) =
delete;
176 RelationHistory(RelationHistory &&) =
delete;
178 operator=(RelationHistory
const &) =
delete;
180 operator=(RelationHistory &&) =
delete;
189 return m_relation_history_push(mPtr, &relation, ts);
207 return m_relation_history_get_latest(mPtr, out_time_ns, out_relation);
214 size() const noexcept
216 return m_relation_history_get_size(mPtr);
225 return m_relation_history_clear(mPtr);
Header for a "One Euro Filter" implementation.
enum m_relation_history_result m_relation_history_get(const struct m_relation_history *rh, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Definition: m_relation_history.cpp:93
@ M_RELATION_HISTORY_RESULT_INTERPOLATED
The desired timestamp was between two entries.
Definition: m_relation_history.h:42
@ M_RELATION_HISTORY_RESULT_PREDICTED
The desired timestamp was newer than the most recent entry.
Definition: m_relation_history.h:43
@ M_RELATION_HISTORY_RESULT_REVERSE_PREDICTED
The desired timestamp was older than the oldest entry.
Definition: m_relation_history.h:44
@ M_RELATION_HISTORY_RESULT_INVALID
The supplied timestamp was invalid (0) or buffer was empty.
Definition: m_relation_history.h:40
@ M_RELATION_HISTORY_RESULT_EXACT
The exact desired timestamp was found.
Definition: m_relation_history.h:41
C++-only functionality in the Math helper library.
Definition: m_documentation.hpp:15
static Eigen::Map< const Eigen::Vector3f > position(const struct xrt_pose &pose)
Return a Eigen type wrapping a pose's position (const).
Definition: m_eigen_interop.hpp:217
static Eigen::Map< const Eigen::Quaternionf > orientation(const struct xrt_pose &pose)
Return a Eigen type wrapping a pose's orientation (const).
Definition: m_eigen_interop.hpp:199
One Euro filter for a unit quaternion (used as 3D rotation).
Definition: m_filter_one_euro.h:117
One Euro filter for a 3D float measurement.
Definition: m_filter_one_euro.h:99
Definition: m_relation_history.h:48
Definition: m_relation_history.cpp:50
void m_relation_history_destroy(struct m_relation_history **rh)
Destroys an opaque relation_history object.
Definition: m_relation_history.cpp:306
m_relation_history_result
Describes how the resulting space relation for the desired time stamp was generated.
Definition: m_relation_history.h:39
void m_relation_history_create(struct m_relation_history **rh, struct m_relation_history_filters *motion_vector_filters)
Creates an opaque relation_history object.
Definition: m_relation_history.cpp:59
uint32_t m_relation_history_get_size(const struct m_relation_history *rh)
Returns the number of items in the history.
Definition: m_relation_history.cpp:292
bool m_relation_history_push(struct m_relation_history *rh, struct xrt_space_relation const *in_relation, int64_t timestamp)
Pushes a new pose to the history.
Definition: m_relation_history.cpp:69
bool m_relation_history_estimate_motion(struct m_relation_history *rh, const struct xrt_space_relation *in_relation, int64_t timestamp, struct xrt_space_relation *out_relation)
Estimates the movement (velocity and angular velocity) of a new relation based on the latest relation...
Definition: m_relation_history.cpp:193
void m_relation_history_clear(struct m_relation_history *rh)
Clears the history from all of the items.
Definition: m_relation_history.cpp:299
enum m_relation_history_result m_relation_history_get(const struct m_relation_history *rh, int64_t at_timestamp_ns, struct xrt_space_relation *out_relation)
Interpolates or extrapolates to the desired timestamp.
Definition: m_relation_history.cpp:93
bool m_relation_history_get_latest(const struct m_relation_history *rh, int64_t *out_time_ns, struct xrt_space_relation *out_relation)
Get the latest report in the buffer, if any.
Definition: m_relation_history.cpp:278
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:659
static const cJSON * get(const cJSON *json, const char *f)
Less typing.
Definition: u_json.c:36
Common defines and enums for XRT.