mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
commander: only play safety change tunes if initialized
This commit is contained in:
@@ -1875,6 +1875,7 @@ Commander::run()
|
||||
const bool safety_updated = _safety_sub.updated();
|
||||
|
||||
if (safety_updated) {
|
||||
const bool previous_safety_valid = (_safety.timestamp != 0);
|
||||
const bool previous_safety_off = _safety.safety_off;
|
||||
|
||||
if (_safety_sub.copy(&_safety)) {
|
||||
@@ -1899,7 +1900,7 @@ Commander::run()
|
||||
}
|
||||
|
||||
// Notify the user if the status of the safety switch changes
|
||||
if (_safety.safety_switch_available && previous_safety_off != _safety.safety_off) {
|
||||
if (previous_safety_valid && _safety.safety_switch_available && previous_safety_off != _safety.safety_off) {
|
||||
|
||||
if (_safety.safety_off) {
|
||||
set_tune(tune_control_s::TUNE_ID_NOTIFY_POSITIVE);
|
||||
|
||||
Reference in New Issue
Block a user