mirror of https://github.com/ArduPilot/ardupilot
AP_NavEKF2: use get_distance instead of location_diff
This commit is contained in:
parent
0b50f32c32
commit
3f5a6a243c
|
@ -51,7 +51,7 @@ bool NavEKF2_core::calcGpsGoodToAlign(void)
|
|||
float deltaTime = constrain_float(float(imuDataDelayed.time_ms - lastPreAlignGpsCheckTime_ms)*0.001f,0.01f,posFiltTimeConst);
|
||||
lastPreAlignGpsCheckTime_ms = imuDataDelayed.time_ms;
|
||||
// Sum distance moved
|
||||
gpsDriftNE += location_diff(gpsloc_prev, gpsloc).length();
|
||||
gpsDriftNE += gpsloc_prev.get_distance(gpsloc);
|
||||
gpsloc_prev = gpsloc;
|
||||
// Decay distance moved exponentially to zero
|
||||
gpsDriftNE *= (1.0f - deltaTime/posFiltTimeConst);
|
||||
|
|
Loading…
Reference in New Issue