From bc6d965bbcd9f515a5545c16db64a4f5f3a838e9 Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Tue, 5 Mar 2024 14:41:52 +1030 Subject: [PATCH] Copter: Payload Place: Change PLDP_RNG_MIN to PLDP_RNG_MAX --- ArduCopter/Parameters.cpp | 8 ++++---- ArduCopter/Parameters.h | 2 +- ArduCopter/mode_auto.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index 58d86ab25a..f8f1376c90 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -1176,13 +1176,13 @@ const AP_Param::GroupInfo ParametersG2::var_info2[] = { // @User: Standard AP_GROUPINFO("PLDP_THRESH", 1, ParametersG2, pldp_thrust_placed_fraction, 0.9), - // @Param: PLDP_RNG_MIN - // @DisplayName: Payload Place minimum range finder altitude - // @Description: Minimum range finder altitude in m to trigger payload touchdown, set to zero to disable. + // @Param: PLDP_RNG_MAX + // @DisplayName: Payload Place maximum range finder altitude + // @Description: Maximum range finder altitude in m to trigger payload touchdown, set to zero to disable. // @Units: m // @Range: 0 100 // @User: Standard - AP_GROUPINFO("PLDP_RNG_MIN", 2, ParametersG2, pldp_range_finder_minimum_m, 0.0), + AP_GROUPINFO("PLDP_RNG_MAX", 2, ParametersG2, pldp_range_finder_maximum_m, 0.0), // @Param: PLDP_DELAY // @DisplayName: Payload Place climb delay diff --git a/ArduCopter/Parameters.h b/ArduCopter/Parameters.h index 30fbe9b875..21bc10e78c 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -682,7 +682,7 @@ public: // payload place parameters AP_Float pldp_thrust_placed_fraction; - AP_Float pldp_range_finder_minimum_m; + AP_Float pldp_range_finder_maximum_m; AP_Float pldp_delay_s; AP_Float pldp_descent_speed_ms; }; diff --git a/ArduCopter/mode_auto.cpp b/ArduCopter/mode_auto.cpp index 83d2369b5c..12233d9f48 100644 --- a/ArduCopter/mode_auto.cpp +++ b/ArduCopter/mode_auto.cpp @@ -1301,14 +1301,14 @@ void PayloadPlace::run() // thrust is above minimum threshold place_start_time_ms = now_ms; break; - } else if (is_positive(g2.pldp_range_finder_minimum_m)) { + } else if (is_positive(g2.pldp_range_finder_maximum_m)) { if (!copter.rangefinder_state.enabled) { // abort payload place because rangefinder is not enabled state = State::Ascent_Start; - gcs().send_text(MAV_SEVERITY_WARNING, "%s PLDP_RNG_MIN set and rangefinder not enabled", prefix_str); + gcs().send_text(MAV_SEVERITY_WARNING, "%s PLDP_RNG_MAX set and rangefinder not enabled", prefix_str); break; - } else if (copter.rangefinder_alt_ok() && (copter.rangefinder_state.glitch_count == 0) && (copter.rangefinder_state.alt_cm > g2.pldp_range_finder_minimum_m * 100.0)) { - // range finder altitude is above minimum + } else if (copter.rangefinder_alt_ok() && (copter.rangefinder_state.glitch_count == 0) && (copter.rangefinder_state.alt_cm > g2.pldp_range_finder_maximum_m * 100.0)) { + // range finder altitude is above maximum place_start_time_ms = now_ms; break; }