AltitudeEstimation icon indicating copy to clipboard operation
AltitudeEstimation copied to clipboard

Kalman Filter always outputs negative acceleration and velocity

Open nocs85 opened this issue 9 months ago • 4 comments

Hello!

I am extremely interested in this Kalman Filter but unfortunately I am unable to let it calculate a positive acceleration, regardless of the Inputs (and signs) I provide. Here is a very simple sample code with two variations but the result is always the same, the Kalman filter returns always negative velocity and negative acceleration :(

float accelData[3];
accelData[0] = 0;
accelData[1] = 0;
accelData[2] = -0.1;

float gyroData[3];
gyroData[0] = 0;
gyroData[1] = 0;
gyroData[2] = 0;

altitude.estimate(accelData, gyroData, 0, micros());

altitude.getAltitude(), altitude.getVerticalVelocity() and altitude.getVerticalAcceleration() return always negative values, regardless of sign of value assigned to accelData[2], i.e. accelData[2] = -0.1; and accelData[2] = 0.1; lead always to the same results.

Can you please help?

PS: I previously tried with real IMU and pressure sensor data from BNO085 and BMP390 but since that didn't work I tried the basic example above and still I get the same results: always negative acceleration, negative velocity, decreasing altitude, regardless of the signs of the IMU signals

nocs85 avatar May 07 '24 20:05 nocs85