Skip to content

Commit

Permalink
AP_Baro: Allow setting field elevation to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade committed Nov 25, 2024
1 parent 650b978 commit b289292
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/AP_Baro/AP_Baro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,8 @@ void AP_Baro::update_field_elevation(void)
// auto-set based on origin
Location origin;
if (!armed && AP::ahrs().get_origin(origin)) {
new_field_elev = !is_equal(_field_elevation_active, origin.alt * 0.01f);
_field_elevation_active = origin.alt * 0.01;
new_field_elev = true;
}
} else if (fabsf(_field_elevation_active-_field_elevation) > 1.0 &&
!is_zero(_field_elevation)) {
Expand Down

0 comments on commit b289292

Please sign in to comment.