Monado OpenXR Runtime
m_relation_history.cpp File Reference

Small utility for keeping track of the history of an xrt_space_relation, ie. More...

#include "m_relation_history.h"
#include "math/m_api.h"
#include "math/m_predict.h"
#include "math/m_vec3.h"
#include "os/os_time.h"
#include "util/u_logging.h"
#include "util/u_trace_marker.h"
#include "xrt/xrt_defines.h"
#include "os/os_threading.h"
#include "util/u_template_historybuf.hpp"
#include <memory>
#include <algorithm>
#include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <mutex>
Include dependency graph for m_relation_history.cpp:

Data Structures

struct  relation_history_entry
 
struct  m_relation_history
 

Functions

void m_relation_history_create (struct m_relation_history **rh_ptr)
 
bool m_relation_history_push (struct m_relation_history *rh, struct xrt_space_relation const *in_relation, int64_t timestamp)
 
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)
 
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)
 
bool m_relation_history_get_latest (const struct m_relation_history *rh, int64_t *out_time_ns, struct xrt_space_relation *out_relation)
 
uint32_t m_relation_history_get_size (const struct m_relation_history *rh)
 
void m_relation_history_clear (struct m_relation_history *rh)
 
void m_relation_history_destroy (struct m_relation_history **rh_ptr)
 

Variables

static constexpr size_t BufLen = 4096
 

Detailed Description

Small utility for keeping track of the history of an xrt_space_relation, ie.

for knowing where a HMD or controller was in the past.

Author
Moses Turner moses.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Rylie Pavlik rylie.nosp@m..pav.nosp@m.lik@c.nosp@m.olla.nosp@m.bora..nosp@m.com
Korcan Hussein korca.nosp@m.n.hu.nosp@m.ssein.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ 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 
)
Todo:
Does interpolating the velocities make any sense?

Referenced by Device::get_pose().