The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

tests: Fix levenberg-marquardt test

+27 -3
+27 -3
tests/tests_levenbergmarquardt.cpp
··· 9 9 #include "util/u_logging.h" 10 10 #include "xrt/xrt_defines.h" 11 11 #include <util/u_worker.hpp> 12 + #include <math/m_mathinclude.h> 12 13 #include <math/m_space.h> 13 14 #include <math/m_vec3.h> 15 + #include <math/m_vec2.h> 14 16 15 17 #include "kine_common.hpp" 16 18 #include "lm_interface.hpp" ··· 34 36 35 37 struct one_frame_input input = {}; 36 38 39 + for (int view = 0; view < 2; view++) { 40 + input.views[view].active = true; 41 + input.views[view].stereographic_radius = 0.5; 42 + input.views[view].look_dir = XRT_QUAT_IDENTITY; 43 + for (int i = 0; i < 5; i++) { 44 + 45 + input.views[view].curls[i].value = -0.5f; 46 + input.views[view].curls[i].variance = 1.0f; 47 + } 48 + for (int i = 0; i < 21; i++) { 49 + 50 + xrt_vec2 dir = {sinf(i), cosf(i)}; 51 + m_vec2_normalize(&dir); 52 + 53 + input.views[view].keypoints_in_scaled_stereographic[i].pos_2d = dir; //{0,(float)i,-1}; 54 + input.views[view].keypoints_in_scaled_stereographic[i].depth_relative_to_midpxm = 55 + (i / 21.0f) - 0.5; 56 + input.views[view].keypoints_in_scaled_stereographic[i].confidence_depth = 1.0f; 57 + input.views[view].keypoints_in_scaled_stereographic[i].confidence_xy = 1.0f; 58 + } 59 + } 60 + 37 61 lm::KinematicHandLM *hand; 38 62 39 63 xrt_pose left_in_right = XRT_POSE_IDENTITY; ··· 42 66 lm::optimizer_create(left_in_right, false, U_LOGGING_TRACE, &hand); 43 67 44 68 45 - xrt_hand_joint_set out; 46 - float out_hand_size; 47 - float out_reprojection_error; 69 + xrt_hand_joint_set out = {}; 70 + float out_hand_size = 0.0f; 71 + float out_reprojection_error = 0.0f; 48 72 lm::optimizer_run(hand, // 49 73 input, // 50 74 true, //