mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Commander: extend COM_ARM_WO_GPS to disable warning (#23628)
This commit is contained in:
parent
0f1507c24e
commit
2cda0efd84
@ -273,12 +273,27 @@ void EstimatorChecks::checkEstimatorStatus(const Context &context, Report &repor
|
||||
}
|
||||
|
||||
if (!context.isArmed() && ekf_gps_check_fail) {
|
||||
NavModes required_groups_gps = required_groups;
|
||||
events::Log log_level = events::Log::Error;
|
||||
NavModes required_groups_gps;
|
||||
events::Log log_level;
|
||||
|
||||
if (_param_com_arm_wo_gps.get()) {
|
||||
switch (static_cast<GnssArmingCheck>(_param_com_arm_wo_gps.get())) {
|
||||
default:
|
||||
|
||||
/* FALLTHROUGH */
|
||||
case GnssArmingCheck::DenyArming:
|
||||
required_groups_gps = required_groups;
|
||||
log_level = events::Log::Error;
|
||||
break;
|
||||
|
||||
case GnssArmingCheck::WarningOnly:
|
||||
required_groups_gps = NavModes::None; // optional
|
||||
log_level = events::Log::Warning;
|
||||
break;
|
||||
|
||||
case GnssArmingCheck::Disabled:
|
||||
required_groups_gps = NavModes::None;
|
||||
log_level = events::Log::Disabled;
|
||||
break;
|
||||
}
|
||||
|
||||
// Only report the first failure to avoid spamming
|
||||
@ -438,11 +453,20 @@ void EstimatorChecks::checkEstimatorStatus(const Context &context, Report &repor
|
||||
}
|
||||
|
||||
if (message && reporter.mavlink_log_pub()) {
|
||||
if (!_param_com_arm_wo_gps.get()) {
|
||||
mavlink_log_critical(reporter.mavlink_log_pub(), message, " Fail");
|
||||
switch (static_cast<GnssArmingCheck>(_param_com_arm_wo_gps.get())) {
|
||||
default:
|
||||
|
||||
} else {
|
||||
mavlink_log_critical(reporter.mavlink_log_pub(), message, "");
|
||||
/* FALLTHROUGH */
|
||||
case GnssArmingCheck::DenyArming:
|
||||
mavlink_log_critical(reporter.mavlink_log_pub(), message, " Fail");
|
||||
break;
|
||||
|
||||
case GnssArmingCheck::WarningOnly:
|
||||
mavlink_log_warning(reporter.mavlink_log_pub(), message, "");
|
||||
break;
|
||||
|
||||
case GnssArmingCheck::Disabled:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,6 +59,12 @@ public:
|
||||
void checkAndReport(const Context &context, Report &reporter) override;
|
||||
|
||||
private:
|
||||
enum class GnssArmingCheck : uint8_t {
|
||||
DenyArming = 0,
|
||||
WarningOnly = 1,
|
||||
Disabled = 2
|
||||
};
|
||||
|
||||
void checkEstimatorStatus(const Context &context, Report &reporter, const estimator_status_s &estimator_status,
|
||||
NavModes required_groups);
|
||||
void checkSensorBias(const Context &context, Report &reporter, NavModes required_groups);
|
||||
@ -108,7 +114,7 @@ private:
|
||||
DEFINE_PARAMETERS_CUSTOM_PARENT(HealthAndArmingCheckBase,
|
||||
(ParamInt<px4::params::SENS_IMU_MODE>) _param_sens_imu_mode,
|
||||
(ParamInt<px4::params::COM_ARM_MAG_STR>) _param_com_arm_mag_str,
|
||||
(ParamBool<px4::params::COM_ARM_WO_GPS>) _param_com_arm_wo_gps,
|
||||
(ParamInt<px4::params::COM_ARM_WO_GPS>) _param_com_arm_wo_gps,
|
||||
(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,
|
||||
|
||||
@ -225,11 +225,14 @@ PARAM_DEFINE_FLOAT(COM_DISARM_LAND, 2.0f);
|
||||
PARAM_DEFINE_FLOAT(COM_DISARM_PRFLT, 10.0f);
|
||||
|
||||
/**
|
||||
* Allow arming without GPS
|
||||
* GPS preflight check
|
||||
*
|
||||
* Measures taken when a check defined by EKF2_GPS_CHECK is failing.
|
||||
*
|
||||
* @group Commander
|
||||
* @value 0 Require GPS lock to arm
|
||||
* @value 1 Allow arming without GPS
|
||||
* @value 0 Deny arming
|
||||
* @value 1 Warning only
|
||||
* @value 2 Disabled
|
||||
*/
|
||||
PARAM_DEFINE_INT32(COM_ARM_WO_GPS, 1);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user