Use polynomial interpolation for poses and views

This commit is contained in:
Patrick Nicolas
2026-01-27 17:32:34 +01:00
parent 97d6a19199
commit 25c2449a5e
7 changed files with 371 additions and 75 deletions
+4 -4
View File
@@ -129,9 +129,9 @@ xrt_result_t wivrn_hmd::get_tracked_pose(xrt_input_name name, int64_t at_timesta
return XRT_ERROR_INPUT_UNSUPPORTED;
}
auto [extrapolation_time, view] = views.get_at(at_timestamp_ns);
auto [production_timestamp, view] = views.get_at(at_timestamp_ns);
*res = view.relation;
cnx->add_predict_offset(extrapolation_time);
cnx->add_predict_offset(std::chrono::nanoseconds(at_timestamp_ns - production_timestamp));
return XRT_SUCCESS;
}
@@ -163,8 +163,8 @@ xrt_result_t wivrn_hmd::get_view_poses(const xrt_vec3 * default_eye_relation,
xrt_fov * out_fovs,
xrt_pose * out_poses)
{
auto [extrapolation_time, view] = views.get_at(at_timestamp_ns);
cnx->add_predict_offset(extrapolation_time);
auto [production_timestamp, view] = views.get_at(at_timestamp_ns);
cnx->add_predict_offset(std::chrono::nanoseconds(at_timestamp_ns - production_timestamp));
int flags = view.relation.relation_flags;