pre arm check: add circuit breaker for the VTOL arming in fixed-wing mode prevention

Added a new circuit breaker that, if set, enables arming in fixed-wing mode for VTOLs.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2020-01-27 10:48:01 +01:00 committed by Lorenz Meier
parent f4df3fb5f2
commit 4fa64f686a
6 changed files with 22 additions and 1 deletions

View File

@ -21,6 +21,7 @@ bool circuit_breaker_engaged_enginefailure_check
bool circuit_breaker_flight_termination_disabled
bool circuit_breaker_engaged_usb_check
bool circuit_breaker_engaged_posfailure_check # set to true when the position valid checks have been disabled
bool circuit_breaker_vtol_fw_arming_check # set to true if for VTOLs arming in fixed-wing mode should be allowed
bool offboard_control_signal_found_once
bool offboard_control_signal_lost

View File

@ -57,6 +57,7 @@
#define CBRK_ENGINEFAIL_KEY 284953
#define CBRK_USB_CHK_KEY 197848
#define CBRK_VELPOSERR_KEY 201607
#define CBRK_VTOLARMING_KEY 159753
#include <stdint.h>

View File

@ -176,3 +176,18 @@ PARAM_DEFINE_INT32(CBRK_USB_CHK, 0);
* @group Circuit Breaker
*/
PARAM_DEFINE_INT32(CBRK_VELPOSERR, 0);
/**
* Circuit breaker for arming in fixed-wing mode check
*
* Setting this parameter to 159753 will enable arming in fixed-wing
* mode for VTOLs.
* WARNING: ENABLING THIS CIRCUIT BREAKER IS AT OWN RISK
*
* @reboot_required true
* @min 0
* @max 159753
* @category Developer
* @group Circuit Breaker
*/
PARAM_DEFINE_INT32(CBRK_VTOLARMING, 0);

View File

@ -134,7 +134,8 @@ bool PreFlightCheck::preArmCheck(orb_advert_t *mavlink_log_pub, const vehicle_st
}
}
if (status.is_vtol && status.vehicle_type != vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
if (!status_flags.circuit_breaker_vtol_fw_arming_check && status.is_vtol
&& status.vehicle_type != vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
if (prearm_ok) {
mavlink_log_critical(mavlink_log_pub, "Arming denied! Vehicle is not in multicopter mode");
prearm_ok = false;

View File

@ -2340,6 +2340,8 @@ Commander::get_circuit_breaker_params()
CBRK_FLIGHTTERM_KEY);
status_flags.circuit_breaker_engaged_posfailure_check = circuit_breaker_enabled_by_val(_param_cbrk_velposerr.get(),
CBRK_VELPOSERR_KEY);
status_flags.circuit_breaker_vtol_fw_arming_check = circuit_breaker_enabled_by_val(_param_cbrk_vtolarming.get(),
CBRK_VTOLARMING_KEY);
}
void

View File

@ -243,6 +243,7 @@ private:
(ParamInt<px4::params::CBRK_ENGINEFAIL>) _param_cbrk_enginefail,
(ParamInt<px4::params::CBRK_FLIGHTTERM>) _param_cbrk_flightterm,
(ParamInt<px4::params::CBRK_VELPOSERR>) _param_cbrk_velposerr,
(ParamInt<px4::params::CBRK_VTOLARMING>) _param_cbrk_vtolarming,
// Geofrence
(ParamInt<px4::params::GF_ACTION>) _param_geofence_action,