-
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
Implemented ICM20948 / AK09916 magnetometer driver #9345
Conversation
What is the difference between the ICM20948 and the MPU9250? The reason I ask is that this looks like a rename / revision of that part and we found that keeping a part family in one driver greatly improves the quality of the driver because incremental fixes are done centrally. I would assume that minor checks for driver versions would allow to run the same driver against both. Check the MPU6000 driver for an example (its supporting pretty much any of the ICM devices under the sun). We have in the past had cases where not very well maintained drivers caused significant issues and the more different drivers we have, the more we prime ourselves for it. |
And many thanks for the hard work on the contribution! I know this must have taken time to write and is much appreciated! |
Fantastic work! |
Thanks! I will look into the MPU9250 and MPU6000 drivers and see if I can integrate ICM20948 support. I wasn't aware those supported a range of devices, thanks for the hint! |
After a quick glance, the AK8963 submodule of MPU9250 seems quite similar to AK09916. Would you say it makes sense to use different register maps in one driver based on device type? |
@flochir In our experience yes, as the overall logic / operation is the same. You can also think of it in terms of the engineering process: Within Invensense there is also a continuous iteration on the components where they start off with the old design and then change it. So all the tacit knowledge in the driver for the old part usually applies also to the new part. |
All right, I'll try to come up with an integration into MPU9250. |
Hello, I am trying to read out the values of ICM 20948 using an i2c configurable FTDI cable and Visual Studio. I am reading the output registers directly and the accelerometer, gyro output values look fine with a bit of tolerance but the magnetometer values are weird. Please have a look and shed some light on what might be causing this. Thank you Regards, |
@copperscopernicus you could compare your sensor initialization and readout code to PR #10116, the mag works fine with that. |
Here's my prototype driver for the ICM20948 IMU on recent Here GNSS devices for review (see issue #8624).
The ICM20948 packages an AK09916 submodule which is also available as a standalone magnetometer, so I wrote the driver for it separately and use it from the ICM20948 driver. It should work with a AK09916 on its own. I might test this at some point.
The ICM20948 driver itself is no CDev yet as it only configures the ICM20948 parent to put through the AK09916 on the I2C bus. The accelerometer and gyro and temperature sensor could be implemented here, though. Would they make sense being mounted on the external GPS?
I will work to improve this. As of now it seems to be running well on my Pixhawk 2.1 + Here GNSS setup, will do a test flight tomorrow. Any hints on style or implementation welcome!