From 8f06a27480ee7e796a8817e70bf1ef7d2269872e Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Sat, 4 Sep 2021 09:14:25 +0930 Subject: [PATCH] Copter: Remove parameter RNGFND_GAIN --- ArduCopter/Parameters.cpp | 12 +----------- ArduCopter/Parameters.h | 12 ++++-------- ArduCopter/config.h | 4 ---- ArduCopter/defines.h | 2 +- ArduCopter/tuning.cpp | 7 ------- 5 files changed, 6 insertions(+), 31 deletions(-) diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index e33498a284..68043848f4 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -167,16 +167,6 @@ const AP_Param::Info Copter::var_info[] = { GSCALAR(rtl_alt_type, "RTL_ALT_TYPE", 0), #endif -#if RANGEFINDER_ENABLED == ENABLED - // @Param: RNGFND_GAIN - // @DisplayName: Rangefinder gain - // @Description: Used to adjust the speed with which the target altitude is changed when objects are sensed below the copter - // @Range: 0.01 2.0 - // @Increment: 0.01 - // @User: Standard - GSCALAR(rangefinder_gain, "RNGFND_GAIN", RANGEFINDER_GAIN_DEFAULT), -#endif - // @Param: FS_GCS_ENABLE // @DisplayName: Ground Station Failsafe Enable // @Description: Controls whether failsafe will be invoked (and what action to take) when connection with Ground station is lost for at least 5 seconds. See FS_OPTIONS param for additional actions, or for cases allowing Mission continuation, when GCS failsafe is enabled. @@ -346,7 +336,7 @@ const AP_Param::Info Copter::var_info[] = { // @DisplayName: Channel 6 Tuning // @Description: Controls which parameters (normally PID gains) are being tuned with transmitter's channel 6 knob // @User: Standard - // @Values: 0:None,1:Stab Roll/Pitch kP,4:Rate Roll/Pitch kP,5:Rate Roll/Pitch kI,21:Rate Roll/Pitch kD,3:Stab Yaw kP,6:Rate Yaw kP,26:Rate Yaw kD,56:Rate Yaw Filter,55:Motor Yaw Headroom,14:AltHold kP,7:Throttle Rate kP,34:Throttle Accel kP,35:Throttle Accel kI,36:Throttle Accel kD,12:Loiter Pos kP,22:Velocity XY kP,28:Velocity XY kI,10:WP Speed,25:Acro RollPitch kP,40:Acro Yaw kP,45:RC Feel,13:Heli Ext Gyro,38:Declination,39:Circle Rate,41:RangeFinder Gain,46:Rate Pitch kP,47:Rate Pitch kI,48:Rate Pitch kD,49:Rate Roll kP,50:Rate Roll kI,51:Rate Roll kD,52:Rate Pitch FF,53:Rate Roll FF,54:Rate Yaw FF,58:SysID Magnitude + // @Values: 0:None,1:Stab Roll/Pitch kP,4:Rate Roll/Pitch kP,5:Rate Roll/Pitch kI,21:Rate Roll/Pitch kD,3:Stab Yaw kP,6:Rate Yaw kP,26:Rate Yaw kD,56:Rate Yaw Filter,55:Motor Yaw Headroom,14:AltHold kP,7:Throttle Rate kP,34:Throttle Accel kP,35:Throttle Accel kI,36:Throttle Accel kD,12:Loiter Pos kP,22:Velocity XY kP,28:Velocity XY kI,10:WP Speed,25:Acro RollPitch kP,40:Acro Yaw kP,45:RC Feel,13:Heli Ext Gyro,38:Declination,39:Circle Rate,46:Rate Pitch kP,47:Rate Pitch kI,48:Rate Pitch kD,49:Rate Roll kP,50:Rate Roll kI,51:Rate Roll kD,52:Rate Pitch FF,53:Rate Roll FF,54:Rate Yaw FF,58:SysID Magnitude GSCALAR(radio_tuning, "TUNE", 0), // @Param: FRAME_TYPE diff --git a/ArduCopter/Parameters.h b/ArduCopter/Parameters.h index 374eef77a1..ba1bea0312 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -100,10 +100,10 @@ public: k_param_throttle_accel_enabled, // deprecated - remove k_param_wp_yaw_behavior, k_param_acro_trainer, - k_param_pilot_speed_up, // renamed from k_param_pilot_velocity_z_max - k_param_circle_rate, // deprecated - remove - k_param_rangefinder_gain, - k_param_ch8_option_old, // deprecated + k_param_pilot_speed_up, // renamed from k_param_pilot_velocity_z_max + k_param_circle_rate, // deprecated - remove + k_param_rangefinder_gain, // deprecated - remove + k_param_ch8_option_old, // deprecated k_param_arming_check_old, // deprecated - remove k_param_sprayer, k_param_angle_max, @@ -403,10 +403,6 @@ public: AP_Int8 rtl_alt_type; #endif -#if RANGEFINDER_ENABLED == ENABLED - AP_Float rangefinder_gain; -#endif - AP_Int8 failsafe_gcs; // ground station failsafe behavior AP_Int16 gps_hdop_good; // GPS Hdop value at or below this value represent a good position diff --git a/ArduCopter/config.h b/ArduCopter/config.h index c906530437..01fa940c75 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -81,10 +81,6 @@ # define RANGEFINDER_TIMEOUT_MS 1000 // rangefinder filter reset if no updates from sensor in 1 second #endif -#ifndef RANGEFINDER_GAIN_DEFAULT - # define RANGEFINDER_GAIN_DEFAULT 0.8f // gain for controlling how quickly rangefinder range adjusts target altitude (lower means slower reaction) -#endif - #ifndef RANGEFINDER_FILT_DEFAULT # define RANGEFINDER_FILT_DEFAULT 0.5f // filter for rangefinder distance #endif diff --git a/ArduCopter/defines.h b/ArduCopter/defines.h index a45df46cdc..dc440ed49c 100644 --- a/ArduCopter/defines.h +++ b/ArduCopter/defines.h @@ -54,7 +54,7 @@ enum tuning_func { TUNING_DECLINATION = 38, // compass declination in radians TUNING_CIRCLE_RATE = 39, // circle turn rate in degrees (hard coded to about 45 degrees in either direction) TUNING_ACRO_YAW_KP = 40, // acro controller's P term. converts pilot input to a desired roll, pitch or yaw rate - TUNING_RANGEFINDER_GAIN = 41, // rangefinder gain + TUNING_RANGEFINDER_GAIN = 41, // unused TUNING_EKF_VERTICAL_POS = 42, // unused TUNING_EKF_HORIZONTAL_POS = 43, // unused TUNING_EKF_ACCEL_NOISE = 44, // unused diff --git a/ArduCopter/tuning.cpp b/ArduCopter/tuning.cpp index 92e04b671a..3e2dd4fbbc 100644 --- a/ArduCopter/tuning.cpp +++ b/ArduCopter/tuning.cpp @@ -142,13 +142,6 @@ void Copter::tuning() break; #endif -#if RANGEFINDER_ENABLED == ENABLED - case TUNING_RANGEFINDER_GAIN: - // set rangefinder gain - g.rangefinder_gain.set(tuning_value); - break; -#endif - case TUNING_RC_FEEL_RP: attitude_control->set_input_tc(tuning_value); break;