FW Pos C: rename LAUN_* param to FW_LAUN_* to be more explicit

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2022-11-23 09:11:48 +01:00
parent 5587a47471
commit 1400f81874
6 changed files with 36 additions and 23 deletions
+21 -3
View File
@@ -269,11 +269,29 @@ bool param_modify_on_import(bson_node_t node)
}
}
// 2022-11-09: translate LAUN_ALL_ON->LAUN_DETCN_ON
// 2022-11-09: translate several fixed-wing launch parameters
{
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");
strcpy(node->name, "FW_LAUN_DETCN_ON");
PX4_INFO("copying %s -> %s", "LAUN_ALL_ON", "FW_LAUN_DETCN_ON");
return true;
}
if (strcmp("LAUN_CAT_A", node->name) == 0) {
strcpy(node->name, "FW_LAUN_AC_THLD");
PX4_INFO("copying %s -> %s", "LAUN_CAT_A", "FW_LAUN_AC_THLD");
return true;
}
if (strcmp("LAUN_CAT_T", node->name) == 0) {
strcpy(node->name, "FW_LAUN_AC_T");
PX4_INFO("copying %s -> %s", "LAUN_CAT_T", "FW_LAUN_AC_T");
return true;
}
if (strcmp("LAUN_CAT_MDEL", node->name) == 0) {
strcpy(node->name, "FW_LAUN_MOT_DEL");
PX4_INFO("copying %s -> %s", "LAUN_CAT_MDEL", "FW_LAUN_MOT_DEL");
return true;
}
}
@@ -1537,7 +1537,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
} else {
/* Perform launch detection */
if (!_skipping_takeoff_detection && _param_laun_detcn_on.get() &&
if (!_skipping_takeoff_detection && _param_fw_laun_detcn_on.get() &&
_launchDetector.getLaunchDetected() < launch_detection_status_s::STATE_FLYING) {
if (_control_mode.flag_armed) {
@@ -1553,7 +1553,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_detcn_on.get()) {
&& _param_fw_laun_detcn_on.get()) {
_launch_detected = true;
_launch_global_position = global_position;
_takeoff_ground_alt = _current_altitude;
@@ -1574,7 +1574,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_detcn_on.get()) {
&& _param_fw_laun_detcn_on.get()) {
/* Launch has been detected, hence we have to control the plane. */
if (_param_fw_use_npfg.get()) {
@@ -878,7 +878,7 @@ private:
(ParamFloat<px4::params::FW_TKO_AIRSPD>) _param_fw_tko_airspd,
(ParamFloat<px4::params::RWTO_PSP>) _param_rwto_psp,
(ParamBool<px4::params::LAUN_DETCN_ON>) _param_laun_detcn_on
(ParamBool<px4::params::FW_LAUN_DETCN_ON>) _param_fw_laun_detcn_on
)
};
@@ -1129,4 +1129,4 @@ PARAM_DEFINE_FLOAT(FW_WIND_ARSP_SC, 0.f);
* @boolean
* @group FW Launch detection
*/
PARAM_DEFINE_INT32(LAUN_DETCN_ON, 0);
PARAM_DEFINE_INT32(FW_LAUN_DETCN_ON, 0);
@@ -102,9 +102,9 @@ private:
uint state_{launch_detection_status_s::STATE_WAITING_FOR_LAUNCH};
DEFINE_PARAMETERS(
(ParamFloat<px4::params::LAUN_CAT_A>) _param_laun_cat_a,
(ParamFloat<px4::params::LAUN_CAT_T>) _param_laun_cat_t,
(ParamFloat<px4::params::LAUN_CAT_MDEL>) _param_laun_cat_mdel
(ParamFloat<px4::params::FW_LAUN_AC_THLD>) _param_laun_cat_a,
(ParamFloat<px4::params::FW_LAUN_AC_T>) _param_laun_cat_t,
(ParamFloat<px4::params::FW_LAUN_MOT_DEL>) _param_laun_cat_mdel
)
};
@@ -39,15 +39,10 @@
* @author Thomas Gubler <thomasgubler@gmail.com>
*/
/*
* Catapult launch detection parameters
*
*/
/**
* Catapult accelerometer threshold.
* Trigger acceleration threshold
*
* LAUN_CAT_A for LAUN_CAT_T serves as threshold to trigger launch detection.
* Launch is detected when acceleration in body forward direction is above FW_LAUN_AC_THLD for FW_LAUN_AC_T seconds.
*
* @unit m/s^2
* @min 0
@@ -55,12 +50,12 @@
* @increment 0.5
* @group FW Launch detection
*/
PARAM_DEFINE_FLOAT(LAUN_CAT_A, 30.0f);
PARAM_DEFINE_FLOAT(FW_LAUN_AC_THLD, 30.0f);
/**
* Catapult time threshold.
* Trigger time
*
* LAUN_CAT_A for LAUN_CAT_T serves as threshold to trigger launch detection.
* Launch is detected when acceleration in body forward direction is above FW_LAUN_AC_THLD for FW_LAUN_AC_T seconds.
*
* @unit s
* @min 0.0
@@ -69,7 +64,7 @@ PARAM_DEFINE_FLOAT(LAUN_CAT_A, 30.0f);
* @increment 0.05
* @group FW Launch detection
*/
PARAM_DEFINE_FLOAT(LAUN_CAT_T, 0.05f);
PARAM_DEFINE_FLOAT(FW_LAUN_AC_T, 0.05f);
/**
* Motor delay
@@ -84,4 +79,4 @@ PARAM_DEFINE_FLOAT(LAUN_CAT_T, 0.05f);
* @increment 0.5
* @group FW Launch detection
*/
PARAM_DEFINE_FLOAT(LAUN_CAT_MDEL, 0.0f);
PARAM_DEFINE_FLOAT(FW_LAUN_MOT_DEL, 0.0f);