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 handle negative goal distance #131

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

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 asyncio

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)
from threading import Thread

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 14 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 @@ -209,14 +209,14 @@
def process_station_list_from_fms(self, force_update=False):
if not self._processing_thread:
self._processing_thread = True
thread = Thread(target=asyncio.run(self.fms_thread()), args=(force_update,))

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (asyncio)
thread.setDaemon(True)
thread.start()
self._processing_thread = False

async def fms_thread(self, force_update=False):
try:
async with aiohttp.ClientSession() as session:

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

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (aiohttp)
async with session.post(
f"http://{self.AUTOWARE_IP}:4711/v1/services/order",
json=self._fms_payload,
Expand Down Expand Up @@ -426,7 +426,10 @@
self._announced_depart = True
elif self._is_driving:
# handle text and announce while bus is running
if self._autoware.information.goal_distance < 100:
if (
self._autoware.information.goal_distance < 100
and self._autoware.information.goal_distance > 0
):
# display text and announce if the goal is within 100m
self._display_phrase = utils.handle_phrase("arriving")
if not self._announced_arrive:
Expand Down
Loading