Rover: default BRD_SAFETYOPTION to to allow disarming with safety switch

This commit is contained in:
Randy Mackay 2018-05-08 21:19:03 +09:00 committed by Andrew Tridgell
parent d2c247bb90
commit 40a8e0de09
1 changed files with 8 additions and 0 deletions

View File

@ -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", unsigned(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
}