Skip to content

Commit

Permalink
FW Position Controller: fix Altitude mode without valid z reference (…
Browse files Browse the repository at this point in the history
…e.g. no GPS)

Signed-off-by: Silvan Fuhrer <[email protected]>
  • Loading branch information
sfuhrer committed Apr 26, 2024
1 parent f91103a commit 34cb698
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/fw_pos_control/FixedwingPositionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2304,7 +2304,7 @@ FixedwingPositionControl::Run()
_reference_altitude = 0.f;
}

_current_altitude = -_local_pos.z + _local_pos.ref_alt; // Altitude AMSL in meters
_current_altitude = -_local_pos.z + _reference_altitude; // Altitude AMSL in meters

// handle estimator reset events. we only adjust setpoins for manual modes
if (_control_mode.flag_control_manual_enabled) {
Expand Down

0 comments on commit 34cb698

Please sign in to comment.