Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/main/sensors/gyro.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ typedef struct smithPredictor_s {
uint8_t enabled;
uint8_t samples;
uint8_t idx;

float data[MAX_SMITH_SAMPLES + 1]; // This is gonna be a ring buffer. Max of 8ms delay at 8khz

pt1Filter_t smithPredictorFilter; // filter the smith predictor output for RPY

float smithPredictorStrength;
} smithPredictor_t;

float applySmithPredictor(smithPredictor_t *smithPredictor, float gyroFiltered);
#endif // USE_SMITH_PREDICTOR

typedef enum {
Expand Down Expand Up @@ -208,7 +207,6 @@ bool gyroOverflowDetected(void);
bool gyroYawSpinDetected(void);
uint16_t gyroAbsRateDps(int axis);
uint8_t gyroReadRegister(uint8_t whichSensor, uint8_t reg);
float applySmithPredictor(smithPredictor_t *smithPredictor, float gyroFiltered);
#ifdef USE_GYRO_DATA_ANALYSE
bool isDynamicFilterActive(void);
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/main/sensors/gyro_filter_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ static FAST_CODE void GYRO_FILTER_FUNCTION_NAME(gyroSensor_t *gyroSensor) {
#ifndef USE_GYRO_IMUF9001
update_kalman_covariance(gyroADCf, axis);
#endif
#ifdef USE_SMITH_PREDICTOR
applySmithPredictor(gyroSensor->smithPredictor, gyroADCf);
#endif

#ifdef USE_GYRO_IMUF9001
// DEBUG_GYRO_FILTERED records the scaled, filtered, after all software filtering has been applied.
Expand Down