diff --git a/libraries/SITL/SITL.cpp b/libraries/SITL/SITL.cpp index c5a6e4ec92..c8f55224fd 100644 --- a/libraries/SITL/SITL.cpp +++ b/libraries/SITL/SITL.cpp @@ -200,6 +200,8 @@ const AP_Param::GroupInfo SITL::var_info2[] = { AP_GROUPINFO("EFI_TYPE", 58, SITL, efi_type, SITL::EFI_TYPE_NONE), + AP_GROUPINFO("SAFETY_STATE", 59, SITL, _safety_switch_state, 0), + AP_GROUPEND }; diff --git a/libraries/SITL/SITL.h b/libraries/SITL/SITL.h index 367d6d3860..9d67299ad6 100644 --- a/libraries/SITL/SITL.h +++ b/libraries/SITL/SITL.h @@ -292,6 +292,19 @@ public: AP_Float hdg; // 0 to 360 } opos; + AP_Int8 _safety_switch_state; + + AP_HAL::Util::safety_state safety_switch_state() const { + return (AP_HAL::Util::safety_state)_safety_switch_state.get(); + } + void force_safety_off() { + _safety_switch_state = (uint8_t)AP_HAL::Util::SAFETY_ARMED; + } + bool force_safety_on() { + _safety_switch_state = (uint8_t)AP_HAL::Util::SAFETY_DISARMED; + return true; + } + uint16_t irlock_port; void simstate_send(mavlink_channel_t chan);