mirror of https://github.com/ArduPilot/ardupilot
AP_Baro: Check if origin alt is zero before using it as field elevation
This commit is contained in:
parent
fa0f089fe1
commit
5fda953316
|
@ -1013,7 +1013,9 @@ void AP_Baro::update_field_elevation(void)
|
|||
is_zero(_field_elevation)) {
|
||||
// auto-set based on origin
|
||||
Location origin;
|
||||
if (!armed && AP::ahrs().get_origin(origin)) {
|
||||
if (!armed &&
|
||||
AP::ahrs().get_origin(origin) &&
|
||||
origin.alt != 0) {
|
||||
_field_elevation_active = origin.alt * 0.01;
|
||||
new_field_elev = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue