Giter Club home page Giter Club logo

Comments (5)

made3 avatar made3 commented on May 21, 2024 1

Hey @max-krichenbauer
Did you find a way to get a degree value or something like that from the magnetometer outputs? It is hard to find anything on the internet about using the magnetometer values of the HoloLens...

Edit: So, I received values like x: 400 y: 400 z: -200 +/- around 40 depending on what direction I looked at. I had to remove the hard iron distortion by getting the max and min value of each axis and removing the mean value of those from the incoming values.
Example: When rotating the headset I gathered a max-X value of 420 and a min-X value of 380. So now I remove the mean value (400) from all incoming x-values. That way the values I get are centered around 0 and not around 400 anymore. Same goes for the y and z axis.

Then I used the atan to get degree values from my Y and Z:

if (magValueZ > 0) magDegrees = 90. - ((double)atan(magValueY / magValueZ) * 180. / (atan(1) * 4));
if (magValueZ < 0) magDegrees = 270. - ((double)atan(magValueY / magValueZ) * 180. / (atan(1) * 4));
if (magValueZ == 0 && magValueY < 0) magDegrees = 180;
if (magValueZ == 0 && magValueY > 0) magDegrees = 0;

X is not needed. Might be different in your case because @max-krichenbauer apparently received my z values on his y. No idea how that works though.
(atan(1) * 4) is just Pi.

So in the end I received the clockwise degrees starting at north. 0 is north, 90 is east, 180 sout and 270 west.

from hololens2forcv.

ozgunkaratas avatar ozgunkaratas commented on May 21, 2024

Hey Max,
have you had any update regarding data extraction from the IMU sensor?

from hololens2forcv.

max-krichenbauer avatar max-krichenbauer commented on May 21, 2024

Hi @ozgunkaratas
Through other channels, I received the following explanation:

They *think* the units for the returned values are micro-teslas.
[...]
I'm guessing that the HL2 only uses the magnetometer to sense relative heading.
So it's probably not calibrated to do more than that. 
For example, the research API does not give any extrinsic calibration data on how the magnetometer is precisely oriented to the coordinate frames of the other sensors or cameras. 
This would also explain why they aren't 100% sure of the units – because they might only be looking at how the direction of the magnetic field changes with HL2 orientation (and not using the absolute field strength).

from hololens2forcv.

ozgunkaratas avatar ozgunkaratas commented on May 21, 2024

Hi @max-krichenbauer
thank you for your update, i was able to compare HL magnetometer data with my external IMU sensor which outputs field strength information in 3 axes in units of Tesla and the HL and the IMU do not match with each other whatsoever. I think you are right in the sense that this is used for sensing relative heading.

from hololens2forcv.

ilyassebel avatar ilyassebel commented on May 21, 2024

Hi

Hello!

I'm reading the magnetometer values from the Hololens 2, but I can't figure out what they are supposed to mean or if my readings are erroneous.
The documentation doesn't state any unit of measurement or meaning for these values.

When I tested it, the values where [464, -198, 483] and after turning 180 degrees they were [456, -223, 463].
What do these values mean an how are they to be processed.

Thank you!

Best regards,
Max

Hi Max,

Please how did you get the magnetometer values ?

Best regards

from hololens2forcv.

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.