All modules and core of the app was created
This commit is contained in:
@@ -4,25 +4,17 @@ class Kalman2DFilter {
|
||||
public:
|
||||
Kalman2DFilter(float dt = 4.f, float accelUncertainty = 10.f, float barometerUncertainty = 100.f) {
|
||||
dt /= 1000.f;
|
||||
F = { 1, dt,
|
||||
0, 1 };
|
||||
G = { 0.5f * dt * dt,
|
||||
dt };
|
||||
F = { 1, dt, 0, 1 };
|
||||
G = { 0.5f * dt * dt, dt };
|
||||
H = { 1, 0 };
|
||||
I = { 1, 0,
|
||||
0, 1 };
|
||||
I = { 1, 0, 0, 1 };
|
||||
Q = G * ~G * accelUncertainty * accelUncertainty;
|
||||
R = { barometerUncertainty * barometerUncertainty };
|
||||
P = { 0, 0,
|
||||
0, 0 };
|
||||
S = { 0,
|
||||
0 };
|
||||
P = { 0, 0, 0, 0 };
|
||||
S = { 0, 0 };
|
||||
}
|
||||
|
||||
void filter(const float &AccZInertial,
|
||||
const float &AltitudeBarometer,
|
||||
float &AltitudeKalman,
|
||||
float &VelocityVerticalKalman) {
|
||||
void filter(const float &AccZInertial, const float &AltitudeBarometer, float &AltitudeKalman, float &VelocityVerticalKalman) {
|
||||
Acc = { AccZInertial };
|
||||
S = F * S + G * Acc;
|
||||
P = F * P * ~F + Q;
|
||||
|
||||
Reference in New Issue
Block a user