Skip to content

Commit

Permalink
AP_Landing: make and use AP_LANDINGGEAR_ENABLED
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Dec 14, 2022
1 parent 3c201ae commit 3d641fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/AP_Landing/AP_Landing_Slope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
#include <AP_GPS/AP_GPS.h>
#include <AP_Logger/AP_Logger.h>

#if defined(APM_BUILD_TYPE)
// - this is just here to encourage the build system to supply the "legacy build defines". The actual dependecy is in the AP_LandingGear.h and AP_LandingGear_config.h headers
#endif

void AP_Landing::type_slope_do_land(const AP_Mission::Mission_Command& cmd, const float relative_altitude)
{
initial_slope = 0;
Expand Down Expand Up @@ -111,14 +115,16 @@ bool AP_Landing::type_slope_verify_land(const Location &prev_WP_loc, Location &n
}

type_slope_stage = SlopeStage::FINAL;


#if AP_LANDINGGEAR_ENABLED
// Check if the landing gear was deployed before landing
// If not - go around
AP_LandingGear *LG_inst = AP_LandingGear::get_singleton();
if (LG_inst != nullptr && !LG_inst->check_before_land()) {
type_slope_request_go_around();
gcs().send_text(MAV_SEVERITY_CRITICAL, "Landing gear was not deployed");
}
#endif
}

if (gps.ground_speed() < 3) {
Expand Down

0 comments on commit 3d641fa

Please sign in to comment.