From 9a26582a9e9c7827526a42f5ec632ff88e3e2a59 Mon Sep 17 00:00:00 2001 From: tkhmy Date: Fri, 9 Aug 2024 11:37:40 +0900 Subject: [PATCH] fix ignore emergency parameter not working Signed-off-by: tkhmy --- src/signage/src/signage/route_handler.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index d09f097..d98dce8 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -73,9 +73,10 @@ def __init__( self._node.create_timer(0.2, self.announce_engage_when_starting) def emergency_checker_callback(self): - if self._parameter.ignore_emergency: - in_emergency = False - if self._autoware.information.operation_mode == OperationModeState.STOP: + if ( + self._parameter.ignore_emergency + or self._autoware.information.operation_mode == OperationModeState.STOP + ): in_emergency = False else: in_emergency = self._autoware.information.mrm_behavior == MrmState.EMERGENCY_STOP @@ -125,8 +126,8 @@ def announce_engage_when_starting(self): if ( self._autoware.information.localization_init_state - == LocalizationInitializationState.UNINITIALIZED or - self._autoware.information.autoware_control == False + == LocalizationInitializationState.UNINITIALIZED + or self._autoware.information.autoware_control == False ): self._prev_motion_state = 0 return @@ -282,7 +283,11 @@ def route_checker_callback(self): ): self._service_interface.trigger_external_signage(True) self._trigger_external_signage = True - if not self._announce_engage and self._parameter.signage_stand_alone and self._autoware.information.autoware_control: + if ( + not self._announce_engage + and self._parameter.signage_stand_alone + and self._autoware.information.autoware_control + ): self._announce_interface.send_announce("engage") self._service_interface.trigger_external_signage(True) self._trigger_external_signage = True