Request tracking extrapolation on client

Add the timestamp where data was requested, use this to compute how far
in the future the application is requesting samples.
With this information, client requests 2 tracking samples: one at the
current time and one in the future.
Server now keeps track of actual samples + one predicted sample, and is
most of the time in the interpolation use case.
This commit is contained in:
Patrick Nicolas
2024-04-04 13:41:36 +02:00
parent b9c4e04a14
commit 7658f427e6
11 changed files with 126 additions and 45 deletions
+5 -4
View File
@@ -120,8 +120,9 @@ static xrt_hand_joint_set convert_joints(const std::optional<std::array<from_hea
void hand_joints_list::update_tracking(const from_headset::hand_tracking & tracking, const clock_offset & offset)
{
if (hand_id == 0)
add_sample(tracking.timestamp, convert_joints(tracking.left), offset);
else
add_sample(tracking.timestamp, convert_joints(tracking.right), offset);
add_sample(
tracking.production_timestamp,
tracking.timestamp,
convert_joints(hand_id == 0 ? tracking.left : tracking.right),
offset);
}