Skip to content

Commit

Permalink
Plane: Pass external HAGL to TECS
Browse files Browse the repository at this point in the history
  • Loading branch information
Georacer authored and peterbarker committed Dec 14, 2024
1 parent 70fe304 commit 4c335e8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ArduPlane/ArduPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,16 @@ float Plane::tecs_hgt_afe(void)
coming.
*/
float hgt_afe;

if (flight_stage == AP_FixedWing::FlightStage::LAND) {

#if AP_MAVLINK_MAV_CMD_SET_HAGL_ENABLED
// if external HAGL is active use that
if (get_external_HAGL(hgt_afe)) {
return hgt_afe;
}
#endif

hgt_afe = height_above_target();
#if AP_RANGEFINDER_ENABLED
hgt_afe -= rangefinder_correction();
Expand Down

0 comments on commit 4c335e8

Please sign in to comment.