Skip to content

Commit

Permalink
add comfortable stop condition
Browse files Browse the repository at this point in the history
Signed-off-by: tkhmy <[email protected]>
  • Loading branch information
tkhmy committed Aug 19, 2024
1 parent 9a26582 commit fa95b37
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/signage/src/signage/route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,20 @@ def emergency_checker_callback(self):
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_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
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 in_emergency and not self._in_emergency_state:
self._announce_interface.announce_emergency("emergency")
Expand Down

0 comments on commit fa95b37

Please sign in to comment.