mirror of
https://github.com/okalachev/flix.git
synced 2025-08-17 00:56:11 +00:00
Minor code simplification
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user