Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Feature request - Double Tap Recenter #38

Open
mungewell opened this issue Nov 19, 2016 · 4 comments
Open

Feature request - Double Tap Recenter #38

mungewell opened this issue Nov 19, 2016 · 4 comments

Comments

@mungewell
Copy link
Collaborator

While in Cinematic mode, finding the key/using the mouse to re-center the screen is a pain.

Can the toolbox sense a double tap on the accelerometers to recenter the screen?
Simon

@dproldan
Copy link

I have done exactly that. Works really wel.

I'll post details when i get home.

El 19 nov. 2016 7:00 p. m., "mungewell" notifications@github.com escribió:

While in Cinematic mode, finding the key/using the mouse to re-center the
screen is a pain.

Can the toolbox sense a double tap on the accelerometers to recenter the
screen?
Simon


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#38, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABhEzpOz-9BnB_WE9ISCQqvjCinpop-Zks5q_zlWgaJpZM4K3UeH
.

@gusmanb
Copy link
Owner

gusmanb commented Nov 19, 2016

@dproldan Nice!, any help is welcome.

@mungewell Was thinking about it these days, not only to detect a tap but "clicks", with the correct algorithms, from the sensor readings in theory these can be detected, I've used in the past acceleromters with this functionality integrated and they detect it based on the force curve, so this must be achievable in code. We can use these clicks to different functions, I was thinking on the mouse emulator, single-click left mouse button, double-click right mouse button.

We can start with a simple tamp detect based on the @dproldan code (or maybe the code already detects clicks, that would be wonderful) and with time advance to a more complex click detection.

@dproldan
Copy link

dproldan commented Nov 20, 2016

This is what I've been using to recenter the mouse, I'm not a sw developer, so this is probably too crude, but maybe you can use it as a proof of concept.
// Used both axis so the knock has to be on the chamfered edge of the headset.

device.on("data", function(data) {
          acc.yaw = -data.yaw * 0.00080;
          acc.pitch = -data.pitch * 0.00080;
          knock= data.yAccel1+data.xAccel1;
          doThings();
          });
var doThings = function() {
    mouse.Place(ptX, ptY);
    ptX = 720+acc.yaw;
    ptY = 450+acc.pitch;
    if (ptX>1960) {ptX=1960};
    if (ptY>1080) { ptY=1080};
    if (knock>=30000) {device.resetYaw();device.resetPitch()}
                           };
    resetYaw() {
    this._yaw = 0;
  }
    resetPitch() {
        this._pitch = 0;
    }

@gusmanb
Copy link
Owner

gusmanb commented Nov 20, 2016

I've tested the code and was too unreliable, some taps were detected when moving the head fast in diagonal.

So, I rolled my own tap detector and seems to work quite well.

It detects a double tap in any direction as I'm using the force vector magnitude, it must be a fast double tap, I use two fingers to do it and nearly 100% of the taps are correctly detected, and unless you remove the hmd it does not detect false taps.

Some important thig is when the toolbox boots if the hmd is powered on it must be stable, else if it's powered on after the toolbox it must remain in that time stable, in that interval the gravity magnitude is computed. If the tests are good I will do as the PS4 does, wait until the helmet is worn and stabilizes to measure the gravity to avoid false calibrations.

Test and share results.

test_tap.zip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants