Setteable MIN_COUSE_SPEED in ahrs_float_dcm (#2794)

Co-authored-by: jesusBV20 <jesbauti@ucm.es>
Co-authored-by: Hector Garcia de Marina <hgdemarina@gmail.com>
This commit is contained in:
Hector Garcia de Marina
2021-11-06 20:41:35 +01:00
committed by GitHub
parent ce706bcd04
commit 360b6a82f9
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ void ahrs_dcm_update_gps(struct GpsState *gps_s UNUSED)
ahrs_dcm.gps_age = 0;
ahrs_dcm.gps_speed = gps_s->speed_3d / 100.;
if (gps_s->gspeed >= 500) { //got a 3d fix and ground speed is more than 5.0 m/s //FIXME: Should be settable
if (gps_s->gspeed >= 100*AHRS_FLOAT_MIN_SPEED_GPS_COURSE) { // AHRS_FLOAT_MIN_SPEED_GPS_COURSE m/s
ahrs_dcm.gps_course = ((float)gps_s->course) / 1.e7;
ahrs_dcm.gps_course_valid = true;
} else {
@@ -72,6 +72,9 @@ extern struct AhrsFloatDCM ahrs_dcm;
// Mode 1 = DCM integration with Kp and Ki
// Mode 2 = direct accelerometer -> euler
#ifndef AHRS_FLOAT_MIN_SPEED_GPS_COURSE
#define AHRS_FLOAT_MIN_SPEED_GPS_COURSE 5 // m/s
#endif
#define PERFORMANCE_REPORTING 1
#if PERFORMANCE_REPORTING == 1