Closed lvdlvd closed 1 week ago
You should call FusionAhrsUpdate
for each new gyroscope measurement and use the most recent accelerometer and magnetometer measurements at that time. The deltaTime
value should correspond to the gyroscope. This is the correct way to combine asynchronously sampled sensors. The errors associated with the phasing will be negligible.
Thanks for your swift reply!
Apologies if this is obvious, but i get implausible results if i do this naively, and i can't find authoritative documentation on the matter.
i have an accelerometer sampling at 100Hz, a gyroscope at 400Hz and a magnetometer at about 150Hz without a common clock base, i.e. they have each their own free running oscilattors, but the samples come in with accurate timestamps.
Looking inside the FusionAhrsUpdate function, it seems to be able to deal with the accel and mag missing, so depending on which sensor data is coming in, i call it as below: whenever i get the accel or the mag, i re-use the last gyro:
help much appreciated.