From 17d16133d78fe8f69dad22e9bf4c10bd5ca591a3 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 8 May 2018 21:19:03 +0900 Subject: [PATCH] Rover: default BRD_SAFETYOPTION to to allow disarming with safety switch --- APMrover2/Parameters.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/APMrover2/Parameters.cpp b/APMrover2/Parameters.cpp index 3935b98282..b7b33b93ad 100644 --- a/APMrover2/Parameters.cpp +++ b/APMrover2/Parameters.cpp @@ -641,6 +641,14 @@ void Rover::load_parameters(void) const uint16_t old_aux_chan_mask = 0x3FFA; SRV_Channels::upgrade_parameters(old_rc_keys, old_aux_chan_mask, &rcmap); hal.console->printf("load_all took %uus\n", micros() - before); + // set a more reasonable default NAVL1_PERIOD for rovers L1_controller.set_default_period(NAVL1_PERIOD); + + // configure safety switch to allow stopping the motors while armed +#if AP_FEATURE_SAFETY_BUTTON + AP_Param::set_default_by_name("BRD_SAFETYOPTION", AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_OFF| + AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_ON| + AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_ARMED); +#endif }