Monado OpenXR Runtime
Loading...
Searching...
No Matches
m_relation_history Struct Reference
Collaboration diagram for m_relation_history:

Public Member Functions

void m_relation_history_create (struct m_relation_history **rh)
 Creates an opaque relation_history object.
 
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.
 
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 if the input relation does not have valid velocity data.
 
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.
 
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.
 
uint32_t m_relation_history_get_size (const struct m_relation_history *rh)
 Returns the number of items in the history.
 
void m_relation_history_clear (struct m_relation_history *rh)
 Clears the history from all of the items.
 
void m_relation_history_destroy (struct m_relation_history **rh)
 Destroys an opaque relation_history object.
 

Data Fields

HistoryBuffer< struct relation_history_entry, BufLen > impl
 
os::Mutex mutex
 

Related Symbols

(Note that these are not member symbols.)

enum  m_relation_history_result
 Describes how the resulting space relation for the desired time stamp was generated. More...
 

Member Function Documentation

◆ m_relation_history_clear()

void m_relation_history_clear ( struct m_relation_history rh)

Clears the history from all of the items.

◆ m_relation_history_create()

void m_relation_history_create ( struct m_relation_history **  rh)

Creates an opaque relation_history object.

◆ m_relation_history_destroy()

void m_relation_history_destroy ( struct m_relation_history **  rh)

Destroys an opaque relation_history object.

References U_LOG_E.

◆ m_relation_history_get()

◆ m_relation_history_get_latest()

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.

Parameters
rhself
[out]out_time_nsPopulated with the latest report time, if any
[out]out_relationPopulated with the latest relation, if any
Returns
false if the history is empty.

References xrt::auxiliary::util::HistoryBuffer< T, MaxSize >::back(), and xrt::auxiliary::util::HistoryBuffer< T, MaxSize >::empty().

◆ m_relation_history_get_size()

uint32_t m_relation_history_get_size ( const struct m_relation_history rh)

Returns the number of items in the history.

References xrt::auxiliary::util::HistoryBuffer< T, MaxSize >::size().

◆ m_relation_history_push()

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.

If the history is full, it will also pop a pose out of the other side of the buffer.

Returns
false if the timestamp is earlier than the most recent timestamp already recorded

References xrt::auxiliary::util::HistoryBuffer< T, MaxSize >::back(), xrt::auxiliary::util::HistoryBuffer< T, MaxSize >::empty(), xrt::auxiliary::util::HistoryBuffer< T, MaxSize >::push_back(), and U_LOG_E.

◆ m_relation_history_push_with_motion_estimation()

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 if the input relation does not have valid velocity data.

If the history is full, it will also pop a pose out of the other side of the buffer.

Returns
false if the timestamp is earlier than the most recent timestamp already recorded

References time_ns_to_s().

Friends And Related Symbol Documentation

◆ m_relation_history_result

Describes how the resulting space relation for the desired time stamp was generated.


The documentation for this struct was generated from the following files: