commander: allow rearming grace period for arming switch only

This commit is contained in:
bresch
2022-03-09 08:42:21 +01:00
committed by Beat Küng
parent cd5a1e510a
commit 182980526f
3 changed files with 2 additions and 12 deletions
+2 -1
View File
@@ -677,7 +677,8 @@ static constexpr const char *main_state_str(uint8_t main_state)
transition_result_t Commander::arm(arm_disarm_reason_t calling_reason, bool run_preflight_checks)
{
// allow a grace period for re-arming: preflight checks don't need to pass during that time, for example for accidential in-air disarming
if (_param_com_rearm_grace.get() && (hrt_elapsed_time(&_last_disarmed_timestamp) < 5_s)) {
if (calling_reason == arm_disarm_reason_t::rc_switch
&& (hrt_elapsed_time(&_last_disarmed_timestamp) < 5_s)) {
run_preflight_checks = false;
}
-1
View File
@@ -247,7 +247,6 @@ private:
(ParamBool<px4::params::COM_ARM_MIS_REQ>) _param_arm_mission_required,
(ParamBool<px4::params::COM_ARM_AUTH_REQ>) _param_arm_auth_required,
(ParamBool<px4::params::COM_ARM_CHK_ESCS>) _param_escs_checks_required,
(ParamBool<px4::params::COM_REARM_GRACE>) _param_com_rearm_grace,
(ParamInt<px4::params::COM_FLIGHT_UUID>) _param_flight_uuid,
(ParamInt<px4::params::COM_TAKEOFF_ACT>) _param_takeoff_finished_action,
-10
View File
@@ -678,16 +678,6 @@ PARAM_DEFINE_INT32(COM_ARM_MAG_ANG, 45);
*/
PARAM_DEFINE_INT32(COM_ARM_MAG_STR, 2);
/**
* Rearming grace period
*
* Re-arming grace allows to rearm the drone with manual command without running prearmcheck during 5 s after disarming.
*
* @group Commander
* @boolean
*/
PARAM_DEFINE_INT32(COM_REARM_GRACE, 1);
/**
* Enable RC stick override of auto and/or offboard modes
*