Skip to content

Commit

Permalink
feat: add finals more detail (#82)
Browse files Browse the repository at this point in the history
* add

* add explanation

* add en

* more doc

* refactor

* ci

* add change zenoh config, dockerbuild

* Revert "add change zenoh config, dockerbuild"

This reverts commit baf240c.
  • Loading branch information
knorrrr authored Nov 7, 2024
1 parent 525e791 commit 608c61d
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 4 deletions.
22 changes: 22 additions & 0 deletions docs/finals/index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Finals Overview

For the latest information on the semifinals and finals, please visit the following Society of Automotive Engineers of Japan website:
[https://www.jsae.or.jp/jaaic/2024ver/](https://www.jsae.or.jp/jaaic/2024ver/)

## Event Details

### Schedule

| Event | Date | Time |
| ------------------------------ | ----------------------------- | ---- |
| Final Practice Day | November 1, 2024 (Postponed) | 8:30~20:00 |
| Semifinals | November 2, 2024 (Postponed) | 8:30~20:00 |
| Finals | November 3, 2024 (Postponed) | 9:00~17:30 |
| Awards Ceremony & Networking | December 13, 2024 | TBD |

### Venue

[City Circuit Tokyo Bay](https://city-circuit.com/)
<iframe width="704" height="396" src="https://www.youtube.com/embed/GsuCUoNrMDM?si=zoh1mL_U0yRnB2fj" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## [Next: How to Operate the Vehicle](./operation.en.md)
2 changes: 2 additions & 0 deletions docs/finals/index.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@

[シティサーキット東京ベイ](https://city-circuit.com/)
<iframe width="704" height="396" src="https://www.youtube.com/embed/GsuCUoNrMDM?si=zoh1mL_U0yRnB2fj" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

## [Next: 車両の動かし方](./operation.ja.md)
163 changes: 163 additions & 0 deletions docs/finals/operation.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# How to Operate the Vehicle

## Information Provided to Each Team

The following information will be shared with each team before the event.
| Item | Purpose |
| ---- | ------- |
| Vehicle Number (A1-A8) | Identification number assigned to each team's vehicle |
| Vehicle ECU Username | Username for logging in and SSH connection to the vehicle ECU |
| Vehicle ECU Password | Password for logging in and SSH connection to the vehicle ECU |

## Important Notes

- Please do not rename the `aichallenge-2024` directory under home as scripts are path-dependent.
- ROSBAG recording is not automatic, so please execute the recording command during operation.
- By default, Zenoh communication is set to only receive topics. If you need to change settings during operation, please use either of the following methods:
- Connect via SSH and execute directly from within the ECU without using Zenoh Bridge
- Comment out the `allow` section (lines 55-62) in the configuration file (`vehicle/zenoh.json5`) inside `aichallenge-2024` on the ECU
- To connect using a vehicle number, you need to install arp-scan software using the following command:
- `sudo apt install arp-scan`

## How to Connect to Vehicle ECU

Connect to the ECU via SSH from your local PC using the `CCTB_office_01` Wi-Fi network.

- Install arp-scan on your local PC: `sudo apt update && sudo apt install arp-scan`
- Connect your PC to the `CCTB_office_01` Wi-Fi network (same network as the vehicle ECU).
- On your PC, execute `cd aichallege-2024/remote` to change to the working directory
- Execute `bash connect_ssh.bash <vehicle_name> <username>` on your PC (e.g., `bash connect_ssh.bash A9 aic-team`)
- Enter your PC password if prompted
- Enter the vehicle ECU password when prompted

You should now have access to the vehicle ECU.

If the above commands don't work, please try the following:

- Ask the event staff for the vehicle's `<IP address>`
- Execute `ssh <username>@<IP address>` on your PC

## How to Transfer Autoware to Vehicle ECU

- Please keep the folder name as `aichallenge-2024` due to script path dependencies.

1. An `aichallenge-2024` folder is located under `/home` on the ECU; edit the submit folder within.
2. Transfer aichallenge-2024 from your PC using SCP or VSCode Remote SSH

## Operations After Connecting to Vehicle ECU

### 1. Starting Drivers and Docker Containers

```bash
cd aichallenge-2024
./docker_build.sh dev (only needs to be executed once initially)
bash run_vehicle_tmux.sh
```

The terminal will be split as shown below:
![tmux-image](./images/tmux.png)

- Left ①: Starts ./docker_run dev cpu and enters aichallenge-2024 container
- Right ②: Starts ./docker_run dev cpu and enters aichallenge-2024 container
- Right ③: Vehicle driver software starts
- Right ④: Zenoh bridge starts
- Right ⑤: Nothing specific

The vehicle driver (right ③) and Zenoh bridge (right ④) will start automatically.

### 2. Starting Autoware

Execute within Docker container. By default, use terminal ① on the left or ② on the right.

```bash
cd /aichallenge
./build_autoware.bash (execute only once initially, then as needed when making changes that require rebuilding)
./run_autoware.bash vehicle (autoware starts and is ready)
```

### 3. Recording ROSBAG

Execute within Docker container. By default, use terminal ① on the left or ② on the right.

```bash
cd /aichallenge
source workspace/install/setup.bash
ros2 bag record -a
# If you want to avoid warnings (though they don't affect operation), use this alternative command:
ros2 bag record -a -x "(/racing_kart/.*|/to_can_bus|/from_can_bus)"
# You can also record using this command:
cd /aichallenge
./record_rosbag.bash
```

### 4. When Finishing Operation

Execute the following in terminal ⑤ on the right to stop the container and tmux:

```bash
./stop_vehicle_tmux.sh
```

## For ROS Communication Between Local PC and ECU

- Execute the following on your local PC:

```bash
# Only needed once initially
./docker_build.sh dev
# Enter Docker container
./docker_run.sh dev cpu
# Launch terminator (GUI version of tmux) and split screen by right-clicking
# In one terminator terminal, connect to vehicle via Zenoh
cd /remote
./connect_zenoh.bash <vehicle_number>
# In the other terminator terminal, you can communicate with ECU
# (Example: Launch Rviz)
cd /aichallenge
./run_rviz.bash
```

- Press CTRL+C in the Zenoh terminal to end communication.

## FAQ: Troubleshooting

### Q. ROS communication not working between local PC and ECU / Topic duplication

A. Restart Zenoh on both local PC and ECU

#### Restarting Zenoh on ECU

Stop Zenoh in terminal ⑤ by executing:

```bash
cd vehicle
./kill_zenoh.bash
```

Then restart Zenoh in terminal ④:

```bash
./run_zenoh.bash
```

#### Restarting Zenoh on Local PC

Press CTRL+C in the Zenoh terminal to stop it
Then execute `./connect_zenoh.bash <vehicle_number>` to restart

### Q. Low ROS Topic publishing frequency during Zenoh communication

A. The config file `./vehicle/zenoh.json5` is set for stable communication, default 10Hz.
If needed, you can adjust the publishing frequency by modifying `pub_max_frequencies: ["/*=10"]`.

### Q. ROS Topics delayed or missing on local PC

A. Topics may be delayed or lost due to communication conditions.

- Try reducing the number of topics displayed on local PC or adjusting publishing frequency
- You can set topic priorities in `./vehicle/zenoh.json5` config file using `pub_priorities: ["/racing_kart/joy=1:express"]`
- Try executing `./remote/network_setting.bash`

### Q. Unsure if inside aichallenge-2024 container

A. A simple check: execute the docker command in the terminal - if you get `bash: docker: command not found`, you're inside Docker.
39 changes: 35 additions & 4 deletions docs/finals/operation.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@

## 車両 ECU への接続方法

手元PCから`CCTB_office_01`のWi-Fi経由でSSHでECUに接続します。

- 手元PCにarp-scanをインストールする。`sudo apt update && sudo apt install arp-scan`
- 手元のPCを `CCTB_office_01` というWi-Fiに接続する(車両 ECU と同じネットワーク)。
- 手元のPCで `cd aichallege-2024/remote` を実行して作業ディレクトリを移動する
- 手元のPCで `bash connect_ssh.bash <車両名> <ユーザー名>` を実行する (例 `bash connect_ssh.bash A9 aic-team`)
- 手元のPCのパスワードを聞かれた場合は入力する
- 車両 ECU のパスワードを聞かれるので入力する
- 上記のコマンドが使えない場合
- 運営スタッフに車両の `<IPアドレス>` を問い合わせください
- 手元のPCで `ssh <ユーザー名>@<IPアドレス>` を実行する

以上で車両ECUにアクセスできるはずです。

上記のコマンドが使えない場合、以下をお試しください。

- 運営スタッフに車両の `<IPアドレス>` を問い合わせください
- 手元のPCで `ssh <ユーザー名>@<IPアドレス>` を実行する

## 車両ECUへのAutoware転送方法

Expand Down Expand Up @@ -59,6 +66,8 @@ bash run_vehicle_tmux.sh
- 右側④:Zenohのブリッジが起動する
- 右側⑤:特になし

右側③の車両ドライバ・右側④のZenohブリッジは自動で起動します。

### 2. Autowareの起動

Dockerコンテナ内で行います.デフォルトでは左側①か右側②のコンテナの端末です.
Expand Down Expand Up @@ -86,6 +95,14 @@ cd /aichallenge
./record_rosbag.bash
```

### 4.走行終了時

右側⑤の端末で以下を実行し、コンテナ・tmuxを終了します。

```bash
./stop_vehicle_tmux.sh
```

## 手元のPCとECUでROS通信したい場合

- 手元のPCで以下を実行します
Expand Down Expand Up @@ -137,8 +154,22 @@ Zenohが起動しているターミナルでCTRL+Cを押下し、Zenohを停止

その後`./connect_zenoh.bash <車両番号>`を実行し、再度起動します

### Q. 手元PCとECUでZenoh通信時にROSの配信周期が低い
### Q. 手元PCとECUでZenoh通信時にROS Topicの配信周期が低い

A. 通信の安定化のために`./vehicle/zenoh.json5`のconfigファイルを設定しており、デフォルト10Hzとなっています。

必要であれば`pub_max_frequencies: ["/*=10"],`を変更することで配信周期を上げることができます。

### Q. 手元PCでROS Topicが遅れる・来ない

A. 通信状況によりTopicが遅れたり・ロスすることがあります。

- 手元PCで表示するTopic数を減らしたりしてみてください。また配信周期の調整も一手です。

- `./vehicle/zenoh.json5`のconfigファイル内 `pub_priorities: ["/racing_kart/joy=1:express"],`でTopicの優先度を設定することも可能です

- `./remote/network_setting.bash`の実行も試してみてください。

### Q. aichallenge-2024コンテナに入れているかわからない

A. 簡易的ですがそのターミナル内でdockerコマンドを実行し`bash: docker: command not found`と出ればDocker内に入れています。

0 comments on commit 608c61d

Please sign in to comment.