> For the complete documentation index, see [llms.txt](https://idminer.gitbook.io/robotis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://idminer.gitbook.io/robotis/part-1-turtlebot3/15.-ros2/15.1.-she-ding/15.1.2.-tb3-sbc-chan-ban-dian-nao-she-ding/untitled-1.md).

# 15.1.2.7. 環境設定

**Domain ID 的分配**

在 DDS 通訊中，remote PC 和 TurtleBot3 之間的 **ROS\_DOMAIN\_ID** 必須匹配，以便在相同的網路環境下進行無線通訊。以下指令顯示如何在 TurtleBot3 中將**ROS\_DOMAIN\_ID** 分配給 SBC。

* TurtleBot3 預設 ID 是設為 0。&#x20;
* 建議將 remote PC 和 TurtleBot3 SBC 的 **ROS\_DOMAIN\_ID** 設置為 **30**。

```
$ echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc
$ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc
$ source ~/.bashrc
```

{% hint style="danger" %}
**警告**：請勿 **overlap 重疊**你與其他用戶之間的任何 ID。它會在同一網絡環境下導致用戶之間的通訊衝突。
{% endhint %}

**OpenCR Port 的設定**

以下指令顯示如何將 OpenCR port 的授權分配給 TurtleBot3。

```
$ cd ~/turtlebot3_ws/src/turtlebot3/turtlebot3/turtlebot3_bringup 
$ sudo cp ./99-turtlebot3-cdc.rules /etc/udev/rules.d/ 
$ sudo udevadm control --reload-rules 
$ sudo udevadm trigger
```
