mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 06:43:34 +08:00
Commander: add parameter to disallow disarming in manual thrust modes
This commit is contained in:
committed by
Mathieu Bresciani
parent
78987f6016
commit
ead16d0e6c
@@ -631,7 +631,7 @@ transition_result_t Commander::disarm(arm_disarm_reason_t calling_reason, bool f
|
|||||||
|| (calling_reason == arm_disarm_reason_t::rc_switch)
|
|| (calling_reason == arm_disarm_reason_t::rc_switch)
|
||||||
|| (calling_reason == arm_disarm_reason_t::rc_button);
|
|| (calling_reason == arm_disarm_reason_t::rc_button);
|
||||||
|
|
||||||
if (!landed && !(mc_manual_thrust_mode && commanded_by_rc)) {
|
if (!landed && !(mc_manual_thrust_mode && commanded_by_rc && _param_com_disarm_man.get())) {
|
||||||
if (calling_reason != arm_disarm_reason_t::rc_stick) {
|
if (calling_reason != arm_disarm_reason_t::rc_stick) {
|
||||||
mavlink_log_critical(&_mavlink_log_pub, "Disarming denied: not landed\t");
|
mavlink_log_critical(&_mavlink_log_pub, "Disarming denied: not landed\t");
|
||||||
events::send(events::ID("commander_disarm_denied_not_landed"),
|
events::send(events::ID("commander_disarm_denied_not_landed"),
|
||||||
|
|||||||
@@ -332,6 +332,7 @@ private:
|
|||||||
|
|
||||||
(ParamFloat<px4::params::COM_DISARM_LAND>) _param_com_disarm_land,
|
(ParamFloat<px4::params::COM_DISARM_LAND>) _param_com_disarm_land,
|
||||||
(ParamFloat<px4::params::COM_DISARM_PRFLT>) _param_com_disarm_preflight,
|
(ParamFloat<px4::params::COM_DISARM_PRFLT>) _param_com_disarm_preflight,
|
||||||
|
(ParamBool<px4::params::COM_DISARM_MAN>) _param_com_disarm_man,
|
||||||
(ParamInt<px4::params::COM_DL_LOSS_T>) _param_com_dl_loss_t,
|
(ParamInt<px4::params::COM_DL_LOSS_T>) _param_com_dl_loss_t,
|
||||||
(ParamInt<px4::params::COM_HLDL_LOSS_T>) _param_com_hldl_loss_t,
|
(ParamInt<px4::params::COM_HLDL_LOSS_T>) _param_com_hldl_loss_t,
|
||||||
(ParamInt<px4::params::COM_HLDL_REG_T>) _param_com_hldl_reg_t,
|
(ParamInt<px4::params::COM_HLDL_REG_T>) _param_com_hldl_reg_t,
|
||||||
|
|||||||
@@ -245,6 +245,19 @@ PARAM_DEFINE_INT32(COM_ARM_WO_GPS, 1);
|
|||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(COM_ARM_SWISBTN, 0);
|
PARAM_DEFINE_INT32(COM_ARM_SWISBTN, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow disarming via switch/stick/button on multicopters in manual thrust modes
|
||||||
|
*
|
||||||
|
* 0: Disallow disarming when not landed
|
||||||
|
* 1: Allow disarming in multicopter flight in modes where
|
||||||
|
* the thrust is directly controlled by thr throttle stick
|
||||||
|
* e.g. Stabilized, Acro
|
||||||
|
*
|
||||||
|
* @group Commander
|
||||||
|
* @boolean
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_INT32(COM_DISARM_MAN, 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Battery failsafe mode
|
* Battery failsafe mode
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user