The open source OpenXR runtime
0
fork

Configure Feed

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

d/steamvr_lh: disable prediction for skeletal input

+4 -19
+4 -19
src/xrt/drivers/steamvr_lh/device.cpp
··· 662 662 const auto it = std::ranges::lower_bound(joint_history, desired_timestamp_ns, {}, 663 663 [](const JointsWithTimestamp &joint) { return joint.timestamp; }); 664 664 665 - auto predict_joint_set = [out_value, out_timestamp_ns, 666 - desired_timestamp_ns](const JointsWithTimestamp &joints) { 667 - out_value->is_active = joints.joint_set.is_active; 668 - int64_t delta_ns = desired_timestamp_ns - joints.timestamp; 669 - double delta_s = time_ns_to_s(delta_ns); 670 - 671 - *out_timestamp_ns = desired_timestamp_ns; 672 - m_predict_relation(&joints.joint_set.hand_pose, delta_s, &out_value->hand_pose); 673 - for (int i = 0; i < XRT_HAND_JOINT_COUNT; i++) { 674 - auto &new_joint = joints.joint_set.values.hand_joint_set_default[i]; 675 - auto &interp_joint = out_value->values.hand_joint_set_default[i]; 676 - 677 - m_predict_relation(&new_joint.relation, delta_s, &interp_joint.relation); 678 - interp_joint.radius = new_joint.radius; 679 - } 680 - }; 681 - 682 665 if (it == joint_history.end()) { 683 666 // Timestamp is newer than anything in history 684 - predict_joint_set(joint_history.back()); 667 + *out_value = joint_history.back().joint_set; 668 + *out_timestamp_ns = it->timestamp; 685 669 } else if (desired_timestamp_ns == it->timestamp) { 686 670 *out_value = it->joint_set; 687 671 *out_timestamp_ns = it->timestamp; 688 672 } else if (it == joint_history.begin()) { 689 673 // Timestamp is older than anything in history 690 - predict_joint_set(joint_history.front()); 674 + *out_value = joint_history.front().joint_set; 675 + *out_timestamp_ns = it->timestamp; 691 676 } else { 692 677 // Interpolate 693 678 auto it_previous = it - 1;