1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +03:00

Gps Rescue: Fix "velocityD" filtering (#12042)

* GPS Rescue: Refactor parameter group

* GPS Rescue: Fix "velocityD" filtering
This commit is contained in:
Jan Post 2022-12-10 13:41:35 +01:00 committed by GitHub
parent 7bd81bf639
commit cb41b55c40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 210 additions and 111 deletions

View file

@ -35,13 +35,13 @@ alignsensor_unittest_SRC := \
$(USER_DIR)/common/maths.c
arming_prevention_unittest_SRC := \
$(USER_DIR)/common/bitarray.c \
$(USER_DIR)/fc/core.c \
$(USER_DIR)/fc/dispatch.c \
$(USER_DIR)/fc/rc_controls.c \
$(USER_DIR)/fc/rc_modes.c \
$(USER_DIR)/fc/runtime_config.c \
$(USER_DIR)/flight/gps_rescue.c \
$(USER_DIR)/common/bitarray.c
$(USER_DIR)/flight/gps_rescue.c
arming_prevention_unittest_DEFINES := \
USE_GPS_RESCUE=

View file

@ -18,34 +18,48 @@
#include <stdint.h>
extern "C" {
#include "blackbox/blackbox.h"
#include "build/debug.h"
#include "common/filter.h"
#include "common/maths.h"
#include "config/feature.h"
#include "pg/motor.h"
#include "pg/pg.h"
#include "pg/pg_ids.h"
#include "pg/rx.h"
#include "config/config.h"
#include "config/feature.h"
#include "fc/controlrate_profile.h"
#include "fc/core.h"
#include "fc/rc_controls.h"
#include "fc/rc_modes.h"
#include "fc/runtime_config.h"
#include "flight/failsafe.h"
#include "flight/gps_rescue.h"
#include "flight/imu.h"
#include "flight/mixer.h"
#include "flight/pid.h"
#include "flight/position.h"
#include "flight/servos.h"
#include "io/beeper.h"
#include "io/gps.h"
#include "pg/gps_rescue.h"
#include "pg/motor.h"
#include "pg/pg.h"
#include "pg/pg_ids.h"
#include "pg/rx.h"
#include "rx/rx.h"
#include "scheduler/scheduler.h"
#include "sensors/acceleration.h"
#include "sensors/gyro.h"
#include "telemetry/telemetry.h"
#include "flight/gps_rescue.h"
PG_REGISTER(accelerometerConfig_t, accelerometerConfig, PG_ACCELEROMETER_CONFIG, 0);
PG_REGISTER(blackboxConfig_t, blackboxConfig, PG_BLACKBOX_CONFIG, 0);
@ -60,6 +74,7 @@ extern "C" {
PG_REGISTER(motorConfig_t, motorConfig, PG_MOTOR_CONFIG, 0);
PG_REGISTER(imuConfig_t, imuConfig, PG_IMU_CONFIG, 0);
PG_REGISTER(gpsConfig_t, gpsConfig, PG_GPS_CONFIG, 0);
PG_REGISTER(gpsRescueConfig_t, gpsRescueConfig, PG_GPS_RESCUE, 0);
PG_REGISTER(positionConfig_t, positionConfig, PG_POSITION, 0);
float rcCommand[4];
@ -81,6 +96,9 @@ extern "C" {
acc_t acc = {};
bool mockIsUpright = false;
uint8_t activePidLoopDenom = 1;
float gpsGetSampleRateHz(void) { return 10.0f; }
void pt2FilterUpdateCutoff(pt2Filter_t *filter, float k) { filter->k = k; }
}
uint32_t simulationFeatureFlags = 0;

View file

@ -54,6 +54,7 @@ extern "C" {
#include "osd/osd_elements.h"
#include "osd/osd_warnings.h"
#include "pg/gps_rescue.h"
#include "pg/pg.h"
#include "pg/pg_ids.h"
#include "pg/rx.h"

View file

@ -43,6 +43,7 @@ extern "C" {
#include "io/gps.h"
#include "io/vtx.h"
#include "pg/gps_rescue.h"
#include "pg/motor.h"
#include "pg/pg.h"
#include "pg/pg_ids.h"