Closed salviador closed 11 months ago
There are a few points to consider that might lead to NaN (Not a Number) results under certain conditions in the Kalman filter:
Initial Conditions and Parameters:
Division by Zero in Kalman Gain Calculation:
float S = P[0][0] + R_measure;
, there is a risk of division by zero when calculating the Kalman gain (K[0] = P[0][0] / S; and K[1] = P[1][0] / S;
). If S becomes zero or very close to zero, it could result in NaN values. A check can be added to ensure S is not zero before performing the division.
Hi, I use Nano 33 BLE rev 2 setting in KALMAN mode, but when I write roll , pitch in serial I only get roll, pitch in nan