# 17.4. TB3 Automatic Parking Vision 自動停車(使用攝影機)

{% hint style="info" %}
備註：&#x20;

* turtlebot3\_automatic\_parking\_vision 使用 Raspberry pi 攝影機，因此此展示使用的預設平台是 TurtleBot3 Waffle Pi 鬆餅 Pi 款。由於它依一些在牆上找到的 AR marker 標記來停車，因此 AR marker 標記需要列印出來。整個過程使用從攝影機獲取的影像，因此如果停車過程不順利，請配置參數來調整，例如亮度，對比度等。
* turtlebot3\_automatic\_parking\_vision 使用基於 image\_proc 節點的矯正影像。為了獲得矯正的影像，TB3 應該取得 Raspberry pi 攝影機的光學校準數據。(每個下載的 turtlebot3 套件，已經將 Raspberry pi v2 攝影機校準數據，當作是預設的數據設置。)
* &#x20;turtlebot3\_automatic\_parking\_vision 套件需要 ar\_track\_alvar 套件。
  {% endhint %}

**\[Remote PC 端]** 執行 roscore

```
$ roscore
```

**\[TB3 SBC 端]** 啟用基本套件來開始 TB3 展示

```
$ roslaunch turtlebot3_bringup turtlebot3_robot.launch
```

**\[TB3 SBC 端]** 開始 Raspberry pi 攝影機節點

```
$ roslaunch turtlebot3_bringup turtlebot3_rpicamera.launch
```

**\[Remote PC 端]** Raspberry pi 套件會發布壓縮的影像以加速通訊。然而，在 image\_proc 節點中的影像校正所需要的是 raw 原始影像。因此，壓縮影像應該轉換為 raw 原始影像。

```
$ rosrun image_transport republish compressed in:=raspicam_node/image raw out:=raspicam_node/image
```

**\[Remote PC 端]** 接著進行影像矯正

```
$ ROS_NAMESPACE=raspicam_node rosrun image_proc image_proc image_raw:=image _approximate_s=true _queue_size:=20
```

**\[Remote PC 端]** 現在應該開始 AR marker 標記的偵測。在執行相關的啟動文件之前，應該先導出此展示將使用的 TB3 模型。運行啟動文件後，RViz 將自動在預設環境下運行。

```
$ export TURTLEBOT3_MODEL=waffle_pi
$ roslaunch turtlebot3_automatic_parking_vision turtlebot3_automatic_parking_vision.launch
```

* [**Youtube TB3 Automatics Parking Vision 影片**](https://youtu.be/dvpWdrD3bVs)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://idminer.gitbook.io/robotis/part-1-turtlebot3/17.-applications-bu-tong-ying-yong/17.4.-tb3-automatic-parking-vision-zi-dong-ting-che-shi-yong-nie-ying-ji.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
