75 int64_t at_timestamp_ns,
107 int64_t *out_time_ns,
153 typedef m_relation_history_result Result;
162 RelationHistory() noexcept { m_relation_history_create(&mPtr); }
163 ~RelationHistory() { m_relation_history_destroy(&mPtr); }
167 RelationHistory(RelationHistory
const &) =
delete;
168 RelationHistory(RelationHistory &&) =
delete;
170 operator=(RelationHistory
const &) =
delete;
172 operator=(RelationHistory &&) =
delete;
181 return m_relation_history_push(mPtr, &relation, ts);
199 return m_relation_history_get_latest(mPtr, out_time_ns, out_relation);
206 size() const noexcept
208 return m_relation_history_get_size(mPtr);
217 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:84
@ 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:46
void m_relation_history_destroy(struct m_relation_history **rh)
Destroys an opaque relation_history object.
Definition: m_relation_history.cpp:259
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:245
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:60
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:184
void m_relation_history_clear(struct m_relation_history *rh)
Clears the history from all of the items.
Definition: m_relation_history.cpp:252
void m_relation_history_create(struct m_relation_history **rh)
Creates an opaque relation_history object.
Definition: m_relation_history.cpp:53
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:84
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:231
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:657
static const cJSON * get(const cJSON *json, const char *f)
Less typing.
Definition: u_json.c:36
Common defines and enums for XRT.