89 int64_t at_timestamp_ns,
105 int64_t *out_time_ns,
151 typedef m_relation_history_result Result;
160 RelationHistory() noexcept { m_relation_history_create(&mPtr); }
161 ~RelationHistory() { m_relation_history_destroy(&mPtr); }
165 RelationHistory(RelationHistory
const &) =
delete;
166 RelationHistory(RelationHistory &&) =
delete;
168 operator=(RelationHistory
const &) =
delete;
170 operator=(RelationHistory &&) =
delete;
179 return m_relation_history_push(mPtr, &relation, ts);
197 return m_relation_history_get_latest(mPtr, out_time_ns, out_relation);
204 size() const noexcept
206 return m_relation_history_get_size(mPtr);
215 return m_relation_history_clear(mPtr);
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:87
@ M_RELATION_HISTORY_RESULT_INTERPOLATED
The desired timestamp was between two entries.
Definition: m_relation_history.h:40
@ M_RELATION_HISTORY_RESULT_PREDICTED
The desired timestamp was newer than the most recent entry.
Definition: m_relation_history.h:41
@ M_RELATION_HISTORY_RESULT_REVERSE_PREDICTED
The desired timestamp was older than the oldest entry.
Definition: m_relation_history.h:42
@ M_RELATION_HISTORY_RESULT_INVALID
The supplied timestamp was invalid (0) or buffer was empty.
Definition: m_relation_history.h:38
@ M_RELATION_HISTORY_RESULT_EXACT
The exact desired timestamp was found.
Definition: m_relation_history.h:39
C++-only functionality in the Math helper library.
Definition: m_documentation.hpp:15
Definition: m_relation_history.cpp:49
void m_relation_history_destroy(struct m_relation_history **rh)
Destroys an opaque relation_history object.
Definition: m_relation_history.cpp:266
m_relation_history_result
Describes how the resulting space relation for the desired time stamp was generated.
Definition: m_relation_history.h:37
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:252
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:63
void m_relation_history_clear(struct m_relation_history *rh)
Clears the history from all of the items.
Definition: m_relation_history.cpp:259
void m_relation_history_create(struct m_relation_history **rh)
Creates an opaque relation_history object.
Definition: m_relation_history.cpp:56
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:87
bool m_relation_history_push_with_motion_estimation(struct m_relation_history *rh, struct xrt_space_relation const *in_relation, int64_t timestamp)
Pushes a new pose to the history, estimating linear and angular velocity based on the previous entry.
Definition: m_relation_history.cpp:216
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:238
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:670
static const cJSON * get(const cJSON *json, const char *f)
Less typing.
Definition: u_json.c:36
Common defines and enums for XRT.