ArduPlane: annotate and correct parameter conversion comments

Adds the missing PARAMETER_CONVERSION annotation to:

 - the conversion_table, which converts the old altitude fence
   parameters (Mar-2021)
 - the loop converting the old chan params to RCx_OPTION (Mar-2021)
 - the tailsitter (Jul-2021) and tiltrotor (Sep-2021) blocks of
   q_conversion_table

The quadplane centi-conversions already carried a date in prose
("centi-conversions added January 2024"); that is now in the standard
form.  Remaining changes are date format corrections.  No functional
change.

Also replaces the "CONVERSION: Added for upgrade to ArduPlane 4.2, Sep
2021" comment on the RCn_OPTION conversion with the standard annotation.
That conversion calls set_and_save() directly rather than an
AP_Param::convert_* helper, so an audit anchored on those helpers did not
see it.  Established by content: absent from Plane-4.1.7, present in
Plane-4.2.0.
This commit is contained in:
Peter Barker
2026-08-31 08:18:26 +10:00
committed by Peter Barker
parent 73498f2b8c
commit 1bc0b2acf6
3 changed files with 11 additions and 7 deletions
+5 -3
View File
@@ -1319,6 +1319,7 @@ ParametersG2::ParametersG2(void) :
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"},
@@ -1372,6 +1373,7 @@ 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<ARRAY_SIZE(rc_option_conversion); i++) {
AP_Int8 chan_param;
AP_Param::ConversionInfo info {rc_option_conversion[i].old_key, rc_option_conversion[i].old_group_element, AP_PARAM_INT8, nullptr};
@@ -1384,7 +1386,7 @@ void Plane::load_parameters(void)
}
// PARAMETER_CONVERSION - Added: March 2021 for ArduPlane-4.1
// 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);
@@ -1512,12 +1514,12 @@ void Plane::load_parameters(void)
AP_Param::convert_class(g.k_param_fence, &fence, fence.var_info, 0, true);
#endif
// PARAMETER_CONVERSION - Added: July-2025 for ArduPilot-4.7
// 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
// PARAMETER_CONVERSION - Added: Dec 2023
// PARAMETER_CONVERSION - Added: Dec-2023 for ArduPlane-4.5
// Convert _CM (centimeter) parameters to meters and _CD (centidegrees) parameters to meters
g.pitch_trim.convert_centi_parameter(AP_PARAM_INT16);
aparm.airspeed_cruise.convert_centi_parameter(AP_PARAM_INT32);
+5 -3
View File
@@ -610,6 +610,7 @@ static const struct AP_Param::defaults_table_struct defaults_table[] = {
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" },
@@ -626,6 +627,7 @@ const AP_Param::ConversionInfo q_conversion_table[] = {
{ 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" },
@@ -636,11 +638,11 @@ const AP_Param::ConversionInfo q_conversion_table[] = {
{ 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
// 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: July-2022
// 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
};
@@ -819,7 +821,7 @@ bool QuadPlane::setup(void)
AP_Param::convert_old_parameters(&q_conversion_table[0], ARRAY_SIZE(q_conversion_table));
// centi-conversions added January 2024
// 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);
pilot_speed_z_max_dn_ms.convert_centi_parameter(AP_PARAM_INT16);
+1 -1
View File
@@ -16,7 +16,7 @@ void Plane::init_ardupilot()
pitchController.convert_pid();
// initialise rc channels including setting mode
// CONVERSION: Added for upgrade to ArduPlane 4.2, Sep 2021
// 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