mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-26 09:43:57 -04:00
AP_GPS: prevent UAVCAN GPS from giving infinite accuracy values
this can happen due to the complex encodings of accuracies in UAVCAN
This commit is contained in:
parent
f8beca190c
commit
d359cdff3f
@ -427,6 +427,12 @@ bool AP_GPS_UAVCAN::read(void)
|
|||||||
if (_new_data) {
|
if (_new_data) {
|
||||||
_new_data = false;
|
_new_data = false;
|
||||||
|
|
||||||
|
// the encoding of accuracies in UAVCAN can result in infinite
|
||||||
|
// values. These cause problems with blending. Use 1000m and 1000m/s instead
|
||||||
|
interim_state.horizontal_accuracy = MIN(interim_state.horizontal_accuracy, 1000.0);
|
||||||
|
interim_state.vertical_accuracy = MIN(interim_state.vertical_accuracy, 1000.0);
|
||||||
|
interim_state.speed_accuracy = MIN(interim_state.speed_accuracy, 1000.0);
|
||||||
|
|
||||||
state = interim_state;
|
state = interim_state;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user