diff --git a/src/lib/parameters/param_translation.cpp b/src/lib/parameters/param_translation.cpp index 5ec98ef16d..bf526bdfa3 100644 --- a/src/lib/parameters/param_translation.cpp +++ b/src/lib/parameters/param_translation.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2020, 2021 PX4 Development Team. All rights reserved. + * Copyright (c) 2020-2022 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -266,6 +266,14 @@ bool param_modify_on_import(bson_node_t node) double _param_vt_f_trans_thr = param_find("VT_F_TRANS_THR"); node->d = _param_vt_f_trans_thr / node->d; PX4_INFO("copying %s -> %s", "VT_PSHER_RMP_DT", "VT_PSHER_SLEW"); + } + } + + // 2022-11-09: translate LAUN_ALL_ON->LAUN_DETCN_ON + { + if (strcmp("LAUN_ALL_ON", node->name) == 0) { + strcpy(node->name, "LAUN_DETCN_ON"); + PX4_INFO("copying %s -> %s", "LAUN_ALL_ON", "LAUN_DETCN_ON"); return true; } } diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index a7386763e9..a80d71abdf 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -1530,7 +1530,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo } else { /* Perform launch detection */ - if (!_skipping_takeoff_detection && _param_laun_all_on.get() && + if (!_skipping_takeoff_detection && _param_laun_detcn_on.get() && _launchDetector.getLaunchDetected() < launch_detection_status_s::STATE_FLYING) { if (_control_mode.flag_armed) { @@ -1546,7 +1546,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo } if (!_launch_detected && _launchDetector.getLaunchDetected() > launch_detection_status_s::STATE_WAITING_FOR_LAUNCH - && _param_laun_all_on.get()) { + && _param_laun_detcn_on.get()) { _launch_detected = true; _launch_global_position = global_position; _takeoff_ground_alt = _current_altitude; @@ -1567,7 +1567,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo /* Set control values depending on the detection state */ if (_launchDetector.getLaunchDetected() > launch_detection_status_s::STATE_WAITING_FOR_LAUNCH - && _param_laun_all_on.get()) { + && _param_laun_detcn_on.get()) { /* Launch has been detected, hence we have to control the plane. */ if (_param_fw_use_npfg.get()) { diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp index 620a08a53e..a903133b80 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.hpp @@ -878,7 +878,7 @@ private: (ParamFloat) _param_fw_tko_airspd, (ParamFloat) _param_rwto_psp, - (ParamBool) _param_laun_all_on + (ParamBool) _param_laun_detcn_on ) }; diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_params.c b/src/modules/fw_pos_control_l1/fw_pos_control_l1_params.c index 8a890ebe1e..a588652fdb 100644 --- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_params.c +++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_params.c @@ -1120,9 +1120,13 @@ PARAM_DEFINE_INT32(FW_LND_ABORT, 3); PARAM_DEFINE_FLOAT(FW_WIND_ARSP_SC, 0.f); /** - * Launch detection + * FW Launch detection + * + * Enables automatic launch detection based on measured acceleration. Use for hand- or catapult-launched vehicles. + * Only available for fixed-wing vehicles. + * Not compatible with runway takeoff. * * @boolean * @group FW Launch detection */ -PARAM_DEFINE_INT32(LAUN_ALL_ON, 0); +PARAM_DEFINE_INT32(LAUN_DETCN_ON, 0);