From 2255475a1a54f80432c752b70c1d5d9f3f8327f9 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Mon, 2 Dec 2024 16:08:41 +0100 Subject: [PATCH] Commander: remove `COM_POS_FS_DELAY` A user configurable delay for the internal `vehicle_local_position` seems confusing in my eyes. It's a different timeout for fixed-wing and multirotor which might have made sense earlier but not really anymore since the topic is constantly published by the estimator and not expected to time out on either vehicle type and the parameter description is also misleading because it's outdated. --- ROMFS/px4fmu_common/init.d/rc.fw_defaults | 2 -- .../HealthAndArmingChecks/checks/estimatorCheck.cpp | 4 ++-- .../HealthAndArmingChecks/checks/estimatorCheck.hpp | 1 - src/modules/commander/commander_params.c | 13 ------------- 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.fw_defaults b/ROMFS/px4fmu_common/init.d/rc.fw_defaults index 32991e59b98c..db15c3d09d95 100644 --- a/ROMFS/px4fmu_common/init.d/rc.fw_defaults +++ b/ROMFS/px4fmu_common/init.d/rc.fw_defaults @@ -13,8 +13,6 @@ param set-default MAV_TYPE 1 # # Default parameters for fixed wing UAVs. # -param set-default COM_POS_FS_DELAY 5 - # there is a 2.5 factor applied on the _FS thresholds if for invalidation param set-default COM_POS_FS_EPH 50 param set-default COM_VEL_FS_EVH 3 diff --git a/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp b/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp index 20dfdfb073e7..1cd140fe5bae 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp @@ -813,7 +813,7 @@ void EstimatorChecks::setModeRequirementFlags(const Context &context, bool pre_f // altitude - failsafe_flags.local_altitude_invalid = !lpos.z_valid || (now > lpos.timestamp + (_param_com_pos_fs_delay.get() * 1_s)); + failsafe_flags.local_altitude_invalid = !lpos.z_valid || (now > lpos.timestamp + 1_s); // attitude @@ -864,7 +864,7 @@ bool EstimatorChecks::checkPosVelValidity(const hrt_abstime &now, const bool dat const bool was_valid) const { bool valid = was_valid; - const bool data_stale = (now > data_timestamp_us + _param_com_pos_fs_delay.get() * 1_s) || (data_timestamp_us == 0); + const bool data_stale = (now > data_timestamp_us + 1_s) || (data_timestamp_us == 0); const float req_accuracy = (was_valid ? required_accuracy * 2.5f : required_accuracy); const bool level_check_pass = data_valid && !data_stale && (data_accuracy < req_accuracy); diff --git a/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.hpp b/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.hpp index dd96769ce07f..b5cc6c21853f 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.hpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.hpp @@ -118,7 +118,6 @@ class EstimatorChecks : public HealthAndArmingCheckBase (ParamBool) _param_sys_has_gps, (ParamFloat) _param_com_pos_fs_eph, (ParamFloat) _param_com_vel_fs_evh, - (ParamInt) _param_com_pos_fs_delay, (ParamFloat) _param_com_low_eph, (ParamInt) _param_com_pos_low_act ) diff --git a/src/modules/commander/commander_params.c b/src/modules/commander/commander_params.c index 0d3cf5f25f6f..48b0cce5221a 100644 --- a/src/modules/commander/commander_params.c +++ b/src/modules/commander/commander_params.c @@ -512,19 +512,6 @@ PARAM_DEFINE_INT32(COM_ARM_AUTH_MET, 0); */ PARAM_DEFINE_FLOAT(COM_ARM_AUTH_TO, 1); -/** - * Loss of position failsafe activation delay. - * - * This sets number of seconds that the position checks need to be failed before the failsafe will activate. - * The default value has been optimised for rotary wing applications. For fixed wing applications, a larger value between 5 and 10 should be used. - * - * @unit s - * @group Commander - * @min 1 - * @max 100 - */ -PARAM_DEFINE_INT32(COM_POS_FS_DELAY, 1); - /** * Horizontal position error threshold. *