mirror of https://github.com/ArduPilot/ardupilot
fixed GPS bug - moved to fast loop location
This commit is contained in:
parent
c327a9f000
commit
8d909f6eed
|
@ -858,6 +858,12 @@ void loop()
|
|||
// -------------------------------------------------
|
||||
estimate_velocity();
|
||||
|
||||
// check for new GPS messages
|
||||
// --------------------------
|
||||
if(GPS_enabled){
|
||||
update_GPS();
|
||||
}
|
||||
|
||||
// perform 10hz tasks
|
||||
// ------------------
|
||||
medium_loop();
|
||||
|
@ -901,10 +907,6 @@ static void fast_loop()
|
|||
// IMU DCM Algorithm
|
||||
read_AHRS();
|
||||
|
||||
if(GPS_enabled){
|
||||
update_GPS();
|
||||
}
|
||||
|
||||
// custom code/exceptions for flight modes
|
||||
// ---------------------------------------
|
||||
update_yaw_mode();
|
||||
|
@ -1292,8 +1294,8 @@ static void update_GPS(void)
|
|||
}else{
|
||||
// after 12 reads we guess we may have lost GPS signal, stop navigating
|
||||
// we have lost GPS signal for a moment. Reduce our error to avoid flyaways
|
||||
nav_roll = 0;
|
||||
nav_pitch = 0;
|
||||
nav_roll >>= 1;
|
||||
nav_pitch >>= 1;
|
||||
}
|
||||
|
||||
if (g_gps->new_data && g_gps->fix) {
|
||||
|
|
Loading…
Reference in New Issue