-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compass/magnetometer missing for xreal light #15
Comments
Hi! I never bothered with the magnetometer, because it was borderline unusable for my purposes. (the Earth's magnetic field is so weak that the metal in the headrest of my chair could cause the compass to completely flip). I don't know what its units are, probably the magnetometer chip's (AK8975) raw values. The "A" packet is sent when the glasses goes to sleep, which is not very useful, and "K" is actually handled: https://github.com/badicsalex/ar-drivers-rs/blob/master/src/nreal_light.rs#L225-L234 |
the magnetometer can help with the yaw information when there are no strong magnetic disturbances. |
As you've discovered, the magnetometer info comes from the MCU channel (and not the Ov580 like the IMU information). You can enable the magnetometer stream with the "1";"U" command, if disabled. All that needs to be done is it should be parsed, no need to do any more reverse engineering than what you've already did :) P.S.: In a proprietary projet, I was able to get a pretty stable 3DOF without magnetometer, so it's definitely doable without a magnetometer. |
reading the MCU magnetometer event, return this text message: |
Oh yeah it's definitely uncalibrated, so the norm will definitely not be the same due to uncorrected soft and hard iron effects. |
actually the reading from the magnetometer are pretty good but the main issue is the magnet of the clip-on frame (which I use as a reading glasses replacment) which add hard iron offset so every time I remove it, I need to recalibrate it. how ever it is really interesting how you got stable 3 DOF with gyro and accelerometer only (as you don't have any yaw reference) unless you had used the stereo cameras. |
It's not stable, it's "pretty stable" :D Meaning it does have a few degrees of yaw every minute. The trick is that you can actually calculate the yaw bias from the gravity vector (and the expectation that it continues to point down, not to the side) if the user turns their head up or down for a short while. |
Hi, what about the timestamp for the magnetometer ? |
The timestamp was not needed for anything at the time, but for the magnetometer it could probably be parsed. I'm not sure how accurately that tracks the gyro/acc timestamp though, because that's literally a different chip, so some adjustments or faking (using the last acc/gyro timestamp as the magnetometer timestamp) might be necessary. |
I am working on some ahrs that fuses gyro, acc and mag (complementary / EKF) |
Unfortunately no, but I assume it's relatively easy to figure out.
The two are always the same. At least they looked the same to me. |
nreal_light.rs does not return the magnetometer packet.
I'd parsed the not handled packet (type:'5', cmd id:'M') and the data is human readable (x10754y-5900z-6173)
but I think I need some multiplier/divisor for it to make sense.
did you managed to understand that message while reverse engineer the MCU firmware ?
can you point me some direction ?
p.s.
also there is unhandled packet ('A','K').
The text was updated successfully, but these errors were encountered: