All modules and core of the app was created

This commit is contained in:
2024-01-11 22:47:53 +07:00
parent 3c2889b8f7
commit 5dd404d44b
18 changed files with 647 additions and 128 deletions

View File

@@ -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;