commander/safety: set early safety_button_available

This commit is contained in:
Igor Misic 2022-04-12 18:15:25 +02:00 committed by Beat Küng
parent f6bdc42977
commit cdfa65d792
1 changed files with 4 additions and 1 deletions

View File

@ -56,10 +56,13 @@ void Safety::safetyButtonHandler()
} else {
if (!_safety.safety_switch_available && _safety_button_sub.advertised()) {
_safety.safety_switch_available = true;
}
button_event_s button_event;
while (_safety_button_sub.update(&button_event)) {
_safety.safety_switch_available = true;
_safety.safety_off |= button_event.triggered; // triggered safety button activates safety off
}
}