Monado OpenXR Runtime
t_hand_tracking_async.c File Reference

Camera based hand tracking driver code. More...

#include "os/os_threading.h"
#include "math/m_space.h"
#include "math/m_relation_history.h"
#include "util/u_var.h"
#include "util/u_misc.h"
#include "util/u_debug.h"
#include "util/u_logging.h"
#include "util/u_trace_marker.h"
#include "tracking/t_hand_tracking.h"
Include dependency graph for t_hand_tracking_async.c:

Data Structures

struct  ht_async_impl
 A synchronous to asynchronous wrapper around the hand-tracker code. More...
 

Functions

static struct ht_async_implht_async_impl (struct t_hand_tracking_async *base)
 
static void * ht_async_mainloop (void *ptr)
 
static void ht_async_receive_left (struct xrt_frame_sink *sink, struct xrt_frame *frame)
 
static void ht_async_receive_right (struct xrt_frame_sink *sink, struct xrt_frame *frame)
 
static void ht_async_break_apart (struct xrt_frame_node *node)
 
static void ht_async_destroy (struct xrt_frame_node *node)
 
static void ht_async_get_hand (struct t_hand_tracking_async *ht_async, enum xrt_input_name name, uint64_t desired_timestamp_ns, struct xrt_hand_joint_set *out_value, uint64_t *out_timestamp_ns)
 
struct t_hand_tracking_asynct_hand_tracking_async_default_create (struct xrt_frame_context *xfctx, struct t_hand_tracking_sync *sync)
 

Detailed Description

Camera based hand tracking driver code.

Author
Moses Turner moses.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ ht_async_get_hand()

static void ht_async_get_hand ( struct t_hand_tracking_async ht_async,
enum xrt_input_name  name,
uint64_t  desired_timestamp_ns,
struct xrt_hand_joint_set out_value,
uint64_t *  out_timestamp_ns 
)
static
Todo:
We could slightly reduce the total number of transforms by putting some of this in ht_async_mainloop

◆ t_hand_tracking_async_default_create()

struct t_hand_tracking_async* t_hand_tracking_async_default_create ( struct xrt_frame_context xfctx,
struct t_hand_tracking_sync sync 
)
Todo:
We came up with this value just by seeing what worked. With Index and WMR, we'd be around 40ms late by the time the camera frames arrived and were processed.

We really need a way to calibrate this live - something like an exponential filter that looks at the typical maximum time between the time at which we were asked for a sample and most recent processed sample timestamp.

References xrt_frame_sink::push_frame, and U_TYPED_CALLOC.