From 3ca126cc461aae86ded60748fa668d41d8b552b2 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Thu, 6 Oct 2022 12:14:22 +0200 Subject: [PATCH] Commander: improve description of COM_FS EPH, EPV, VEL_EVH params and increase FW and VTOL defaults Signed-off-by: Silvan Fuhrer --- ROMFS/px4fmu_common/init.d/rc.fw_defaults | 4 ++- ROMFS/px4fmu_common/init.d/rc.vtol_defaults | 3 +++ src/modules/commander/commander_params.c | 27 ++++++++++++++++----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.fw_defaults b/ROMFS/px4fmu_common/init.d/rc.fw_defaults index dc972e9cdf..e896756107 100644 --- a/ROMFS/px4fmu_common/init.d/rc.fw_defaults +++ b/ROMFS/px4fmu_common/init.d/rc.fw_defaults @@ -14,7 +14,9 @@ param set-default MAV_TYPE 1 # Default parameters for fixed wing UAVs. # param set-default COM_POS_FS_DELAY 5 -param set-default COM_POS_FS_EPH 15 + +# 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_POS_FS_EPV 30 param set-default COM_VEL_FS_EVH 5 # Disable preflight disarm to not interfere with external launching diff --git a/ROMFS/px4fmu_common/init.d/rc.vtol_defaults b/ROMFS/px4fmu_common/init.d/rc.vtol_defaults index 41217999d7..2f4cb66bb9 100644 --- a/ROMFS/px4fmu_common/init.d/rc.vtol_defaults +++ b/ROMFS/px4fmu_common/init.d/rc.vtol_defaults @@ -10,6 +10,9 @@ set VEHICLE_TYPE vtol # MAV_TYPE_VTOL_FIXEDROTOR 22 param set-default MAV_TYPE 22 +# there is a 2.5 factor applied on COM_POS_FS_EPH if for invalidation +param set-default COM_POS_FS_EPH 50 + param set-default MIS_TAKEOFF_ALT 20 param set-default MIS_YAW_TMT 10 diff --git a/src/modules/commander/commander_params.c b/src/modules/commander/commander_params.c index 4d93e1b96f..43b8606c34 100644 --- a/src/modules/commander/commander_params.c +++ b/src/modules/commander/commander_params.c @@ -714,32 +714,47 @@ PARAM_DEFINE_INT32(COM_POS_FS_DELAY, 1); /** * Horizontal position error threshold. * - * This is the horizontal position error (EPH) threshold that will trigger a failsafe. The default is appropriate for a multicopter. Can be increased for a fixed-wing. + * This is the horizontal position error (EPH) threshold that will trigger a failsafe. + * The default is appropriate for a multicopter. Can be increased for a fixed-wing. + * If the previous position error was below this threshold, there is an additional + * factor of 2.5 applied (threshold for invalidation 2.5 times the one for validation). * * @unit m + * @min 0 + * @decimal 1 * @group Commander */ -PARAM_DEFINE_FLOAT(COM_POS_FS_EPH, 5); +PARAM_DEFINE_FLOAT(COM_POS_FS_EPH, 5.f); /** * Vertical position error threshold. * - * This is the vertical position error (EPV) threshold that will trigger a failsafe. The default is appropriate for a multicopter. Can be increased for a fixed-wing. + * This is the vertical position error (EPV) threshold that will trigger a failsafe. + * The default is appropriate for a multicopter. Can be increased for a fixed-wing. + * If the previous position error was below this threshold, there is an additional + * factor of 2.5 applied (threshold for invalidation 2.5 times the one for validation). * * @unit m + * @min 0 + * @decimal 1 * @group Commander */ -PARAM_DEFINE_FLOAT(COM_POS_FS_EPV, 10); +PARAM_DEFINE_FLOAT(COM_POS_FS_EPV, 10.f); /** * Horizontal velocity error threshold. * - * This is the horizontal velocity error (EVH) threshold that will trigger a failsafe. The default is appropriate for a multicopter. Can be increased for a fixed-wing. + * This is the horizontal velocity error (EVH) threshold that will trigger a failsafe. + * The default is appropriate for a multicopter. Can be increased for a fixed-wing. + * If the previous velocity error was below this threshold, there is an additional + * factor of 2.5 applied (threshold for invalidation 2.5 times the one for validation). * * @unit m/s + * @min 0 + * @decimal 1 * @group Commander */ -PARAM_DEFINE_FLOAT(COM_VEL_FS_EVH, 1); +PARAM_DEFINE_FLOAT(COM_VEL_FS_EVH, 1.f); /** * Next flight UUID