Repository navigation
feat(pico4-monado): a double tap on the headset switches SteamVR's room view, as PICO OS's Quick Seethrough Mode does - #43
Open
linuxnoodle wants to merge 2 commits into
Conversation
…meter, pico4_tap, with its tests and pico4-tap-replay PICO OS switches its passthrough on a double tap on the side of the headset (its Quick Seethrough Mode). pico4_tap finds the double tap in the head IMU's acceleration for the driver: plain C without Monado's types, so that it is tested on its own. Gravity is taken out by a 0.3 s low-pass. Two spikes of at least 15 m/s², each shorter than 60 ms with its top within its first 20 ms, 80 to 400 ms apart and at most four times unlike, count as a double tap when a 150 ms envelope of the motion is under 4 m/s² as the second starts. After a double tap nothing counts for 700 ms, after a refused spike for 60 ms. A gap in the samples (a suspend), a sample that repeats a time, or a headset that rests on another gravity start it over. test_pico4_tap runs scenes of a synthetic accelerometer at the ICM-42688's 1024 Hz; each rule of the detector decides at least one of them. pico4-tap-replay runs the detector over what pico4-imu stream --csv recorded, lists every spike it looks at, and takes other settings with --set.
…om view, as PICO OS's Quick Seethrough Mode does The driver feeds pico4_tap from the accelerometer branch of handle_sample, counts a double tap only while the wear sensor says the headset is worn, and bumps a counter in the room view's shared memory (pico4_roomview.h, version 3: taps and the time of the last; last in the struct, so that the previous pico4-roomview still reads a driver that has them). PICO4_DOUBLE_TAP=0 switches it off. pico4-roomview tells the compositor's system layer of each double tap, by the mailbox message of the dashboard's camera button (set_camera_roomview_enabled, as pico4-steamvr-switch roomview sends it): on when the compositor does not ask for frames, off when it does. Between that message and the compositor's answer a second double tap switches from what was told, not from the answer still to come (pico4_roomview_switch, tested in test_pico4_tracking). Nothing is switched while the first-run setup runs, nor for a double tap more than 2 s old: one seen without a compositor. Worn on a PICO 4 with 2026.11.26: double taps on either side of the headset switch the room view on and off.
Contributor
|
Thanks for the work, the detector and its tests are careful. Still, I don't want to take this in, for three reasons:
So I'd close this one, unless you see something I'm missing. If the Frame gains such a gesture, or SteamVR offers a way to ask for the room view that knows when it is allowed, it is worth looking at again. |
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.
pico4-monado: a double tap on the headset switches the room view
What
PICO OS switches its passthrough on a double tap on the side of the headset (its description of Quick Seethrough Mode). This gives SteamVR's room view the same shortcut, in two commits: the detector, then the switch.
The detector,
pico4_tap.c, is plain C without Monado's types, so that it is tested on its own. Gravity is taken out by a 0.3 s low-pass. Two spikes of at least 15 m/s², each shorter than 60 ms with its top within its first 20 ms, 80 to 400 ms apart and at most four times unlike, count as a double tap when a 150 ms envelope of the motion is under 4 m/s² as the second starts. Running, shaking the head, a push (sustained or slowly building), the first knock's bounce or ringing and knocks unlike each other do not count; in the tests walking stays under the envelope. After a double tap nothing counts for 700 ms, after a refused spike for 60 ms. A gap in the samples (a suspend), a sample that repeats a time, or a headset resting on another gravity starts it over. The numbers arepico4_tap_default_config.The switch.
handle_samplefeeds the detector from the accelerometer and counts a double tap only while the wear sensor says worn. The count goes into the room view's shared memory (pico4_roomview.h, version 3:tapsand the time of the last, at the end of the struct).pico4-roomviewtells the compositor's system layer by the mailbox message of the dashboard's camera button (set_camera_roomview_enabled, aspico4-steamvr-switch roomviewsends it): on when the compositor does not ask for frames, off when it does.pico4-tap-replayruns the detector over whatpico4-imu stream --rate 1000 --csvrecorded, lists every spike it looks at, and takes other settings with--set.pkgrel=22.Details
pico4_roomview_switch, tested intest_pico4_tracking). If the compositor does not follow within 2 s, its answer counts again.pico4-roomviewreads a driver that has them; the new one does not map a file of version 2, which is shorter.PICO4_DOUBLE_TAP=0.Verified
test_pico4_tap: scenes of a synthetic accelerometer at the ICM-42688's 1024 Hz. Each rule of the detector decides at least one scene: breaking one rule at a time failed a check in all 19 tries, and 1000 other noise sequences fail none. It passes under the recipe'scc -std=c11 -D_GNU_SOURCE -O1 -Wall -Wextra -Werror.pico4-tap-replay: a minute at rest on a desk gives no double tap, with the motion at most 0.43 m/s²; the lenses moved bypico4-lens setin a double tap's rhythm (four pairs) give none either, with at most 3.7 m/s².pico4-onboarding:/procnames itpico4-onboardin(comm holds 15 characters), which the producer looks for; the full 16-character name finds nothing.test_pico4_trackingcovers the counter and the switch's state. The recipe's C tests, the repository's tests,build/versions.py check,build/shellcheck.py, ruff and ty pass.Notes
pico4-monadoto 22 as well: whichever of the two merges second needs itspkgrelraised once more.