Skip to content

Improve robustness of save data#89

Open
K-Meech wants to merge 6 commits into
mainfrom
km/save-robust
Open

Improve robustness of save data#89
K-Meech wants to merge 6 commits into
mainfrom
km/save-robust

Conversation

@K-Meech
Copy link
Copy Markdown
Collaborator

@K-Meech K-Meech commented May 29, 2026

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 GazeItem to match HeadPoseItem

  • Updated 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) called RotationRefresh and GazeRefresh. 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 TrackerBuffers so 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).

@K-Meech K-Meech requested review from mmcleod89 and thompson318 May 29, 2026 14:09
@K-Meech K-Meech mentioned this pull request May 29, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant