Improve robustness of save data#89
Open
K-Meech wants to merge 6 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #77
Adds option to write sampled speeds to file for star collector (matching existing option for rocket launch). Rocket launch / star collector are the only games that use the buffers.
Added a minimum interval between falls for the zero gravity save data. This can be adjusted on the 'sway line' - currently set to 0.5 seconds.
Updated constructor of
GazeItemto matchHeadPoseItemUpdated docs to match changes
At the moment, we have to manually set the buffer size large enough to handle the time range we are interested in for each game. Potentially, this may cause issues in future if the time is updated without the buffer size.
To help make this more robust, I checked the rate with which new items are added to the pose and gaze buffers. I made two simple scenes on a separate branch for testing (
km/tracker-refresh) calledRotationRefreshandGazeRefresh. Each has a simple script enabled that pulls data from the tracker every update and adds it to the buffer + logs some values. For both, the interval between new readings seemed to consistently be ~0.03 seconds (or 33 Hertz, matching the recorded head tracking specs for Tobii 5. Based on other spec sheets I might have expected the gaze rate to be higher, but it also seems to be 0.03seconds consistently). This matches @thompson318 's estimates in this comment: Expand data for star collector game #76 (comment) My frame rate (the rate with which update was called) was higher than this, as I could see the game trying to add the same value to the buffer multiple times, but being rejected due to their identical time stamps - so hopefully this is reasonably reflective of the fastest rate with which we can get new values from the tracker.Based on this I've updated
TrackerBuffersso you can provide an expected time period in seconds, and it will set the capacity accordingly as: 1.5 * (secondsOfData / 0.03). The 1.5x is to make the buffer 50% larger than the minimum required value, to give some headroom in case there are a few extra values added. This should mean the buffer always has enough capacity to match the time periods needed in the games that use it (rocket launch and star collector).