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

add handling for force goal #120

Merged
merged 1 commit into from
Sep 11, 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
12 changes: 8 additions & 4 deletions src/signage/src/signage/route_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import os
import requests
import json
from datetime import datetime

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (aiohttp)
import aiohttp

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (asyncio)
import asyncio

import signage.signage_utils as utils
from tier4_external_api_msgs.msg import DoorStatus

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (adapi)
from autoware_adapi_v1_msgs.msg import (
RouteState,
MrmState,
Expand Down Expand Up @@ -67,7 +67,7 @@
self._announced_depart = False
self._announced_arrive = False
self._trigger_external_signage = False

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (asyncio)
asyncio.run(self.process_station_list_from_fms())

self._node.create_timer(0.2, self.route_checker_callback)
Expand All @@ -92,8 +92,12 @@
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
self._in_slowing_state = (
self._autoware.information.motion_state == MotionState.MOVING
)
self._in_slow_stop_state = (
self._autoware.information.motion_state == MotionState.STOPPED
)
else:
self._in_slowing_state = False
self._in_slow_stop_state = False
Expand Down Expand Up @@ -177,7 +181,7 @@
self._node.get_logger().error("not able to play the announce, ERROR: {}".format(str(e)))

async def process_station_list_from_fms(self, force_update=False):
try:

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (aiohttp)
async with aiohttp.ClientSession() as session:
async with session.post(
f"http://{self.AUTOWARE_IP}:4711/v1/services/order",
Expand Down Expand Up @@ -286,7 +290,7 @@
self._is_driving = True
self._is_stopping = False
self._announced_depart = False

if (
not self._trigger_external_signage
and self._autoware.information.autoware_control
Expand All @@ -302,7 +306,7 @@
self._service_interface.trigger_external_signage(True)
self._trigger_external_signage = True
self._announce_engage = True
elif self._autoware.information.route_state == RouteState.ARRIVED:
elif self._autoware.information.route_state in [RouteState.ARRIVED, RouteState.UNSET]:
# Check whether the vehicle arrive to goal
self._is_driving = False
self._is_stopping = True
Expand All @@ -318,10 +322,10 @@
self._trigger_external_signage = False

if self._prev_route_state != RouteState.SET:
if self._autoware.information.route_state == RouteState.SET:

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (asyncio)
asyncio.run(self.process_station_list_from_fms(force_update=True))

if not self._fms_check_time:

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (asyncio)
asyncio.run(self.process_station_list_from_fms())
elif utils.check_timeout(
self._node.get_clock().now(), self._fms_check_time, self._parameter.check_fms_time
Expand Down
Loading