Monado OpenXR Runtime
lm_interface.hpp File Reference

Interface for Levenberg-Marquardt kinematic optimizer. More...

#include "xrt/xrt_defines.h"
#include "util/u_logging.h"
#include "../kine_common.hpp"
Include dependency graph for lm_interface.hpp:

Go to the source code of this file.

Functions

void xrt::tracking::hand::mercury::lm::optimizer_create (xrt_pose left_in_right, bool is_right, u_logging_level log_level, KinematicHandLM **out_kinematic_hand)
 
void xrt::tracking::hand::mercury::lm::optimizer_run (KinematicHandLM *hand, one_frame_input &observation, bool hand_was_untracked_last_frame, float smoothing_factor, bool optimize_hand_size, float target_hand_size, float hand_size_err_mul, float amt_use_depth, xrt_hand_joint_set &out_hand, float &out_hand_size, float &out_reprojection_error)
 The main tracking code calls this function with some 2D(ish) camera observations of the hand, and this function calculates a good 3D hand pose and writes it to out_viz_hand. More...
 
void xrt::tracking::hand::mercury::lm::optimizer_destroy (KinematicHandLM **hand)
 

Detailed Description

Interface for Levenberg-Marquardt kinematic optimizer.

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

Function Documentation

◆ optimizer_run()

void xrt::tracking::hand::mercury::lm::optimizer_run ( KinematicHandLM hand,
one_frame_input observation,
bool  hand_was_untracked_last_frame,
float  smoothing_factor,
bool  optimize_hand_size,
float  target_hand_size,
float  hand_size_err_mul,
float  amt_use_depth,
xrt_hand_joint_set out_hand,
float &  out_hand_size,
float &  out_reprojection_error 
)

The main tracking code calls this function with some 2D(ish) camera observations of the hand, and this function calculates a good 3D hand pose and writes it to out_viz_hand.

Parameters
observationThe observation of the hand joints. Warning, this function will mutate the observation unpredictably. Keep a copy of it if you need it after.
hand_was_untracked_last_frameIf the hand was untracked last frame (it was out of view, obscured, ML models failed, etc.) - if it was, we don't want to enforce temporal consistency because we have no good previous hand state with which to do that.
optimize_hand_sizeWhether or not it's allowed to tweak the hand size - when we're calibrating the user's hand size, we want to do that; afterwards we don't want to waste the compute.
target_hand_sizeThe hand size we want it to get close to
hand_size_err_mulA multiplier to help determine how close it has to get to that hand size
[out]out_handThe xrt_hand_joint_set to output its result to
[out]out_hand_sizeThe hand size it ended up at
[out]out_reprojection_errorThe reprojection error it ended up at
Parameters
smoothing_factor- Unused if this is the first frame

References xrt::tracking::hand::mercury::lm::optimizer_run().

Referenced by xrt::tracking::hand::mercury::lm::optimizer_run().