From 1eefaa3f3e7e1069c20482a909a8dce99ddad5b8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 13:13:55 +1000 Subject: [PATCH 01/26] ArduCopter: remove parameter conversions from before 4.3 All of these conversions are present in the Copter-4.3.0 tag, so anybody running 4.3.0 or later has already had them applied: - PSC_NE_VEL_FLTE (Aug-2021) - ACRO_RP_RATE/ACRO_Y_RATE replacing ACRO_RP_P/ACRO_Y_P (Sep-2021) - INS_HNTC2 from the old fixed notch (Apr-2022) - FENCE_ parameters into the AC_Fence object (Mar-2022) - the rate and expo command model parameters (Jun-2022) - PRX to PRX1_ (Aug-2022) Past this a user moving from a version of ArduCopter earlier than 4.3.0 will not have these parameters converted. --- ArduCopter/Copter.h | 4 -- ArduCopter/Parameters.cpp | 90 --------------------------------------- ArduCopter/system.cpp | 6 --- 3 files changed, 100 deletions(-) diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 4582d5b247dd2..f6c81cfb934d1 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -968,10 +968,6 @@ class Copter : public AP_Vehicle { // Parameters.cpp void load_parameters(void) override; - void convert_pid_parameters(void); -#if HAL_PROXIMITY_ENABLED - void convert_prx_parameters(); -#endif // precision_landing.cpp void init_precland(); diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index fe135d0e0989f..623d8647b35bd 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -1271,11 +1271,6 @@ void Copter::load_parameters(void) { AP_Vehicle::load_parameters(g.format_version, Parameters::k_format_version); - // PARAMETER_CONVERSION - Added: Mar-2022 -#if AP_FENCE_ENABLED - AP_Param::convert_class(g.k_param_fence_old, &fence, fence.var_info, 0, true); -#endif - // PARAMETER_CONVERSION - Added: Jul-2025 for ArduPilot-4.7 #if AP_RPM_ENABLED AP_Param::convert_class(g.k_param_rpm_sensor_old, &rpm_sensor, rpm_sensor.var_info, 0, true, true); @@ -1363,88 +1358,3 @@ void Copter::load_parameters(void) // setup AP_Param frame type flags AP_Param::set_frame_type_flags(AP_PARAM_FRAME_COPTER); } - -// handle conversion of PID gains -void Copter::convert_pid_parameters(void) -{ - const AP_Param::ConversionInfo angle_and_filt_conversion_info[] = { - // PARAMETER_CONVERSION - Added: Aug-2021 - { Parameters::k_param_pi_vel_xy, 3, AP_PARAM_FLOAT, "PSC_NE_VEL_FLTE" }, - }; - - // convert angle controller gain and filter without scaling - for (const auto &info : angle_and_filt_conversion_info) { - AP_Param::convert_old_parameter(&info, 1.0f); - } - -#if AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED -#if HAL_INS_NUM_HARMONIC_NOTCH_FILTERS > 1 - if (!ins.harmonic_notches[1].params.enabled()) { - // notch filter parameter conversions (moved to INS_HNTC2) for 4.2.x, converted from fixed notch - const AP_Param::ConversionInfo notchfilt_conversion_info[] { - // PARAMETER_CONVERSION - Added: Apr-2022 for ArduPilot-4.2 - { Parameters::k_param_ins, 101, AP_PARAM_INT8, "INS_HNTC2_ENABLE" }, - { Parameters::k_param_ins, 293, AP_PARAM_FLOAT, "INS_HNTC2_ATT" }, - { Parameters::k_param_ins, 357, AP_PARAM_FLOAT, "INS_HNTC2_FREQ" }, - { Parameters::k_param_ins, 421, AP_PARAM_FLOAT, "INS_HNTC2_BW" }, - }; - AP_Param::convert_old_parameters(¬chfilt_conversion_info[0], ARRAY_SIZE(notchfilt_conversion_info)); - AP_Param::set_default_by_name("INS_HNTC2_MODE", 0); - AP_Param::set_default_by_name("INS_HNTC2_HMNCS", 1); - } -#endif -#endif // AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED - - // ACRO_RP_P and ACRO_Y_P replaced with ACRO_RP_RATE and ACRO_Y_RATE for Copter-4.2 - // PARAMETER_CONVERSION - Added: Sep-2021 - const AP_Param::ConversionInfo acro_rpy_conversion_info[] = { - { Parameters::k_param_acro_rp_p, 0, AP_PARAM_FLOAT, "ACRO_RP_RATE" }, - { Parameters::k_param_acro_yaw_p, 0, AP_PARAM_FLOAT, "ACRO_Y_RATE" } - }; - for (const auto &info : acro_rpy_conversion_info) { - AP_Param::convert_old_parameter(&info, 45.0); - } - - // convert rate and expo command model parameters for Copter-4.3 - // PARAMETER_CONVERSION - Added: Jun-2022 for ArduPilot-4.3 - const AP_Param::ConversionInfo cmd_mdl_conversion_info[] = { - { Parameters::k_param_g2, 47, AP_PARAM_FLOAT, "ACRO_RP_RATE" }, - { Parameters::k_param_acro_rp_expo, 0, AP_PARAM_FLOAT, "ACRO_RP_EXPO" }, - { Parameters::k_param_g2, 48, AP_PARAM_FLOAT, "ACRO_Y_RATE" }, - { Parameters::k_param_g2, 9, AP_PARAM_FLOAT, "ACRO_Y_EXPO" }, - { Parameters::k_param_g2, 49, AP_PARAM_FLOAT, "PILOT_Y_RATE" }, - { Parameters::k_param_g2, 50, AP_PARAM_FLOAT, "PILOT_Y_EXPO" }, - }; - for (const auto &info : cmd_mdl_conversion_info) { - AP_Param::convert_old_parameter(&info, 1.0); - } - - // make any SRV_Channel upgrades needed - SRV_Channels::upgrade_parameters(); -} - -#if HAL_PROXIMITY_ENABLED -void Copter::convert_prx_parameters() -{ - // convert PRX to PRX1_ parameters for Copter-4.3 - // PARAMETER_CONVERSION - Added: Aug-2022 - static const AP_Param::ConversionInfo prx_conversion_info[] = { - { Parameters::k_param_g2, 72, AP_PARAM_INT8, "PRX1_TYPE" }, - { Parameters::k_param_g2, 136, AP_PARAM_INT8, "PRX1_ORIENT" }, - { Parameters::k_param_g2, 200, AP_PARAM_INT16, "PRX1_YAW_CORR" }, - { Parameters::k_param_g2, 264, AP_PARAM_INT16, "PRX1_IGN_ANG1" }, - { Parameters::k_param_g2, 328, AP_PARAM_INT8, "PRX1_IGN_WID1" }, - { Parameters::k_param_g2, 392, AP_PARAM_INT16, "PRX1_IGN_ANG2" }, - { Parameters::k_param_g2, 456, AP_PARAM_INT8, "PRX1_IGN_WID2" }, - { Parameters::k_param_g2, 520, AP_PARAM_INT16, "PRX1_IGN_ANG3" }, - { Parameters::k_param_g2, 584, AP_PARAM_INT8, "PRX1_IGN_WID3" }, - { Parameters::k_param_g2, 648, AP_PARAM_INT16, "PRX1_IGN_ANG4" }, - { Parameters::k_param_g2, 712, AP_PARAM_INT8, "PRX1_IGN_WID4" }, - { Parameters::k_param_g2, 1224, AP_PARAM_FLOAT, "PRX1_MIN" }, - { Parameters::k_param_g2, 1288, AP_PARAM_FLOAT, "PRX1_MAX" }, - }; - for (const auto &info : prx_conversion_info) { - AP_Param::convert_old_parameter(&info, 1.0); - } -} -#endif diff --git a/ArduCopter/system.cpp b/ArduCopter/system.cpp index 60487dde1fcb7..29c94ff94ef11 100644 --- a/ArduCopter/system.cpp +++ b/ArduCopter/system.cpp @@ -509,16 +509,10 @@ void Copter::allocate_motors(void) } // upgrade parameters. This must be done after allocating the objects - convert_pid_parameters(); #if FRAME_CONFIG == HELI_FRAME motors->heli_motors_param_conversions(); #endif -#if HAL_PROXIMITY_ENABLED - // convert PRX to PRX1_ parameters - convert_prx_parameters(); -#endif - // upgrade attitude controller parameters copter.attitude_control->convert_parameters(); From 5e07288e1135df644cefe0a79be9a18b0c5441ff Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 13:15:46 +1000 Subject: [PATCH 02/26] ArduPlane: remove parameter conversions from before 4.3 All of these conversions are present in the 4.3.0 release, so anybody running 4.3.0 or later has already had them applied: - FENCE_TYPE/FENCE_ACTION upgrade from the old altitude fences (Mar-2021) - TERRAIN_FOLLOW and USE_REV_THRUST parameter widths (2021) - the EFI object out of g2 (Oct-2021) - the airspeed object out of the old parameter tree (Jan-2022) - INS_HNTC2 from the old fixed notch (Apr-2022) - FENCE_ parameters into the AC_Fence object (Mar-2022) - the tailsitter, tiltrotor and weathervane parameter moves, and Q_PLT_Y_RATE - the entire q_conversion_table (2021 to Jul-2022) Past this a user moving from a version of ArduPlane earlier than 4.3.0 will not have these parameters converted. The Q_M_PWM_MIN/Q_M_PWM_MAX conversion is left alone here; it does more than migrate and is removed in its own commit. --- ArduPlane/Parameters.cpp | 135 --------------------------------------- ArduPlane/quadplane.cpp | 42 ------------ 2 files changed, 177 deletions(-) diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index 22cd849e71e4c..45f0024ec5a85 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -1360,8 +1360,6 @@ void Plane::load_parameters(void) g2.servo_channels.set_default_function(CH_2, SRV_Channel::k_elevator); g2.servo_channels.set_default_function(CH_3, SRV_Channel::k_throttle); g2.servo_channels.set_default_function(CH_4, SRV_Channel::k_rudder); - - SRV_Channels::upgrade_parameters(); #if HAL_QUADPLANE_ENABLED if (quadplane.enable) { @@ -1385,138 +1383,9 @@ void Plane::load_parameters(void) } } - -// PARAMETER_CONVERSION - Added: Mar-2021 for ArduPlane-4.1 -#if AP_FENCE_ENABLED - enum ap_var_type ptype_fence_type; - AP_Int8 *fence_type_new = (AP_Int8*)AP_Param::find("FENCE_TYPE", &ptype_fence_type); - if (fence_type_new && !fence_type_new->configured()) { - // If we find the new parameter and it hasn't been configured - // attempt to upgrade the altitude fences. - int8_t fence_type_new_val = AC_FENCE_TYPE_POLYGON; - AP_Int16 fence_alt_min_old; - AP_Param::ConversionInfo fence_alt_min_info_old = { - Parameters::k_param_fence_minalt, - 0, - AP_PARAM_INT16, - nullptr - }; - if (AP_Param::find_old_parameter(&fence_alt_min_info_old, &fence_alt_min_old)) { - if (fence_alt_min_old.configured()) { - // - fence_type_new_val |= AC_FENCE_TYPE_ALT_MIN; - } - } - - AP_Int16 fence_alt_max_old; - AP_Param::ConversionInfo fence_alt_max_info_old = { - Parameters::k_param_fence_maxalt, - 0, - AP_PARAM_INT16, - nullptr - }; - if (AP_Param::find_old_parameter(&fence_alt_max_info_old, &fence_alt_max_old)) { - if (fence_alt_max_old.configured()) { - fence_type_new_val |= AC_FENCE_TYPE_ALT_MAX; - } - } - - fence_type_new->set_and_save((int8_t)fence_type_new_val); - } - - AP_Int8 fence_action_old; - AP_Param::ConversionInfo fence_action_info_old = { - Parameters::k_param_fence_action, - 0, - AP_PARAM_INT8, - "FENCE_ACTION" - }; - if (AP_Param::find_old_parameter(&fence_action_info_old, &fence_action_old)) { - enum ap_var_type ptype; - AP_Int8 *fence_action_new = (AP_Int8*)AP_Param::find(&fence_action_info_old.new_name[0], &ptype); - AC_Fence::Action fence_action_new_val; - if (fence_action_new && !fence_action_new->configured()) { - switch(fence_action_old.get()) { - case 0: // FENCE_ACTION_NONE - case 2: // FENCE_ACTION_REPORT_ONLY - default: - fence_action_new_val = AC_Fence::Action::REPORT_ONLY; - break; - case 1: // FENCE_ACTION_GUIDED - fence_action_new_val = AC_Fence::Action::GUIDED; - break; - case 3: // FENCE_ACTION_GUIDED_THR_PASS - fence_action_new_val = AC_Fence::Action::GUIDED_THROTTLE_PASS; - break; - case 4: // FENCE_ACTION_RTL - fence_action_new_val = AC_Fence::Action::RTL_AND_LAND; - break; - } - fence_action_new->set_and_save((int8_t)fence_action_new_val); - - // Now upgrade the new fence enable at the same time - enum ap_var_type ptype_fence_enable; - AP_Int8 *fence_enable = (AP_Int8*)AP_Param::find("FENCE_ENABLE", &ptype_fence_enable); - // fences were used if there was a count, and the old fence action was not zero - AC_Fence *ap_fence = AP::fence(); - bool fences_exist = false; - if (ap_fence) { - // If the fence library is present, attempt to read the fence count - fences_exist = ap_fence->polyfence().total_fence_count() > 0; - } - - bool fences_used = fence_action_old.get() != 0; - if (fence_enable && !fence_enable->configured()) { - // The fence enable parameter exists, so now set it accordingly - fence_enable->set_and_save(fences_exist && fences_used); - } - } - } -#endif // AP_FENCE_ENABLED - -#if AP_TERRAIN_AVAILABLE - // PARAMETER_CONVERSION - Added: Mar-2021 for ArduPlane-4.1 - g.terrain_follow.convert_parameter_width(AP_PARAM_INT8); -#endif - - // PARAMETER_CONVERSION - Added: Jun-2021 for ArduPlane-4.1 - g.use_reverse_thrust.convert_parameter_width(AP_PARAM_INT16); - // PARAMETER_CONVERSION - Added: Jun-2026 for FBWB_CLIMB_RATE width change g.flybywire_climb_rate.convert_parameter_width(AP_PARAM_INT8); -#if AP_AIRSPEED_ENABLED - // PARAMETER_CONVERSION - Added: Jan-2022 - { - const uint16_t old_key = g.k_param_airspeed; - const uint16_t old_index = 0; // Old parameter index in the tree - AP_Param::convert_class(old_key, &airspeed, airspeed.var_info, old_index, true); - } -#endif - -#if AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED -#if HAL_INS_NUM_HARMONIC_NOTCH_FILTERS > 1 - if (!ins.harmonic_notches[1].params.enabled()) { - // notch filter parameter conversions (moved to INS_HNTC2) for 4.2.x, converted from fixed notch - const AP_Param::ConversionInfo notchfilt_conversion_info[] { - // PARAMETER_CONVERSION - Added: Apr-2022 for ArduPlane-4.2 - { Parameters::k_param_ins, 101, AP_PARAM_INT8, "INS_HNTC2_ENABLE" }, - { Parameters::k_param_ins, 293, AP_PARAM_FLOAT, "INS_HNTC2_ATT" }, - { Parameters::k_param_ins, 357, AP_PARAM_FLOAT, "INS_HNTC2_FREQ" }, - { Parameters::k_param_ins, 421, AP_PARAM_FLOAT, "INS_HNTC2_BW" }, - }; - AP_Param::convert_old_parameters(¬chfilt_conversion_info[0], ARRAY_SIZE(notchfilt_conversion_info)); - AP_Param::set_default_by_name("INS_HNTC2_MODE", 0); - AP_Param::set_default_by_name("INS_HNTC2_HMNCS", 1); - } -#endif // HAL_INS_NUM_HARMONIC_NOTCH_FILTERS -#endif // AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED - - // PARAMETER_CONVERSION - Added: Mar-2022 -#if AP_FENCE_ENABLED - AP_Param::convert_class(g.k_param_fence, &fence, fence.var_info, 0, true); -#endif - // PARAMETER_CONVERSION - Added: Jul-2025 for ArduPilot-4.7 #if AP_RPM_ENABLED AP_Param::convert_class(g.k_param_rpm_sensor_old, &rpm_sensor, rpm_sensor.var_info, 0, true, true); @@ -1541,10 +1410,6 @@ void Plane::load_parameters(void) landing.convert_parameters(); static const AP_Param::G2ObjectConversion g2_conversions[] { - // PARAMETER_CONVERSION - Added: Oct-2021 -#if HAL_EFI_ENABLED - { &efi, efi.var_info, 22 }, -#endif #if AP_STATS_ENABLED // PARAMETER_CONVERSION - Added: Jan-2024 for Plane-4.6 { &stats, stats.var_info, 5 }, diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index 5b1143c70fa15..942d312c0c0f0 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -606,46 +606,6 @@ static const struct AP_Param::defaults_table_struct defaults_table[] = { { "Q_A_ACC_Y_MAX", 100 }, }; -/* - conversion table for quadplane parameters - */ -const AP_Param::ConversionInfo q_conversion_table[] = { - // PARAMETER_CONVERSION - Added: Jul-2021 for ArduPlane-4.2 - // tailsitter params have moved but retain the same names - { Parameters::k_param_quadplane, 48, AP_PARAM_INT8, "Q_TAILSIT_ANGLE" }, - { Parameters::k_param_quadplane, 61, AP_PARAM_INT8, "Q_TAILSIT_ANG_VT" }, - { Parameters::k_param_quadplane, 50, AP_PARAM_INT8, "Q_TAILSIT_INPUT" }, - { Parameters::k_param_quadplane, 53, AP_PARAM_FLOAT, "Q_TAILSIT_VFGAIN" }, - { Parameters::k_param_quadplane, 54, AP_PARAM_FLOAT, "Q_TAILSIT_VHGAIN" }, - { Parameters::k_param_quadplane, 56, AP_PARAM_FLOAT, "Q_TAILSIT_VHPOW" }, - { Parameters::k_param_quadplane, 251, AP_PARAM_FLOAT, "Q_TAILSIT_GSCMAX" }, - { Parameters::k_param_quadplane, 379, AP_PARAM_FLOAT, "Q_TAILSIT_RLL_MX" }, - { Parameters::k_param_quadplane, 635, AP_PARAM_INT16, "Q_TAILSIT_MOTMX" }, - { Parameters::k_param_quadplane, 1147, AP_PARAM_INT16, "Q_TAILSIT_GSCMSK" }, - { Parameters::k_param_quadplane, 1211, AP_PARAM_FLOAT, "Q_TAILSIT_GSCMIN" }, - { Parameters::k_param_quadplane, 1403, AP_PARAM_FLOAT, "Q_TAILSIT_DSKLD" }, - { Parameters::k_param_quadplane, 1595, AP_PARAM_FLOAT, "Q_TAILSIT_RAT_FW" }, - { Parameters::k_param_quadplane, 1659, AP_PARAM_FLOAT, "Q_TAILSIT_RAT_FW" }, - - // PARAMETER_CONVERSION - Added: Sep-2021 for ArduPlane-4.2 - // tiltrotor params have moved but retain the same names - { Parameters::k_param_quadplane, 37, AP_PARAM_INT16, "Q_TILT_MASK" }, - { Parameters::k_param_quadplane, 38, AP_PARAM_INT16, "Q_TILT_RATE_UP" }, - { Parameters::k_param_quadplane, 39, AP_PARAM_INT8, "Q_TILT_MAX" }, - { Parameters::k_param_quadplane, 47, AP_PARAM_INT8, "Q_TILT_TYPE" }, - { Parameters::k_param_quadplane, 49, AP_PARAM_INT16, "Q_TILT_RATE_DN" }, - { Parameters::k_param_quadplane, 55, AP_PARAM_FLOAT, "Q_TILT_YAW_ANGLE" }, - { Parameters::k_param_quadplane, 1467, AP_PARAM_FLOAT, "Q_TILT_FIX_ANGLE" }, - { Parameters::k_param_quadplane, 1531, AP_PARAM_FLOAT, "Q_TILT_FIX_GAIN" }, - - // PARAMETER_CONVERSION - Added: Jan-2022 for ArduPlane-4.2 - { Parameters::k_param_quadplane, 33, AP_PARAM_FLOAT, "Q_WVANE_GAIN" }, // Moved from quadplane to weathervane library - { Parameters::k_param_quadplane, 34, AP_PARAM_FLOAT, "Q_WVANE_ANG_MIN" }, // Q_WVANE_MINROLL moved from quadplane to weathervane library - - // PARAMETER_CONVERSION - Added: Jul-2022 for ArduPlane-4.3 - { Parameters::k_param_quadplane, 25, AP_PARAM_FLOAT, "Q_PLT_Y_RATE" }, // Moved from quadplane to command model library -}; - // PARAMETER_CONVERSION - Added: Oct-2021 const AP_Param::ConversionInfo mot_pwm_conversion_table[] = { { Parameters::k_param_quadplane, 22, AP_PARAM_INT16, "Q_M_PWM_MIN" }, @@ -819,8 +779,6 @@ bool QuadPlane::setup(void) setup_defaults(); - AP_Param::convert_old_parameters(&q_conversion_table[0], ARRAY_SIZE(q_conversion_table)); - // PARAMETER_CONVERSION - Added: Jan-2024 for ArduPlane-4.5 land_final_speed_ms.convert_centi_parameter(AP_PARAM_INT16); pilot_speed_z_max_up_ms.convert_centi_parameter(AP_PARAM_INT16); From f8f58ea184e06b9e92329bfd8e9c2ba42fa153f4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:40:50 +1000 Subject: [PATCH 03/26] ArduPlane: remove magic repair of Q_M_PWM_MIN/Q_M_PWM_MAX The Q_M_PWM_MIN/Q_M_PWM_MAX conversion was added Oct-2021 and so is present in the 4.3.0 release, which is enough to retire it under the 4.3 migration floor. It is being removed in a commit of its own because it was never just a migration: AP_Param::convert_old_parameters(&mot_pwm_conversion_table[0], ...); if (!motors->check_mot_pwm_params()) { AP_Param::convert_old_parameters(&mot_pwm_conversion_table[0], ..., CONVERT_FLAG_FORCE); } The second call re-ran on every single boot, not just on the first boot after an upgrade. Any vehicle whose current Q_M_PWM_MIN/Q_M_PWM_MAX were invalid had them silently overwritten from the old quadplane parameter slots, over and over, for as long as they stayed invalid. A user could be flying on values they never set and have no indication of it. That magic goes away here. A vehicle with invalid Q_M_PWM_MIN/MAX is no longer quietly repaired; it now fails the existing AP_MotorsMulticopter arming check with "Check Q_M_PWM_MIN and Q_M_PWM_MAX" and the user fixes the parameters themselves. This is a behaviour change, and it is the point of the commit rather than a side-effect of the migration-floor cleanup. AP_MotorsMulticopter::check_mot_pwm_params() is still used by that arming check, so it stays. --- ArduPlane/quadplane.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index 942d312c0c0f0..9982dfce04255 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -606,12 +606,6 @@ static const struct AP_Param::defaults_table_struct defaults_table[] = { { "Q_A_ACC_Y_MAX", 100 }, }; -// PARAMETER_CONVERSION - Added: Oct-2021 -const AP_Param::ConversionInfo mot_pwm_conversion_table[] = { - { Parameters::k_param_quadplane, 22, AP_PARAM_INT16, "Q_M_PWM_MIN" }, - { Parameters::k_param_quadplane, 23, AP_PARAM_INT16, "Q_M_PWM_MAX" }, -}; - QuadPlane::QuadPlane(AP_AHRS &_ahrs) : ahrs(_ahrs) { @@ -761,12 +755,6 @@ bool QuadPlane::setup(void) motors->set_update_rate(rc_speed); attitude_control->parameter_sanity_check(); - // Try to convert mot PWM params, if still invalid force conversion - AP_Param::convert_old_parameters(&mot_pwm_conversion_table[0], ARRAY_SIZE(mot_pwm_conversion_table)); - if (!motors->check_mot_pwm_params()) { - AP_Param::convert_old_parameters(&mot_pwm_conversion_table[0], ARRAY_SIZE(mot_pwm_conversion_table), AP_Param::CONVERT_FLAG_FORCE); - } - // setup the trim of any motors used by AP_Motors so I/O board // failsafe will disable motors uint32_t mask = plane.quadplane.motors->get_motor_mask(); From c94c65a42e30031da53dff0d3ed1e7e9fa47c284 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 13:16:39 +1000 Subject: [PATCH 04/26] ArduSub: remove parameter conversions from before 4.3 Sub has no 4.2, 4.3, 4.4 or 4.6 release, so the oldest version a user can be moving from once the migration floor is 4.3 is Sub-4.5. Both of these conversions are present in ArduSub-4.5.0, so anybody running that or later has already had them applied: - the airspeed object out of g2 (Jan-2022) - FENCE_ parameters into the AC_Fence object (Mar-2022) Also drops the call to SRV_Channels::upgrade_parameters(), which is being removed. --- ArduSub/Parameters.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ArduSub/Parameters.cpp b/ArduSub/Parameters.cpp index 48731cb3cbc00..03279c89b893c 100644 --- a/ArduSub/Parameters.cpp +++ b/ArduSub/Parameters.cpp @@ -805,21 +805,12 @@ void Sub::load_parameters() // We should ignore this parameter since ROVs are neutral buoyancy AP_Param::set_by_name("MOT_THST_HOVER", 0.5); - // PARAMETER_CONVERSION - Added: Mar-2022 -#if AP_FENCE_ENABLED - AP_Param::convert_class(g.k_param_fence_old, &fence, fence.var_info, 0, true); -#endif - // PARAMETER_CONVERSION - Added: Jul-2025 for ArduPilot-4.7 #if AP_RPM_ENABLED AP_Param::convert_class(g.k_param_rpm_sensor_old, &rpm_sensor, rpm_sensor.var_info, 0, true, true); #endif static const AP_Param::G2ObjectConversion g2_conversions[] { -#if AP_AIRSPEED_ENABLED - // PARAMETER_CONVERSION - Added: Jan-2022 for ArduSub-4.5 - { &airspeed, airspeed.var_info, 19 }, -#endif #if AP_STATS_ENABLED // PARAMETER_CONVERSION - Added: Jan-2024 { &stats, stats.var_info, 1 }, @@ -896,8 +887,6 @@ void Sub::convert_old_parameters() { Parameters::k_param_attitude_control, 387, AP_PARAM_FLOAT, "ATC_RAT_YAW_FLTE" }, }; AP_Param::convert_old_parameters(&filt_conversion_info[0], ARRAY_SIZE(filt_conversion_info)); - - SRV_Channels::upgrade_parameters(); } #if LEAKDETECTOR_MAX_INSTANCES > 0 From 182571b44bdb2b8cc84c38cb722c75edc378c51d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 13:16:39 +1000 Subject: [PATCH 05/26] Rover: remove parameter conversions from before 4.3 Rover has no 4.3 release, so the oldest version a user can be moving from once the migration floor is 4.3 is Rover-4.4. All of these conversions are present in Rover-4.4.0, so anybody running that or later has already had them applied: - the airspeed object out of g2 (Jan-2022) - the AIS object out of g2 (Mar-2022) - FENCE_ parameters into the AC_Fence object (Mar-2022) Also drops the call to SRV_Channels::upgrade_parameters(), which is being removed. --- Rover/Parameters.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index de047e78774f4..599c46aec5ecc 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -788,8 +788,6 @@ void Rover::load_parameters(void) g2.crash_angle.set_default(30); } - SRV_Channels::upgrade_parameters(); - // convert CH7_OPTION to RC7_OPTION for Rover-3.4 to 3.5 upgrade // PARAMETER_CONVERSION - Added: Jan-2019 for Rover-3.5 const AP_Param::ConversionInfo ch7_option_info = { Parameters::k_param_ch7_option, 0, AP_PARAM_INT8, "RC7_OPTION" }; @@ -837,18 +835,6 @@ void Rover::load_parameters(void) #endif static const AP_Param::G2ObjectConversion g2_conversions[] { -#if AP_AIRSPEED_ENABLED -// PARAMETER_CONVERSION - Added: Jan-2022 for Rover-4.2 - { &airspeed, airspeed.var_info, 37 }, -#endif -#if AP_AIS_ENABLED -// PARAMETER_CONVERSION - Added: Mar-2022 for Rover-4.4 - { &ais, ais.var_info, 50 }, -#endif -#if AP_FENCE_ENABLED -// PARAMETER_CONVERSION - Added: Mar-2022 for Rover-4.4 - { &fence, fence.var_info, 17 }, -#endif #if AP_STATS_ENABLED // PARAMETER_CONVERSION - Added: Jan-2024 for Rover-4.6 { &stats, stats.var_info, 1 }, From f185c6458c43ef4cf294814eec7d58d0442bc2fc Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 13:17:13 +1000 Subject: [PATCH 06/26] SRV_Channel: remove SERVOn_FUNCTION parameter width conversion This converted SERVOn_FUNCTION from int8 to int16, and is present in the 4.3.0 release (in fact all the way back to 4.0.0). Anybody running 4.3.0 or later has already had it applied. --- libraries/SRV_Channel/SRV_Channel.h | 3 --- libraries/SRV_Channel/SRV_Channel_aux.cpp | 15 --------------- 2 files changed, 18 deletions(-) diff --git a/libraries/SRV_Channel/SRV_Channel.h b/libraries/SRV_Channel/SRV_Channel.h index c347583b5c437..bdff5ee0e50d4 100644 --- a/libraries/SRV_Channel/SRV_Channel.h +++ b/libraries/SRV_Channel/SRV_Channel.h @@ -565,9 +565,6 @@ class SRV_Channels { #endif } - // SERVO* parameters - static void upgrade_parameters(void); - // given a zero-based motor channel, return the k_motor function for that channel static SRV_Channel::Function get_motor_function(uint8_t channel) { if (channel < 8) { diff --git a/libraries/SRV_Channel/SRV_Channel_aux.cpp b/libraries/SRV_Channel/SRV_Channel_aux.cpp index afc0a6356d45f..287193850a666 100644 --- a/libraries/SRV_Channel/SRV_Channel_aux.cpp +++ b/libraries/SRV_Channel/SRV_Channel_aux.cpp @@ -907,21 +907,6 @@ void SRV_Channels::constrain_pwm(SRV_Channel::Function function) } } -/* - upgrade SERVO* parameters. This does the following: - - - update to 16 bit FUNCTION from AP_Int8 -*/ -void SRV_Channels::upgrade_parameters(void) -{ - // PARAMETER_CONVERSION - Added: Jan-2020 - for (uint8_t i=0; i Date: Thu, 27 Aug 2026 13:17:13 +1000 Subject: [PATCH 07/26] AP_BoardConfig: remove BRD_SERIAL_NUM parameter width conversion This converted BRD_SERIAL_NUM from int16 to int32 and is present in the 4.3.0 release, so anybody running 4.3.0 or later has already had it applied. --- libraries/AP_BoardConfig/AP_BoardConfig.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/libraries/AP_BoardConfig/AP_BoardConfig.cpp b/libraries/AP_BoardConfig/AP_BoardConfig.cpp index c995373fbf483..f26737408619c 100644 --- a/libraries/AP_BoardConfig/AP_BoardConfig.cpp +++ b/libraries/AP_BoardConfig/AP_BoardConfig.cpp @@ -495,9 +495,6 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = { void AP_BoardConfig::init() { - // PARAMETER_CONVERSION - Added: Apr-2022 for ArduPilot-4.3 - vehicleSerialNumber.convert_parameter_width(AP_PARAM_INT16); - board_setup(); #if AP_RTC_ENABLED From 7e0ad96d19018f85713147fb86b21d0fc35093da Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 13:17:13 +1000 Subject: [PATCH 08/26] AP_VideoTX: remove VTX_OPTIONS parameter width conversion This was meant to convert VTX_OPTIONS from int8 to int16, and is present in the 4.3.0 release, so anybody running 4.3.0 or later has already had it applied. It should be noted that it never actually did anything. 0658f06030 widened _options from AP_Int8 to AP_Int16 and added the conversion in the same commit, but passed the new width rather than the old one: _options.convert_parameter_width(AP_PARAM_INT16); The argument to convert_parameter_width() is the type the value was stored as *before* the widening, so this should have been AP_PARAM_INT8. AP_Param::scan() matches on the type in the parameter header, so a value written as an int8 is never found by a scan for an int16 and the conversion always returned false without touching anything. A user upgrading across the widening lost their VTX_OPTIONS regardless. So this removes dead code, and the migration floor is not really what makes it safe to do so. --- libraries/AP_VideoTX/AP_VideoTX.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/libraries/AP_VideoTX/AP_VideoTX.cpp b/libraries/AP_VideoTX/AP_VideoTX.cpp index fd2cc4d6b72e8..002ed55185f78 100644 --- a/libraries/AP_VideoTX/AP_VideoTX.cpp +++ b/libraries/AP_VideoTX/AP_VideoTX.cpp @@ -150,9 +150,6 @@ bool AP_VideoTX::init(void) return false; } - // PARAMETER_CONVERSION - Added: Sep-2022 for ArduPilot-4.3 - _options.convert_parameter_width(AP_PARAM_INT16); - // find the index into the power table for (uint8_t i = 0; i < VTX_MAX_POWER_LEVELS; i++) { if (_power_mw <= _power_levels[i].mw) { From 89b1e4a4edb1a99adf72d33ca9a3d6eb03c31f27 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 13:36:49 +1000 Subject: [PATCH 09/26] ArduSub: remove ATC_RAT_*_FILT parameter conversion This moved ATC_RAT_RLL/PIT/YAW_FILT to ATC_RAT_*_FLTE and dates from 2019 - it is present in ArduSub-4.1.2 and ArduSub-4.5.0. Sub has no 4.2, 4.3, 4.4 or 4.6 release, so the oldest version a user can be moving from once the migration floor is 4.3 is ArduSub-4.5.0, which has already had this applied. Sub::convert_old_parameters() is left empty by this, so it goes too. --- ArduSub/Parameters.cpp | 14 -------------- ArduSub/Sub.h | 1 - 2 files changed, 15 deletions(-) diff --git a/ArduSub/Parameters.cpp b/ArduSub/Parameters.cpp index 03279c89b893c..b4f6d2bce77d8 100644 --- a/ArduSub/Parameters.cpp +++ b/ArduSub/Parameters.cpp @@ -800,7 +800,6 @@ void Sub::load_parameters() AP_Param::set_frame_type_flags(AP_PARAM_FRAME_SUB); - convert_old_parameters(); AP_Param::set_defaults_from_table(defaults_table, ARRAY_SIZE(defaults_table)); // We should ignore this parameter since ROVs are neutral buoyancy AP_Param::set_by_name("MOT_THST_HOVER", 0.5); @@ -876,19 +875,6 @@ void Sub::load_parameters() AP_Param::convert_old_parameters(&origin_conversion_info[0], ARRAY_SIZE(origin_conversion_info)); } -void Sub::convert_old_parameters() -{ - // attitude control filter parameter changes from _FILT to FLTE or FLTD - // PARAMETER_CONVERSION - Added: Jul-2019 for ArduSub-4.0 - const AP_Param::ConversionInfo filt_conversion_info[] = { - // move ATC_RAT_RLL/PIT_FILT to FLTD, move ATC_RAT_YAW_FILT to FLTE - { Parameters::k_param_attitude_control, 385, AP_PARAM_FLOAT, "ATC_RAT_RLL_FLTE" }, - { Parameters::k_param_attitude_control, 386, AP_PARAM_FLOAT, "ATC_RAT_PIT_FLTE" }, - { Parameters::k_param_attitude_control, 387, AP_PARAM_FLOAT, "ATC_RAT_YAW_FLTE" }, - }; - AP_Param::convert_old_parameters(&filt_conversion_info[0], ARRAY_SIZE(filt_conversion_info)); -} - #if LEAKDETECTOR_MAX_INSTANCES > 0 // PARAMETER_CONVERSION - Added: Dec-2025 // Deals with leak detector getting misconfigured when updating from Sub 4.1 diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index 954c3d6c38b40..e10cfaa909fe0 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -558,7 +558,6 @@ class Sub : public AP_Vehicle { uint16_t get_pilot_speed_dn() const; - void convert_old_parameters(void); #if LEAKDETECTOR_MAX_INSTANCES > 0 void update_leak_pins(); From 7a2b1aed9b36ca5a0217d657c22563542a1d3205 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 13:36:50 +1000 Subject: [PATCH 10/26] Rover: remove CH7_OPTION to RC7_OPTION parameter conversion Added in 2019 for the Rover-3.4 to 3.5 upgrade, and present in Rover-4.4.0 - the oldest release a Rover user can be moving from once the migration floor is 4.3, as Rover has no 4.3. --- Rover/Parameters.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index 599c46aec5ecc..882ecd42fd755 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -788,18 +788,6 @@ void Rover::load_parameters(void) g2.crash_angle.set_default(30); } - // convert CH7_OPTION to RC7_OPTION for Rover-3.4 to 3.5 upgrade - // PARAMETER_CONVERSION - Added: Jan-2019 for Rover-3.5 - const AP_Param::ConversionInfo ch7_option_info = { Parameters::k_param_ch7_option, 0, AP_PARAM_INT8, "RC7_OPTION" }; - AP_Int8 ch7_opt_old; - if (AP_Param::find_old_parameter(&ch7_option_info, &ch7_opt_old)) { - const uint8_t ch7_opt_map[] = {0,7,50,41,51,52,53,54,16,4,42,55,56}; - const uint8_t ch7_opt_old_val = (uint8_t)ch7_opt_old.get(); - if (ch7_opt_old_val < ARRAY_SIZE(ch7_opt_map)) { - AP_Param::set_default_by_name(ch7_option_info.new_name, ch7_opt_map[ch7_opt_old_val]); - } - } - // set AR_WPNav's WP_SPEED to be old WP_SPEED (if set) or CRUISE_SPEED (if set) // PARAMETER_CONVERSION - Added: May-2019 for Rover-4.0 const AP_Param::ConversionInfo wp_speed_old_info = { Parameters::k_param_g2, 14, AP_PARAM_FLOAT, "WP_SPEED" }; From fbe62e6f13a691ce09752f914d7dcef399887892 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:00:32 +1000 Subject: [PATCH 11/26] ArduPlane: remove remaining parameter conversions from before 4.3 - the conversion_table, which converted the old altitude fence parameters (Mar-2021) - the loop converting the old chan params to RCx_OPTION, along with rc_option_conversion and the RCConversionInfo struct (Mar-2021) Both are present in the 4.3.0 release, so anybody running 4.3.0 or later has already had them applied. --- ArduPlane/Parameters.cpp | 59 ---------------------------------------- ArduPlane/system.cpp | 3 -- 2 files changed, 62 deletions(-) diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index 45f0024ec5a85..d29ccf2364091 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -1305,56 +1305,10 @@ ParametersG2::ParametersG2(void) : AP_Param::setup_object_defaults(this, var_info); } -/* - This is a conversion table from old parameter values to new - parameter names. The startup code looks for saved values of the old - parameters and will copy them across to the new parameters if the - new parameter does not yet have a saved value. It then saves the new - value. - - Note that this works even if the old parameter has been removed. It - relies on the old k_param index not being removed - - The second column below is the index in the var_info[] table for the - old object. This should be zero for top level parameters. - */ -static const AP_Param::ConversionInfo conversion_table[] = { - // PARAMETER_CONVERSION - Added: Mar-2021 for ArduPlane-4.1 - { Parameters::k_param_fence_minalt, 0, AP_PARAM_INT16, "FENCE_ALT_MIN"}, - { Parameters::k_param_fence_maxalt, 0, AP_PARAM_INT16, "FENCE_ALT_MAX"}, - { Parameters::k_param_fence_retalt, 0, AP_PARAM_INT16, "FENCE_RET_ALT"}, - { Parameters::k_param_fence_ret_rally, 0, AP_PARAM_INT8, "FENCE_RET_RALLY"}, - { Parameters::k_param_fence_autoenable, 0, AP_PARAM_INT8, "FENCE_AUTOENABLE"}, -}; - -struct RCConversionInfo { - uint16_t old_key; // k_param_* - uint32_t old_group_element; // index in old object - RC_Channel::AUX_FUNC fun; // new function -}; - -static const RCConversionInfo rc_option_conversion[] = { - { Parameters::k_param_flapin_channel_old, 0, RC_Channel::AUX_FUNC::FLAP}, - { Parameters::k_param_g2, 968, RC_Channel::AUX_FUNC::SOARING}, -#if AP_FENCE_ENABLED - { Parameters::k_param_fence_channel, 0, RC_Channel::AUX_FUNC::FENCE}, -#endif -#if AP_MISSION_ENABLED - { Parameters::k_param_reset_mission_chan, 0, RC_Channel::AUX_FUNC::MISSION_RESET}, -#endif -#if HAL_PARACHUTE_ENABLED - { Parameters::k_param_parachute_channel, 0, RC_Channel::AUX_FUNC::PARACHUTE_RELEASE}, -#endif - { Parameters::k_param_fbwa_tdrag_chan, 0, RC_Channel::AUX_FUNC::FBWA_TAILDRAGGER}, - { Parameters::k_param_reset_switch_chan, 0, RC_Channel::AUX_FUNC::MODE_SWITCH_RESET}, -}; - void Plane::load_parameters(void) { AP_Vehicle::load_parameters(g.format_version, Parameters::k_format_version); - AP_Param::convert_old_parameters(&conversion_table[0], ARRAY_SIZE(conversion_table)); - // setup defaults in SRV_Channels g2.servo_channels.set_default_function(CH_1, SRV_Channel::k_aileron); g2.servo_channels.set_default_function(CH_2, SRV_Channel::k_elevator); @@ -1370,19 +1324,6 @@ void Plane::load_parameters(void) AP_Param::set_frame_type_flags(AP_PARAM_FRAME_PLANE); - // Convert chan params to RCx_OPTION - // PARAMETER_CONVERSION - Added: Mar-2021 for ArduPlane-4.1 - for (uint8_t i=0; i 0) { - RC_Channel *chan = rc().channel(chan_param.get() - 1); - if (chan != nullptr && !chan->option.configured()) { - chan->option.set_and_save((int16_t)rc_option_conversion[i].fun); // save the new param - } - } - } - // PARAMETER_CONVERSION - Added: Jun-2026 for FBWB_CLIMB_RATE width change g.flybywire_climb_rate.convert_parameter_width(AP_PARAM_INT8); diff --git a/ArduPlane/system.cpp b/ArduPlane/system.cpp index 977d4de796eb5..62486d7ff4b37 100644 --- a/ArduPlane/system.cpp +++ b/ArduPlane/system.cpp @@ -12,9 +12,6 @@ void Plane::init_ardupilot() ins.set_log_raw_bit(MASK_LOG_IMU_RAW); - rollController.convert_pid(); - pitchController.convert_pid(); - // initialise rc channels including setting mode // PARAMETER_CONVERSION - Added: Sep-2021 for ArduPlane-4.2 #if HAL_QUADPLANE_ENABLED From 124540b87973758dd01be9295182df004256fa25 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:00:32 +1000 Subject: [PATCH 12/26] ArduSub: remove conversion_table Converted the old battery failsafe parameters (Mar-2018) and COMPASS_ENABLE (Apr-2019). Sub has no 4.2, 4.3, 4.4 or 4.6 release, so the oldest version a user can be moving from once the migration floor is 4.3 is ArduSub-4.5.0, which has already had these applied. --- ArduSub/Parameters.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ArduSub/Parameters.cpp b/ArduSub/Parameters.cpp index b4f6d2bce77d8..fd08d1370215d 100644 --- a/ArduSub/Parameters.cpp +++ b/ArduSub/Parameters.cpp @@ -783,21 +783,10 @@ ParametersG2::ParametersG2() AP_Param::setup_object_defaults(this, var_info); } -const AP_Param::ConversionInfo conversion_table[] = { - // PARAMETER_CONVERSION - Added: Mar-2018 for ArduSub-4.0 - { Parameters::k_param_fs_batt_voltage, 0, AP_PARAM_FLOAT, "BATT_LOW_VOLT" }, - { Parameters::k_param_fs_batt_mah, 0, AP_PARAM_FLOAT, "BATT_LOW_MAH" }, - { Parameters::k_param_failsafe_battery_enabled, 0, AP_PARAM_INT8, "BATT_FS_LOW_ACT" }, - // PARAMETER_CONVERSION - Added: Apr-2019 for ArduSub-4.0 - { Parameters::k_param_compass_enabled_deprecated, 0, AP_PARAM_INT8, "COMPASS_ENABLE" }, -}; - void Sub::load_parameters() { AP_Vehicle::load_parameters(g.format_version, Parameters::k_format_version); - AP_Param::convert_old_parameters(&conversion_table[0], ARRAY_SIZE(conversion_table)); - AP_Param::set_frame_type_flags(AP_PARAM_FRAME_SUB); AP_Param::set_defaults_from_table(defaults_table, ARRAY_SIZE(defaults_table)); From 43f3de5cb643bd5fdca3cbf393343c347fa26c02 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:00:32 +1000 Subject: [PATCH 13/26] Rover: remove parameter conversions from before 4.3 Trims conversion_table down to just the TRQ1_ block, which was added May-2024 and so is still required. Everything above it - battery (Oct-2013), serial baud (Jan-2015), MOT_THR (Aug-2017), COMPASS_ENABLE (Apr-2019), WP_RADIUS (May-2019), sailboat (May-2019), ATC_TURN_MAX_G (May-2021), WP_PIVOT (Dec-2021) and PRX1_ (Aug-2022) - is present in Rover-4.4.0, the oldest release a Rover user can be moving from once the migration floor is 4.3, as Rover has no 4.3. Also removes the WP_SPEED/CRUISE_SPEED conversion (May-2019) and the attitude control FF/FILT conversion (Jul-2019) on the same grounds. --- Rover/Parameters.cpp | 71 -------------------------------------------- 1 file changed, 71 deletions(-) diff --git a/Rover/Parameters.cpp b/Rover/Parameters.cpp index 882ecd42fd755..0aa8197ca4fa2 100644 --- a/Rover/Parameters.cpp +++ b/Rover/Parameters.cpp @@ -718,50 +718,6 @@ ParametersG2::ParametersG2(void) old object. This should be zero for top level parameters. */ const AP_Param::ConversionInfo conversion_table[] = { - // PARAMETER_CONVERSION - Added: Oct-2013 for APMrover2-2.44 - { Parameters::k_param_battery_monitoring, 0, AP_PARAM_INT8, "BATT_MONITOR" }, - { Parameters::k_param_battery_volt_pin, 0, AP_PARAM_INT8, "BATT_VOLT_PIN" }, - { Parameters::k_param_battery_curr_pin, 0, AP_PARAM_INT8, "BATT_CURR_PIN" }, - { Parameters::k_param_volt_div_ratio, 0, AP_PARAM_FLOAT, "BATT_VOLT_MULT" }, - { Parameters::k_param_curr_amp_per_volt, 0, AP_PARAM_FLOAT, "BATT_AMP_PERVOLT" }, - { Parameters::k_param_pack_capacity, 0, AP_PARAM_INT32, "BATT_CAPACITY" }, - // PARAMETER_CONVERSION - Added: Jan-2015 for APMrover2-2.49 - { Parameters::k_param_serial0_baud, 0, AP_PARAM_INT16, "SERIAL0_BAUD" }, - { Parameters::k_param_serial1_baud, 0, AP_PARAM_INT16, "SERIAL1_BAUD" }, - { Parameters::k_param_serial2_baud, 0, AP_PARAM_INT16, "SERIAL2_BAUD" }, - // PARAMETER_CONVERSION - Added: Aug-2017 for Rover-3.2 - { Parameters::k_param_throttle_min_old, 0, AP_PARAM_INT8, "MOT_THR_MIN" }, - { Parameters::k_param_throttle_max_old, 0, AP_PARAM_INT8, "MOT_THR_MAX" }, - // PARAMETER_CONVERSION - Added: Apr-2019 for Rover-4.0 - { Parameters::k_param_compass_enabled_deprecated, 0, AP_PARAM_INT8, "COMPASS_ENABLE" }, - // PARAMETER_CONVERSION - Added: May-2019 for Rover-4.0 - { Parameters::k_param_waypoint_radius_old, 0, AP_PARAM_FLOAT, "WP_RADIUS" }, - // PARAMETER_CONVERSION - Added: Dec-2021 for Rover-4.4 - { Parameters::k_param_g2, 299, AP_PARAM_INT16, "WP_PIVOT_ANGLE" }, - { Parameters::k_param_g2, 363, AP_PARAM_INT16, "WP_PIVOT_RATE" }, - { Parameters::k_param_g2, 491, AP_PARAM_FLOAT, "WP_PIVOT_DELAY" }, - // PARAMETER_CONVERSION - Added: May-2019 for Rover-4.0 - { Parameters::k_param_g2, 32, AP_PARAM_FLOAT, "SAIL_ANGLE_MIN" }, - { Parameters::k_param_g2, 33, AP_PARAM_FLOAT, "SAIL_ANGLE_MAX" }, - { Parameters::k_param_g2, 34, AP_PARAM_FLOAT, "SAIL_ANGLE_IDEAL" }, - { Parameters::k_param_g2, 35, AP_PARAM_FLOAT, "SAIL_HEEL_MAX" }, - { Parameters::k_param_g2, 36, AP_PARAM_FLOAT, "SAIL_NO_GO_ANGLE" }, - // PARAMETER_CONVERSION - Added: May-2021 for Rover-4.1 - { Parameters::k_param_turn_max_g_old, 0, AP_PARAM_FLOAT, "ATC_TURN_MAX_G" }, - // PARAMETER_CONVERSION - Added: Aug-2022 for Rover-4.4 - { Parameters::k_param_g2, 82, AP_PARAM_INT8 , "PRX1_TYPE" }, - { Parameters::k_param_g2, 146, AP_PARAM_INT8 , "PRX1_ORIENT" }, - { Parameters::k_param_g2, 210, AP_PARAM_INT16, "PRX1_YAW_CORR" }, - { Parameters::k_param_g2, 274, AP_PARAM_INT16, "PRX1_IGN_ANG1" }, - { Parameters::k_param_g2, 338, AP_PARAM_INT8, "PRX1_IGN_WID1" }, - { Parameters::k_param_g2, 402, AP_PARAM_INT16, "PRX1_IGN_ANG2" }, - { Parameters::k_param_g2, 466, AP_PARAM_INT8, "PRX1_IGN_WID2" }, - { Parameters::k_param_g2, 530, AP_PARAM_INT16, "PRX1_IGN_ANG3" }, - { Parameters::k_param_g2, 594, AP_PARAM_INT8, "PRX1_IGN_WID3" }, - { Parameters::k_param_g2, 658, AP_PARAM_INT16, "PRX1_IGN_ANG4" }, - { Parameters::k_param_g2, 722, AP_PARAM_INT8, "PRX1_IGN_WID4" }, - { Parameters::k_param_g2, 1234, AP_PARAM_FLOAT, "PRX1_MIN" }, - { Parameters::k_param_g2, 1298, AP_PARAM_FLOAT, "PRX1_MAX" }, // PARAMETER_CONVERSION - Added: May-2024 for Rover-4.6 { Parameters::k_param_g2, 113, AP_PARAM_INT8, "TRQ1_TYPE" }, { Parameters::k_param_g2, 177, AP_PARAM_INT8, "TRQ1_ONOFF_PIN" }, @@ -788,33 +744,6 @@ void Rover::load_parameters(void) g2.crash_angle.set_default(30); } - // set AR_WPNav's WP_SPEED to be old WP_SPEED (if set) or CRUISE_SPEED (if set) - // PARAMETER_CONVERSION - Added: May-2019 for Rover-4.0 - const AP_Param::ConversionInfo wp_speed_old_info = { Parameters::k_param_g2, 14, AP_PARAM_FLOAT, "WP_SPEED" }; - const AP_Param::ConversionInfo cruise_speed_info = { Parameters::k_param_speed_cruise, 0, AP_PARAM_FLOAT, "WP_SPEED" }; - AP_Float wp_speed_old; - if (AP_Param::find_old_parameter(&wp_speed_old_info, &wp_speed_old)) { - // old WP_SPEED parameter value was set so copy to new WP_SPEED - AP_Param::convert_old_parameter(&wp_speed_old_info, 1.0f); - } else { - // copy CRUISE_SPEED to new WP_SPEED - AP_Param::convert_old_parameter(&cruise_speed_info, 1.0f); - } - - // attitude control FF and FILT parameter changes for Rover-3.6 - // PARAMETER_CONVERSION - Added: Jul-2019 for Rover-4.0 - const AP_Param::ConversionInfo ff_and_filt_conversion_info[] = { - { Parameters::k_param_g2, 24650, AP_PARAM_FLOAT, "ATC_STR_RAT_FLTE" }, - { Parameters::k_param_g2, 28746, AP_PARAM_FLOAT, "ATC_STR_RAT_FF" }, - { Parameters::k_param_g2, 24714, AP_PARAM_FLOAT, "ATC_SPEED_FLTE" }, - { Parameters::k_param_g2, 28810, AP_PARAM_FLOAT, "ATC_SPEED_FF" }, - { Parameters::k_param_g2, 25226, AP_PARAM_FLOAT, "ATC_BAL_FLTE" }, - { Parameters::k_param_g2, 29322, AP_PARAM_FLOAT, "ATC_BAL_FF" }, - { Parameters::k_param_g2, 25354, AP_PARAM_FLOAT, "ATC_SAIL_FLTE" }, - { Parameters::k_param_g2, 29450, AP_PARAM_FLOAT, "ATC_SAIL_FF" }, - }; - AP_Param::convert_old_parameters(&ff_and_filt_conversion_info[0], ARRAY_SIZE(ff_and_filt_conversion_info)); - // configure safety switch to allow stopping the motors while armed #if HAL_HAVE_SAFETY_SWITCH AP_Param::set_default_by_name("BRD_SAFETYOPTION", AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_OFF| From 1b3c1874c9d3aa66895ec6f45d21303a5c53f9ea Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:00:32 +1000 Subject: [PATCH 14/26] APM_Control: remove convert_pid() AP_RollController::convert_pid() and AP_PitchController::convert_pid() converted the old RLL2SRV_/PTCH2SRV_ gains into the AC_PID form. Added Apr-2021 and described in the code as "a temporary conversion function during development"; present in the 4.3.0 release, so anybody running 4.3.0 or later has already had it applied. --- libraries/APM_Control/AP_PitchController.cpp | 32 -------------------- libraries/APM_Control/AP_PitchController.h | 1 - libraries/APM_Control/AP_RollController.cpp | 31 ------------------- libraries/APM_Control/AP_RollController.h | 1 - 4 files changed, 65 deletions(-) diff --git a/libraries/APM_Control/AP_PitchController.cpp b/libraries/APM_Control/AP_PitchController.cpp index 08a5f12907d49..40d27ac391dd1 100644 --- a/libraries/APM_Control/AP_PitchController.cpp +++ b/libraries/APM_Control/AP_PitchController.cpp @@ -303,35 +303,3 @@ float AP_PitchController::run_axis_rate_control(float desired_rate_degs, float s return run_rate_control(desired_rate_degs, scaler, disable_integrator, ground_mode); } - -/* - convert from old to new PIDs - this is a temporary conversion function during development - */ -// PARAMETER_CONVERSION - Added: Apr-2021 for ArduPilot-4.1 -void AP_PitchController::convert_pid() -{ - AP_Float &ff = rate_pid.ff(); - if (ff.configured()) { - return; - } - - float old_ff=0, old_p=1.0, old_i=0.3, old_d=0.08; - int16_t old_imax = 3000; - bool have_old = AP_Param::get_param_by_index(this, 1, AP_PARAM_FLOAT, &old_p); - have_old |= AP_Param::get_param_by_index(this, 3, AP_PARAM_FLOAT, &old_i); - have_old |= AP_Param::get_param_by_index(this, 2, AP_PARAM_FLOAT, &old_d); - have_old |= AP_Param::get_param_by_index(this, 8, AP_PARAM_FLOAT, &old_ff); - have_old |= AP_Param::get_param_by_index(this, 7, AP_PARAM_FLOAT, &old_imax); - if (!have_old) { - // none of the old gains were set - return; - } - - const float kp_ff = MAX((old_p - old_i * gains.tau) * gains.tau - old_d, 0); - rate_pid.ff().set_and_save(old_ff + kp_ff); - rate_pid.kI().set_and_save_ifchanged(old_i * gains.tau); - rate_pid.kP().set_and_save_ifchanged(old_d); - rate_pid.kD().set_and_save_ifchanged(0); - rate_pid.kIMAX().set_and_save_ifchanged(old_imax/4500.0); -} diff --git a/libraries/APM_Control/AP_PitchController.h b/libraries/APM_Control/AP_PitchController.h index e5022bfb95a2a..0bb0b69d67b58 100644 --- a/libraries/APM_Control/AP_PitchController.h +++ b/libraries/APM_Control/AP_PitchController.h @@ -12,7 +12,6 @@ class AP_PitchController : public AP_FW_Controller static const struct AP_Param::GroupInfo var_info[]; - void convert_pid(); private: AP_Float _roll_ff; diff --git a/libraries/APM_Control/AP_RollController.cpp b/libraries/APM_Control/AP_RollController.cpp index 63d26096333e4..72f625a43a7a0 100644 --- a/libraries/APM_Control/AP_RollController.cpp +++ b/libraries/APM_Control/AP_RollController.cpp @@ -245,34 +245,3 @@ float AP_RollController::run_axis_rate_control(float desired_rate_degs, float sc return run_rate_control(desired_rate_degs, scaler, disable_integrator, ground_mode); } - -/* - convert from old to new PIDs - this is a temporary conversion function during development - */ -// PARAMETER_CONVERSION - Added: Apr-2021 for ArduPilot-4.1 -void AP_RollController::convert_pid() -{ - AP_Float &ff = rate_pid.ff(); - if (ff.configured()) { - return; - } - float old_ff=0, old_p=1.0, old_i=0.3, old_d=0.08; - int16_t old_imax=3000; - bool have_old = AP_Param::get_param_by_index(this, 1, AP_PARAM_FLOAT, &old_p); - have_old |= AP_Param::get_param_by_index(this, 3, AP_PARAM_FLOAT, &old_i); - have_old |= AP_Param::get_param_by_index(this, 2, AP_PARAM_FLOAT, &old_d); - have_old |= AP_Param::get_param_by_index(this, 6, AP_PARAM_FLOAT, &old_ff); - have_old |= AP_Param::get_param_by_index(this, 5, AP_PARAM_INT16, &old_imax); - if (!have_old) { - // none of the old gains were set - return; - } - - const float kp_ff = MAX((old_p - old_i * gains.tau) * gains.tau - old_d, 0); - rate_pid.ff().set_and_save(old_ff + kp_ff); - rate_pid.kI().set_and_save_ifchanged(old_i * gains.tau); - rate_pid.kP().set_and_save_ifchanged(old_d); - rate_pid.kD().set_and_save_ifchanged(0); - rate_pid.kIMAX().set_and_save_ifchanged(old_imax/4500.0); -} diff --git a/libraries/APM_Control/AP_RollController.h b/libraries/APM_Control/AP_RollController.h index 39542aaf1b3d3..2b6023e644bfd 100644 --- a/libraries/APM_Control/AP_RollController.h +++ b/libraries/APM_Control/AP_RollController.h @@ -12,7 +12,6 @@ class AP_RollController : public AP_FW_Controller static const struct AP_Param::GroupInfo var_info[]; - void convert_pid(); /* set the in_recovery flag, which is used during a VTOL upset recovery From 24a0c9624ec375aa5fee7df94635c7fd658b05e7 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:00:33 +1000 Subject: [PATCH 15/26] AP_Compass: remove primary compass parameter conversion Converted the old COMPASS_PRIMARY into the device-id priority list. Added Feb-2020 and present in the 4.3.0 release, so anybody running 4.3.0 or later has already had it applied. Note that the conversion sat inside Compass::init(), below its if (!_enabled) { return; } early return, so "present in the release" is not quite the same as "has run". A user who has had COMPASS_ENABLE=0 for every release from 4.3 onwards never reached the conversion, and if they enable the compass after moving to 4.8 their old COMPASS_PRIMARY selection is not honoured. That is judged too unlikely - and the parameter too old - to keep the conversion for. --- libraries/AP_Compass/AP_Compass.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/libraries/AP_Compass/AP_Compass.cpp b/libraries/AP_Compass/AP_Compass.cpp index 4b971385e1c22..71b0ef53648c8 100644 --- a/libraries/AP_Compass/AP_Compass.cpp +++ b/libraries/AP_Compass/AP_Compass.cpp @@ -719,24 +719,6 @@ void Compass::init() } #if COMPASS_MAX_INSTANCES > 1 - // PARAMETER_CONVERSION - Added: Feb-2020 for ArduPilot-4.0 - // Look if there was a primary compass setup in previous version - // if so and the primary compass is not set in current setup - // make the devid as primary. - if (_priority_did_stored_list[Priority(0)] == 0) { - uint16_t k_param_compass; - if (AP_Param::find_top_level_key_by_pointer(this, k_param_compass)) { - const AP_Param::ConversionInfo primary_compass_old_param = {k_param_compass, 12, AP_PARAM_INT8, ""}; - AP_Int8 value; - value.set(0); - bool primary_param_exists = AP_Param::find_old_parameter(&primary_compass_old_param, &value); - int8_t oldvalue = value.get(); - if ((oldvalue!=0) && (oldvalue Date: Thu, 27 Aug 2026 14:00:33 +1000 Subject: [PATCH 16/26] AP_Logger: remove LOG_FILE_BUFSIZE parameter width conversion Widened LOG_FILE_BUFSIZE from 8 to 16 bits. Added Nov-2020 and present in the 4.3.0 release, so anybody running 4.3.0 or later has already had it applied. --- libraries/AP_Logger/AP_Logger.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libraries/AP_Logger/AP_Logger.cpp b/libraries/AP_Logger/AP_Logger.cpp index 423b6f10c6e55..2520f30244e46 100644 --- a/libraries/AP_Logger/AP_Logger.cpp +++ b/libraries/AP_Logger/AP_Logger.cpp @@ -223,10 +223,6 @@ void AP_Logger::init(const AP_Int32 &log_bitmask, const struct LogStructure *str { _log_bitmask = &log_bitmask; - // PARAMETER_CONVERSION - Added: Nov-2020 for ArduPilot-4.1 - // convert from 8 bit to 16 bit LOG_FILE_BUFSIZE - _params.file_bufsize.convert_parameter_width(AP_PARAM_INT8); - if (hal.util->was_watchdog_armed()) { GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Forcing logging for watchdog reset"); _params.log_disarmed.set(LogDisarmed::LOG_WHILE_DISARMED); From 68a8c2db9d647ac118ee594f7efabb195cf2287f Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:00:33 +1000 Subject: [PATCH 17/26] AP_Mount: remove convert_params() Converted MNT_ to MNT1_, mount angle limits from centi-degrees to degrees, and the mount RC input channels to RCx_OPTION. Added Sep-2022 and first shipped in the 4.3.0 release, so anybody running 4.3.0 or later has already had it applied. --- libraries/AP_Mount/AP_Mount.cpp | 97 --------------------------------- libraries/AP_Mount/AP_Mount.h | 3 - 2 files changed, 100 deletions(-) diff --git a/libraries/AP_Mount/AP_Mount.cpp b/libraries/AP_Mount/AP_Mount.cpp index 6b66439e01b5d..ef5a06b8a0298 100644 --- a/libraries/AP_Mount/AP_Mount.cpp +++ b/libraries/AP_Mount/AP_Mount.cpp @@ -61,9 +61,6 @@ void AP_Mount::init() return; } - // perform any required parameter conversion - convert_params(); - // primary is reset to the first instantiated mount bool primary_set = false; @@ -1095,100 +1092,6 @@ void AP_Mount::handle_gimbal_device_attitude_status(const mavlink_message_t &msg } } -// perform any required parameter conversion -void AP_Mount::convert_params() -{ - // exit immediately if MNT1_TYPE has already been configured - if (_params[0].type.configured()) { - return; - } - - // PARAMETER_CONVERSION - Added: Sep-2022 for ArduPilot-4.3 - - // convert MNT_TYPE to MNT1_TYPE - int8_t mnt_type = 0; - IGNORE_RETURN(AP_Param::get_param_by_index(this, 19, AP_PARAM_INT8, &mnt_type)); - if (mnt_type == 0) { - // if the mount was not previously set, no need to perform the upgrade logic - return; - } else if (mnt_type > 0) { - int8_t stab_roll = 0; - int8_t stab_pitch = 0; - IGNORE_RETURN(AP_Param::get_param_by_index(this, 4, AP_PARAM_INT8, &stab_roll)); - IGNORE_RETURN(AP_Param::get_param_by_index(this, 5, AP_PARAM_INT8, &stab_pitch)); - if (mnt_type == 1 && stab_roll == 0 && stab_pitch == 0) { - // Servo type without stabilization is changed to BrushlessPWM - // conversion is still done even if HAL_MOUNT_SERVO_ENABLED is false - mnt_type = 7; // (int8_t)Type::BrushlessPWM; - } - // if the mount was previously set, then we need to save the upgraded mount type - _params[0].type.set_and_save(mnt_type); - } - - // convert MNT_JSTICK_SPD to MNT1_RC_RATE - int8_t jstick_spd = 0; - if (AP_Param::get_param_by_index(this, 16, AP_PARAM_INT8, &jstick_spd) && (jstick_spd > 0)) { - _params[0].rc_rate_max.set_and_save(jstick_spd * 0.3); - } - - // find Mount's top level key - uint16_t k_param_mount_key; - if (!AP_Param::find_top_level_key_by_pointer(this, k_param_mount_key)) { - return; - } - - // table of mount parameters to be converted without scaling - static const AP_Param::ConversionInfo mnt_param_conversion_info[] { - { k_param_mount_key, 0, AP_PARAM_INT8, "MNT1_DEFLT_MODE" }, - { k_param_mount_key, 1, AP_PARAM_VECTOR3F, "MNT1_RETRACT" }, - { k_param_mount_key, 2, AP_PARAM_VECTOR3F, "MNT1_NEUTRAL" }, - { k_param_mount_key, 17, AP_PARAM_FLOAT, "MNT1_LEAD_RLL" }, - { k_param_mount_key, 18, AP_PARAM_FLOAT, "MNT1_LEAD_PTCH" }, - }; - uint8_t table_size = ARRAY_SIZE(mnt_param_conversion_info); - for (uint8_t i=0; i 0)) { - // get pointers to the appropriate RCx_OPTION parameter - char pname[17]; - enum ap_var_type ptype; - snprintf(pname, sizeof(pname), "RC%u_OPTION", (unsigned)mnt_rcin); - AP_Int16 *rcx_option = (AP_Int16 *)AP_Param::find(pname, &ptype); - if ((rcx_option != nullptr) && !rcx_option->configured()) { - rcx_option->set_and_save(mnt_rc_conversion_table[i].new_rc_option); - } - } - } -} - // singleton instance AP_Mount *AP_Mount::_singleton; diff --git a/libraries/AP_Mount/AP_Mount.h b/libraries/AP_Mount/AP_Mount.h index 2b601562b6770..ab94eac9a0470 100644 --- a/libraries/AP_Mount/AP_Mount.h +++ b/libraries/AP_Mount/AP_Mount.h @@ -371,9 +371,6 @@ class AP_Mount void handle_global_position_int(const mavlink_message_t &msg); void handle_gimbal_device_information(const mavlink_message_t &msg); void handle_gimbal_device_attitude_status(const mavlink_message_t &msg); - - // perform any required parameter conversion - void convert_params(); }; namespace AP { From dd197ad8553c280a9e1089ba74200a2add70278a Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 14:00:33 +1000 Subject: [PATCH 18/26] AP_NavEKF3: remove convert_parameters() Converted EK3_GPS_TYPE, EK3_ALT_SOURCE and EK3_MAG_CAL into the EK3_SRC1_ parameters. Added Nov-2020 and present in the 4.3.0 release, so anybody running 4.3.0 or later has already had it applied. Note that the only call to convert_parameters() was from InitialiseFilter(), below its if (_enable == 0 || _imuMask == 0) { return false; } early return, so "present in the release" is not quite the same as "has run". A user who has had EK3_ENABLE=0 for every release from 4.3 onwards never reached the conversion, and if they enable EKF3 after moving to 4.8 they get EK3_SRC1_ defaults rather than their old source selections. That is judged too unlikely - and the parameters too old - to keep the conversion for. --- libraries/AP_NavEKF3/AP_NavEKF3.cpp | 107 ---------------------------- libraries/AP_NavEKF3/AP_NavEKF3.h | 3 - 2 files changed, 110 deletions(-) diff --git a/libraries/AP_NavEKF3/AP_NavEKF3.cpp b/libraries/AP_NavEKF3/AP_NavEKF3.cpp index 39b427dd6a7bc..f3333d308aa9d 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3.cpp +++ b/libraries/AP_NavEKF3/AP_NavEKF3.cpp @@ -803,11 +803,6 @@ bool NavEKF3::InitialiseFilter(void) // expected number of IMU frames per prediction _framesPerPrediction = uint8_t((EKF_TARGET_DT / (_frameTimeUsec * 1.0e-6) + 0.5)); -#if !APM_BUILD_TYPE(APM_BUILD_AP_DAL_Standalone) - // convert parameters if necessary - convert_parameters(); -#endif - #if APM_BUILD_TYPE(APM_BUILD_Replay) if (ins.get_accel_count() == 0) { return false; @@ -1789,108 +1784,6 @@ void NavEKF3::writeTerrainData(float alt_m) #endif } -// parameter conversion of EKF3 parameters -// PARAMETER_CONVERSION - Added: Nov-2020 for ArduPilot-4.1 -void NavEKF3::convert_parameters() -{ - // exit immediately if param conversion has been done before - if (sources.configured()) { - return; - } - - // find EKF3's top level key - uint16_t k_param_ekf3; - if (!AP_Param::find_top_level_key_by_pointer(this, k_param_ekf3)) { - return; - } - - // use EK3_GPS_TYPE to set EK3_SRC1_POSXY, EK3_SRC1_VELXY, EK3_SRC1_VELZ - const AP_Param::ConversionInfo gps_type_info = {k_param_ekf3, 1, AP_PARAM_INT8, "EK3_GPS_TYPE"}; - AP_Int8 gps_type_old; - const bool found_gps_type = AP_Param::find_old_parameter(&gps_type_info, &gps_type_old); - if (found_gps_type) { - switch (gps_type_old.get()) { - case 0: - // EK3_GPS_TYPE == 0 (GPS 3D Vel and 2D Pos) - AP_Param::set_and_save_by_name("EK3_SRC1_POSXY", (int8_t)AP_NavEKF_Source::SourceXY::GPS); - AP_Param::set_and_save_by_name("EK3_SRC1_VELXY", (int8_t)AP_NavEKF_Source::SourceXY::GPS); - AP_Param::set_and_save_by_name("EK3_SRC1_VELZ", (int8_t)AP_NavEKF_Source::SourceZ::GPS); - break; - case 1: - // EK3_GPS_TYPE == 1 (GPS 2D Vel and 2D Pos) then EK3_SRC1_POSXY = GPS(1), EK3_SRC1_VELXY = GPS(1), EK3_SRC1_VELZ = NONE(0) - AP_Param::set_and_save_by_name("EK3_SRC1_POSXY", (int8_t)AP_NavEKF_Source::SourceXY::GPS); - AP_Param::set_and_save_by_name("EK3_SRC1_VELXY", (int8_t)AP_NavEKF_Source::SourceXY::GPS); - AP_Param::set_and_save_by_name("EK3_SRC1_VELZ", (int8_t)AP_NavEKF_Source::SourceZ::NONE); - break; - case 2: - // EK3_GPS_TYPE == 2 (GPS 2D Pos) then EK3_SRC1_POSXY = GPS(1), EK3_SRC1_VELXY = None(0), EK3_SRC1_VELZ = NONE(0) - AP_Param::set_and_save_by_name("EK3_SRC1_POSXY", (int8_t)AP_NavEKF_Source::SourceXY::GPS); - AP_Param::set_and_save_by_name("EK3_SRC1_VELXY", (int8_t)AP_NavEKF_Source::SourceXY::NONE); - AP_Param::set_and_save_by_name("EK3_SRC1_VELZ", (int8_t)AP_NavEKF_Source::SourceZ::NONE); - break; - case 3: - default: - // EK3_GPS_TYPE == 3 (No GPS) we don't know what to do, could be optical flow, beacon or external nav - sources.mark_configured(); - break; - } - } else { - // mark configured in storage so conversion is only run once - sources.mark_configured(); - } - - // use EK3_ALT_SOURCE to set EK3_SRC1_POSZ - const AP_Param::ConversionInfo alt_source_info = {k_param_ekf3, 9, AP_PARAM_INT8, "EK3_ALT_SOURCE"}; - AP_Int8 alt_source_old; - if (AP_Param::find_old_parameter(&alt_source_info, &alt_source_old)) { - switch (alt_source_old.get()) { - case 0: - // EK3_ALT_SOURCE = BARO, the default so do nothing - break; - case 1: - // EK3_ALT_SOURCE == 1 (RangeFinder) - AP_Param::set_and_save_by_name("EK3_SRC1_POSZ", (int8_t)AP_NavEKF_Source::SourceZ::RANGEFINDER); - break; - case 2: - // EK3_ALT_SOURCE == 2 (GPS) - AP_Param::set_and_save_by_name("EK3_SRC1_POSZ", (int8_t)AP_NavEKF_Source::SourceZ::GPS); - break; - case 3: - // EK3_ALT_SOURCE == 3 (Beacon) - AP_Param::set_and_save_by_name("EK3_SRC1_POSZ", (int8_t)AP_NavEKF_Source::SourceZ::BEACON); - break; - case 4: - // EK3_ALT_SOURCE == 4 (ExtNav) - AP_Param::set_and_save_by_name("EK3_SRC1_POSZ", (int8_t)AP_NavEKF_Source::SourceZ::EXTNAV); - break; - default: - // do nothing - break; - } - } - - // use EK3_MAG_CAL to set EK3_SRC1_YAW - switch (_magCal.get()) { - case 5: - // EK3_MAG_CAL = 5 (External Yaw sensor). We rely on effective_magCal to interpret old "5" values as "Never" - AP_Param::set_and_save_by_name("EK3_SRC1_YAW", (int8_t)AP_NavEKF_Source::SourceYaw::GPS); - break; - case 6: - // EK3_MAG_CAL = 6 (ExtYaw with Compass fallback). We rely on effective_magCal to interpret old "6" values as "When Flying" - AP_Param::set_and_save_by_name("EK3_SRC1_YAW", (int8_t)AP_NavEKF_Source::SourceYaw::GPS_COMPASS_FALLBACK); - break; - default: - // do nothing - break; - } - - // if GPS and optical flow enabled set EK3_SRC2_VELXY to optical flow - // EK3_SRC_OPTIONS should default to 1 meaning both GPS and optical flow velocities will be fused - if (dal.opticalflow_enabled() && (!found_gps_type || (gps_type_old.get() <= 2))) { - AP_Param::set_and_save_by_name("EK3_SRC2_VELXY", (int8_t)AP_NavEKF_Source::SourceXY::OPTFLOW); - } -} - // Set to true if the terrain underneath is stable enough to be used as a height reference // in combination with a range finder. Set to false if the terrain underneath the vehicle // cannot be used as a height reference. Use to prevent range finder operation otherwise diff --git a/libraries/AP_NavEKF3/AP_NavEKF3.h b/libraries/AP_NavEKF3/AP_NavEKF3.h index c917b432358e0..70c4d80698b96 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3.h +++ b/libraries/AP_NavEKF3/AP_NavEKF3.h @@ -366,9 +366,6 @@ class NavEKF3 { // Writes the default equivalent airspeed and 1-sigma uncertainty in m/s to be used in forward flight if a measured airspeed is required and not available. void writeDefaultAirSpeed(float airspeed, float uncertainty); - // parameter conversion - void convert_parameters(); - // returns true when the yaw angle has been aligned bool yawAlignmentComplete(void) const; From ab145255e66c5cab729789656c37030d0e40ae90 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 20:20:26 +1000 Subject: [PATCH 19/26] AntennaTracker: remove RCn_OPTION parameter conversion Rewrote a stored RCn_OPTION of ARMDISARM_UNUSED (41) to ARMDISARM (153). Added Sep-2021 and present in Tracker-4.5.0, which is the earliest tracker release there is, so every tracker release a user can be moving from already applied it. A stored 41 which survives becomes an unhandled auxiliary function and does nothing, which is the same outcome as any other option number this firmware does not know. --- AntennaTracker/system.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/AntennaTracker/system.cpp b/AntennaTracker/system.cpp index 8373c6c8c1f53..2885ee7ce052d 100644 --- a/AntennaTracker/system.cpp +++ b/AntennaTracker/system.cpp @@ -46,8 +46,6 @@ void Tracker::init_ardupilot() #endif // initialise rc channels including setting mode - // PARAMETER_CONVERSION - Added: Sep-2021 for Tracker-4.5 - rc().convert_options(RC_Channel::AUX_FUNC::ARMDISARM_UNUSED, RC_Channel::AUX_FUNC::ARMDISARM); rc().init(); // initialise servos From a0a7912cdc8b61058309e335eaf618b66c9d1414 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 20:20:27 +1000 Subject: [PATCH 20/26] ArduCopter: remove RCn_OPTION parameter conversion Rewrote a stored RCn_OPTION of ARMDISARM_UNUSED (41) to ARMDISARM_AIRMODE (154). Added Sep-2021 and present in Copter-4.2.0, so anybody moving from 4.3.0 or later has already had it applied. A stored 41 which survives becomes an unhandled auxiliary function and does nothing, which is the same outcome as any other option number this firmware does not know. --- ArduCopter/system.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ArduCopter/system.cpp b/ArduCopter/system.cpp index 29c94ff94ef11..973319f89481e 100644 --- a/ArduCopter/system.cpp +++ b/ArduCopter/system.cpp @@ -64,8 +64,6 @@ void Copter::init_ardupilot() allocate_motors(); // initialise rc channels including setting mode - // PARAMETER_CONVERSION - Added: Sep-2021 for Copter-4.2 - rc().convert_options(RC_Channel::AUX_FUNC::ARMDISARM_UNUSED, RC_Channel::AUX_FUNC::ARMDISARM_AIRMODE); rc().init(); // sets up motors and output to escs From 41aedf0372ea2580bfdf785350830930ac5ca060 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 20:20:27 +1000 Subject: [PATCH 21/26] ArduPlane: remove RCn_OPTION parameter conversion Rewrote a stored RCn_OPTION of ARMDISARM_UNUSED (41) to ARMDISARM (153), or to ARMDISARM_AIRMODE (154) on a quadplane which had the airmode option set and no AIRMODE switch. Added Sep-2021 and present in Plane-4.2.0, so anybody moving from 4.3.0 or later has already had it applied. A stored 41 which survives becomes an unhandled auxiliary function and does nothing, which is the same outcome as any other option number this firmware does not know. --- ArduPlane/system.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ArduPlane/system.cpp b/ArduPlane/system.cpp index 62486d7ff4b37..9eb25558bcd94 100644 --- a/ArduPlane/system.cpp +++ b/ArduPlane/system.cpp @@ -13,12 +13,6 @@ void Plane::init_ardupilot() ins.set_log_raw_bit(MASK_LOG_IMU_RAW); // initialise rc channels including setting mode - // PARAMETER_CONVERSION - Added: Sep-2021 for ArduPlane-4.2 -#if HAL_QUADPLANE_ENABLED - rc().convert_options(RC_Channel::AUX_FUNC::ARMDISARM_UNUSED, (quadplane.enabled() && quadplane.option_is_set(QuadPlane::Option::AIRMODE_UNUSED) && (rc().find_channel_for_option(RC_Channel::AUX_FUNC::AIRMODE) == nullptr)) ? RC_Channel::AUX_FUNC::ARMDISARM_AIRMODE : RC_Channel::AUX_FUNC::ARMDISARM); -#else - rc().convert_options(RC_Channel::AUX_FUNC::ARMDISARM_UNUSED, RC_Channel::AUX_FUNC::ARMDISARM); -#endif rc().init(); #if AP_RELAY_ENABLED From b4e021a1caea463b129abce1d503e569f9fe6dde Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 20:20:27 +1000 Subject: [PATCH 22/26] ArduSub: remove RCn_OPTION parameter conversion Rewrote a stored RCn_OPTION of ARMDISARM_UNUSED (41) to ARMDISARM (153). Added Sep-2021, but Sub has no 4.2 to 4.4 releases, so the first release carrying it is ArduSub-4.5.0. That is also the oldest release a Sub user can be moving from once the migration floor is 4.3, so everybody in scope has already had it applied. A stored 41 which survives becomes an unhandled auxiliary function and does nothing, which is the same outcome as any other option number this firmware does not know. --- ArduSub/system.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/ArduSub/system.cpp b/ArduSub/system.cpp index 6bd897a557612..3be221e3fe888 100644 --- a/ArduSub/system.cpp +++ b/ArduSub/system.cpp @@ -48,8 +48,6 @@ void Sub::init_ardupilot() gcs().setup_uarts(); // initialise rc channels including setting mode - // PARAMETER_CONVERSION - Added: Sep-2021 for ArduSub-4.5 - rc().convert_options(RC_Channel::AUX_FUNC::ARMDISARM_UNUSED, RC_Channel::AUX_FUNC::ARMDISARM); rc().init(); From 526121639110304e9682f7c756d857c1e0780c4d Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 20:20:27 +1000 Subject: [PATCH 23/26] Blimp: remove RCn_OPTION parameter conversion Rewrote a stored RCn_OPTION of ARMDISARM_UNUSED (41) to ARMDISARM (153). Added Sep-2021. Blimp has no release tags, so unlike the other vehicles there is no release which can be shown to contain the conversion, and a 4.3 migration floor says nothing about a build made from master. This removal takes the floor to mean that a Blimp older than the whole 4.3 cycle is out of scope for migration, the same as it is for every other vehicle. A stored 41 which survives becomes an unhandled auxiliary function and does nothing, which is the same outcome as any other option number this firmware does not know. --- Blimp/system.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Blimp/system.cpp b/Blimp/system.cpp index ec6ee92418fb7..298011bcfc9e3 100644 --- a/Blimp/system.cpp +++ b/Blimp/system.cpp @@ -46,8 +46,6 @@ void Blimp::init_ardupilot() AP_Param::invalidate_count(); // initialise rc channels including setting mode - // PARAMETER_CONVERSION - Added: Sep-2021 for ArduPilot-4.2 - rc().convert_options(RC_Channel::AUX_FUNC::ARMDISARM_UNUSED, RC_Channel::AUX_FUNC::ARMDISARM); rc().init(); // sets up motors and output to escs From 6ac7651a0b1d35ac866f657547219641be055cf4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 20:20:27 +1000 Subject: [PATCH 24/26] Rover: remove RCn_OPTION parameter conversions Rewrote a stored RCn_OPTION of ARMDISARM_UNUSED (41) to ARMDISARM (153), and Rover's SAVE_TRIM (5) to TRIM_TO_CURRENT_SERVO_RC (155). Both were added Sep-2021 and are present in Rover-4.2.0, so anybody moving from Rover-4.4.0 - the oldest release a Rover user can be moving from once the migration floor is 4.3, as Rover has no 4.3 - has already had them applied. A stored 41 or 5 which survives becomes an unhandled auxiliary function on Rover and does nothing, which is the same outcome as any other option number this firmware does not know. --- Rover/system.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Rover/system.cpp b/Rover/system.cpp index 7426f3a8f7206..68ac010dfb059 100644 --- a/Rover/system.cpp +++ b/Rover/system.cpp @@ -134,9 +134,6 @@ void Rover::init_ardupilot() set_mode(*initial_mode, ModeReason::INITIALISED); // initialise rc channels - // PARAMETER_CONVERSION - Added: Sep-2021 for Rover-4.2 - rc().convert_options(RC_Channel::AUX_FUNC::ARMDISARM_UNUSED, RC_Channel::AUX_FUNC::ARMDISARM); - rc().convert_options(RC_Channel::AUX_FUNC::SAVE_TRIM, RC_Channel::AUX_FUNC::TRIM_TO_CURRENT_SERVO_RC); rc().init(); rover.g2.sailboat.init(); From 3756a23aca08f4e6f1e59f209ce8d3acdeb6745b Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 20:20:28 +1000 Subject: [PATCH 25/26] RC_Channel: remove convert_options() The last caller went away with the per-vehicle RCn_OPTION conversions. AUX_FUNC::ARMDISARM_UNUSED and AUX_FUNC::SAVE_TRIM stay in the enum: those numbers are still spoken for and must not be handed out again. --- libraries/RC_Channel/RC_Channel.cpp | 16 ---------------- libraries/RC_Channel/RC_Channel.h | 1 - 2 files changed, 17 deletions(-) diff --git a/libraries/RC_Channel/RC_Channel.cpp b/libraries/RC_Channel/RC_Channel.cpp index 9386a369ae552..909c5c8728554 100644 --- a/libraries/RC_Channel/RC_Channel.cpp +++ b/libraries/RC_Channel/RC_Channel.cpp @@ -2151,20 +2151,4 @@ bool RC_Channels::duplicate_options_exist() return false; } -// convert option parameter from old to new -// PARAMETER_CONVERSION - Added: Sep-2021 for ArduPilot-4.2 -void RC_Channels::convert_options(const RC_Channel::AUX_FUNC old_option, const RC_Channel::AUX_FUNC new_option) -{ - for (uint8_t i=0; ioption.get() == old_option) { - c->option.set_and_save((int16_t)new_option); - } - } -} - #endif // AP_RC_CHANNEL_ENABLED diff --git a/libraries/RC_Channel/RC_Channel.h b/libraries/RC_Channel/RC_Channel.h index 7db60561b9864..9d0a3132b0e8d 100644 --- a/libraries/RC_Channel/RC_Channel.h +++ b/libraries/RC_Channel/RC_Channel.h @@ -645,7 +645,6 @@ class RC_Channels { class RC_Channel *find_channel_for_option(const RC_Channel::AUX_FUNC option); bool duplicate_options_exist(); - void convert_options(const RC_Channel::AUX_FUNC old_option, const RC_Channel::AUX_FUNC new_option); void init_aux_all(); void read_aux_all(); From 6365262312c6af1830dcd20e7ff18f2992a1f852 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 27 Aug 2026 20:47:03 +1000 Subject: [PATCH 26/26] AP_GPS: remove GPS_AUTO_SWITCH use-second parameter conversion GPS_AUTO_SWITCH used to have a value 3, "use second GPS". That was replaced by GPS_PRIMARY, and this converted a stored 3 into GPS_PRIMARY=1 with GPS_AUTO_SWITCH=0. Added Nov-2020 and present in the 4.1.0 release, so anybody moving from 4.3.0 or later has already had it applied. The conversion only ran while GPS_PRIMARY was unconfigured, but GPS_PRIMARY arrived in the very same commit as the conversion, so on the first 4.1-or-later boot of any vehicle carrying a 3 it was unconfigured and the conversion ran. A stored 3 which survives is no longer any of NONE, BLEND or USE_PRIMARY_IF_3D_FIX, so update_primary() falls through to the UseBest path - the same as any other value this firmware does not know, and the same as it already does today for anybody who sets 3 by hand after having configured GPS_PRIMARY. 3 is not offered in the parameter's @Values and GPSAutoSwitch::USE_SECOND stays commented out in the enum, so the number is not handed out again. --- libraries/AP_GPS/AP_GPS.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index 1831b232f4a85..d8fc7abbda774 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -320,13 +320,6 @@ void AP_GPS::init() convert_parameters(); - // Set new primary param based on old auto_switch use second option - // PARAMETER_CONVERSION - Added: Nov-2020 for ArduPilot-4.1 - if ((_auto_switch.get() == 3) && !_primary.configured()) { - _primary.set_and_save(1); - _auto_switch.set_and_save(0); - } - // search for serial ports with gps protocol const auto &serial_manager = AP::serialmanager(); uint8_t uart_idx = 0;