GithubHelp home page GithubHelp logo

Comments (3)

MrZMN avatar MrZMN commented on May 13, 2024

Hi, I changed the sensor from 'Sensor.TYPE_ROTATION_VECTOR' to 'Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR', which eliminates the use of gyroscope compared to the former counterpart.

Something interesting ensues after that. The jiggle problem becomes worse (if I put the phone on a flat table, it never stops jiggling in 1-2 degrees). By contrast, the slow response almost disappears.

This confirms part of my previous assumptions, where we should blame the issues partly to the sensor fusion. I don't know the internal realisation of the software sensors by Android (perhaps some Kalman Filters or AHRS), but I assume that there's always a tradeoff - one must sacrifice one thing to attain another thing.

Any comments are appreciated.

from compass.

Kr0oked avatar Kr0oked commented on May 13, 2024

Hi, thanks for the nice words about the app!

With the current TYPE_ROTATION_VECTOR sensor the SDK takes care of everything. So the result is only as good as the implementation, your devices hardware and the factory calibration. I have seen big differences across my own test devices. Unfortunatly I don't have many devices for testing.

When I started with the app I tried to filter the values myself Older version.
I used the TYPE_ACCELEROMETER and TYPE_MAGNETIC_FIELD in combination with a low pass filter. I also tried out some more filtering to improve the result. But it was either unstable or unresponsive. As you said there is always a tradeoff. So I gave up this approach and I now rely on the TYPE_ROTATION_VECTOR which produces a better result then I can do.

If you want to experiment a little bit more and try out your own filtering you can now have a look at uncalibrated filters like TYPE_MAGNETIC_FIELD_UNCALIBRATED:

Note: Uncalibrated sensors provide more raw results and may include some bias, but their measurements contain fewer jumps from corrections applied through calibration. Some applications may prefer these uncalibrated results as smoother and more reliable. For instance, if an application is attempting to conduct its own sensor fusion, introducing calibrations can actually distort results.

from compass.

MrZMN avatar MrZMN commented on May 13, 2024

Thank you for the reply! The information you provided is absolutely helpful! I agree that the result should rely on the specific devices.

I agree that it's wise to use Android SDK methods, although it's not likely that they'll bring about superb performance on each individual device (not like Apple who only has a few phone models). Maybe implementing the whole thing from scratch can potentially have somewhat better performance, but I doubt it requires much effort.

Again, thank you for your excellent contribution!

from compass.

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.