Open jerabaul29 opened 1 year ago
PS: the accelerations seem definitely to be expected in g:s, so my feeding ms-2 into the Kalman filter is probably at least suboptimal, better said wrong; but if the Kalman filter is just using the mean direction of accel to determine the vertical, and not taking into account the magnitude (possible, but hard to see through the maths of the algo), that may not play a bit role for the quaternion estimate. Still, would be nice to test and better to get right :) .
My 2 cents, a few of the possible sources of issues:
sign: are the accelerations "absolute accelerations" or "accelerations measured by the IMU"? This is quite easy to mix up, especially when gravity is involved: gravity is pulling "to the ground", but feels as if accelerating "to the sky". Same with angular rates, I always get confused about the conventions in the datasheet vs the libraries vs the filters....
units: m/s^2 vs g vs mg, deg/s vs rad/s as you were pointing out; I think it may be a good idea to triple check all of this once and for all with https://github.com/adafruit/Adafruit_AHRS / https://github.com/adafruit/Adafruit_AHRS/blob/master/src/Adafruit_AHRS_NXPFusion.h and https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion / https://github.com/PaulStoffregen/NXPMotionSense . And these codes have been copy pasted and slightly reworked several times, which makes things even worse imo :( . I had for my part get inspired by: https://github.com/adafruit/Adafruit_AHRS/blob/master/examples/ahrs_fusion_ble_nrf51/ahrs_fusion_ble_nrf51.ino .