mirror of https://github.com/ArduPilot/ardupilot
AP_GPS: don't accept infinite accuracies for blending
these result in NaN values for velocities
This commit is contained in:
parent
d359cdff3f
commit
0dafabf552
|
@ -1415,6 +1415,11 @@ bool AP_GPS::calc_blend_weights(void)
|
||||||
if (get_rate_ms(i) > max_rate_ms) {
|
if (get_rate_ms(i) > max_rate_ms) {
|
||||||
max_rate_ms = get_rate_ms(i);
|
max_rate_ms = get_rate_ms(i);
|
||||||
}
|
}
|
||||||
|
if (isinf(state[i].speed_accuracy) ||
|
||||||
|
isinf(state[i].horizontal_accuracy) ||
|
||||||
|
isinf(state[i].vertical_accuracy)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ((int32_t)(max_ms - min_ms) < (int32_t)(2 * max_rate_ms)) {
|
if ((int32_t)(max_ms - min_ms) < (int32_t)(2 * max_rate_ms)) {
|
||||||
// data is not too delayed so use the oldest time_stamp to give a chance for data from that receiver to be updated
|
// data is not too delayed so use the oldest time_stamp to give a chance for data from that receiver to be updated
|
||||||
|
|
Loading…
Reference in New Issue