Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9344b88
chore: add pytest configuration and test directory structure
suzuki0keiichi Feb 20, 2026
2085ada
test: add unit tests for signage/packet_tools.py
suzuki0keiichi Feb 20, 2026
a1165a9
test: add unit tests for signage/signage_utils.py
suzuki0keiichi Feb 20, 2026
49159b7
test: add unit tests for external_signage/packet_tools.py
suzuki0keiichi Feb 20, 2026
b936959
chore: add SonarCloud configuration
suzuki0keiichi Feb 20, 2026
4bf94e9
ci: add GitHub Actions workflow for tests and SonarCloud analysis
suzuki0keiichi Feb 20, 2026
3c06731
fix: resolve spellcheck failures in CI
suzuki0keiichi Feb 20, 2026
2f8c99a
fix: exclude spell_check_pr.yml from cspell targets
suzuki0keiichi Feb 20, 2026
9559485
fix: add pytest config keywords to cspell dictionary
suzuki0keiichi Feb 20, 2026
c6816e0
fix: migrate cspell dictionary from curl to npm install
suzuki0keiichi Feb 24, 2026
881a259
fix: exclude package.xml from cspell targets
suzuki0keiichi Feb 24, 2026
b3feb33
fix: bump pre-commit/action from v2.0.3 to v3.0.1
suzuki0keiichi Feb 24, 2026
8aa2de0
fix: update black to 26.1.0 and fix pre-commit formatting issues
suzuki0keiichi Feb 24, 2026
5f0d83f
fix: remove unused signage/packet_tools.py and its test
suzuki0keiichi Feb 25, 2026
446d2d9
Merge pull request #186 from tier4/chore/add-sonarcloud-analysis
suzuki0keiichi Mar 2, 2026
cffbf6f
chore: remove level4_mode_manager_msgs (use l4_toolkit) (#190)
Mar 6, 2026
70e568e
fix (#191)
yabuta Mar 19, 2026
55c2802
fix (#192)
yabuta Apr 15, 2026
7eab6d5
fix (#193)
yabuta Apr 21, 2026
e691fd5
refactor: externalize FMS host and port via environment variables (#197)
yabuta Apr 30, 2026
7bf0857
Sync 4.3.3 (#198)
yabuta May 13, 2026
cfcc46c
delete msg (#199)
yabuta May 25, 2026
f9f995c
feat: 外部指示による表示変更 (#200)
yabuta Jun 9, 2026
d023e93
chore: add .graphrag to .gitignore
suzuki0keiichi Jun 19, 2026
971ca6e
Merge pull request #203 from tier4/chore/exclude-graphrag-from-git
suzuki0keiichi Jun 23, 2026
4abf623
feat: 乗客向けHMI 車内アナウンス・到着表示 (UC-04/UC-05) とゴール距離算出 (#205)
yabuta Jul 30, 2026
73ddb8f
feat: 車外サイネージ行先表示と回送中表示 (#211)
yabuta Jul 30, 2026
baf0275
feat: 転倒防止アナウンス機能 (#206)
yabuta Jul 30, 2026
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
2 changes: 1 addition & 1 deletion .beta.repos
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ repositories:
autoware/autoware_internal_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_internal_msgs.git
version: 1.6.0
version: 1.6.0
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
uses: actions/setup-python@v2

- name: Run pre-commit
uses: pre-commit/action@v2.0.3
uses: pre-commit/action@v3.0.1
34 changes: 34 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test and SonarCloud

on:
pull_request:
push:
branches: [develop]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install test dependencies
run: pip install pytest pytest-cov python-dateutil

- name: Run tests with coverage
run: pytest --cov=src/signage/src --cov=src/external_signage/src --cov-report=xml --cov-report=term -v

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
11 changes: 4 additions & 7 deletions .github/workflows/spell_check_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ jobs:
run: |
npm install cspell

- name: Retrieve spell check dictionary
run: |
curl --silent --show-error \
--output .github/workflows/.cspell.json \
https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/cspell/.cspell.json
- name: Install spell check dictionary
run: npm install --ignore-scripts https://github.com/tier4/autoware-spell-check-dict

- name: Check spelling
run: |
Expand All @@ -34,6 +31,6 @@ jobs:
# How to exclude specific files:
# Ex. "**/!(*.osm|*.svg|CHANGELOG.rst)"
./node_modules/.bin/cspell \
--config .github/workflows/.cspell.json \
"**/!(CHANGELOG.rst|${{ github.event.inputs.ignore_patterns }})" \
--config node_modules/@tier4/autoware-spell-check-dict/.cspell.json \
"**/!(CHANGELOG.rst|package.xml|${{ github.event.inputs.ignore_patterns }})" \
2> /dev/null
15 changes: 10 additions & 5 deletions .github/workflows/spell_check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Retrieve spell check dictionary
- name: Setup Node.js
uses: actions/setup-node@v2

- name: Install spell check dictionary
run: npm install --ignore-scripts https://github.com/tier4/autoware-spell-check-dict

- name: Add project-specific cspell overrides
run: |
curl --silent --show-error \
--output .github/workflows/.cspell.json \
https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/cspell/.cspell.json
jq '.words += ["testpaths", "pythonpath", "addopts"] | .ignorePaths += ["**/package.xml"]' node_modules/@tier4/autoware-spell-check-dict/.cspell.json > /tmp/cspell.json \
&& mv /tmp/cspell.json node_modules/@tier4/autoware-spell-check-dict/.cspell.json

- uses: streetsidesoftware/cspell-action@v1.3.2
with:
config: ".github/workflows/.cspell.json"
config: "node_modules/@tier4/autoware-spell-check-dict/.cspell.json"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ dmypy.json
# ros output
install/
log/

# GraphRAG knowledge vault (managed in separate repository)
.graphrag/
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ repos:
entry: ros:galactic ament_uncrustify --reformat

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 26.1.0
hooks:
- id: black
args: ["--line-length=100"]
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,25 @@ source {AUTOWARE_PATH}/install/setup.bash
bash setup.sh
```

IF you wont to use other FMS Domain, change environment variable.
### Environment variables

The following environment variables must be set before launching:

- `FMS_URL`: FMS domain (e.g. set by your operations team)
- `AUTOWARE_IP`: IP address of the Autoware PC running the FMS gateway
- `AUTOWARE_PORT`: TCP port of the FMS gateway on the Autoware PC

On production vehicles these are provisioned by the `x2_signage_env_setup` role
in [`autoware_ecu_system_setup`](https://github.com/tier4/autoware_ecu_system_setup),
which writes them into `autoware.env`. The signage service then sources
`/opt/autoware/services/set-autoware-env/setup.sh` before launch.

For local development, export them in your shell before running `start.sh`:

```bash
export FMS_URL=fms.web.auto
export FMS_URL=<your-fms-domain>
export AUTOWARE_IP=<autoware-pc-ip>
export AUTOWARE_PORT=<autoware-pc-port>
```

## start
Expand Down
2 changes: 1 addition & 1 deletion ignore_packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ level4_mode_manager
slip_detector
slip_detector_msgs
sudden_deceleration_monitor
vehicle_stuck_checker
vehicle_stuck_checker
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
testpaths = tests
pythonpath = src/signage/src src/external_signage/src
addopts = -p no:launch_testing -p no:launch_ros -p no:launch_pytest
13 changes: 13 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sonar.projectKey=tier4_AutowareSignage
sonar.organization=tier4

# Source code
sonar.sources=src
sonar.tests=tests
sonar.test.inclusions=tests/**/*.py

# Exclude test code from duplication check
sonar.cpd.exclusions=tests/**/*.py

# Python coverage report path (generated by pytest-cov)
sonar.python.coverage.reportPaths=coverage.xml
35 changes: 35 additions & 0 deletions src/external_signage/config/destination_mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SYS-HMI-03 車外サイネージ行先表示: destination.point_id と td5ファイル名prefix の対応表
#
# 【これはテンプレート】実行時は /opt/autoware/destination_mapping.yaml を読み込む。
# 同ファイルが無ければ本テンプレートが自動コピーされる。運用時の紐付け編集は
# /opt/autoware/destination_mapping.yaml 側を直接編集する(リビルド不要で反映)。
#
# active_schedule (FMS) の move タスクの destination.point_id (整数・マップ上のグローバル地点ID) を
# キーに、表示する td5 ファイルの prefix を引く。
# ※ destination には point_id の他に stop_point_id(小さい連番・バス停順序の可能性) と
# name(例 "エフピコ アリーナ 乗車口"・全角スペース含む) もあるが、キーは point_id を使う
# (stop_point_id は路線間で衝突しうるため不適)。
# td5 ファイルは以下の命名規約で配置する:
#
# resource/td5_file/destination/{prefix}_{width}x{height}.td5
# front / back = 128x16, side = 80x24 (両サイズを用意する)
#
# 例) point_id 2 (name "BusStop2") を prefix "busstop2" に対応させる場合、
# destination/busstop2_128x16.td5 と destination/busstop2_80x24.td5 を配置し、
# 下記に "2": "busstop2" を追加する。
# ※キーは int でも str でも可 (ロード時に str へ正規化する)。可読性のため引用推奨。
#
# 未登録の point_id、td5 未配置/ロード失敗の場合は空白 (null td5) を表示する。
# 有効な行先が取れない状態 (スケジュール無し/未受信/未登録/doing・todo 全完了) は
# 回送中 (kaiso td5) を表示する。行先表示モードでは走行中の自動運行中表示は行わない。
#
# 実 td5 ファイルはディスプレイベンダ提供ツールで事前作成する。
#
# 【暫定 2026-07-27】行先td5のテスト用として miraikan/shinagawa/teleport (+回送 kaiso) を用意した。
# ただし 128x16 (front/back) のみで 80x24 (side) 版は未用意のため、side は空白(null)表示となる
# (_display_state を「td5を持つディスプレイだけ表示」に改修済み。side用td5を配置すれば自動で出る)。
# point_id は現状の仮値 (2567/2568/2569) にテスト用行先を割り当てている。
destination_mapping:
"2567": "miraikan" # destination/miraikan_128x16.td5
"2568": "shinagawa" # destination/shinagawa_128x16.td5
"2569": "teleport" # destination/teleport_128x16.td5
41 changes: 41 additions & 0 deletions src/external_signage/resource/td5_file/destination/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 行先表示 td5 ファイル配置ディレクトリ (SYS-HMI-03)

車外サイネージの行先表示に使う td5 ファイルをここに配置する。

## 命名規約

```
{prefix}_{width}x{height}.td5
```

- `prefix` … `config/destination_mapping.yaml` で `destination.point_id` に対応付けた prefix
- サイズ … front / back = `128x16`、side = `80x24` の両方を用意する

例) prefix `busstop2` の場合:

```
busstop2_128x16.td5
busstop2_80x24.td5
```

## destination.point_id との紐付け

active_schedule (FMS) の move タスク `destination.point_id` (整数) と prefix の対応は
外部ファイル **`/opt/autoware/destination_mapping.yaml`** に記載する
(`signage_settings.json` と同じ場所。リビルド不要で編集反映)。同ファイルが無い場合は
パッケージ同梱テンプレート `config/destination_mapping.yaml` が起動時に自動コピーされる。

## 補足

- td5 ファイルはディスプレイベンダ提供ツールで事前作成する(実行時に動的生成しない)。
- 未登録 id・td5 未配置・ロード失敗時は空白(`null` td5)へ自動フォールバックする。
- 有効な行先が取れない状態(スケジュール無し/未受信/未登録/全完了)は回送中
`resource/td5_file/kaiso_{width}x{height}.td5` を表示する(未配置時は `null` へフォールバック)。
- 行先表示モードでは走行中の自動運行中(`auto`)表示は行わない。

## 【暫定 2026-07-27】テスト用 td5(128x16 のみ)

行先表示テスト用に `miraikan` / `shinagawa` / `teleport`(行先)と `kaiso`(回送, `td5_file/kaiso_128x16.td5`)
を用意している。ただし **128x16(front/back)のみで 80x24(side)版は未用意**。
このため side は空白(`null`)表示となる(`_display_state` は「td5 を持つディスプレイだけ表示」する)。
side 用の `*_80x24.td5` を配置すれば、コード変更なしで side にも自動表示される。
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
42 changes: 42 additions & 0 deletions src/external_signage/scripts/destination_mode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
# 車外サイネージ 行先表示モード (SYS-HMI-03) の切替・確認ヘルパー。
#
# 使い方:
# ./destination_mode.sh on # 行先表示モードON (active_schedule から行先td5を表示)
# ./destination_mode.sh off # 行先表示モードOFF (既存の experiment/auto/mrm/null 表示へ復帰)
# ./destination_mode.sh status # 現在の設定・モード状態を確認
#
# 前提: ROS 2 環境と対象ワークスペースを source 済みで、external_signage ノードが
# 起動していること (signage.launch.xml を use_external_signage:=true で起動)。
set -euo pipefail

SERVICE="/signage/destination_mode"

usage() {
echo "usage: $0 {on|off|status}" >&2
exit 1
}

[ $# -eq 1 ] || usage

case "$1" in
on|true)
echo "[destination_mode] ON にします..."
ros2 service call "$SERVICE" std_srvs/srv/SetBool "{data: true}"
;;
off|false)
echo "[destination_mode] OFF にします..."
ros2 service call "$SERVICE" std_srvs/srv/SetBool "{data: false}"
;;
status)
echo "[destination_mode] 現在の設定 (/signage/external/settings) を1件取得:"
timeout 5 ros2 topic echo --once /signage/external/settings || \
echo " (settings を取得できませんでした。ノード起動を確認してください)"
echo "[destination_mode] mode_status (/signage/mode_status) を1件取得:"
timeout 5 ros2 topic echo --once /signage/mode_status || \
echo " (mode_status を取得できませんでした)"
;;
*)
usage
;;
esac
104 changes: 104 additions & 0 deletions src/external_signage/scripts/publish_test_schedule.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#!/bin/bash
# 車外サイネージ 行先表示 (SYS-HMI-03) テスト用ヘルパー。
# active_schedule を各パターンで publish、または web.auto agent から実スケジュールを
# 取得して publish / 表示する。
#
# 前提:
# - ROS 2 環境と対象ワークスペースを source 済み
# - external_signage ノードが起動済み (signage.launch.xml use_external_signage:=true)
# - 行先表示モードが ON (./destination_mode.sh on) ※OFF だと描画に反映されない
#
# 使い方:
# ./publish_test_schedule.sh doing [POINT_ID] # 走行中(doing): 登録済み point_id -> 行先td5
# ./publish_test_schedule.sh todo [POINT_ID] # 次タスク(todo): 同上
# ./publish_test_schedule.sh done [POINT_ID] # 全タスク完了 -> 回送中 (kaiso)
# ./publish_test_schedule.sh none # スケジュール空 -> 回送中 (kaiso)
# ./publish_test_schedule.sh unmapped [POINT_ID] # 未登録 point_id -> 空白 (null)
# ./publish_test_schedule.sh no-id # point_id 無し -> 空白 (null)
# ./publish_test_schedule.sh real # web.auto agent の実スケジュールを publish
# ./publish_test_schedule.sh show # 実スケジュールを整形表示 (publish しない)
#
# POINT_ID 省略時: doing/todo/done は 2567 (実FMS照合時の destination.point_id)、
# unmapped は 999999 (未登録想定)。
#
# 期待結果はノードログ "destination display -> <key> (<detail>)" で確認する。
# td5 が一部サイズのみの場合 (現状: 行先/回送 td5 は 128x16 のみ) は、そのサイズを持つ
# front/back に表示され、80x24 未用意の side は "td5 not available ... showing null" で空白表示。
# 該当サイズの td5 が全く無い key は全ディスプレイ空白 (null) となる。
set -euo pipefail

TOPIC="/signage/active_schedule"
MOVE_POINT_ID=2567
UNMAPPED_POINT_ID=999999

AGENT_URL="http://${AUTOWARE_IP:-localhost}:${AUTOWARE_PORT:-4711}/v1/services/order"
FMS_ACTIVE_SCHEDULE_URL="https://${FMS_URL:-fms.dev.web.auto}/v1/projects/{project_id}/environments/{environment_id}/vehicles/{vehicle_id}/active_schedule"

usage() {
sed -n '2,29p' "$0" >&2
exit 1
}

# YAML 単一引用符スカラー内に埋め込むため、JSON 中の ' を '' へエスケープして publish する。
publish() {
local json="$1"
local esc="${json//\'/\'\'}"
echo "[publish] ${TOPIC} <- ${json}"
ros2 topic pub --times 3 --rate 2 "${TOPIC}" std_msgs/msg/String "{data: '${esc}'}"
}

# move タスク1件のスケジュール JSON を組み立てる。
# $1 = task status (doing/todo/done ...)
# $2 = point_id (空文字なら destination に point_id を入れない = no-id ケース)
move_schedule() {
local status="$1" pid="${2-}"
if [ -z "${pid}" ]; then
printf '{"tasks":[{"task_type":"move","status":"%s","destination":{"name":"TestStop"}}]}' "${status}"
else
printf '{"tasks":[{"task_type":"move","status":"%s","destination":{"point_id":%s,"stop_point_id":1,"name":"TestStop"}}]}' "${status}" "${pid}"
fi
}

fetch_real() {
curl -s --max-time 12 -X POST "${AGENT_URL}" -H 'Content-Type: application/json' \
-d "{\"method\":\"get\",\"url\":\"${FMS_ACTIVE_SCHEDULE_URL}\",\"body\":{}}"
}

[ $# -ge 1 ] || usage
cmd="$1"; shift || true

case "${cmd}" in
doing|todo|done)
publish "$(move_schedule "${cmd}" "${1:-${MOVE_POINT_ID}}")"
;;
none)
# 空スケジュール -> _resolve_destination は "kaiso" (no schedule)
publish '{}'
;;
unmapped)
publish "$(move_schedule doing "${1:-${UNMAPPED_POINT_ID}}")"
;;
no-id)
# destination に point_id を入れない -> "null" (no destination point_id)
publish "$(move_schedule doing "")"
;;
real)
echo "[real] web.auto agent (${AGENT_URL}) から実スケジュールを取得して publish します..."
raw="$(fetch_real)"
[ -n "${raw}" ] || { echo " 取得できませんでした (agent 未起動/認証/ID 未解決の可能性)" >&2; exit 1; }
publish "${raw}"
;;
show)
echo "[show] web.auto agent (${AGENT_URL}) の実スケジュール:"
raw="$(fetch_real)"
[ -n "${raw}" ] || { echo " 取得できませんでした" >&2; exit 1; }
if command -v python3 >/dev/null 2>&1; then
echo "${raw}" | python3 -m json.tool --no-ensure-ascii 2>/dev/null || echo "${raw}"
else
echo "${raw}"
fi
;;
*)
usage
;;
esac
Loading
Loading