Skip to content

Commit

Permalink
Commander: remove COM_POS_FS_DELAY
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MaEtUgR committed Dec 2, 2024
1 parent 1a165a4 commit 2255475
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
2 changes: 0 additions & 2 deletions ROMFS/px4fmu_common/init.d/rc.fw_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class EstimatorChecks : public HealthAndArmingCheckBase
(ParamBool<px4::params::SYS_HAS_GPS>) _param_sys_has_gps,
(ParamFloat<px4::params::COM_POS_FS_EPH>) _param_com_pos_fs_eph,
(ParamFloat<px4::params::COM_VEL_FS_EVH>) _param_com_vel_fs_evh,
(ParamInt<px4::params::COM_POS_FS_DELAY>) _param_com_pos_fs_delay,
(ParamFloat<px4::params::COM_POS_LOW_EPH>) _param_com_low_eph,
(ParamInt<px4::params::COM_POS_LOW_ACT>) _param_com_pos_low_act
)
Expand Down
13 changes: 0 additions & 13 deletions src/modules/commander/commander_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 2255475

Please sign in to comment.