Monado OpenXR Runtime
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. More...
 
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. More...
 
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. More...
 
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 found in the buffer (as returned by m_relation_history_get_latest). More...
 
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. More...
 
uint32_t m_relation_history_get_size (const struct m_relation_history *rh)
 Returns the number of items in the history. More...
 
void m_relation_history_clear (struct m_relation_history *rh)
 Clears the history from all of the items. More...
 
void m_relation_history_destroy (struct m_relation_history **rh)
 Destroys an opaque relation_history object. More...
 

Data Fields

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

Related Functions

(Note that these are not member functions.)

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.

Referenced by u_tracked_imu_3dof_create().

◆ 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_estimate_motion()

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 found in the buffer (as returned by m_relation_history_get_latest).

Read-only on m_relation_history and in_relation. Copies in_relation->pose to out_relation->pose, and writes new flags and linear/angular velocities to out_relation->pose. OK to alias in_relation and out_relation.

◆ m_relation_history_get()

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.

Read-only operation - doesn't remove anything from the buffer or anything like that - you can call this as often as you want.

◆ 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.

◆ 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.

◆ 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

Friends And Related Function 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: