-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Regression: Navio2 magnetometer failure #7395
Comments
@nicolaerosia would be good if you could debug it further. I don't have a Navio setup ready with me at the moment. |
@mhkabir I'll investigate. Any ideas what could be the issue? |
It's not obvious how the bisected commit breaks it. Are you sure that it's the correct breaking one? |
Yes, I will check again even though I have double tested yesterday. |
@nicolaerosia I'm guessing that one of the rotation calls fail because I see that all the values are zero as reported by @tstellanova. This is where it probably fails : 5cbaaa6#diff-a4442851925fd43c16a781c4b830eb87R734. It never gets the rotation matrix. |
I've rechecked, and this is the last working commit
|
OK I think I got why it broke. POSIX needs an alternative to the IOCTL to detect external mags. |
Yes, it should be all uORB topic internal (including the internal / external flag). We probably should introduce the concept for POSIX devices first, make sure it works there and then flick the rest of the system. |
I can confirm this is currently broken on RPi. The problem is that all
|
@bkueng thanks. Would you be able to propose a PR with the last suggestion? We want to move away from ioctls as far as possible and use the uORB API more. As @LorenzMeier says, we'd need to add an internal/external flag in the uORB topic and fix |
I'd probably also go for the 3rd, but will need to look at it some more. I can do that. |
It's set from QGroundControl if it's an external mag (this detection is probably broken on POSIX for ages or never existed). For internal mags, the parameter is always set to -1, and |
How does QGC know it's external? I tested this with a pixracer & external mag attached, but the param was not set (I did a calibration). |
note that df_mpu9250_wrapper already applies a rotation, should this be done elsewhere, I don't quite follow |
@nicolaerosia no, that is correct. The whole subject is quite complex & confusing. In addition to what we talked about above - the external rotation, which can be set by the user, there is also a rotation parameter supplied via CLI - the one you mention. This is used to make sure internal sensors are correctly rotated according to the labeling on the board. Which is why this is fixed, but can be different for different boards. |
@bkueng ok, so we're applying two rotations, right? Maybe we could just multiply those, and get away applying a single rotation |
Right. But they're applied in 2 different places, and I think it makes sense to keep the one in the driver and the other in the common sensors module. |
Hello,
I'm getting the following error and I don't have a magnetometer working anymore:
I've bisected this down to 5cbaaa6
The text was updated successfully, but these errors were encountered: