From 882970c11aa411aeee937196b0d5753202d86c9c Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Sat, 2 Mar 2024 12:27:36 +1030 Subject: [PATCH] Copter: Payload Place: Change PLDP_RNG_MIN to PLDP_RNG_MAX --- ArduCopter/Parameters.cpp | 2 +- ArduCopter/Parameters.h | 2 +- ArduCopter/mode_auto.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index 58d86ab25a4d79..372935395645fc 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -1182,7 +1182,7 @@ const AP_Param::GroupInfo ParametersG2::var_info2[] = { // @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 30fbe9b8759c17..21bc10e78c87af 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -682,7 +682,7 @@ class ParametersG2 { // 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 83d2369b5c00a8..38ead02182cdbb 100644 --- a/ArduCopter/mode_auto.cpp +++ b/ArduCopter/mode_auto.cpp @@ -1301,13 +1301,13 @@ 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); 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)) { + } 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 minimum place_start_time_ms = now_ms; break;