Browse Source

Safety: keep initialized constant flags when safety disabled

main
Matthias Grob 3 years ago committed by Igor Mišić
parent
commit
71103e6114
  1. 10
      src/modules/commander/Safety.cpp

10
src/modules/commander/Safety.cpp

@ -44,16 +44,16 @@ Safety::Safety()
{ {
// Safety can be turned off with the CBRK_IO_SAFETY parameter. // Safety can be turned off with the CBRK_IO_SAFETY parameter.
_safety_disabled = circuit_breaker_enabled("CBRK_IO_SAFETY", CBRK_IO_SAFETY_KEY); _safety_disabled = circuit_breaker_enabled("CBRK_IO_SAFETY", CBRK_IO_SAFETY_KEY);
}
bool Safety::safetyButtonHandler()
{
if (_safety_disabled) { if (_safety_disabled) {
_button_available = true; _button_available = true;
_safety_off = true; _safety_off = true;
}
}
} else { bool Safety::safetyButtonHandler()
{
if (!_safety_disabled) {
if (!_button_available && _safety_button_sub.advertised()) { if (!_button_available && _safety_button_sub.advertised()) {
_button_available = true; _button_available = true;
} }

Loading…
Cancel
Save