---
# System prepended metadata

title: LG SVL Simulator
tags: [cycarrier]

---

###### tags: `cycarrier`

[google drive 連結](https://drive.google.com/drive/folders/1GEm9s0yrokPrAXK7fK9T1UVjEv3B2DJi?usp=sharing)

# LG SVL Simulator
[Document](https://www.svlsimulator.com/docs/)
[github](https://github.com/lgsvl/simulator)

## 安裝

[install.sh](https://drive.google.com/drive/u/1/folders/1GEm9s0yrokPrAXK7fK9T1UVjEv3B2DJi)
[unity 安裝](https://linuxhint.com/install-unity-2020-2-1f1-ubuntu-20-04/)

## 手冊
### simulator
[執行方式 (上篇)](https://www.svlsimulator.com/docs/installation-guide/installing-simulator/)
[執行方式 (下篇)](https://www.svlsimulator.com/docs/getting-started/getting-started/#running-the-simulator)
[連結 apollo (simulator 設定)](https://www.svlsimulator.com/docs/running-simulations/running-simulator/)
[連結 apollo (apollo 設定)](https://www.svlsimulator.com/docs/archive/2020.06/apollo5-0-instructions/)

註:
bootstrap.sh 在 conainer 的 /apollo/scripts/ 資料夾

Simulator 重要按鍵:
F1 : 說明 
F12: 從新開始

### unity
[建立地圖](https://www.svlsimulator.com/docs/simulation-content/add-new-map/)
上傳時會出現錯誤 ([issue](https://github.com/lgsvl/simulator/issues/1585))

<b>AssetBundles 資源</b>
[map 連結](https://content.lgsvlsimulator.com/maps/)
[vehicle 連結](https://content.lgsvlsimulator.com/vehicles/)

---

## apollo 操作方式
> 這裡假設已經成功執行 [install.sh](https://drive.google.com/drive/u/1/folders/1GEm9s0yrokPrAXK7fK9T1UVjEv3B2DJi)
```shell=
cd ~/adehome 
./apollo-5.0/docker/scripts/dev_start.sh
./apollo-5.0/docker/scripts/dev_into.sh

## 此時應該要在 container 內
./apollo.sh build_opt_gpu
cd scripts
./bootstrap.sh
./bridge.sh

## 開啟另一個 Terminal
~/adehome/svlsimulator/simulator

先做上方 "simulator 執行方式(上篇)"
再做 "連結 apollo (simulator 設定)" 的 Create and run a random interactive simulation
(車子跟地圖請參照 "連結 apollo (apollo 設定)" (從 Open Apollo ... localhost:8888 開始))

再來開啟 sim control
```
註:
可能畫面頻閃, 甚至跑步出來, 目前不知道原因, 只能猜測是電腦性能不夠好

![sim control 開啟示意圖](https://i.imgur.com/oMuHDb6.png)

[圖片來源](https://www.fzb.me/apollo/howto/how_to_build_and_debug_apollo_in_vscode_cn.html)
```
最後做 "連結 apollo (apollo 設定)"從 Open Apollo ... localhost:8888 開始

註:
Submit Route => Send Routing Requests
```

![](https://i.imgur.com/1VtvuDE.png)



## 如何執行 cyber_monitor 和 cyber_visulizer
在 container 內執行
$ source cyber/setup.bash

接著就能執行這兩個指令

註:
* cyber_monitor: 
    * 要執行 bridge.sh 才會有資料

* cyber_visualizer
    * 可能出現錯誤, 亂試了好幾次才成功, 也不知道為什麼成功

[教學影片](https://www.youtube.com/watch?v=Ucr0aM334_k)
(教學影片的版本比較舊, SVL Simulator Open browser 不會開在 localhost:8080 
 而是直接連到 [cloud](https://wise.svlsimulator.com/))

## Q & A

### Error response from daemon: Unknown runtime specified nvidia
在 /etc/doker/daemon.json 加入
```
{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}
```

### 開啟 sim control 地圖頻閃
可能是電腦性能不夠好的問題 ?!

### 闖紅燈 ＆ 轉彎不夠順暢, 甚至開到另一個車道 ?
不知道為什麼


### Apollo 編譯失敗 (xxx.h 檔)
解法: 進入 BIOS 關閉 XMP 