-
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
lis3mdl with two sensors not working #10740
Comments
I can take a look at the code tomorrow and see what's going on. @dagar we should |
Just looked at the code and I think I found the bug: Now if the first device is initialized first and then the second with LIS3MDL_BUS_ALL, the calls to calibrate / init / test / info and reset should have the loop over all devices also. Might be it is easier to do the loop all inside main and remove it in for start / stop. When the second start is called with -S, everything works:
|
@hdiethelm If you'd like to fix this and submit a PR I'd be happy to review and help test the code. I feel I should warn you the LIS3MDL is very temperature sensitive. We found that exceeding +/- 10°C from the temperature at which the device was calibrated is enough to cause unstable flights and fly-aways. We've since switched to using the AK8963 on board the mpu9250 as our primary mag sensor. |
^^Sorry about all the messages. As you see, I'm working on it. But I did not know that github tracks references on issues and just force pushed on my own branch. ;-) |
I've done this work already with Which is part of #10602. You can cherry pick this file If you're unfamiliar with |
ModuleBaseMulti looks quite nice, however, I have already finished the modifications and tested them. At the moment, I have no time porting all to the new framework. Might be later. |
* lis3mdl: Report calibration successful when starting with -C option * lis3mdl: Use PX4_OK, PX4_ERROR for return value / orb_unadvertise * Fixes #10740
* lis3mdl: Report calibration successful when starting with -C option * lis3mdl: Use PX4_OK, PX4_ERROR for return value / orb_unadvertise * Fixes PX4#10740
* lis3mdl: Report calibration successful when starting with -C option * lis3mdl: Use PX4_OK, PX4_ERROR for return value / orb_unadvertise * Fixes PX4#10740
I found a problem with the starting order if two lis3mdl sensors are available.
Version: stable branch
In QGroundControl PREFLIGHT FAIL: MAG 1 SELFTEST FAILED showed up, so I tested some things.
Configuration: Pixracer r15 with lis3mdl onboard and lis3mdl on GPS module:
https://store.mrobotics.io/mRo-GPS-u-Blox-Neo-M8N-HMC5983-Compass-p/mro-gps003-mr.htm
In the default rc.sensors for PX4FMU_V4, the order is the following:
lis3mdl -X start
lis3mdl start
When I display the sensor values, the onboard sensor shows all 0:
When I start them the other way around, they run just fine. However, starting order should not matter:
The text was updated successfully, but these errors were encountered: