104 int64_t at_timestamp_ns,
120 int64_t *out_time_ns,
166 typedef m_relation_history_result Result;
175 RelationHistory() noexcept { m_relation_history_create(&mPtr); }
176 ~RelationHistory() { m_relation_history_destroy(&mPtr); }
180 RelationHistory(RelationHistory
const &) =
delete;
181 RelationHistory(RelationHistory &&) =
delete;
183 operator=(RelationHistory
const &) =
delete;
185 operator=(RelationHistory &&) =
delete;
194 return m_relation_history_push(mPtr, &relation, ts);
212 return m_relation_history_get_latest(mPtr, out_time_ns, out_relation);
219 size() const noexcept
221 return m_relation_history_get_size(mPtr);
230 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:180
@ 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:50
bool m_relation_history_push_or_update(struct m_relation_history *rh, struct xrt_space_relation const *in_relation, int64_t timestamp)
Pushes a new pose to the history, or updates an existing one.
Definition m_relation_history.cpp:162
void m_relation_history_destroy(struct m_relation_history **rh)
Destroys an opaque relation_history object.
Definition m_relation_history.cpp:327
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:313
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:146
void m_relation_history_clear(struct m_relation_history *rh)
Clears the history from all of the items.
Definition m_relation_history.cpp:320
void m_relation_history_create(struct m_relation_history **rh)
Creates an opaque relation_history object.
Definition m_relation_history.cpp:139
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:280
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:299
A relation with two spaces, includes velocity and acceleration.
Definition xrt_defines.h:713
Common defines and enums for XRT.