Blimp: remove redundant check for home-is-set

this is done as part of the frame change
This commit is contained in:
Peter Barker 2024-04-11 18:52:23 +10:00
parent 1eefb4923c
commit 0440903a8c
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ void Blimp::read_inertia()
// current_loc.alt is alt-above-home, converted from inertial nav's alt-above-ekf-origin // current_loc.alt is alt-above-home, converted from inertial nav's alt-above-ekf-origin
const int32_t alt_above_origin_cm = inertial_nav.get_position_z_up_cm(); const int32_t alt_above_origin_cm = inertial_nav.get_position_z_up_cm();
current_loc.set_alt_cm(alt_above_origin_cm, Location::AltFrame::ABOVE_ORIGIN); current_loc.set_alt_cm(alt_above_origin_cm, Location::AltFrame::ABOVE_ORIGIN);
if (!ahrs.home_is_set() || !current_loc.change_alt_frame(Location::AltFrame::ABOVE_HOME)) { if (current_loc.initialised() && !current_loc.change_alt_frame(Location::AltFrame::ABOVE_HOME)) {
// if home has not been set yet we treat alt-above-origin as alt-above-home // if home has not been set yet we treat alt-above-origin as alt-above-home
current_loc.set_alt_cm(alt_above_origin_cm, Location::AltFrame::ABOVE_HOME); current_loc.set_alt_cm(alt_above_origin_cm, Location::AltFrame::ABOVE_HOME);
} }