Minor code simplification

This commit is contained in:
Oleg Kalachev
2025-08-09 17:53:06 +03:00
parent cd953f24ad
commit ea35db37da

View File

@@ -11,8 +11,6 @@
#define WEIGHT_ACC 0.003 #define WEIGHT_ACC 0.003
#define RATES_LFP_ALPHA 0.2 // cutoff frequency ~ 40 Hz #define RATES_LFP_ALPHA 0.2 // cutoff frequency ~ 40 Hz
LowPassFilter<Vector> ratesFilter(RATES_LFP_ALPHA);
void estimate() { void estimate() {
applyGyro(); applyGyro();
applyAcc(); applyAcc();
@@ -20,6 +18,7 @@ void estimate() {
void applyGyro() { void applyGyro() {
// filter gyro to get angular rates // filter gyro to get angular rates
static LowPassFilter<Vector> ratesFilter(RATES_LFP_ALPHA);
rates = ratesFilter.update(gyro); rates = ratesFilter.update(gyro);
// apply rates to attitude // apply rates to attitude