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
+8 -1
View File
@@ -141,6 +141,7 @@ struct tracking
XrFovf fov;
};
XrTime production_timestamp;
XrTime timestamp;
XrViewStateFlags flags;
@@ -169,6 +170,7 @@ struct hand_tracking
uint8_t flags;
};
XrTime production_timestamp;
XrTime timestamp;
std::optional<std::array<pose, XR_HAND_JOINT_COUNT_EXT>> left;
std::optional<std::array<pose, XR_HAND_JOINT_COUNT_EXT>> right;
@@ -321,7 +323,12 @@ struct timesync_query
XrTime query;
};
using packets = std::variant<handshake, audio_stream_description, video_stream_description, audio_data, video_stream_data_shard, haptics, timesync_query>;
struct prediction_offset
{
std::chrono::nanoseconds offset;
};
using packets = std::variant<handshake, audio_stream_description, video_stream_description, audio_data, video_stream_data_shard, haptics, timesync_query, prediction_offset>;
} // namespace to_headset