diff --git a/src/xrt/tracking/hand/mercury/hg_debug_instrumentation.hpp b/src/xrt/tracking/hand/mercury/hg_debug_instrumentation.hpp new file mode 100644 index 000000000..a4974a9cb --- /dev/null +++ b/src/xrt/tracking/hand/mercury/hg_debug_instrumentation.hpp @@ -0,0 +1,55 @@ +// Copyright 2023, Collabora, Ltd. +// SPDX-License-Identifier: BSL-1.0 +/*! + * @file + * @brief Debug instrumentation for mercury_train or others to control hand tracking. + * @author Moses Turner + * @ingroup tracking + */ + +#pragma once + +#include "hg_interface.h" + +#include "util/u_var.h" + + +#ifdef __cplusplus +namespace xrt::tracking::hand::mercury { +extern "C" { +#endif + +struct hg_tuneable_values +{ + bool new_user_event = false; + struct u_var_draggable_f32 after_detection_fac; + struct u_var_draggable_f32 dyn_radii_fac; + struct u_var_draggable_f32 dyn_joint_y_angle_error; + struct u_var_draggable_f32 amount_to_lerp_prediction; + struct u_var_draggable_f32 amt_use_depth; + struct u_var_draggable_f32 mpiou_any; + struct u_var_draggable_f32 mpiou_single_detection; + struct u_var_draggable_f32 mpiou_double_detection; + struct u_var_draggable_f32 max_reprojection_error; + struct u_var_draggable_f32 opt_smooth_factor; + struct u_var_draggable_f32 max_hand_dist; + bool scribble_predictions_into_next_frame = false; + bool scribble_keypoint_model_outputs = false; + bool scribble_optimizer_outputs = true; + bool always_run_detection_model = false; + bool optimize_hand_size = true; + int max_num_outside_view = 6; + bool enable_pose_predicted_input = true; + bool enable_framerate_based_smoothing = false; + + // Stuff that's only really useful for dataset playback: + bool detection_model_in_both_views = false; +}; + +struct hg_tuneable_values * +t_hand_tracking_sync_mercury_get_tuneable_values_pointer(struct t_hand_tracking_sync *ht_sync); + +#ifdef __cplusplus +} +} // namespace xrt::tracking::hand::mercury +#endif diff --git a/src/xrt/tracking/hand/mercury/hg_sync.hpp b/src/xrt/tracking/hand/mercury/hg_sync.hpp index d3a2857c3..5c1c7f5c5 100644 --- a/src/xrt/tracking/hand/mercury/hg_sync.hpp +++ b/src/xrt/tracking/hand/mercury/hg_sync.hpp @@ -11,7 +11,7 @@ #pragma once #include "hg_interface.h" - +#include "hg_debug_instrumentation.hpp" #include "tracking/t_hand_tracking.h" #include "tracking/t_camera_models.h" @@ -332,30 +332,7 @@ public: u_frame_times_widget ft_widget = {}; - struct - { - bool new_user_event = false; - struct u_var_draggable_f32 after_detection_fac; - struct u_var_draggable_f32 dyn_radii_fac; - struct u_var_draggable_f32 dyn_joint_y_angle_error; - struct u_var_draggable_f32 amount_to_lerp_prediction; - struct u_var_draggable_f32 amt_use_depth; - struct u_var_draggable_f32 mpiou_any; - struct u_var_draggable_f32 mpiou_single_detection; - struct u_var_draggable_f32 mpiou_double_detection; - struct u_var_draggable_f32 max_reprojection_error; - struct u_var_draggable_f32 opt_smooth_factor; - struct u_var_draggable_f32 max_hand_dist; - bool scribble_predictions_into_next_frame = false; - bool scribble_keypoint_model_outputs = false; - bool scribble_optimizer_outputs = true; - bool always_run_detection_model = false; // true - bool optimize_hand_size = true; - int max_num_outside_view = 6; - bool enable_pose_predicted_input = true; - bool enable_framerate_based_smoothing = false; - } tuneable_values; - + struct hg_tuneable_values tuneable_values; public: explicit HandTracking();