Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: fix ignore emergency parameter not working #112

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions src/signage/src/signage/route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from datetime import datetime
import signage.signage_utils as utils
from tier4_external_api_msgs.msg import DoorStatus
from autoware_adapi_v1_msgs.msg import (

Check warning on line 11 in src/signage/src/signage/route_handler.py

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (adapi)
RouteState,
MrmState,
OperationModeState,
Expand Down Expand Up @@ -73,22 +73,22 @@
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
self._in_slowing_state = False
self._in_slow_stop_state = False
else:
in_emergency = self._autoware.information.mrm_behavior == MrmState.EMERGENCY_STOP

self._in_slowing_state = (
self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP
or self._autoware.information.mrm_behavior == MrmState.PULL_OVER
) and self._autoware.information.motion_state == MotionState.MOVING

self._in_slow_stop_state = (
self._autoware.information.mrm_behavior == MrmState.COMFORTABLE_STOP
or self._autoware.information.mrm_behavior == MrmState.PULL_OVER
) and self._autoware.information.motion_state == MotionState.STOPPED
if self._autoware.information.mrm_behavior in [
MrmState.COMFORTABLE_STOP,
MrmState.PULL_OVER,
]:
self._in_slowing_state == self._autoware.information.motion_state == MotionState.MOVING
self._in_slow_stop_state == self._autoware.information.motion_state == MotionState.STOPPED

if in_emergency and not self._in_emergency_state:
self._announce_interface.announce_emergency("emergency")
Expand Down Expand Up @@ -125,8 +125,8 @@

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
Expand Down Expand Up @@ -282,7 +282,11 @@
):
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
Expand Down
Loading