ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Plane:No GPS quality check when mixing

Open claytonasmith opened this issue 13 years ago • 2 comments

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;
    }
    

claytonasmith avatar Sep 10 '13 19:09 claytonasmith

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.

squilter avatar Sep 13 '14 01:09 squilter

Paul Riseborough is going to blend in the GPS alt to the overall position estimate calculated in the EKF.

rmackay9 avatar Sep 14 '14 03:09 rmackay9