Coder Social home page Coder Social logo

Comments (4)

dproldan avatar dproldan commented on June 28, 2024

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" [email protected] 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
.

from psvrframework.

gusmanb avatar gusmanb commented on June 28, 2024

@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.

from psvrframework.

dproldan avatar dproldan commented on June 28, 2024

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;
    }

from psvrframework.

gusmanb avatar gusmanb commented on June 28, 2024

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

from psvrframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.