Skip to content

Commit 1eefb49

Browse files
committed
ArduCopter: remove redundant check for home-is-set
this is done as part of the frame change
1 parent d1a1bcb commit 1eefb49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ArduCopter/inertia.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void Copter::read_inertia()
2020
// current_loc.alt is alt-above-home, converted from inertial nav's alt-above-ekf-origin
2121
const int32_t alt_above_origin_cm = inertial_nav.get_position_z_up_cm();
2222
current_loc.set_alt_cm(alt_above_origin_cm, Location::AltFrame::ABOVE_ORIGIN);
23-
if (!ahrs.home_is_set() || !current_loc.change_alt_frame(Location::AltFrame::ABOVE_HOME)) {
23+
if (current_loc.initialised() && !current_loc.change_alt_frame(Location::AltFrame::ABOVE_HOME)) {
2424
// if home has not been set yet we treat alt-above-origin as alt-above-home
2525
current_loc.set_alt_cm(alt_above_origin_cm, Location::AltFrame::ABOVE_HOME);
2626
}

0 commit comments

Comments
 (0)