From 3e895803837eef78d916a5e705ee4b9d1b354523 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 6 Dec 2016 17:30:33 +1100 Subject: [PATCH] Revert "AP_Landing: abstract out init_start_nav_cnd work to landing lib" This reverts commit 8d8775125a20031ade3b5fff9aa71e3e20c69050. doesn't build --- libraries/AP_Landing/AP_Landing.cpp | 11 ----------- libraries/AP_Landing/AP_Landing.h | 8 +++----- libraries/AP_Landing/AP_Landing_Slope.cpp | 12 ------------ 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/libraries/AP_Landing/AP_Landing.cpp b/libraries/AP_Landing/AP_Landing.cpp index 42afb332ed..2915594eeb 100644 --- a/libraries/AP_Landing/AP_Landing.cpp +++ b/libraries/AP_Landing/AP_Landing.cpp @@ -183,17 +183,6 @@ void AP_Landing::setup_landing_glide_slope(const Location &prev_WP_loc, const Lo case TYPE_STANDARD_GLIDE_SLOPE: type_slope_setup_landing_glide_slope(prev_WP_loc, next_WP_loc, current_loc, target_altitude_offset_cm); break; - -/* - * initialize state for new nav command - */ -void AP_Landing::init_start_nav_cmd(void) -{ - switch (type) { - default: - case TYPE_STANDARD_GLIDE_SLOPE: - type_slope_init_start_nav_cmd(); - break; } } diff --git a/libraries/AP_Landing/AP_Landing.h b/libraries/AP_Landing/AP_Landing.h index cb568cbf68..2160238ec5 100644 --- a/libraries/AP_Landing/AP_Landing.h +++ b/libraries/AP_Landing/AP_Landing.h @@ -89,7 +89,6 @@ public: int8_t get_abort_throttle_enable(void) const { return abort_throttle_enable; } int8_t get_flap_percent(void) const { return flap_percent; } int8_t get_throttle_slewrate(void) const { return throttle_slewrate; } - void init_start_nav_cmd(void); // Flag to indicate if we have landed. @@ -111,14 +110,14 @@ public: // landing altitude offset (meters) float alt_offset; + // once landed, post some landing statistics to the GCS + bool post_stats; + // denotes if a go-around has been commanded for landing bool commanded_go_around; private: - // once landed, post some landing statistics to the GCS - bool post_stats; - bool has_aborted_due_to_slope_recalc; AP_Mission &mission; @@ -158,6 +157,5 @@ private: void type_slope_setup_landing_glide_slope(const Location &prev_WP_loc, const Location &next_WP_loc, const Location ¤t_loc, int32_t &target_altitude_offset_cm); void type_slope_check_if_need_to_abort(const AP_Vehicle::FixedWing::Rangefinder_State &rangefinder_state); - void type_slope_init_start_nav_cmd(void); }; diff --git a/libraries/AP_Landing/AP_Landing_Slope.cpp b/libraries/AP_Landing/AP_Landing_Slope.cpp index 72d1c27bc0..fc2f7803cc 100644 --- a/libraries/AP_Landing/AP_Landing_Slope.cpp +++ b/libraries/AP_Landing/AP_Landing_Slope.cpp @@ -292,15 +292,3 @@ void AP_Landing::type_slope_setup_landing_glide_slope(const Location &prev_WP_lo // stay within the range of the start and end locations in altitude constrain_target_altitude_location_fn(loc, prev_WP_loc); } - -void AP_Landing::type_slope_init_start_nav_cmd(void) -{ - complete = false; - pre_flare = false; - - // if a go around had been commanded, clear it now. - commanded_go_around = false; - - // once landed, post some landing statistics to the GCS - post_stats = false; -}