ardupilot
ardupilot copied to clipboard
Plane:No GPS quality check when mixing
Hi, It looks like altitude could be calculated incorrectly if the GPS becomes erroneous. Is that true, or is there a check that I'm missing? I see that the barometer must be healthy, but was expecting the GPS to also be healthy, otherwise only use read_barometer(). Thanks!
- Clayton
static void update_alt() { // this function is in place to potentially add a sonar sensor in the future //altitude_sensor = BARO; **if (barometer.healthy) {** // alt_MSL centimeters (centimeters) current_loc.alt = (1 - g.altitude_mix) \* g_gps->altitude_cm; current_loc.alt += g.altitude_mix \* (read_barometer() + home.alt); } else if (g_gps->status() >= GPS::GPS_OK_FIX_3D) { // alt_MSL centimeters (centimeters) current_loc.alt = g_gps->altitude_cm; }
The code has changed enough since September that I could not find the relevant code. If you mean this, then the problem was solved by ignoring the gps altitude.
Paul Riseborough is going to blend in the GPS alt to the overall position estimate calculated in the EKF.