From 6f895bab712d900f78b1b912df376f41a5a683be Mon Sep 17 00:00:00 2001 From: Kah Hooi Tan <41041286+tkhmy@users.noreply.github.com> Date: Wed, 1 Nov 2023 10:51:24 +0900 Subject: [PATCH] add mute timeout for engage (#82) Signed-off-by: tkhmy --- src/signage/src/signage/route_handler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/signage/src/signage/route_handler.py b/src/signage/src/signage/route_handler.py index 4fb3acb..2025054 100644 --- a/src/signage/src/signage/route_handler.py +++ b/src/signage/src/signage/route_handler.py @@ -48,6 +48,7 @@ def __init__( self._display_phrase = "" self._in_emergency_state = False self._emergency_trigger_time = self._node.get_clock().now() + self._engage_trigger_time = self._node.get_clock().now() self._is_stopping = True self._is_driving = False self._previous_driving_status = False @@ -135,8 +136,13 @@ def announce_engage_when_starting(self): ): if self._announce_engage and not self._skip_announce: self._skip_announce = True - else: + elif utils.check_timeout( + self._node.get_clock().now(), + self._engage_trigger_time, + self._parameter.accept_start, + ): self._announce_interface.send_announce("engage") + self._engage_trigger_time = self._node.get_clock().now() if self._autoware.information.motion_state == MotionState.STARTING: self._service_interface.accept_start()