The open source OpenXR runtime
0
fork

Configure Feed

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

d/steamvr_lh: fix laggy simulated hand tracking

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2340>

authored by

rcelyte and committed by
Rylie Pavlik
97733c01 d2fbd3ce

+4 -5
+3 -4
src/xrt/drivers/steamvr_lh/device.cpp
··· 289 289 }; 290 290 291 291 void 292 - ControllerDevice::update_hand_tracking(struct xrt_hand_joint_set *out) 292 + ControllerDevice::update_hand_tracking(int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out) 293 293 { 294 294 if (!has_index_hand_tracking) 295 295 return; ··· 317 317 auto curl_values = u_hand_tracking_curl_values{pinky, ring, middle, index, thumb}; 318 318 319 319 struct xrt_space_relation hand_relation = {}; 320 - int64_t ts = chrono_timestamp_ns(); 321 - m_relation_history_get_latest(relation_hist, &ts, &hand_relation); 320 + m_relation_history_get(relation_hist, desired_timestamp_ns, &hand_relation); 322 321 323 322 u_hand_sim_simulate_for_valve_index_knuckles(&curl_values, get_xrt_hand(), &hand_relation, out); 324 323 ··· 406 405 { 407 406 if (!has_index_hand_tracking) 408 407 return; 409 - update_hand_tracking(out_value); 408 + update_hand_tracking(desired_timestamp_ns, out_value); 410 409 out_value->is_active = true; 411 410 hand_tracking_timestamp = desired_timestamp_ns; 412 411 *out_timestamp_ns = hand_tracking_timestamp;
+1 -1
src/xrt/drivers/steamvr_lh/device.hpp
··· 184 184 get_xrt_hand(); 185 185 186 186 void 187 - update_hand_tracking(struct xrt_hand_joint_set *out); 187 + update_hand_tracking(int64_t desired_timestamp_ns, struct xrt_hand_joint_set *out); 188 188 189 189 protected: 190 190 void