idminer
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    * **TurtleBot3(ROS1)-Noetic 中文線上手冊** === - 20231124 中譯發布,不會即時修正,內容如有差異不同,請以 [**英文線上手冊**](https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/) 的 Noetic 內容為主 O : 可支援 ∆ : 需要確認 X : 不支援,自行開發 | 特色 | Kinetic | Melodic | Noetic | Dashing | Foxy | Galactic | Humble | | --- | --- | --- | --- | --- | --- | --- | --- | | 遙控 | O | O | O | O | O | O | O | | SLAM | O | O | O | O | O | O | O | | 導航 | O | O | O | O | O | O | O | | 模擬 | O | O | O | O | O | O | O | | 機器手臂 | O | O | O | O | O | ∆ | O | | Home Service Challenge | O | O | O | X | X | X | X | | 自動駕駛挑戰賽 | O | X | O | X | X | X | X | | 機器學習 | O | O | X | O | X | X | X | | 範例 | Kinetic | Melodic | Noetic | Dashing | Foxy | Galactic | Humble | | --- | --- | --- | --- | --- | --- | --- | --- | | Interactive Markers | O | X | X | X | X | X | X | | Obstacle Detection | O | X | X | O | X | X | X | | Position Control | O | X | X | O | X | X | X | | Point Operation | O | X | X | O | X | X | X | | Patrol | O | X | X | O | X | X | X | | Follower | O | X | X | X | X | X | X | | Panorama | O | X | X | X | X | X | X | | Auto Parking | O | X | X | O | X | X | X | | Auto Parking(Vision) | O | X | X | X | X | X | X | | Multi TurtleBot3 | O | X | X | X | X | X | X | # **3. TB3 快速入門指南** --- {%youtube ji2kQXgCjeM %} ## 3.1 Remote PC(桌電/筆電) 設定 :::warning 警告: 以下介紹的內容是用來設定 Remote PC (也就是你的桌電或筆電),以便來遠端控制 TurtleBot3 用。千萬不要使用在 TurtleBot3 的 SBC 單板電腦上。 ::: :::danger **相容性警示** - Jetson Nano 不支援原生的 Ubuntu 20.04。請參考 [NVIDIA Developer forum](https://forums.developer.nvidia.com/t/when-will-jetpack-move-to-ubuntu-20-04/142517) 來詳細了解。 ::: :::info 備註: 操作的內容已在Ubuntu 20.04 及 ROS1 Noetic Ninjemys 版本上測試過。 ::: ### 3.1.1. 在 Remote PC 下載及安裝 Ubuntu 首先要在 Remote PC(你的桌電或是筆電)上安裝 Ubuntu(一種 Linux 作業系統). 請先下載 Ubuntu 20.04 LTS Desktop 版及參考安裝步驟進行安裝. - [Ubuntu 20.04 LTS Desktop image 64-bit 下載點](https://releases.ubuntu.com/20.04/) - [Ubuntu Desktop 安裝步驟](https://www.ubuntu.com/download/desktop/install-ubuntu-desktop) ### 3.1.2. 在 Remote PC 安裝 ROS Ctrl+Alt+T 開啟 terminal 視窗,輸入以下指令,一次一行 - 請先參考這個 [**安裝腳本 script 檔**](https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_noetic.sh) [Remote PC] ``` $ sudo apt update $ sudo apt upgrade $ wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_noetic.sh $ chmod 755 ./install_ros_noetic.sh $ bash ./install_ros_noetic.sh ``` - 如果安裝失敗,請參考[**官方 ROS1 Noetic 安裝指南**](http://wiki.ros.org/noetic/Installation/Ubuntu) ### 3.1.3. 安裝相關 ROS Packages [Remote PC] ``` $ sudo apt-get install ros-noetic-joy ros-noetic-teleop-twist-joy \ ros-noetic-teleop-twist-keyboard ros-noetic-laser-proc \ ros-noetic-rgbd-launch ros-noetic-rosserial-arduino \ ros-noetic-rosserial-python ros-noetic-rosserial-client \ ros-noetic-rosserial-msgs ros-noetic-amcl ros-noetic-map-server \ ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro \ ros-noetic-compressed-image-transport ros-noetic-rqt* ros-noetic-rviz \ ros-noetic-gmapping ros-noetic-navigation ros-noetic-interactive-markers ``` ### 3.1.4. 安裝 TurtleBot3 Packages 安裝所需的 TurtleBot3 Debian Packages [Remote PC] ``` $ sudo apt install ros-noetic-dynamixel-sdk $ sudo apt install ros-noetic-turtlebot3-msgs $ sudo apt install ros-noetic-turtlebot3 ``` 補充資料 - 如果需要用原始碼來 build TurtleBot3 Packages,可參照下列指令,如已有同名的套件,請先移除。 [Remote PC] ``` $ sudo apt remove ros-noetic-dynamixel-sdk $ sudo apt remove ros-noetic-turtlebot3-msgs $ sudo apt remove ros-noetic-turtlebot3 ``` 如果需要下載原始碼,以便自己 build package,請使用下列指令 [Remote PC] ``` $ mkdir -p ~/catkin_ws/src $ cd ~/catkin_ws/src/ $ git clone -b noetic https://github.com/ROBOTIS-GIT/DynamixelSDK.git $ git clone -b noetic https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git $ git clone -b noetic https://github.com/ROBOTIS-GIT/turtlebot3.git $ cd ~/catkin_ws && catkin_make $ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc ``` ### 3.1.5. 網路設定 ![](https://i.imgur.com/TwGccJK.png) 1. 將 PC 連上 WiFi,在 terminal 視窗輸入下方指令來找出 remote PC 的 IP 位址 [Remote PC] ``` $ ifconfig ``` 下圖紅色方框內, 顯示的是 remote PC 的 IP 位址 ![](https://i.imgur.com/4diIDP3.png) 2. 開啟檔案,使用以下指令來更新 ROS IP 設定 [Remote PC] ``` $ nano ~/.bashrc ``` 3. 按 Ctrl + END 或 Alt + / 移動游標到最後一行。然後將檔案內的 ROS_MASTER_URI 的 localhost 以及 ROS_HOSTNAME 後面接的 IP 位址,更改為上面所得到的 remote PC(桌電/筆電) 的 IP 位址,如下圖所示。 ![](https://i.imgur.com/GNkBW0H.png) 4. Source bashrc 檔的指令 [Remote PC] ``` $ source ~/.bashrc ``` ## 3.2 SBC 單板電腦設定 :::warning - 安裝時需要供電及時間較久,不適合使用電池,建議使用 TB3 內附的 SMPS 電源線接市電來供電。 - 需另備 HDMI 螢幕、鍵盤、滑鼠以完成設定 ::: ### 3.2.1. 準備 microSD 卡及讀卡機 如果 PC 沒有 microSD 槽,請改用 microSD 讀卡機來燒錄映像檔。 ![](https://i.imgur.com/k9QUeo1.png) ### 3.2.2. 下載 TB3 SBC OS image 映像檔 下載對應 SBC 的 ROS 版本。Noetic 版本的映像檔是基於 Ubuntu 20.04 產生。 - 下載 [Raspberry Pi 3B+ ROS Noetic image](https://www.robotis.com/service/download.php?no=2008) - SHA256 : a7c57e20f2ee4204c95315866f4a274886094f7c63ed390b6d06d95074830309 - 下載 [Raspberry Pi 4B (2GB or 4GB) ROS Noetic image](https://www.robotis.com/service/download.php?no=2066) - SHA256 : 9d48925a78381885916a6f3bb77891adbfae2b271b05fe2ae9a9b7ebd12c46cc - 此映像檔跟 Raspberry Pi 4B with 8GB RAM 不相容 :::info - recovery 映像檔如有修改,不會預先通知 ::: ### 3.2.3. 解壓縮 image 將下載的 .img 檔解壓縮存到本地硬碟 ### 3.2.4. 燒錄 image 可使用不同的映像檔燒錄工具,如 Raspberry Pi Imager 或 Linux Disks utility #### 3.2.4.1. 使用 Raspberry Pi Imager - 從樹莓派官網下載燒錄工具 [**Raspberry Pi Imager**](https://www.raspberrypi.org/software/) - 可參考 [Raspberry Pi Imager 詳細文件](https://www.raspberrypi.org/blog/raspberry-pi-imager-imaging-utility/) ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/setup/rpi_imager.gif) 如果使用 .deb 安裝 imager 出現 dependency error,請改用 snap install 方式安裝。(此版本非最新,可跟以下的操作畫面有所不同) [Remote PC] ``` $ sudo snap install rpi-imager $ rpi-imager ``` 步驟 1. 按 CHOOSE OS 2. 按 Use Custom 選擇儲存於硬碟的 .img 映像檔 3. 按 CHOOSE STORAGE 選擇 microSD 4. 按 WRITE 開始燒錄映像檔 #### 3.2.4.2. 使用 Disks Utility Disks utility 工具程式已經內含在 Ubuntu Desktop 版內,搜尋 Disks 就可找到開啟此程式。 ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/setup/disks.gif) 步驟 1. 在左邊控制面板選擇 microSD 2. 選擇 Restore Disk Image 選項 3. 開啟存在硬碟內的 .img 映像檔 4. 按 Start Restoring... > Restore 按鍵 ### 3.2.5. Resize the Partition 調整分區大小 為了減少 recovery 映像檔的大小並減少將映像檔燒錄到 microSD 上的時間,recovery 檔的 partition 分區要被最小化。請調整分區大小以便使用未分配的空間。 :::warning **請注意不要選擇錯誤的磁碟或分區。對 PC 的系統碟進行分區,可能會導致嚴重的系統故障。** ::: - [下載安裝 GParted GUI tool](https://gparted.org/download.php) ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/setup/gparted.gif) 步驟 1. 從選單選擇 microSD 卡(mount 的位置會依系統而異) 2. 右鍵單擊黃色分區 3. 選擇 Resize/Move 選項 4. 拖拉分區的右方邊界,一直到最右方 5. 點擊 Resize/Move 按鍵 6. 點擊上方的 Apply All Operations 綠色的勾選 V 鍵 ### 3.2.6. 設置 WiFi 網路設定 1. 開新的 terminal(Ctrl + Alt + T),到 microSD 卡內的 netplan 目錄。 使用 superuser 權限 sudo 來編輯 50-cloud-init.yaml 檔 [Remote PC] ``` $ cd /media/$USER/writable/etc/netplan $ sudo nano 50-cloud-init.yaml ``` 檔案開啟後,把你的 wifi SSID 及密碼替換到 WIFI_SSID 及 WIFI_PASSWORD。 ![](https://i.imgur.com/mIUhdcR.png) Ctrl + S 儲存檔案後,Ctrl + X 結束 nano editor ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/setup/network_setup.gif) :::info 如果出現 “No such file or directory” 訊息,請確認 microSD 卡已經 mount 到系統上 ::: 之後 1. 樹莓派開機 a. 連接 HDMI 螢幕到樹莓派的 HDMI port b. 連接鍵盤跟滑鼠到樹莓派的 USB port c. 插入 microSD 卡 d. 連接電源(透過USB or OpenCR)讓樹莓派開機 e. 登入 ID: ubuntu,密碼: turtlebot :::info HDMI 螢幕必須在開機前就接上樹莓派,要不然樹莓派的 HDMI port 會 disable 停用 ::: ### 3.2.7. ROS 網路設置 :::info Note: 如果碰到有關 ROS GPG Key 的 apt failures(因為當前的 GPG key 已過期),你需要去更新 GPG Key。請參照 [ROS GPG Key Expiration Incident](https://emanual.robotis.com/docs/en/platform/turtlebot3/sbc_setup/#https://discourse.ros.org/t/ros-gpg-key-expiration-incident/20669) 所提供的解決方案來處理。 ::: 請在 SBC(樹莓派) 操作以下步驟 1. 確認 WiFi IP address [Turtlebot3 SBC] ``` $ ifconfig ``` 2. 編輯 .bashrc 檔 [Turtlebot3 SBC] ``` $ nano ~/.bashrc ``` 3. 找到 ROS_MASTER_URI 及 ROS_HOSTNAME 設定頁面,修改對應的 IP address [Turtlebot3 SBC] ``` export ROS_MASTER_URI=http://{IP_ADDRESS_OF_REMOTE_PC}:11311 export ROS_HOSTNAME={IP_ADDRESS_OF_RASPBERRY_PI_3} ``` 4. Ctrl + S 存檔,Ctrl + X 結束 nano editor 5. 套用所有變更 [Turtlebot3 SBC] ``` $ source ~/.bashrc ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/setup/ros1_sbc_netcfg.gif) ### 3.2.8. 新光達 LDS-02 的設定 | LDS-01 | LDS-02 | |:------------------------------------:|:------------------------------------:| | ![](https://i.imgur.com/HwtZjjx.png) | ![](https://i.imgur.com/BuuZp7A.png) | 2022 年版 TurtleBot3 標配的光達已經改為 LDS-02。請使用下列指令在 SBC(樹莓派) 上來設定 LDS-02 光達。 1. 安裝 LDS-02 driver 及更新 TB3 package [Turtlebot3 SBC] ``` $ sudo apt update $ sudo apt install libudev-dev $ cd ~/catkin_ws/src $ git clone -b develop https://github.com/ROBOTIS-GIT/ld08_driver.git $ cd ~/catkin_ws/src/turtlebot3 && git pull $ rm -r turtlebot3_description/ turtlebot3_teleop/ turtlebot3_navigation/ turtlebot3_slam/ turtlebot3_example/ $ cd ~/catkin_ws && catkin_make ``` 2. Export LDS_MODEL to bashrc 檔。LDS model 可以是 LDS-01 或 LDS-02。 [Turtlebot3 SBC] ``` $ echo 'export LDS_MODEL=LDS-01' >> ~/.bashrc $ source ~/.bashrc ``` 以上完成 SBC 的設定 補充資料 ### 3.2.補. 使用手動方式設定 SBC 單板電腦 手動安裝會比由 recovery 映像檔安裝,花更多時間,但可以更有彈性的安裝需要的 packages。**手動方式不建議初學者採用** 1. 下載 Ubuntu 20.04.1(Focal) Preinstalled Server 映像檔 - [Ubuntu 20.04.1(Focal) Preinstalled Server for Raspberry Pi 3(arm64)](http://cdimage.ubuntu.com/ubuntu-server/focal/daily-preinstalled/current/) 2. 解壓縮 image 3. 燒錄 image 到 microSD 卡。可使用不同的映像檔燒錄工具,如 Raspberry Pi Imager 或 Linux Disks utility。 ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/setup/rpi_imager.gif) a. 按 CHOOSE OS b. 按 Use Custom 選擇儲存於硬碟的 .img 映像檔 c. 按 CHOOSE STORAGE 選擇 microSD d. 按 WRITE 開始燒錄映像檔 4. 樹莓派開機 a. 連接 HDMI 螢幕到樹莓派的 HDMI port b. 連接鍵盤跟滑鼠到樹莓派的 USB port c. 插入 microSD 卡 d. 連接電源(透過USB or OpenCR)讓樹莓派開機 5. 設置樹莓派 a. 登入 ID: ubuntu,密碼: ubuntu,登入後會要求更改密碼 b. 打開自動更新檔 ``` $ sudo nano /etc/apt/apt.conf.d/20auto-upgrades ``` 6. 變更自動更新設定 ``` APT::Periodic::Update-Package-Lists "0"; APT::Periodic::Unattended-Upgrade "0"; ``` a. Ctrl + S 儲存檔案,Ctrl + X 結束 7. 輸入指令設定 WiFi 網路 ``` $ sudoedit /etc/netplan/50-cloud-init.yaml ``` 8. 檔案開啟後,將下列內容添加到檔案的最後。然後將 WIFI_SSID 及 WIFI_PASSWORD 內容替換為你的 Wifi ID 及密碼,之後 Ctrl + S 儲存檔案,Ctrl + X 結束 ![](https://i.imgur.com/v2qInWZ.png) 9. SBC 重開機 ``` $ sudo reboot ``` 10. 設定 systemd 避免無網路時會開機延遲,需要以下指令來 mask systemd 程序。 ``` $ systemctl mask systemd-networkd-wait-online.service ``` 11. Disable Suspend 及 Hilbernation ``` $ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target ``` 12. 樹莓派重開機後,如果要在 Remote PC 上使用 SSH 連上樹莓派工作,則在 Remote PC 的 terminal 輸入以下指令,預設密碼是 ubuntu 或使用新密碼 ``` $ ssh ubuntu@{IP Address of Raspberry PI} ``` 13. 安裝 ROS Noetic 版 在 SBC terminal 輸入下列指令,一次一行 也可參考此腳本 [script 檔](https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_noetic_rpi.sh),來了解安裝的細節 ``` $ sudo apt-get update $ sudo apt-get upgrade $ wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_noetic_rpi.sh $ chmod 755 ./install_ros_noetic_rpi.sh $ bash ./install_ros_noetic_rpi.sh ``` 以上安裝如果失敗,可參考官方 [official ROS Noetic installation guide](http://wiki.ros.org/noetic/Installation/Ubuntu) 來處理。 14. 安裝及 Build ROS Packages ``` $ sudo apt install ros-noetic-rosserial-python ros-noetic-tf $ sudo apt install ros-noetic-hls-lfcd-lds-driver $ sudo apt install ros-noetic-turtlebot3-msgs $ sudo apt install ros-noetic-dynamixel-sdk $ cd ~/catkin_ws/src $ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git $ cd ~/catkin_ws/src/turtlebot3 $ rm -r turtlebot3_description/ turtlebot3_teleop/ turtlebot3_navigation/ turtlebot3_slam/ turtlebot3_example/ $ cd ~/catkin_ws/ $ catkin_make -j1 $ source ~/.bashrc ``` 15. 設定 OpenCR 的 USB port ``` $ rosrun turtlebot3_bringup create_udev_rules ``` 16. 編輯 .bashrc 檔要確認 ROS 網路設置 ``` $ nano ~/.bashrc ``` 17. 修改 ROS_MASTER_URI 的 IP 及 ROS_HOSTNAME ``` export ROS_MASTER_URI=http://{IP_ADDRESS_OF_REMOTE_PC}:11311 export ROS_HOSTNAME={IP_ADDRESS_OF_RASPBERRY_PI_3} ``` 18. 存檔及結束 nano editor 19. 2022 年版 TurtleBot3 標配的光達已經改為 LDS-02。請使用下列指令在 SBC(樹莓派) 上來設定 LDS-02 光達。 安裝 LDS-02 driver 及更新 TB3 package [Turtlebot3 SBC] ``` $ sudo apt update $ sudo apt install libudev-dev $ cd ~/catkin_ws/src $ git clone -b develop https://github.com/ROBOTIS-GIT/ld08_driver.git $ cd ~/catkin_ws && catkin_make ``` 20. Export LDS_MODEL to bashrc 檔。LDS model 可以是 LDS-01 或 LDS-02。 ``` $ echo 'export LDS_MODEL=LDS-02' >> ~/.bashrc $ source ~/.bashrc ``` 21. 套用所有變更 ``` $ source ~/.bashrc ``` 可參照下列 Ubuntu Blog 來取得更詳細資訊 - [Improving Security with Ubuntu](https://ubuntu.com/blog/steps-to-maximise-robotics-security-with-ubuntu) - [Improving User Experience of TurtleBot3 Waffle Pi](https://ubuntu.com/blog/building-a-better-turtlebot3) - [How to set up TurtleBot3 Waffle Pi in minutes with Snaps](https://ubuntu.com/blog/how-to-set-up-turtlebot3-in-minutes-with-snaps) ## 3.3. OpenCR 控制板設定 1. 使用 microUSB 連接線連接樹莓派及 OpenCR 2. 樹莓派安裝所需套件以便上傳 OpenCR 韌體 [TurtleBot3 SBC] ``` $ sudo dpkg --add-architecture armhf $ sudo apt-get update $ sudo apt-get install libc6:armhf ``` 3. 依照 TB3 的款式,設定 OpenCR_MODEL 參數為 burger 或 waffle [TurtleBot3 SBC] ``` $ export OPENCR_PORT=/dev/ttyACM0 $ export OPENCR_MODEL=burger_noetic $ rm -rf ./opencr_update.tar.bz2 ``` 4. 下載韌體解壓縮 [TurtleBot3 SBC] ``` $ wget https://github.com/ROBOTIS-GIT/OpenCR-Binaries/raw/master/turtlebot3/ROS1/latest/opencr_update.tar.bz2 $ tar -xvf opencr_update.tar.bz2 ``` 5. 上傳韌體到 OpenCR [TurtleBot3 SBC] ``` $ cd ./opencr_update $ ./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr ``` 6. Burger 如果成功上傳韌體,會出現下列資訊 ![](https://i.imgur.com/wL37GsT.png) 7. 如果上傳失敗,可以嘗試在 recovery mode 下重新上傳韌體。OpenCR 的 recovery mode 啟動順序如下。在 recovery mode 時,OpenCR 的 STATUS led 燈會定時的閃爍。 - 按住 PUSH SW2 鍵 - 按一下 Reset 鍵 - 然後鬆開 Reset 鍵 - 再鬆開 PUSH SW2 鍵 ![](https://i.imgur.com/ZilkkEU.png) **補充資料: 使用 Arduino IDE 來上傳韌體步驟** :::info OpenCR board manager 並不支援在 ARM based SBC 上的 Arduino IDE,如樹莓派 或 NVidia Jetson。 請在 PC 上用 Arduino IDE 來上傳韌體。 ::: 1. 如 PC 的 OS 是 Linux,下列指令設定 USB ports 給 OpenCR 使用。如果是其他 OS(OSX or Windows),可跳過此步驟。 ``` $ wget https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/99-opencr-cdc.rules $ sudo cp ./99-opencr-cdc.rules /etc/udev/rules.d/ $ sudo udevadm control --reload-rules $ sudo udevadm trigger $ sudo apt install libncurses5-dev:i386 ``` 2. 安裝 Arduino IDE - [下載最新的 Arduino IDE](https://www.arduino.cc/en/software) 3. 安裝好後,執行 Arduino IDE 4. 按 Ctrl + , 來打開 Preferences menu 5. 在 Additional Boards Manager URLs 輸入下列位址 ``` https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.json ``` ![](https://i.imgur.com/zcRVecI.png) 6. 打開 TurtleBot3 韌體。因你的平台選擇對應的韌體。 - **Burger**: File > Examples > turtlebot3 > turtlebot3_burger > turtlebot3_core - **Waffle/Waffle Pi**: File > Examples > turtlebot3 > turtlebot3_waffle > turtlebot3_core 7. 打開 turtlebot3_core_config.h 檔,在 Line 21 行,去掉 NOETIC_SUPPORT defintion 註釋 8. 連接 OpenCR 板到 PC 上,從 Tools > Board 選單選擇 OpenCR > OpenCR Board 9. 從 Tools > Port 選單中,選擇連接 OpenCR 的 USB port 10. upload 圖示或 Ctrl+U 來上傳韌體 ![](https://i.imgur.com/S3zNgU6.png) ![](https://i.imgur.com/fxp7cNS.png) 11. 如果上傳失敗,可以嘗試在 recovery mode 下重新上傳韌體。OpenCR 的 recovery mode 啟動順序如下。在 recovery mode 時,OpenCR 的 STATUS led 燈會定時的閃爍。 - 按住 PUSH SW2 鍵 - 按一下 Reset 鍵 - 然後鬆開 Reset 鍵 - 再鬆開 PUSH SW2 鍵 ![](https://i.imgur.com/ZilkkEU.png) ### 3.3.1. OpenCR 測試 :::info Note: 如果測試後,輪子並沒有照設定的移動,請參照章節 14 FAQ 的 14.3. “Setup DYNAMIXELs for TurtleBot3” 重新設定智能馬達。 ::: 你可以使用 PUSH SW1 及 PUSH SW2 按鍵,來檢查 TB3 是否正確組裝。這個流程是測試左右兩個 Dynamixel 智能馬達及 OpenCR 控制板。 ![](https://i.imgur.com/staqXpo.jpg) 1. 在組裝好 TB3 後,將電池連上 OpenCR,打開電源開關,應會看到 OpenCR 板上的 Power LED 燈亮起 2. 將 TB3 放在平面地板上。為安全起見,建議空間的安全半徑為 1m。 3. 按住 PUSH SW1 鍵幾秒鐘,會讓 TB3 往前直行 30cm。 4. 按住 PUSH SW2 鍵幾秒鐘,會讓 TB3 原地旋轉 180 度。 ## 3.4. 硬體組裝 ![](https://i.imgur.com/CEvRMfd.png) ### 3.4.1. 組裝手冊 TB3 出貨時是盒裝,零配件是未組裝狀態。請下載相對應的 PDF 來組裝 - [**TB3 Burger 漢堡款組裝手冊下載**](http://www.robotis.com/service/download.php?no=748) - [**TB3 Waffle 鬆餅款組裝手冊下載**](http://www.robotis.com/service/download.php?no=749) - [**TB3 Waffle Pi 鬆餅 Pi 款組裝手冊下載**](http://www.robotis.com/service/download.php?no=750) ### 3.4.2. TB3 組裝影片 如果難以由 PDF 手冊進行組裝,請參考以下 Youtube 組裝影片。(PS: 採智科技可以提供 TB3 組裝服務,請你在訂購時先跟我們的業務確認。) - TB3 Burger 組裝影片 1 {%youtube rvm-m2ogrLA %} - TB3 Burger 組裝影片 2 {%youtube 5D9S_tcenL4 %} - TB3 Waffle 組裝影片 {%youtube 1nTMyr4ybi0 %} ## 3.5. Bringup 開始啟用 TB3 ### 3.5.1. 執行 roscore **Remote PC** 開新 terminal [Remote PC] ``` $ roscore ``` ### 3.5.2. Bringup 啟動 TB3 :::info TIP: 在執行指令前,TURTLEBOT3_MODEL的參數 ${TB3_MODEL},需依照 TB3 的款式,更改為正確的參數- burger, waffle, 或 waffle_pi ::: 1. 在 remote PC 上 Ctrl + Alt + T 開新 terminal,使用 SSH 連上樹莓派的 IP address。使用預設的密碼 turtlebot [Remote PC] ``` $ ssh ubuntu@{IP_ADDRESS_OF_RASPBERRY_PI} ``` 2. 啟動基礎套件開始 TB3 應用。${TB3_MODEL} 名稱需要置換為 burger,waffle,or waffle_pi [Turtlebot3 SBC] ``` $ export TURTLEBOT3_MODEL=${TB3_MODEL} $ roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` 3. 如果使用的 TB3 是 burger,視窗會出現訊息 [Turtlebot3 SBC] ``` SUMMARY ======== PARAMETERS * /rosdistro: noetic * /rosversion: 1.15.8 * /turtlebot3_core/baud: 115200 * /turtlebot3_core/port: /dev/ttyACM0 * /turtlebot3_core/tf_prefix: * /turtlebot3_lds/frame_id: base_scan * /turtlebot3_lds/port: /dev/ttyUSB0 NODES / turtlebot3_core (rosserial_python/serial_node.py) turtlebot3_diagnostics (turtlebot3_bringup/turtlebot3_diagnostics) turtlebot3_lds (hls_lfcd_lds_driver/hlds_laser_publisher) ROS_MASTER_URI=http://192.168.1.2:11311 process[turtlebot3_core-1]: started with pid [14198] process[turtlebot3_lds-2]: started with pid [14199] process[turtlebot3_diagnostics-3]: started with pid [14200] [INFO] [1531306690.947198]: ROS Serial Python Node [INFO] [1531306691.000143]: Connecting to /dev/ttyACM0 at 115200 baud [INFO] [1531306693.522019]: Note: publish buffer size is 1024 bytes [INFO] [1531306693.525615]: Setup publisher on sensor_state [turtlebot3_msgs/SensorState] [INFO] [1531306693.544159]: Setup publisher on version_info [turtlebot3_msgs/VersionInfo] [INFO] [1531306693.620722]: Setup publisher on imu [sensor_msgs/Imu] [INFO] [1531306693.642319]: Setup publisher on cmd_vel_rc100 [geometry_msgs/Twist] [INFO] [1531306693.687786]: Setup publisher on odom [nav_msgs/Odometry] [INFO] [1531306693.706260]: Setup publisher on joint_states [sensor_msgs/JointState] [INFO] [1531306693.722754]: Setup publisher on battery_state [sensor_msgs/BatteryState] [INFO] [1531306693.759059]: Setup publisher on magnetic_field [sensor_msgs/MagneticField] [INFO] [1531306695.979057]: Setup publisher on /tf [tf/tfMessage] [INFO] [1531306696.007135]: Note: subscribe buffer size is 1024 bytes [INFO] [1531306696.009083]: Setup subscriber on cmd_vel [geometry_msgs/Twist] [INFO] [1531306696.040047]: Setup subscriber on sound [turtlebot3_msgs/Sound] [INFO] [1531306696.069571]: Setup subscriber on motor_power [std_msgs/Bool] [INFO] [1531306696.096364]: Setup subscriber on reset [std_msgs/Empty] [INFO] [1531306696.390979]: Setup TF on Odometry [odom] [INFO] [1531306696.394314]: Setup TF on IMU [imu_link] [INFO] [1531306696.397498]: Setup TF on MagneticField [mag_link] [INFO] [1531306696.400537]: Setup TF on JointState [base_link] [INFO] [1531306696.407813]: -------------------------- [INFO] [1531306696.411412]: Connected to OpenCR board! [INFO] [1531306696.415140]: This core(v1.2.1) is compatible with TB3 Burger [INFO] [1531306696.418398]: -------------------------- [INFO] [1531306696.421749]: Start Calibration of Gyro [INFO] [1531306698.953226]: Calibration End ``` 補充資料 ### 3.5.3. 在 RViz 載入 TurtleBot3 1. Remote PC 開新的 terminal,啟動 robot state publisher [Remote PC] ``` $ roslaunch turtlebot3_bringup turtlebot3_remote.launch ``` 2. Remote PC 開新的 terminal,啟動 RViz。 - 如果使用 apt 方式安裝 TB3 packages, 可輸入下列指令 [Remote PC] ``` $ rosrun rviz rviz -d `rospack find turtlebot3_description`/rviz/model.rviz ``` - 如果使用 git clone 方式安裝 TB3 packages,可輸入下列指令。model name 需置換為 burger or waffle_pi ``` $ rosrun rviz rviz -d `rospack find turtlebot3_description`/rviz/{burger, waffle_pi}.rviz ``` ![](https://i.imgur.com/WY9Q3lb.png) ## 3.6. 基本操作 ### 3.6.1. Teleoperation 遙控 :::warning **警示**:在執行遙控前,請先從 SBC 啟動 TB3,且在桌上測試 TB3 時須注意以防掉落桌面。 ::: TurtleBot3 可用不同的設備來遙控。只要先確認 SBC 及 ROS 版本都有支援對應的 ROS packages。 {%youtube Z4s18hlazb4 %} :::info **備註**: 手冊中的影片內容可能隨時更新,恕不另行通知。 ::: #### 3.6.1.1. 鍵盤控制 :::info TIP: 在執行指令前,TURTLEBOT3_MODEL的參數 ${TB3_MODEL},需依照 TB3 的款式,更改為正確的參數- burger, waffle,或 waffle_pi ::: 1. 在 Remote PC 上新開 terminal,執行 turtlebot3_teleop_key。如 TURTLEBOT3_MODEL 參數未指定,請替換 ${TB3_MODEL} 為 burger 或 waffle 或 waffle_pi [Remote PC] ``` $ export TURTLEBOT3_MODEL=${TB3_MODEL} $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 2. 如果所需節點都開啟成功,terminal 會顯示操作訊息 [Remote PC] ``` Control Your Turtlebot3 Moving around w a s d x w/x : increase/decrease linear velocity a/d : increase/decrease angular velocity space key, s : force stop CTRL-C to quit ``` 補充資料 :::info **如何預先定義好 TURTLEBOT3_MODEL** 如果 TURTLEBOT3_MODEL 參數已經預先定義在 .bashrc 檔內,則 export TURTLEBOT3_MODEL=${TB3_MODEL} 指令可以省略。當新的 terminal 開啟時,.bashrc 檔會自動載入 - 定義 TurtleBot3 Burger 為預設 model 範例 ``` $ echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc $ source ~/.bashrc ``` - 定義 TurtleBot3 Waffle Pi 為預設 model 範例 ``` $ echo 'export TURTLEBOT3_MODEL=waffle_pi' >> ~/.bashrc $ source ~/.bashrc ``` ::: #### 3.6.1.2. RC-100 遙控器 ROBOTIS RC-100B 遙控器已經預設在 TB3 OpenCR 控制板的韌體內。此遙控器須配合 BT-410 藍芽模組一起使用。TB3 Waffle Pi 款已經內含 RC-100B 遙控器及 BT-410 藍芽模組。當使用 RC-100 時,不需要執行任何特定節點,因為 turtlebot_core node 節點會產生所需的 /cmd_vel topic,直接連接到 OpenCR 控制板。 ![](https://i.imgur.com/kr1quhv.png) 1. 連接 BT-410 到 OpenCR 的 UART1 port。參考 chap 13.1.2. OpenCR 1.0 2. 使用 RC-100 遙控 TB3 - Up / Down: 直線加速或減速 - Left / Right: 角速度加速或減速 #### 3.6.1.3. PS3 搖桿 1. 將 PS3 搖桿, 透過藍芽或是 USB 線連到 remote PC(桌電或筆電) 2. 安裝使用 PS3 搖桿的 teleoperation packages [Remote PC] ``` $ sudo apt install ros-noetic-joy ros-noetic-joystick-drivers ros-noetic-teleop-twist-joy ``` 3. 啟動 teleoperation node 遙控模式 [Remote PC] ``` $ roslaunch teleop_twist_joy teleop.launch ``` #### 3.6.1.4. XBOX 360 搖桿 1. 將 XBOX 360 搖桿, 透過無線連接器或是 USB 線連到 remote PC 2. 安裝使用 XBOX 360 搖桿所需的 teleoperation packages [Remote PC] ``` $ sudo apt install xboxdrv ros-noetic-joy ros-noetic-joystick-drivers ros-noetic-teleop-twist-joy ``` 3. 啟動 XBOX 360 搖桿 teleoperation node [Remote PC] ``` $ sudo xboxdrv --silent $ roslaunch teleop_twist_joy teleop.launch ``` #### 3.6.1.5. Wii Remote 1. 將 Wii Remote 搖桿, 透過藍芽連到 remote PC 2. 安裝使用 Wii Remote 搖桿的 teleoperation packages [Remote PC] ``` $ sudo apt install ros-noetic-wiimote libbluetooth-dev libcwiid-dev $ cd ~/catkin_ws/src $ git clone https://github.com/ros-drivers/joystick_drivers.git $ cd ~/catkin_ws && catkin_make ``` 3. 啟動 Wii remote teleoperation node [Remote PC] ``` $ rosrun wiimote wiimote_node $ rosrun wiimote teleop_wiimote ``` ### 3.6.2. Topic Monitor :::info 要檢視 TB3 的 topics,可使用 ROS 提供的 [**rqt**](http://wiki.ros.org/rqt),它是 Qt-based 框架用做 ROS GUI 圖形使用開發。它是一個工具,可以在 GUI 圖形介面內單一的 topic list 上,顯示 TB3 所有 topics,包含 topic name,type,bandwidth,Hz,value 等資訊 ::: 1. 從 PC 下指令執行 rqt。如果 topic monitor 視窗沒有出現,可以選擇 plugin -> Topics -> Topic Monitor. ``` $ rqt ``` ![](https://i.imgur.com/RnSRoDH.png) 2. 當 topic monitor 載入後,預設 topic values 是沒有監控的。點擊每個 topic 前的 checkbox 方塊框打 V 來開始監控。 ![](https://i.imgur.com/6sYjNmu.png) 3. 點擊 checkbox 前的 ▶ 三角箭號圖示,來查看詳細的 topic 資訊 ![](https://i.imgur.com/2N83rWm.png) - /battery_state 顯示電池狀態的有關資訊,如當下的電壓,尚有電池容量。 ![](https://i.imgur.com/rs6Hwwc.png) - /diagnostics 顯示連接到 TB3 的各種零組件狀態,如 MPU9250、Dynamixel X 智能馬達、HLS-LFCD-LDS 光達、電池及 OpenCR 控制板 ![](https://i.imgur.com/6MneRpc.png) - /odom 顯示 TB3 的測距訊息。Topic 有 encoder 數據的方向及位置資料。 ![](https://i.imgur.com/XNE96ZS.png) - /sensor_state 顯示 encoder 數值、電池、扭力等訊息 ![](https://i.imgur.com/N0EpXrY.png) - /scan 顯示所有 LDS 光達的數據訊息,如 angle_max and min, range_max and min, indicates, ranges 等 ![](https://i.imgur.com/hENspQW.png) 此外,只要添加了新的 topics,你就可以通過 rqt 程式來監控 topics 資訊。 # **4. SLAM 地圖定位** --- :::info Note: - 請在 Remote PC 上執行 SLAM - 在執行任何操作前,請務必先執行章節 Bringup 啟動 TB3 ::: **SLAM(Simultaneous Localization and Mapping)** 即時定位與地圖構建, 是一種繪製地圖的技術,可在任一空間中估算當前的位置. 以下的影片展示 TurtleBot3, 如何使用 SLAM 技術,來精確的繪製地圖. {%youtube lkW4-dG2BCY %} 影片說明: - 機器人: TurtleBot3 Burger - 感測器: LiDAR 光達(Laser Distance Sensor) - ROS 套件: Gmapping / Cartographer - 地點: ROBOTIS 實驗室及總部 15 樓走廊 - 時間長: 55 分 - 距離: 共計 351 公尺 **Youtube TB3 SLAM 影片 2** {%youtube 7mEKrT_cKWI %} 影片2 說明: * 機器人: TurtleBot3 Burger and Waffle * 感測器: LiDAR 光達(Laser Distance Sensor, LDS-01) * ROS 套件: Gmapping * 地點: ROBOTIS 總部教室 * 時間長: 約 4 分 * 距離: 共計 15 公尺 **備註**: 手冊中的影片內容可能隨時更新,恕不另行通知。 ## 4.1. 執行 SLAM node 1. 從 Remote PC 執行 roscore [Remote PC] ``` $ roscore ``` 2. TB3 SBC 執行(Bringup)基本套件來開始 TB3 應用。如已執行可跳過此步驟 - 在 Remote PC 開新的 terminal (Ctrl + Alt + T),連上 SBC 的 IP address。預設密碼是 turtlebot - TURTLEBOT3_MODEL 的參數需設定 burger, waffle, 或 waffle_pi。 [Remote PC] ``` $ ssh pi@{IP_ADDRESS_OF_RASPBERRY_PI} $ export TURTLEBOT3_MODEL=${TB3_MODEL} $ roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` 3. 在 Remote PC 開新的 terminal, 啟動 SLAM 節點。GMapping 是預設的 SLAM 方法。另外 TURTLEBOT3_MODEL 的參數需設定 burger, waffle, 或 waffle_pi。 [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_slam turtlebot3_slam.launch ``` 補充資料 :::info **如何儲存 TURTLEBOT3_MODEL 參數?** 如果在 .bashrc 檔內 TURTLEBOT3_MODEL 參數已預設好,那 $ export TURTLEBOT3_MODEL=${TB3_MODEL} 指令可以忽略。 開新的 terminal 時, .bashrc 檔會自動載入 - 定義 TB3 Burger 為預設模型 [Remote PC] ``` $ echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc $ source ~/.bashrc ``` - 定義 TB3 Waffle Pi 為預設模型 [Remote PC] ``` $ echo 'export TURTLEBOT3_MODEL=waffle_pi' >> ~/.bashrc $ source ~/.bashrc ``` ::: 補充資料 :::info **使用其他的 SLAM 方法** - **GMapping** ([ROS Wiki](http://wiki.ros.org/gmapping),[Github](https://github.com/ros-perception/slam_gmapping)) 1. 在 Remote PC 安裝相關套件。(跟 Gampping 相關的套件,在章節 3.1. PC Setup 時,就已經安裝好) 2. 執行 Gmapping SLAM node [Remote PC] ``` $ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping ``` - **Cartographer** ([ROS Wiki](http://wiki.ros.org/cartographer),[Github](https://github.com/googlecartographer/cartographer)) 1. 在 Remote PC 下載及 build 相關套件。 Cartographer 套件由 Google 開發,但目前並沒有支援 ROS1 Noetic 的 binary 安裝檔。如要在 Noetic 使用本套件,你應該下載原始碼後 build 此套件。詳情可參考[官方 wiki 頁面](https://google-cartographer-ros.readthedocs.io/en/latest/#building-installation)。 [Remote PC] ``` $ sudo apt update $ sudo apt install -y python3-wstool python3-rosdep ninja-build stow $ cd ~/catkin_ws/src $ wstool init src $ wstool merge -t src https://raw.githubusercontent.com/cartographer-project/cartographer_ros/master/cartographer_ros.rosinstall $ wstool update -t src $ sudo rosdep init $ rosdep update $ rosdep install --from-paths src --ignore-src --rosdistro=noetic -y $ src/cartographer/scripts/install_abseil.sh $ sudo apt remove ros-noetic-abseil-cpp $ catkin_make_isolated --install --use-ninja ``` 2. 啟動 Cartographer SLAM node [Remote PC] ``` $ source ~/catkin_ws/install_isolated/setup.bash $ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartographer ``` - **Karto** ([ROS Wiki](http://wiki.ros.org/slam_karto),[Github](https://github.com/ros-perception/slam_karto)) 1. 在 Remote PC 安裝相關套件。 [Remote PC] ``` $ sudo apt install ros-noetic-slam-karto ``` 2. 啟動 Karto SLAM node [Remote PC] ``` $ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=karto ``` ::: ## 4.2. 執行遙控 Teleoperation Node 一旦 SLAM node 成功執行,TB3 就可使用遙控 teleoperation,開始對未知區域繪製地圖。此時避免機器人做出劇烈的移動很重要,比如直線速度變化太快,或旋轉太快。使用機器人繪製地圖時,機器人最好能掃描,地圖環境內的每個角落。它需要一些經驗來建立一個乾淨的地圖,所以我們需要多次練習 SLAM,以學習建圖技巧。 1. 在 Remote PC 開新 terminal 執行 teleoperation node。TURTLEBOT3_MODEL 參數需對應好 - burger,waffle,waffle_pi [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch Control Your TurtleBot3! --------------------------- Moving around: w a s d x w/x : increase/decrease linear velocity a/d : increase/decrease angular velocity space key, s : force stop CTRL-C to quit ``` 2. 開始探索及繪製地圖 ![](https://i.imgur.com/U5daA9T.png) ## 4.3. 微調指南 對不同的環境,Gmapping 可有許多參數來改變其效能。你可以在 [ROS Wiki](http://wiki.ros.org/gmapping) 網頁了解全部的參數,或參考 ROS Robot Programming 書的 Chapter 11 章。 本節微調指南會提供一些提示,供你配置一些重要參數。如果你想改變 SLAM 效能則會取決於你的環境,這些提示可能會幫助你並節省你的時間。 以下參數定義於 turtlebot3_slam/config/gmapping_params.yaml 檔內 ### 4.3.1. **maxUrange** 此參數設定光達最大可用範圍 ### 4.3.2. **map_update_interval** 此參數定義地圖更新的時間(以秒為單位)。如果此值設置越小,地圖更新頻率會更頻繁,此時電腦就需要更大的計算量。設置這個參數取決於你的環境。 ![](https://i.imgur.com/FDMg0C5.png) ### 4.3.3. **minimumScore** 此參數設定感測器掃描數據匹配結果,是成功或失敗的最小分數值。這可以減少機器人在大區域範圍內的預期位置的誤差。如果設置適當,可以看到以下類似資訊。 ``` Average Scan Matching Score=278.965 neff= 100 Registering Scans:Done update frame 6 update ld=2.95935e-05 ad=0.000302522 Laser Pose= -0.0320253 -5.36882e-06 -3.14142 ``` 如果設置太高,則會看到下列警示 ``` Scan Matching Failed, using odometry. Likelihood=0 lp:-0.0306155 5.75314e-06 -3.14151 op:-0.0306156 5.90277e-06 -3.14151 ``` ### 4.3.4. **linearUpdate** 當機器人移動多遠掃描一次 ### 4.3.5. **angularUpdate** 當機器人轉動多大時掃描一次。最好設數值小於 linearUpdate 較佳。 ## 4.4. 儲存地圖 地圖會根據機器人移動時的 odometry 測距數據,tf,及感測器掃描的資訊來建圖。當 TB3 移動時,地圖數據會呈現在 RViz 視窗。在建好所需區域的完整地圖後,將地圖資料儲存在硬碟以備後續使用。 1. 啟用在 map_server package 中的 map_saver node 來產生地圖檔。地圖檔會儲存在 map_saver node 所在的資料夾。除非另外命名,map 是預設的地圖檔名,會產生 map.pgm 及 map.yaml 兩個檔。 [Remote PC] ``` $ rosrun map_server map_saver -f ~/map ``` : -f 選項是用來指定資料夾位置以及要儲存的檔名。以上的指令是指 map.pgm 及 map.yaml 檔,會被儲存在 home 資料夾 ~/ (e.g., /home/${username}). ## 4.5. 地圖 地圖是 ROS 社群中常用的二維 **Occupancy Grid Map(OGM)** 地圖。儲存的地圖大略如下圖所示,**白色**是機器人可以移動的空白區域,**黑色**是機器人不能移動的佔用區域,**灰色**則是未知區域。地圖可在 Chap.5 Navigation 導航中使用。 ![](https://i.imgur.com/NKeh7u8.png) 下圖顯示了使用 TurtleBot3 創建大型地圖的結果。花了大約一個小時才製作出一幅移動距離約為 350 公尺的地圖。 ![](https://i.imgur.com/RfsuCzp.png) # **5. Navigation 導航** --- :::warning **警示**:此節 TB3 執行指令後會移動及旋轉,請將機器人放置在安全的地面 ::: :::info **備註**: - 請在 Remote PC 執行 Navigation。 - 在執行任何操作前,請先 Bringup 啟動 TB3。 - 導航需要使用 SLAM 產生的地圖。請確認有地圖數據。 ::: **Navigation 導航**可以在一個給定的環境中,將機器人從一個位置移動到指定目的地。為此,地圖必需要包含給定環境中的家具,物體和牆壁的幾何信息。如前面的 SLAM 章節所述,地圖則是由感測器得到的距離訊息,和機器人本身的方位訊息來創建。 Navigation 導航功能讓機器人能夠通過使用圖資、機器人編碼器、IMU 感測器、和距離感測器等,從當前的方位,移動到地圖上指定的目標方位。執行此任務的過程如下節所述。 ## 5.1. 執行 Navigation node 1. 從 Remote PC 執行 roscore。如已執行可跳過此步驟。 [Remote PC] ``` $ roscore ``` 2. TB3 SBC 執行(Bringup)基本套件來開始 TB3 應用。如以執行可跳過此步驟 - 在 Remote PC 開新的 terminal (Ctrl + Alt + T),連上 SBC 的 IP address。預設密碼是 turtlebot - TURTLEBOT3_MODEL 的參數需設定 burger, waffle, 或 waffle_pi。 [Remote PC] ``` $ ssh ubuntu@{IP_ADDRESS_OF_RASPBERRY_PI} $ export TURTLEBOT3_MODEL=${TB3_MODEL} $ roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` 3. 啟動 Navigation 節點。 [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml ``` 補充資料 :::info **如何儲存 TURTLEBOT3_MODEL 參數?** 如果在 .bashrc 檔內 TURTLEBOT3_MODEL 參數已預設好,那 $ export TURTLEBOT3_MODEL=${TB3_MODEL} 指令可以忽略。 開新的 terminal 時, .bashrc 檔會自動載入 - 定義 TB3 Burger 為預設模型 ``` $ echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc $ source ~/.bashrc ``` - 定義 TB3 Waffle Pi 為預設模型 ``` $ echo 'export TURTLEBOT3_MODEL=waffle_pi' >> ~/.bashrc $ source ~/.bashrc ``` ::: ## 5.2. 估計 Initial Pose 初始方位 **Initial Pose Estimation** 必須在跑 Navigation 之前就執行,因為這個程序會初始化 AMCL 參數,這在進行 Navigation 時很重要。TurtleBot3 必須正確定位在地圖上,LDS 感測器數據要與顯示的地圖正確地重疊。 1. 點擊 RViz 選單的 2D Pose Estimate 鍵 ![](https://i.imgur.com/TExqd9f.png) 2. 在地圖上點擊真正機器人的所在位置,拉出大的綠色箭號指向機器人正面的方向。 3. 重複步驟 1 跟 2,直到 LDS 感測器的數據跟儲存地圖正確的重疊。 ![](https://i.imgur.com/FT0c7LM.png) 4. 啟動 keyboard teleoperation node 以便準確定位在地圖上的機器人位置 [Remote PC] ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 5. 來回一點一點移動機器人,以收集周圍環境資訊,來縮小 TurtleBot3 在地圖上的估計位置,地圖上是以小的綠色箭頭來顯示 TB3。 ![](https://i.imgur.com/X3Dq64y.png) ![](https://i.imgur.com/H9R3zpy.png) 6. 按 Ctrl + C 來結束 keyboard teleoperation node,這可以防止在導航期間,從多個節點發布不同的 cmd_vel 值。 ## 5.3. Set Navigation Goal 設定導航目標 1. 在 RViz 選單點擊 2D Nav Goal 鍵 ![](https://i.imgur.com/eV0DgMc.png) 2. 在地圖上點擊來設定機器人的目的地,並拉出綠色箭號,作為機器人抵達目的地後要面對的方向 - 綠色箭號是一個 marker 標記,是指定機器人的目的地 - 箭頭的根部是機器人目的地的 x 和 y 座標位置,箭頭指向的方位,則決定機器人的 theta (θ) 角度。 - 當 x, y, θ 都決定後,TB3 就會開始往目的地移動。 ![](https://i.imgur.com/sEYo8RI.jpg) {%youtube VYlMywwYALU %} :::info **備註**: 手冊中的影片內容可能隨時更新,恕不另行通知。 ::: 補充資料 :::info 有關 **Navigation**的詳細資訊 - 機器人會依據 global path planner 產生到達 Navigation Goal 目的地的路徑,並依路徑移動。如果路徑上碰到障礙物,Navigation 會使用 local path planner 來避開障礙物。 - 如果不能產生到達 Navigation Goal 目的地的路徑時,則會造成 Navigation Goal 設定失敗。如果在機器人到達目的地前,要停止機器人移動,可以將 TB3 當前位置設為 Navigation Goal 即可。 - [官方 ROS Navigation Wiki](http://wiki.ros.org/navigation) ::: ## 5.4. Tuning 微調指南 對不同的機器人,Navigation 程序內有許多參數可用來改變其效能。 你可以在 [ROS Navigation Wiki 網頁](http://wiki.ros.org/navigation),[Basic Navigation Tuning Guide](http://wiki.ros.org/navigation/Tutorials/Navigation%20Tuning%20Guide),[ROS Navigation Tuning Guide by Kaiyu Zheng](http://kaiyuzheng.me/documents/navguide.pdf) 了解全部的參數,或參考 ROS Robot Programming 書的 Chapter 11 章。 本微調指南提供一些提示,供你配置重要參數。如果你想改變效能則會取決於你的環境,這些提示可能會幫助你並節省你的時間。 ### 5.4.1. **inflation_radius** - 定義於 turtlebot3_navigation/param/costmap_common_param_${TB3_MODEL}.yaml - 這個參數可把障礙物,放大為一個膨脹區域,而在規劃路徑時,機器人不會穿過此膨脹區域。將此值設置為比機器人半徑大是比較保險的。要了解更多訊息,請參閱[costmap_2d wiki 網頁](http://wiki.ros.org/costmap_2d#Inflation)。 ![](https://i.imgur.com/R7BPyR0.png) ### 5.4.2. **cost_scaling_factor** - 定義於 turtlebot3_navigation/param/costmap_common_param_${TB3_MODEL}.yaml - 此因子是一個反比的參數,會用來乘以 cost 值。所以如這個參數增加,所產生的 cost 值就會降低。 ![](https://i.imgur.com/CpHcjRA.png) 最好的路徑是讓機器人穿過障礙物之間的中心處。可將此因子設置的比較小,以遠離障礙物。 ### 5.4.3. **max_vel_x** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 此因子被設定為平移速度的最大值。 ### 5.4.4. **min_vel_x** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 此因子被設定為平移速度的最小值。如果設為負值,機器人可以向後移動。 ### 5.4.5 **max_trans_vel** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 最大平移速度的允許值。機器人不能快於此值。 ### 5.4.6. **min_trans_vel** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 最小平移速度的允許值。機器人不能慢於此值。 ### 5.4.7. **max_rot_vel** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 最大旋轉速度的允許值。機器人旋轉不能快於此值。 ### 5.4.8. **min_rot_vel** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 最小旋轉速度的允許值。機器人旋轉不能慢於此值。 ### 5.4.9. **acc_lim_x** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 平移加速度的限制值。 ### 5.4.10. **acc_lim_theta** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 旋轉加速度的限制值。 ### 5.4.11. **xy_goal_tolerance** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 當機器人到達目標方位時,所允許的 x,y 距離誤差。 ### 5.4.12. **yaw_goal_tolerance** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 當機器人達到其目標方位時,所允許的 yaw 偏航角度誤差。 ### 5.4.13. **sim_time** - 定義於 turtlebot3_navigation/param/dwa_local_planner_params_${TB3_MODEL}.yaml - 此因子是以秒為單位,設定前向模擬時間(forward simulation)。值設太低,機器人會不容易通過狹窄地區。值設太高則會限制動態轉向。你可以在下圖中看到,黃色線所代表模擬路徑的差異。 ![](https://i.imgur.com/TqbKBEi.png) # **6. Simulation 模擬** --- :::info Note: - 請在 Remote PC 上跑 Simulation - 第一次跑 Simulation 時,會花比較長的時間來設定環境 ::: 補充資料 :::success TurtleBot3 支持模擬開發環境,可以在模擬中使用虛擬機器人進行編程開發。有兩種開發環境可以做到這一點,一種是使用**帶有 3D 可視化工具 RViz 的假節點 fake node**;另一種是使用 **3D 機器人模擬器 Gazebo**。 - **假節點 fake node** 適合用來測試機器人模型和移動,但它不支援感測器。 - 如果需要執行 SLAM 或 Navigation,**Gazebo** 會是一個可行的解決方案,因為它支持 IMU、LDS 和攝影機等感測器。 在本教程中,將主要介紹在 ROS 開發人員中使用最廣泛的 Gazebo 模擬器。 - [**Gazebo 教學**](http://gazebosim.org/tutorials) ::: ## 6.1. Gazebo Simulation {%youtube UzOoJ6a_mOg %} :::info **備註**: 手冊中的影片內容可能隨時更新,恕不另行通知。 ::: Gazebo Simulation 使用 ROS Gazebo package,因此必須事先安裝支援 ROS1 Noetic 的 Gazebo 版本。 ### 6.1.1. 安裝 Simulation Package **TurtleBot3 Simulation Package** 需要 turtlebot3 及 turtlebot3_msgs packages 為先決條件。沒有這兩個 packages,無法啟動 Simulation。 如果還沒有安裝所需 packages,可參照 Remote PC 設定章節來安裝。 [Remote PC] ``` $ cd ~/catkin_ws/src/ $ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git $ cd ~/catkin_ws && catkin_make ``` ### 6.1.2. 啟動 Simulation World 世界地圖 TB3 有三種模擬的世界地圖可選擇。啟動 Gazebo 時可以任選其一。 :::info 啟動一個新的世界地圖前,需確認完全關閉前一個地圖 ::: 1. Empty World 空白世界地圖 ![](https://i.imgur.com/iAaFFfd.png) [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch ``` 2. TurtleBot3 World TB3 世界地圖 ![](https://hackmd.io/_uploads/B1WJNnT4T.png) [Remote PC] ``` $ export TURTLEBOT3_MODEL=waffle $ roslaunch turtlebot3_gazebo turtlebot3_world.launch ``` 3. TurtleBot3 House 房屋地圖 ![](https://i.imgur.com/bK9B8a9.png) [Remote PC] ``` $ export TURTLEBOT3_MODEL=waffle_pi $ roslaunch turtlebot3_gazebo turtlebot3_house.launch ``` :::info **備註**: 如果首次執行 TurtleBot3 House 房屋地圖,則下載地圖文件需要幾分鐘或更長時間,具體取決於網路速度 ::: ### 6.1.3. 操作 TB3 要使用鍵盤來控制 TB3,需在新的 terminal 啟動 teleoperation node [Remote PC] ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 補充資料 :::success **如何執行自動避障** 在 TB3 packages 中已包含一個簡單的 collision avoidance node,來讓機器人與障礙物保持安全距離,並轉向避免碰撞。 要在 TurtleBot3 World 世界地圖模擬內自動駕駛 TB3,請依照以下說明操作 1. Ctrl + C 結束 turtlebot3_teleop_key node,關閉 teleop node 2. 在 terminal 輸入指令 [Remote PC] ``` $ roslaunch turtlebot3_gazebo turtlebot3_simulation.launch ``` ::: :::success **如何可視化 Simulation data(RViz)?** 當 simulation 進行時,RViz 可以看到已公布的 topics。在新的 terminal 啟動 RViz。 [Remote PC] ``` $ roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch ``` ![](https://i.imgur.com/MYLjIjb.png) ::: ## 6.2. SLAM 模擬 執行 Gazebo 模擬器,可在世界地圖中用虛擬機器人來進行 SLAM 模擬,而無須使用實體的機器人來實作。在 Gazebo 中,你可以選擇上面提到的各種地圖環境,和不同的機器人模型來進行模擬,用 SLAM 模擬跟用 TB3 實作 SLAM 會很相似。 下列操作會需要之前章節為先決條件,請回看 Simulation 章節內容。 ### 6.2.1. 開啟 Simulation World 世界地圖 Gazebo 有三個地圖可開啟,但因要 SLAM 來建地圖,建議使用 **TurtleBot3 World** 或 **TurtleBot3 House** 地圖。 使用下列指令來開啟地圖,此範例載入 TurtleBot3 World 世界地圖。也需注意 TURTLEBOT3_MODEL 所對應的參數 burger, waffle, waffle_pi [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_gazebo turtlebot3_world.launch ``` 補充資料 :::success **如何載入 TurtleBot3 House 地圖** ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_gazebo turtlebot3_house.launch ``` ::: ### 6.2.2. 執行 SLAM Node 在 Remote PC 開新 terminal(Ctrl + Alt + T) 並跑 SLAM node。預設是使用 Gmapping SLAM 方法。也需注意 TURTLEBOT3_MODEL 所對應的參數 burger, waffle, waffle_pi [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping ``` ### 6.2.3. 執行 Teleoperation Node 在 Remote PC 開新 terminal(Ctrl + Alt + T) 並跑 teleoperation node。也需注意 TURTLEBOT3_MODEL 所對應的參數 burger, waffle, waffle_pi [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch Control Your TurtleBot3! --------------------------- Moving around: w a s d x w/x : increase/decrease linear velocity a/d : increase/decrease angular velocity space key, s : force stop CTRL-C to quit ``` ### 6.2.4. 儲存地圖 當地圖成功產生後,在 Remote PC 開新 terminal(Ctrl + Alt + T) 並儲存地圖 ![](https://i.imgur.com/JZK7zZ5.png) [Remote PC] ``` $ rosrun map_server map_saver -f ~/map ``` ![](https://i.imgur.com/Q5ozbRR.png) 所儲存的 map.pgm 檔 ## 6.3. Navigation Simulation 模擬導航 就如在 Gazebo 模擬器跑虛擬 SLAM,你也可以進行虛擬導航 virtual Navigation,而無須使用實體的機器人來實作。當然在跑 virtual Navigation 前,必須準備好合適的地圖環境。虛擬導航跟實作會很相似。 ### 6.3.1. 開啟模擬的世界地圖 :::info Ctrl + C 來結束之前章節開啟的全部應用 ::: 在之前 SLAM 章節使用 TurtleBot3 World 地圖來建地圖。相同的 Gazebo 環境也被用在模擬 Navigation。一樣要注意所使用的 TURTLEBOT3_MODEL 參數- burger, waffle, waffle_pi。 [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_gazebo turtlebot3_world.launch ``` 補充資料 :::success **如何載入 TurtleBot3 House 地圖** [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_gazebo turtlebot3_house.launch ``` ::: ### 6.3.2. 執行 Navigation Node 在 Remote PC 開新 terminal(Ctrl + Alt + T) 並跑 Navigation node。 [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml ``` ### 6.3.3. 估計 Initial Pose 初始方位 **Initial Pose Estimation**必須在跑 Navigation 之前就執行,因為這個程序會初始化 AMCL 參數,這些參數對進行正確的 Navigation 很重要。TurtleBot3 必須正確定位在地圖上,LDS 光達數據需與顯示的地圖要整齊地重疊。 1. 點擊 RViz 選單的 2D Pose Estimate 鍵 ![](https://i.imgur.com/TExqd9f.png) 2. 在地圖上點擊真正機器人的所在位置,拉出大的綠色箭號指向機器人正面的方向。 3. 重複步驟 1 跟 2,直到 LDS 感測器的數據跟儲存地圖正確的重疊。 ![](https://i.imgur.com/FT0c7LM.png) 4. 啟動 keyboard teleoperation node,以便準確定位在地圖上的機器人位置 [Remote PC] ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 5. 一點一點來回移動機器人,以收集周圍環境資訊,來縮小 TurtleBot3 在地圖上的估計位置,在地圖上是以微小的綠色箭頭顯示 TB3。 ![](https://i.imgur.com/X3Dq64y.png) ![](https://i.imgur.com/H9R3zpy.png) 6. 在 teleop node terminal 上按 Ctrl + C 來結束 keyboard teleoperation node,這可以防止在導航期間,從多個節點發布不同的 cmd_vel 值。 ### 6.3.4. Set Navigation Goal 設定導航目標 1. 在 RViz 選單點擊 2D Nav Goal 鍵 ![](https://i.imgur.com/eV0DgMc.png) 2. 在地圖上點擊來設定機器人的目的地,並拉出綠色箭號,其指向則是機器人抵達目的地後要面對的方向 - 綠色箭號是指定機器人目的地的一個標記 - 箭頭的根部是機器人目的地的 x 和 y 座標位置,箭頭指向的方位決定機器人的 theta (θ) 角。 - 當 x, y, θ 都決定後,TB3 就會開始往目的地移動。 ![](https://i.imgur.com/sEYo8RI.jpg) {%youtube VYlMywwYALU %} :::info **備註**: 手冊中的影片內容可能隨時更新,恕不另行通知。 ::: ## 6.4. Fake Node Simulation {%youtube iHXZSLBJHMg %} :::info **備註**: 手冊中的影片內容可能隨時更新,恕不另行通知。 ::: 要使用 turtlebot3_fake_node,你需要安裝 turtlebot3_simulation 套件。按照以下指示安裝套件。 :::success **提示**:Ubuntu 的 Terminal (終端機)可以在螢幕左上方的 Search 圖示找到. 快捷鍵可以使用 Ctrl-Alt-T. ::: :::info **備註**:turtlebot3_simulation 套件需要事先安裝 turtlebot3 套件和 turtlebot3_msgs 套件作為先決條件。如果你沒有在 PC Setup 設定章節中安裝先決套件,請先安裝此 2 個先決套件。 ::: [Remote PC] ``` $ cd ~/catkin_ws/src/ $ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git $ cd ~/catkin_ws && catkin_make ``` 要啟動虛擬機器人,請執行 turtlebot3_fake 套件中的 turtlebot3_fake.launch 檔,如下所示。 turtlebot3_fake 是一個非常簡單的模擬節點,可以在沒有實體機器人的情況下,來模擬機器人運行。你甚至可以在 RViz 工具中,用 teleoperation node 遙控節點來遙控虛擬的 TurtleBot3 機器人。 須注意對應的 TURTLEBOT3_MODEL 參數- burger, waffle, waffle_pi [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_fake turtlebot3_fake.launch ``` [Remote PC] ``` $ export TURTLEBOT3_MODEL=burger $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` ## 6.5. 單獨的 Gazebo 模擬 :::info 此特色只支援 Kinetic 版 ::: # **7. Manipulation 機器手臂** --- :::info **備註**: - 操作的內容已在 Ubuntu 20.04 及 ROS1 Noetic Ninjemys 版本上測試過。 - 如要了解更多 OpenManipulator-X 機器手臂資訊,請參考 [OpenManipulator-X 線上手冊(英)](https://emanual.robotis.com/docs/en/platform/openmanipulator_x/overview/) ::: :::warning - 此手冊內容如有更新變動,不會預先通知。 ::: :::success **提示**:Ubuntu 的 Terminal (終端機)可以在螢幕左上方的 Search 圖示找到. 快捷鍵可以使用 Ctrl-Alt-T. ::: ## 7.1. TurtleBot3 跟 OpenManipulator-X 機器手臂 跟 Kinetic 相同,請參考 Kinetic 內容 ## 7.2. 手臂軟體設定 :::info **備註**:在安裝 turtlebot3_manipulation 套件之前,請確認先前已經在 RemotePC(桌電或筆電),安裝了 turtlebot3 和 open_manipulator 套件。 ::: 1. 在 Remote PC 上下載,build OpenManipulator 相關套件,以便後續手臂組裝後使用 [Remote PC] ``` $ cd ~/catkin_ws/src/ $ git clone https://github.com/ROBOTIS-GIT/turtlebot3_manipulation.git $ git clone https://github.com/ROBOTIS-GIT/turtlebot3_manipulation_simulations.git $ git clone https://github.com/ROBOTIS-GIT/open_manipulator_dependencies.git $ sudo apt install ros-noetic-ros-control* ros-noetic-control* ros-noetic-moveit* $ cd ~/catkin_ws && catkin_make ``` - 如果 catkin_make 完成沒有錯誤,OpenManipulator 套件就安裝成功。你就可以在 RViz 載入搭載有 OpenManipulator-X 手臂的 TB3 Waffle or TB3 Waffle Pi 模型。 ``` $ cd ~/catkin_ws && catkin_make $ cd ~/catkin_ws/src/ $ git clone https://github.com/ROBOTIS-GIT/open_manipulator_with_tb3.git $ git clone https://github.com/ROBOTIS-GIT/open_manipulator_with_tb3_msgs.git $ git clone https://github.com/ROBOTIS-GIT/open_manipulator_with_tb3_simulations.git $ git clone https://github.com/ROBOTIS-GIT/open_manipulator_perceptions.git $ sudo apt-get install ros-melodic-smach* ros-melodic-ar-track-alvar ros-melodic-ar-track-alvar-msgs $ cd ~/catkin_ws && catkin_make ``` ## 7.3. 手臂硬體組裝 - [CAD 檔](http://www.robotis.com/service/download.php?no=767) for (TurtleBot3 Waffle Pi + OpenMANIPULATOR) ![](https://i.imgur.com/uuJYUEI.png) - 首先拆下 LDS-01 or LDS-02 光達並將其移到 TurtleBot3 的前半部(紅圈代表螺絲的建議位置)。 - 接著在 TurtleBot3 上安裝 OpenManipulator-X 手臂(黃色圓圈表示螺絲的建議位置)。 ![](https://i.imgur.com/Lmu2YDc.png) ![](https://i.imgur.com/Uan7SJU.png) TurtleBot3 Waffle Pi + OpenMANIPULATOR-X 組合示意圖 ## 7.4. OpenCR 控制板設定 :::info **備註**:要使用 OpenManipulator-X 機器手臂,需要先上傳韌體到 OpenCR,你可以選擇任一種上傳韌體的方法(shell script 或 Arduino IDE)。但我們強烈建議使用 **shell script 腳本**。 如果需要修改 TurtleBot3 的韌體,則可以使用第二種方法。 - 方法 1:[Shell script 腳本](https://emanual.robotis.com/docs/en/platform/turtlebot3/manipulation/#shell-script),使用 shell script 腳本上傳預建好的二進位檔。 - 方法 2:[Arduino IDE](https://emanual.robotis.com/docs/en/platform/turtlebot3/manipulation/#arduino-ide),build 原始碼並使用 Arduino IDE 上傳生成的二進位檔。 OpenCR Arduino board manager 不支援 Arm-based 的處理器,如 Raspberry or Jetson Nano。故建議在 PC 上操作。 ::: :::warning **警示**:在進行上傳韌體到 OpenCR 前,請確保所有 DYNAMIXEL 智能馬達都已連接到 OpenCR 控制板。 否則,樹莓派可能會出現意外問題。 ::: 將 OpenManipulator-X 手臂安裝到 TB3 後,需要上傳控制手臂馬達的韌體到 OpenCR 板,請依照下列步驟。 1. TB3 SBC 端: 下載 OpenCR 韌體到 SBC 樹莓派,及用下列指令上傳正確的韌體 [TurtleBot3 SBC] ``` $ export OPENCR_PORT=/dev/ttyACM0 $ export OPENCR_MODEL=om_with_tb3_noetic $ rm -rf ./opencr_update.tar.bz2 $ wget https://github.com/ROBOTIS-GIT/OpenCR-Binaries/raw/master/turtlebot3/ROS1/latest/opencr_update.tar.bz2 $ tar -xvf opencr_update.tar.bz2 $ cd ./opencr_update $ ./update.sh $OPENCR_PORT $OPENCR_MODEL.opencr ``` 2. 當上傳完成,你會看到 terminal 上出現 **jump_to_fw** 的字串。 :::danger **注意身體位置,以防止被關節夾傷** 當韌體上傳成功,OpenCR 板會重開機,OpenManipulator-X 手臂會移動到初始姿態。建議你將手臂先擺放跟下圖類似的姿態,避免手臂初始化時,會跟身體部位做碰觸。 ![](https://i.imgur.com/hBSACtG.png) ::: ### 7.4.1. 使用 Arduino IDE 來上傳韌體 :::info OpenCR board manager 並不支援 ARM based SBC 的 Arduino IDE,如樹莓派 或 NVidia Jetson。 請在 PC 上用 Arduino IDE 來上傳韌體。 ::: 補充資料 使用 Arduino IDE 來上傳韌體的細節 1. 如 PC 的 OS 是 Linux,下列指令設定 OpenCR 的 USB port。如果其他 OS(OSX or Windows),可跳過此步驟。 ``` $ wget https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/99-opencr-cdc.rules $ sudo cp ./99-opencr-cdc.rules /etc/udev/rules.d/ $ sudo udevadm control --reload-rules $ sudo udevadm trigger $ sudo apt install libncurses5-dev:i386 ``` 2. 安裝 Arduino IDE - [下載最新的 Arduino IDE](https://www.arduino.cc/en/software) 3. 安裝好後,執行 Arduino IDE 4. 按 Ctrl + , 來打開 Preferences menu 5. 在 Additional Boards Manager URLs 輸入下列位址 ``` https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.json ``` ![](https://i.imgur.com/zcRVecI.png) 6. 打開 TurtleBot3 with OpenMANIPULATOR 韌體。因你的平台選擇對應的韌體。 - TurtleBot3 with OpenMANIPULATOR : **File > Examples > turtlebot3 > turtlebot3_with_open_manipulator > turtlebot3_with_open_manipulator_core** 7. 在 turtlebot3_with_open_manipulator_core.h 檔案內,取消 #define NOETIC_SUPPORT 的註釋,然後儲存為不同檔名 8. 連接 OpenCR 板到 PC 上,從 Tools > Board 選單選擇 OpenCR > OpenCR Board 9. 從 Tools > Port 選單中選擇連接 OpenCR 的 USB port 10. upload 圖示或 Ctrl+U 來上傳韌體 ![](https://i.imgur.com/S3zNgU6.png) ![](https://i.imgur.com/fxp7cNS.png) 10. 如果上傳失敗,可以嘗試在 recovery mode 下重新上傳韌體。OpenCR 的 recovery mode 啟動順序如下。在 recovery mode 時,OpenCR 的 STATUS led 燈會定時的閃爍。 - 按住 PUSH SW2 鍵 - 按一下 Reset 鍵 - 然後鬆開 Reset 鍵 - 再鬆開 PUSH SW2 鍵 ![](https://i.imgur.com/ZilkkEU.png) ## 7.5. Bringup 啟動 TB3 與機器手臂 :::info **備註**:請先確認 [turtlebot3_core.launch](https://github.com/ROBOTIS-GIT/turtlebot3/blob/467c76bc4fa2e34162f57107388839d82d3bcc0e/turtlebot3_bringup/launch/turtlebot3_core.launch#L5) 檔內的 OpenCR usb port name,已正確指派給 PC ::: ### 7.5.1. 執行 roscore 在 Remote PC 新開 terminal 執行 roscore [Remote PC] ``` $ roscore ``` ### 7.5.2. 定義 TurtleBot3 Model 在 TB3 SBC 新開 terminal,輸出 TURTLEBOT3_MODEL 參數,waffle or waffle_pi 到 .bashrc 檔內 [TurtleBot3 SBC] ``` $ export TURTLEBOT3_MODEL=waffle_pi ``` ### 7.5.3. 啟動 TB3 在 TB3 SBC,啟動 TB3,開始 rosserial 及 LDS sensor [TurtleBot3 SBC] ``` $ roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` ## 7.6. 模擬 此節使用 Gazebo 模擬器來模擬 TB3 與機器手臂 ### 7.6.1. 執行 Gazebo 在 Gazebo 模擬器內載入 TB3 with OpenManipulator-X 的檔案 [Remote PC] ``` $ roslaunch turtlebot3_manipulation_gazebo turtlebot3_manipulation_gazebo.launch ``` ![](https://i.imgur.com/bdUDx22.png) ### 7.6.2. 執行 move_group node 要能夠使用 Moveit 功能,需啟動 move_group node。使用下列指令開啟 Gazebo,點擊 [▶] 鍵來開始模擬。如果啟動成功,會出現 “You can start planning now!” 訊息。 [Remote PC] ``` $ roslaunch turtlebot3_manipulation_moveit_config move_group.launch ``` ### 7.6.3. 執行 RViz 讀取 moveit.rviz 檔後,就可以在 RViz 內使用 MoveIt 功能。moveit.rviz 檔是用來設置 MoveIt 環境。 你可以使用 interactive marker 來控制已安裝的機器手臂,並模擬手臂移動到 goal position,這有助於通過事前的手臂模擬移動,來防止可能的實際性接觸。 [Remote PC] ``` $ roslaunch turtlebot3_manipulation_moveit_config moveit_rviz.launch ``` ![](https://i.imgur.com/mJC0Eo8.png) ### 7.6.4. 執行 ROBOTIS GUI Controller 圖形介面控制器 你也可以使用 ROBOTIS GUI 圖形介面在 Gazebo 內控制 OpenManipulator-X 機器手臂。GUI controller 支援 **Task Space Control** 及 **Joint Space Control** 兩種方式由你選擇。 - Task Space Control: 基於 OpenMANIPULATOR-X 末端執行器的有效夾取位置(表示為爪手之間的小紅色立方體)進行控制。 - Joint Space Control: 根據每個關節角度進行控制。 [Remote PC] ``` $ roslaunch turtlebot3_manipulation_gui turtlebot3_manipulation_gui.launch ``` ![](https://i.imgur.com/CTTz6PQ.png) ## 7.7. 操作實體的 OpenManipulator-X 手臂 請依照下列指示來操作 ### 7.7.1. 執行 roscore 在 ROS1 執行 roscore [Remote PC] ``` $ roscore ``` ### 7.7.2. 執行 Bringup 啟動 1. 在 TB3 SBC,執行 Bringup node 啟動 TB3,開始 rosserial 及 LDS sensor [TurtleBot3 SBC] ``` $ roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` 在 TB3 執行 OpenManipulator-X 的 Bringup 啟動套件 [Remote PC] ``` $ roslaunch turtlebot3_manipulation_bringup turtlebot3_manipulation_bringup.launch ``` ### 7.7.3. 執行 move_group node [Remote PC] ``` $ roslaunch turtlebot3_manipulation_moveit_config move_group.launch ``` ### 7.7.4. 執行 RViz 執行 RViz 來可視化觀看數據,及使用 interactive marker [Remote PC] ``` $ roslaunch turtlebot3_manipulation_moveit_config moveit_rviz.launch ``` ### 7.7.5. 執行 ROBOTIS GUI Controller 使用 ROBOTIS GUI Controller 取代 RViz tool 來控制機器手臂 [Remote PC] ``` $ roslaunch turtlebot3_manipulation_gui turtlebot3_manipulation_gui.launch ``` ## 7.8. SLAM :::info 與 Kinetic 版本相同 ::: ## 7.9. Navigation 導航 :::info 與 Kinetic 版本相同 ::: ## 7.10. TurtleBot3 Home Service Challenge 居家服務挑戰賽 :::info 備註: - 操作的內容已在Ubuntu 20.04 及 ROS1 Noetic Ninjemys 版本上測試過。 - 詳細資訊可參考 [OpenMANIPULATOR e-Manual](https://emanual.robotis.com/docs/en/platform/openmanipulator/) and [ROS1 Turtlebot3 Manipulation](https://emanual.robotis.com/docs/en/platform/turtlebot3/manipulation) - Home Service Challenge Noetic package 只在 Gazebo 模擬器模擬測試過 - 以後才會做實際 TB3 的測試 ::: ![](https://i.imgur.com/mQY3ATB.jpg) 居家服務挑戰賽場館及物品 {%youtube 3aZXpVsEi0c %} 宣傳影片 ### 7.10.1. 入門 :::warning Note: 在安裝 Home Service Challenge package 前務必先完成下列動作 - [TurtleBot3 PC Set up](https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/#pc-setup) - [TurtleBot3 SBC Set up](https://emanual.robotis.com/docs/en/platform/turtlebot3/sbc_setup/#sbc-setup) - [OpenMANIPULATOR-X packages](https://emanual.robotis.com/docs/en/platform/openmanipulator_x/quick_start_guide/#install-ros-packages) ::: #### 7.10.1.1. 先決條件 要參加此挑戰賽,需具有 - Remote PC - 在筆電或桌電安裝 ROS1 Noetic - 這個指南是基於 Gazebo 模擬,非實體操作 #### 7.10.1.2. Remote PC setup 1. 安裝 Home Service Challenge packages ``` $ cd ~/catkin_ws/src/ $ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_home_service_challenge.git $ git clone -b noetic-devel https://github.com/machinekoder/ar_track_alvar $ cd ~/catkin_ws && catkin_make ``` 2. 在 RViz 載入 TB3 Waffle(or Waffle Pi) with OpenManipulator-X 手臂 ``` $ export TURTLEBOT3_MODEL=${TB3_MODEL} $ roslaunch turtlebot3_manipulation_description turtlebot3_manipulation_view.launch use_gui:=true ``` :::info Note: ${TB3_MODEL} 可設為 waffle or waffle_pi ::: ![](https://i.imgur.com/dAvSRaq.png) RViz 視窗,${TB3_MODEL} 設為 waffle_pi ### 7.10.2. Camera Calibration 攝影機校準 :::info 此節是操作於實體機器人,Gazebo 不需要 ::: ### 7.10.3. SLAM :::info 此節是操作於實體機器人,Gazebo 不需要 ::: ### 7.10.4. Missions 任務 #### 7.10.4.1. 執行 demo and manager package 1. [**Remote PC**] 執行 Gazebo simulation ``` $ roslaunch turtlebot3_home_service_challenge_simulation competition.launch ``` 2. [**Remote PC**] 在 Gazebo 執行 simulation demo ``` $ roslaunch turtlebot3_home_service_challenge_tools turtlebot3_home_service_challenge_demo_simulation.launch ``` ![](https://i.imgur.com/0Dsuba1.png) 3. [**Remote PC**] 執行 manager package,是用來進行 Home Service 挑戰賽的任務 ``` $ roslaunch turtlebot3_home_service_challenge_manager manager.launch ``` #### 7.10.4.2. 指令 [**Remote PC**] 在挑戰賽時使用下列指令 - **Ready**: TB3 將準備開始一項任務 ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String ready_mission ``` - **Start**: TB3 將開始任務 ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String start_mission ``` - **Stop**: TB3 將停止執行任務 ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String stop_mission ``` - **Restart**: TB3 將在給定的 scenario 情境下,重新開始任務 ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String restart_mission:SCENARIO_NAME ``` :::info 當使用指令時,必須從 scenario.yaml 內包含一個情境。有關詳細 scenario 情境,可參考下面的 Configuration 設置章節 ::: #### 7.10.4.3. Operation Test 操作測試 [**Remote PC**] 發布下列 topics 來測試 navigation 導航跟 manipulation 機器手臂功能 - Navigation ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String nav_start ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/mission_start.gif) ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String nav_ar_marker_0 ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/mission_0.gif) ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String nav_ar_marker_1 ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/mission_1.gif) ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String nav_ar_marker_2 ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/mission_2.gif) ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String nav_ar_marker_3 ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/mission_3.gif) - Manipulation ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String arm_home ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/hsc_arm_home.gif) ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String arm_joint ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/hsc_arm_joint.gif) ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String arm_task ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/hsc_arm_task.gif) ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String open_gripper ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/hsc_open_gripper.gif) ``` $ rostopic pub -1 /tb3_hsc/command std_msgs/String close_gripper ``` ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/home_service_challenge/noetic/hsc_close_gripper.gif) #### 7.10.4.4. Configuration 設置 [**Remote PC**] 依據所給的環境,可修改設置檔內的資料 - scenario.yaml: 此檔案包含 scenario 情境資料 - 檔案路徑: /turtlebot3_home_service_challenge_manager/script/scenario.yaml - 腳本 script ``` SCENARIO_NAME: # start - scenario - finish task: TASK_NAME args: [0, 1, 2] timeout: 10 #sec, 0 : no time out next_scenario: find_object scenario_on_failure: standby retry_times: 0 #times, 0 : no retry ``` - room.yaml: 此檔案包含 Home Service 挑戰賽場地資訊 - 檔案路徑: /turtlebot3_home_service_challenge_manager/config/room.yaml - 腳本 script ``` room_1: name: toilet object: marker: ar_marker_0 position: [0.25, 0, 0.15] target: marker: ar_marker_4 position: [0.25, 0, 0.15] x: [1.5, 0.6] y: [1.5, 0.2] ``` - config.yaml: 此設定檔案包含 manager package 的資料 - 檔案路徑: /turtlebot3_home_service_challenge_manager/config/config.yaml #### 7.10.4.5. Home Service 挑戰賽任務細節 居家服務挑戰賽的目標,是按照給定的規則,將四個不同的物體,從客廳移動到特定的地方,然後返回起點。 使用 demo package,在挑戰賽中移動物體的流程如下: 1. 導航到客廳的一個目標 - 找到目標,然後使用 Navigation package 抵達目標 ![](https://i.imgur.com/oGnTOh8.png) 2. 接近目標 - 為了精確接近目標,TurtleBot3 輪子直接通過 AR marker 計算目標位置來控制。(使用的 topic: /tb3_hsc/cmd_vel)。為了產生可靠的效能,Closed-loop 和控制系統可以使用指定的次數。 ![](https://i.imgur.com/5cZZYFb.png) 3. 使用 OpenManipulator-X 爪夾抓取目標處物件 - 使用 moveit package 來抓取物件(Joint space control, Task space control 及 Gripper control) ![](https://i.imgur.com/ts0SYxx.png) moveit 流程圖 4. 離開到下個房間放置物件(使用的 topic: /tb3_hsc/cmd_vel) - 當從目標處往回走時,輪子由 mamager 程式使用 /tb3_hsc/cmd_vel topic 直接控制 5. 導航到要安置物件的目標處 - 找下一個目標,使用 Navigation package 抵達目標處 ![](https://i.imgur.com/OSVkZPo.png) 6. 接近目標 7. 使用爪手放置物件 8. 使用 Navigation package 回到起始點 ![](https://i.imgur.com/3j97U55.png) ### 7.10.5. 模擬 在 Gazebo 模擬器模擬 TB3附OpenManipulator-X 1. [**Remote PC**] 執行 Gazebo ``` $ roslaunch turtlebot3_home_service_challenge_simulation competition.launch ``` ![](https://i.imgur.com/hZ9apud.png) 2. [**Remote PC**] 在 Gazebo 跑 simulation demo ``` $ roslaunch turtlebot3_home_service_challenge_tools turtlebot3_home_service_challenge_demo_simulation.launch ``` ![](https://i.imgur.com/Qny1ECm.png) 3. [**Remote PC**] 執行 Home Service Manager ``` $ roslaunch turtlebot3_home_service_challenge_manager manager.launch ``` 4. 使用 Home Service Manager 指令(參考 7.10.4.2.) # **8. [ROS1] Automonous Driving 自駕車挑戰賽** --- ![](https://i.imgur.com/52GNGkx.jpg) AutoRace 是一個自動駕駛機器人平台的競賽。 ## 8.1. 開始準備 :::warning **備註**: - AutoRace package 主要是在 Ubuntu 20.04 及 ROS1 Noetic Ninjemys 版本上開發。 - AutoRace package 主要在 Gazebo 模擬器上模擬 - 要順利的模擬給定的範例,請看完 6. Simulation ::: :::info Tips: 如果有實體 TB3,你可以從 Autonomous Driving package 實作到 Lane Detection。細節可以參考每節後的'**補充資料**'內敘述。 ::: :::info **備註**: 手冊中的內容可能隨時更新,恕不另行通知。 ::: ### 8.1.1. 先決條件? **Remote PC 筆電/桌電** - 安裝 ROS1 Noetic - 本節內容主要是基於 Gazebo 模擬,故只需要電腦,但可以移植到實體 TB3 上實作 :::success 補充資料: ### 8.1.2. 要參加實體比賽需要的準備? **1. TurtleBot3 Burger 漢堡款** - 使用 AutoRace 套件包在 ROS 上進行自動駕駛的基礎款。 - AutoRace 套件包的開源碼是基於 TurtleBot3 Burger 開發的 **2. Remote PC 筆電/桌電** - 跟 TB3 的 SBC 單板電腦溝通 - 安裝 ROS 1 的筆電,桌電,或其他裝置 **3. Raspberry Pi 攝像機及固定架** - 你可以更換不同 camera 只要有支援 ROS - 用來校準 camera 的原始碼,是基於 [Fisheye Lens 魚眼鏡頭](https://www.waveshare.com/rpi-camera-g.htm)模組來開發 **4. AutoRace 比賽軌道及相關所需物件** - 從 [ROBOTIS_GIT / autorace](https://github.com/ROBOTIS-GIT/autorace_track) 下載 3D CAD 檔案用於製作 AutoRace 軌道,交通標誌,交通信號燈和其他物件。 - 從 [ROBOTIS-GIT/autorace_referee](https://github.com/ROBOTIS-GIT/autorace_referee) 下載裁判程式原始碼 ::: ### 8.1.3. 安裝 Autorace Package 套件包 1. [**Remote PC**] 安裝 AutoRace 2020 meta packages ``` $ cd ~/catkin_ws/src/ $ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_autorace_2020.git $ cd ~/catkin_ws && catkin_make ``` 2. [**Remote PC**] 安裝額外的相關套件 ``` $ sudo apt install ros-noetic-image-transport ros-noetic-cv-bridge ros-noetic-vision-opencv python3-opencv libopencv-dev ros-noetic-image-proc ``` :::success 補充資料: **在實體 TB3 安裝 Autorace Package** 以下步驟說明如何安裝 package 及校準 camera 1. 在 Remote PC 及 SBC 安裝 AutoRace 套件包 ``` $ cd ~/catkin_ws/src/ $ git clone -b feature-raspicam https://github.com/ROBOTIS-GIT/turtlebot3_autorace_2020.git $ cd ~/catkin_ws && catkin_make ``` 2. 在 SBC 安裝額外的相關套件 - 新增 swap 檔以防止 build OpenCV 時記憶體不足 ``` $ sudo fallocate -l 4G /swapfile $ sudo chmod 600 /swapfile $ sudo mkswap /swapfile $ sudo swapon /swapfile ``` - 安裝相關套件 ``` $ sudo apt-get update $ sudo apt-get install build-essential cmake gcc g++ git unzip pkg-config $ sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libavcodec-dev libavformat-dev libswscale-dev libgtk2.0-dev libcanberra-gtk* libxvidcore-dev libx264-dev python3-dev python3-numpy python3-pip libtbb2 libtbb-dev libdc1394-22-dev libv4l-dev v4l-utils libopenblas-dev libatlas-base-dev libblas-dev liblapack-dev gfortran libhdf5-dev libprotobuf-dev libgoogle-glog-dev libgflags-dev protobuf-compiler ``` - build with opencv 及 opencv_contrib ``` $ cd ~ $ wget -O opencv.zip https://github.com/opencv/opencv/archive/4.5.0.zip $ wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.5.0.zip $ unzip opencv.zip $ unzip opencv_contrib.zip $ mv opencv-4.5.0 opencv $ mv opencv_contrib-4.5.0 opencv_contrib ``` - 產生 cmake 檔 ``` $ cd opencv $ mkdir build $ cd build $ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ -D ENABLE_NEON=ON \ -D BUILD_TIFF=ON \ -D WITH_FFMPEG=ON \ -D WITH_GSTREAMER=ON \ -D WITH_TBB=ON \ -D BUILD_TBB=ON \ -D BUILD_TESTS=OFF \ -D WITH_EIGEN=OFF \ -D WITH_V4L=ON \ -D WITH_LIBV4L=ON \ -D WITH_VTK=OFF \ -D OPENCV_ENABLE_NONFREE=ON \ -D INSTALL_C_EXAMPLES=OFF \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D BUILD_NEW_PYTHON_SUPPORT=ON \ -D BUILD_opencv_python3=TRUE \ -D OPENCV_GENERATE_PKGCONFIG=ON \ -D BUILD_EXAMPLES=OFF .. ``` - 會花 1-2 hrs 來 build ``` $ cd ~/opencv/build $ make -j4 $ sudo make install $ sudo ldconfig $ make clean $ sudo apt-get update ``` - SBC 樹莓派關機,取出 microSD 卡,編輯在 system-boot section 的 config.txt,在 enable_uart=1 行之前加入 start_x=1 ``` $ sudo apt install ffmpeg $ ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 -ss 0:0:2 -frames 1 capture_test.jpg ``` - 再安裝額外相依套件 ``` $ sudo apt install ros-noetic-cv-camera ``` 3. [**Remote PC**] 安裝額外相依套件 ``` $ sudo apt install ros-noetic-image-transport ros-noetic-image-transport-plugins ros-noetic-cv-bridge ros-noetic-vision-opencv python3-opencv libopencv-dev ros-noetic-image-proc ros-noetic-cv-camera ros-noetic-camera-calibration ``` ::: ## 8.2. 攝影機校準 Calibration 校準 camera 是自動駕駛很重要的步驟,以下介紹如何簡單地逐步校準 camera。 ### 8.2.1. 攝影機影像校準 在 Gazebo 模擬不需要校準攝影機 :::success 補充資料: **在實體 TurtleBot3 上校準攝影機影像** 1. 在 Remote PC 啟動 roscore ``` $ roscore ``` 2. 在 SBC 啟用 camera ``` $ roslaunch turtlebot3_autorace_camera raspberry_pi_camera_publish.launch ``` 3. 在 Remote PC 上執行 rqt_image_view ``` $ rqt_image_view ``` ![](https://i.imgur.com/LYmtAQE.png) rqt 的影像視角 ::: ### 8.2.2. 攝影機內部參數校準 在 Gazebo 模擬不需要校準內部攝影機參數 :::success 補充資料: **如何在實體 TB3 做攝影機內部參數校準** 在 A4 尺寸的紙張上印出用於 Camera 內部參數校準的棋盤。 - 棋盤檔位於 turtlebot3_autorace_camera/data/checkerboard_for_calibration.pdf。 - 修改 turtlebot3_autorace_camera/launch/turtlebot3_autorace_intrinsic_camera_calibration.launch 內的參數值。 - camera 校準的詳細資訊,可參考 ROS Wiki 的 [Camera Calibration 手冊](http://wiki.ros.org/camera_calibration) \ ![](https://i.imgur.com/f55Axz8.png) \ 棋盤檔 1. 在 Remote PC 啟動 roscore ``` $ roscore ``` 2. 在 SBC 啟用 camera ``` $ roslaunch turtlebot3_autorace_camera raspberry_pi_camera_publish.launch ``` 3. 在 Remote PC 執行 camera 內部校準啟動檔 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch mode:=calibration ``` 4. 使用棋盤紙來校準 camera,點擊 CALIBRATE ![](https://i.imgur.com/lL27IN5.png) 5. 點擊 SAVE 來儲存校準後的資料 ![](https://i.imgur.com/riPFIkA.png) 6. 在 /tmp 資料夾下會新增一個 calibrationdata.tar.gz 資料夾 ![](https://i.imgur.com/rqT3vVN.png) 7. 從 calibrationdata.tar.gz 內抽取出 ost.yaml 檔 ![](https://i.imgur.com/Ysk6H5V.png) ost.yaml ![](https://i.imgur.com/KcLbw0u.png) 在 ost.yaml 檔的內部參數校準數據 8. 從 ost.yaml 內複製數據,貼上 camerav2_320x240_30fps.yaml 檔 ![](https://i.imgur.com/KKjiD6B.png) camerav2_320x240_30fps.yaml ![](https://i.imgur.com/HakTANp.png) 在 camerav2_320x240_30fps.yaml 內的內部參數校準數據 ::: ### 8.2.3. camera 外部參數校準 1. 在 Remote PC 開新的 terminal 啟動 Gazebo ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 2. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 3. 開新的 terminal 啟動外部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch mode:=calibration ``` 4. 在 Remote PC 執行 rqt ``` $ rqt ``` 5. 點擊 plugins > visualization > Image view,新增二個攝影機視角圖的視窗 6. 在兩個視窗分別選擇 /camera/image_extrinsic_calib/compressed topic 及 /camera/image_projected_compensated topic - 兩個視窗其中一個將顯示紅色梯形影像,另一個將顯示地面投影視圖(鳥瞰視圖)。 ![](https://i.imgur.com/2JbRpnf.png) 左圖 ..compressed topic,右圖 ..compensated topic 7. 在 Remote PC 上執行 rqt_reconfigure ``` $ rosrun rqt_reconfigure rqt_reconfigure ``` 8. 調整在 /camera/image_projection 和 /camera/image_compensation_projection 的參數 - 更改 /camera/image_projection 的參數,會影響 /camera/image_extrinsic_calib/compressed topic - 內部攝影機校準將會轉換被紅色梯形所包圍的影像 ![](https://i.imgur.com/MicGUT9.png) rqt_reconfigure 9. 之後覆寫調整的數值到 yaml 檔,位於 turtlebot3_autorace_camera/calibration/extrinsic_calibration/ 目錄下。這會儲存現有教準參數,以備之後載入。 ![](https://i.imgur.com/VZ3yKGj.png) turtlebot3_autorace_camera/calibration/extrinsic_calibration/compensation.yaml 檔 ![](https://i.imgur.com/hzSTLS2.png) turtlebot3_autorace_camera/calibration/extrinsic_calibration/projection.yaml 檔 :::success 補充資料: **如何在實體 TB3 做攝影機外部參數校準** 1. 在 Remote PC 啟動 roscore ``` $ roscore ``` 2. 在 SBC 啟用 camera ``` $ roslaunch turtlebot3_autorace_camera raspberry_pi_camera_publish.launch ``` 3. 在 Remote PC 輸入指令 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch mode:=action ``` 4. 在 Remote PC 執行 camera 外部校準啟動檔 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch mode:=calibration ``` 5. 在 Remote PC 執行 rqt ``` $ rqt ``` 6. 點擊 plugins > visualization > Image view,可以新增多個攝影機視角圖的視窗 7. 在兩個視窗分別選擇 /camera/image_extrinsic_calib/compressed topic 及 /camera/image_projected_compensated topic - 兩個視窗其中一個將顯示紅色矩形影像,另一個將顯示地面投影視圖(鳥瞰視圖)。 ![](https://i.imgur.com/ppHgi1c.png) 左圖 ..compressed topic,右圖 ..compensated topic 8. 在 Remote PC 上執行 rqt_reconfigure ``` $ rosrun rqt_reconfigure rqt_reconfigure ``` 9. 調整在 /camera/image_projection 和 /camera/image_compensation_projection 的參數 - 更改 /camera/image_projection 的參數,會影響 /camera/image_extrinsic_calib/compressed topic - 內部攝影機校準將會轉換被紅色矩形所包圍的影像,並顯示從車道上方所看到的影像 ![](https://i.imgur.com/0NPhSQz.png) rqt_reconfigure ![](https://i.imgur.com/4N96uwv.png) 參數修改後的結果 ::: ### 8.2.4. 檢查校準的結果 在完成所有校準後,請在 Remote PC 逐步的執行以下指令,來檢查校準結果。 [**Remote PC**] 1. 關閉全部 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動外部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch ``` 5. 開新的 terminal 執行 rqt_image_viewer ``` $ rqt_image_view ``` 6. 如校準設定成功,則選擇 /camera/image_projected_compensated topic 時,鳥瞰視野會出現如下圖。 ![](https://i.imgur.com/DrjWni7.png) :::success 補充資料: **如何在實體 TB3 檢查校準結果** 當完成了全部 camera 校準過程(camera 影像校準、內部參數校準、外部參數校準)後,**請確認校準結果都已經套用在 camera。** 以下過程敘述影像辨識的設定。 1. 在 Remote PC 啟動 roscore ``` $ roscore ``` 2. 在 SBC 啟用 camera ``` $ roslaunch turtlebot3_autorace_camera raspberry_pi_camera_publish.launch ``` 3. 在 Remote PC 執行 camera 內部校準啟動檔 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch mode:=action ``` 4. 在 Remote PC 開新 terminal,下指令 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch mode:=action ``` 5. 在 Remote PC 執行 rqt ``` $ rqt ``` ![](https://i.imgur.com/SSODKXv.png) rqt_reconfigure 現在,以下的說明將主要用來調整物體辨識的 feature detector / color filter (特徵檢測器/濾色器)。之後的每一次調整都是相互獨立的。不過如果要對每個參數一個一個做調整,請確認先做好當下這個參數的調整後,然後再繼續下一個參數調整。 ::: ## 8.3. Lane Detection 賽道偵測 Lane detection package 在 Remote PC 執行,它接收從 (1)TB3攝影機,或是 (2)Gazebo 模擬,傳來的影像,做賽道偵測後,讓 TB3 沿賽道行駛。以下指令說明如何透過 rqt 做賽道偵測及校準。 1. 將 TB3 放到賽道上,在黃色及白色的車道線之間. :::info 備註: Lane detection filter 是黃色在左,白色在右。故要確認黃色車道線在 TB3 左側,白色車道線在右側。 ::: 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動外部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch ``` 5. 開新的 terminal 啟動 lane detection calibration 節點 ``` $ roslaunch turtlebot3_autorace_detect detect_lane.launch mode:=calibration ``` 6. 開新的 terminal 執行 rqt ``` $ rqt ``` 7. 選擇 Plugins > Cisualization > Image view,啟動 rqt image viewer,可同時啟用多個 rqt plugin 8. 在每個 image viewer 分別顯示三個 topics - /detect/image_lane/compressed ![](https://i.imgur.com/jPVd6JY.png) - /detect/image_yellow_lane_marker/compressed: 左邊車道黃色的影像過濾圖 ![](https://i.imgur.com/OMII0OY.png) - /detect/image_white_lane_marker/compressed: 右邊車道白色的影像過濾圖 ![](https://i.imgur.com/gksDW9d.png) 9. 開新的 terminal 執行 rqt_reconfigure ``` $ rosrun rqt_reconfigure rqt_reconfigure ``` 10. 點擊 detect Lane,然後調整參數來做車道線的顏色過濾 ![](https://i.imgur.com/AXCHsJw.png) :::info **TIPS**:由於你的實際環境(包括房間內的光線亮度等)的影響,車道線顏色過濾的校準過程有時會非常困難。因此,你應該有耐心地執行此過程。要快速完成所有操作,請將位於 turtlebot3_auatorace_detect/param/lane/ 內 lane.yaml 的值輸入到 reconfiguration 參數上,然後開始校準。 - 首先校準 hue(色調) low – high 值。(1) Hue(色調)值表示顏色,每種顏色(如黃色,白色)都有自己的色調值區域(請參閱 hsv map)。 - 然後校準 saturation(飽和度) low – high值。(2) 每種顏色也有其自己的飽和範圍。 - 最後,校準 lightness(亮度)的 low – high 值。(3)然而在原始碼中,因具有自動調整功能,因此校準 lightness(亮度)的 low 值是沒有意義的。只需將 lightness(亮度)的 high 值設置為 255 即可。清晰的過濾後的車道線影像,會給你提供清晰的車道效果。 ::: 11. 開啟在 turtlebot3_autorace_detect/param/lane/ 下的 lane.yaml 檔。你需要將修改後的值覆寫到此檔內。這會使 camera 在下次啟動時,就會使用你所修改的參數。 ![](https://i.imgur.com/NRxYlzr.png) 修改後的 lane.yaml 檔 12. Ctrl + C 關閉所有 terminal 包含 rqt_reconfigure 及 detect_lane terminal 13. 開新的 terminal 啟動 lane detect node 不用加 calibration 選項 ``` $ roslaunch turtlebot3_autorace_detect detect_lane.launch ``` 14. 開新的 terminal 啟動節電來開始 lane following ``` $ roslaunch turtlebot3_autorace_driving turtlebot3_autorace_control_lane.launch ``` :::success 補充資料: **在實體 TB3 上執行賽道偵測 Lane Detection** 賽道偵測套件可讓 TB3 不受外部干擾,在兩條車道線內行走。 以下的步驟描述,如何使用 lane detection 賽道偵測功能及透過 rqt 來校準 camera. 1. 將 TB3 放到賽道上,在黃色及白色的車道線之間. - 請確認黃色車道線在 TB3 左側,白色車道線在右側。 2. 在 Remote PC 啟動 roscore ``` $ roscore ``` 3. 在 SBC 啟用 camera ``` $ roslaunch turtlebot3_autorace_camera raspberry_pi_camera_publish.launch ``` 4. 在 Remote PC 執行 camera 內部校準啟動檔 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch mode:=action ``` 5. 在 Remote PC 執行 camera 外部校準啟動檔 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch mode:=action ``` 6. 在 Remote PC 執行 lane detection launch 檔 ``` $ roslaunch turtlebot3_autorace_detect detect_lane.launch mode:=calibration ``` 7. 在 Remote PC 執行 rqt ``` $ rqt ``` 8. 點擊 plugins > visualization > Image view,可以新增多個攝影機視角圖的視窗 9. 在新增的三個視窗分別選擇 topics: /detect/image_yellow_lane_marker/compressed, /detect/image_lane/compressed, /detect/image_white_lane_marker/compressed - 左側(黃線)及右側(白線)視窗,會顯示過濾後的影像。中間則是TB3的鳥瞰圖 ![](https://i.imgur.com/yNJPf72.png) 左圖 黃色,中圖 白色,右圖 鳥瞰影像 10. 在 Remote PC 執行 rqt_reconfigure ``` $ rosrun rqt_reconfigure rqt_reconfigure ``` 11. 點擊 Detect Lane,然後調整參數來做車道線的顏色過濾 ![](https://i.imgur.com/AXCHsJw.png) Detect Lane 參數列表 ![](https://i.imgur.com/54OQT4P.png) 在 rqt_reconfigure 經過參數調整後的過濾影像 - **TIPS**:由於你的實際環境(包括房間內的光線亮度等)的影響,車道線顏色過濾的校準過程有時會非常困難。因此,你應該有耐心地執行此過程。要快速完成所有操作,請將位於 turtlebot3autorace[Autorace_Misson]_detect/param/lane/ 內 lane.yaml 的值輸入到 reconfiguration 參數上,然後開始校準。 - 首先校準 hue(色調) low – high 值。(1) Hue(色調)值表示顏色,每種顏色(如黃色,白色)都有自己的色調值區域(請參閱 hsv map)。 - 然後校準 saturation(飽和度) low – high值。(2) 每種顏色也有其自己的飽和範圍。 - 最後,校準 lightness(亮度)的 low – high 值。(3)然而在原始碼中,因具有自動調整功能,因此校準 lightness(亮度)的 low 值是沒有意義的。只需將 lightness(亮度)的 high 值設置為 255 即可。清晰的過濾後的車道線影像,會給你提供清晰的車道效果。 12. 開啟在 turtlebot3_autorace_detect/param/lane/ 下的 lane.yaml 檔。你需要將修改後的值覆寫到此檔內。這會使 camera 在下次啟動時,就會使用你所設置的參數。 ![](https://i.imgur.com/NRxYlzr.png) 修改後的 lane.yaml 檔 13. 結束 rqt_rconfigure 及 turtlebot3_autorace_detect_lane 程序 14. 在 Remote PC 開新 terminal 輸入 ``` $ roslaunch turtlebot3_autorace_detect detect_lane.launch mode:=action ``` 15. 檢查輸出的結果是否正確 - 在 Remote PC 開新 terminal 輸入 ``` $ roslaunch turtlebot3_autorace_driving turtlebot3_autorace_control_lane.launch ``` - 在 Remote PC 開新 terminal 輸入 ``` $ roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` 16. 輸入這些指令後,TB3 會啟動開始運行 ::: ## 8.4. 交通號誌 Traffic Sign 偵測 TB3 的 node 使用 SIFT algorithm 演算法來偵測交通號誌,比較原始影像跟攝影機影像。當 TB3 在賽道上行駛時,會執行已編程好的程序。請遵照下列步驟來使用 Traffic sign detection。 :::info **備註**: 如交通號誌中有更多邊線(edge),SIFT 演算法就可以提供更好的辨識結果。請參考以下連結: - https://docs.opencv.org/master/da/df5/tutorial_py_sift_intro.html ::: 1. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 2. 開新的 terminal 執行 teleoperation node,將 TB3 沿賽道行駛,到攝影機能夠清楚看到交通號誌的地方停止。 ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 3. 開新的 terminal 執行 rqt_image_view ``` $ rqt_image_view ``` 4. 選擇 /camera/image_compensated 來顯示攝影機影像 5. 從 rqt_image_view 抓取每個交通號誌影像,切掉無用的影像部分。為了最好的效果,建議使用原始的交通號誌影像檔。 6. 儲存影像到 turtlebot3_autorace_detect package 的 /turtlebot3_autorace_2020/turtlebot3_autorace_detect/image/,記住檔名要跟原始碼用的檔名要一樣。 - 預設檔名: construction.png, intersection.png, left.png, right.png, parking.png, stop.png, tunnel.png 7. 開新的 terminal 執行 camera 內部校準啟動檔 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 8. 開新的 terminal 執行 camera 外部校準啟動檔 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch ``` 9. 開新的 terminal 執行 traffic sign detection node - 在 mission 引數部分需要輸入對應的任務名稱,有 intersection, construction, parking, level_crossing, tunnel。 - 取代 SELECT_MISSION 關鍵字為上面的任務名稱之一 ``` $ roslaunch turtlebot3_autorace_detect detect_sign.launch mission:=SELECT_MISSION ``` 10. 開新的 terminal 執行 rqt image view plugin ``` $ rqt_image_view ``` 11. 從下拉選單選擇 /detect/image_traffic_sign/compressed。螢幕會顯示交通號誌偵測結果。 ![](https://i.imgur.com/lYgL05w.png) 當 mission:=intersection 時的偵測 T 字路號誌結果 ![](https://i.imgur.com/rXYpO4k.png) 當 mission:=intersection 時的偵測向左轉號誌結果 ![](https://i.imgur.com/xmq99di.png) 當 mission:=intersection 時的偵測向右轉號誌結果 ![](https://i.imgur.com/BKI3I58.png) 當 mission:=construction 時偵測施工號誌的結果 ![](https://i.imgur.com/xw8UE3g.png) 當 mission:=parking 時偵測停車號誌的結果 ![](https://i.imgur.com/OEuzQF3.png) 當 m 時偵測到停止號誌 mission:=level_crossing 時偵測到停止號誌 ![](https://i.imgur.com/G3Xoe7d.png) 當 mission:=tunnel 時偵測到隧道號誌的結果 ## 8.5. TurtleBot3 AutoRace 自駕車競賽的任務詳解 AutoRace 是給自動駕駛機器人平台的一個比賽。 為了能給機器人應用程式的開發,提供不同情境,比賽會盡可能減少硬性的規定。整個比賽內容完全是開源的,基於 ROS 來運行,包含全部的軟體(裁判系統的原始碼)和全部的硬體(比賽地圖的 stp / dwg 檔案)。內容會持續的更新,請參與比賽,展現你的技術。 :::warning **警示**: 如要參加比賽,請務必閱讀完本章節 Autonomous Driving。 ::: ### 8.5.1. 第一關: Traffic Light 紅綠燈 AutoRace 第一關是 Traffic Light 紅綠燈。TB3 要判斷紅綠燈後開始比賽。 {%youtube d2cP8OTMbwI %} #### 8.5.1.1. 紅綠燈偵測 :::info NOTE: 為了能在 Gazebo 內固定紅綠燈為特定色,你可以修改 core_node_mission 檔內的 controlMission 方法,位於 turtlebot3_autorace_2020/turtlebot3_autorace_core/nodes/ 目錄內。 ::: 1. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 2. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 3. 開新的 terminal 啟動外部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動 traffic light detection node 要加上 calibration 選項 ``` $ roslaunch turtlebot3_autorace_detect detect_traffic_light.launch mode:=calibration ``` 5. 開新的 terminal 執行 rqt,開四個 rqt_image_view plugin ``` $ rqt ``` 6. 選擇四個 topics: /detect/image_red_light, /detect/image_yellow_light, /detect/image_green_light, /detect/image_traffic_light ![](https://i.imgur.com/6iejCkI.png) 偵測綠燈。右邊圖是 ..green_light topic ![](https://i.imgur.com/nQOsr0F.png) 偵測黃燈。右邊圖是 ..yellow_light topic ![](https://i.imgur.com/x3GlIYi.png) 偵測紅燈。右邊圖是 ..red_light topic 7. 開新的 terminal 執行 rqt_reconfigure ``` $ rosrun rqt_reconfigure rqt_reconfigure ``` 8. 在左邊區域選擇 detect_traffic_light,調整參數以便紅綠燈顏色可以清楚分辨。 ![](https://i.imgur.com/VyUM1gT.png) Traffic light reconfigure 9. 開啟 traffic_light.yaml 檔,位於 turtlebot3_autorace_detect/param/traffic_light/ ![](https://i.imgur.com/WHxlQrM.png) 10. 將調整後的數值覆寫,然後存檔 #### 8.5.1.2. 測試紅綠燈偵測 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動外部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch ``` 5. 開新的 terminal 啟動 traffic light detection node ``` $ roslaunch turtlebot3_autorace_detect detect_traffic_light.launch ``` 6. 開新的 terminal 執行 rqt_image_view ``` $ rqt_image_view ``` 7. 檢查 topics: /detect/image_red_light, /detect/image_yellow_light, /detect/image_green_light #### 8.5.1.3. 如何進行紅綠燈任務 :::info 在跑此任務之前,請務必遵照上節 紅綠燈偵測 的敘述來校準顏色 ::: 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動 autorace core node 要加上任務名稱 ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_core.launch mission:=traffic_light ``` 5. 開新的 terminal 輸入以下指令。這會讓準備跑 traffic light 任務設為 decided_mode 為 3。 ``` $ rostopic pub -1 /core/decided_mode std_msgs/UInt8 "data: 3" ``` 6. 啟動 Gazebo mission node ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_mission.launch ``` ### 8.5.2. 第二關: Intersection 十字路口 AutoRace 第 2 關是 Intersection 十字路口。TB3 在十字路口,要辨識特定的轉彎號誌(左轉或右轉),依照指示轉向。 {%youtube F101PDx20nc %} #### 8.5.2.1. 如何進行 Intersection 任務 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動 keyboard teleoperation node 控制 TB3 沿賽道行駛到十字路口號誌前停下來 ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 5. 開新的 terminal 啟動 autorace core node 要加上任務名稱 ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_core.launch mission:=intersection ``` 6. 開新的 terminal 啟動 Gazebo mission node ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_mission.launch ``` 7. 開新的 terminal 輸入以下指令。這會讓準備跑 intersection 任務設為 decided_mode 為 2。 ``` $ rostopic pub -1 /core/decided_mode std_msgs/UInt8 "data: 2" ``` ### 8.5.3. 第三關: Construction 避障 AutoRace 第三關 Construction 避障。TB3 行駛時須避開賽道上的施工障礙物。 {%youtube pO9SXz7ad7M %} #### 8.5.3.1. 如何進行 Construction 避障任務 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動 keyboard teleoperation node 控制 TB3 沿賽道行駛到 Construction 施工號誌前停下來 ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 5. 開新的 terminal 啟動 autorace core node 要加上任務名稱 ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_core.launch mission:=construction ``` 6. 開新的 terminal 輸入以下指令。這會讓準備跑 construction 任務設為 decided_mode 為 2。 ``` $ rostopic pub -1 /core/decided_mode std_msgs/UInt8 "data: 2" ``` ### 8.5.4. 第四關: Parking 停車 AutoRace 第四關 Parking 停車。TB3 偵測停車號誌,自行開入空置的停車格內。 {%youtube ZRuX_nYwohI %} #### 8.5.4.1. 如何執行 Parking 停車任務 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動 keyboard teleoperation node 控制 TB3 沿賽道行駛到停車號誌前停下來 ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 5. 開新的 terminal 啟動 autorace core node 要加上任務名稱 ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_core.launch mission:=parking ``` 6. 開新的 terminal 啟動 Gazebo mission node ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_mission.launch ``` 7. 開新的 terminal 輸入以下指令。這會讓準備跑 parking 任務設為 decided_mode 為 2。 ``` $ rostopic pub -1 /core/decided_mode std_msgs/UInt8 "data: 2" ``` ### 8.5.5. 第五關: Level Crossing 柵欄 AutoRace 第五關 Level Crossing 柵欄。TB3 前方有柵欄,當柵欄放下時停止等待,柵欄升起時通過。 {%youtube PMOYhx9kiDk %} #### 8.5.5.1. 柵欄升降偵測 Level Crossing Detection 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動外部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch ``` 5. 開新的 terminal 啟動 level crossing detection node 要加上 calibration 選項 ``` $ roslaunch turtlebot3_autorace_detect detect_level_crossing.launch mode:=calibration ``` 6. 開新的 terminal 執行 rqt,開二個 rqt_image_view plugin ``` $ rqt ``` 7. 選擇二個 topics: /detect/image_level_color_filtered/compressed, /detect/image_level/compressed ![](https://i.imgur.com/9kBBxxx.png) 8. 開新的 terminal 執行 rqt_reconfigure ``` $ rosrun rqt_reconfigure rqt_reconfigure ``` 9. 在左邊區域選擇 detect_level_crossing,調整參數以便增強柵欄偵測。 ![](https://i.imgur.com/PRGzvLR.png) 10. 開啟 level.yaml 檔,位於 turtlebot3_autorace_detect/param/level/ ![](https://i.imgur.com/LWWHhIU.png) 11. 將調整後的數值覆寫,然後存檔 #### 8.5.5.2. 測試 柵欄升降偵測 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動外部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera extrinsic_camera_calibration.launch ``` 5. 開新的 terminal 啟動 level crossing detection ``` $ roslaunch turtlebot3_autorace_detect detect_level_crossing.launch ``` 6. 開新的 terminal 執行 rqt_image_view ``` $ rqt_image_view ``` 7. 檢查 topics: /detect/image_level/compressed #### 8.5.5.3. 如何進行 Level Crossing 柵欄任務 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動 keyboard teleoperation node 控制 TB3 沿賽道行駛到停止號誌前停下來 ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 5. 開新的 terminal 啟動 autorace core node 要加上任務名稱 ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_core.launch mission:=level_crossing ``` 6. 開新的 terminal 啟動 Gazebo mission node ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_mission.launch ``` 7. 開新的 terminal 輸入以下指令。這會讓準備跑 level crossing 任務設為 decided_mode 為 2。 ``` $ rostopic pub -1 /core/decided_mode std_msgs/UInt8 "data: 2" ``` ### 8.5.6. 第六關: Tunnel 隧道 AutoRace 第六關 Tunnel 隧道。TB3 需避開障礙物,成功的從隧道出口駛出。 {%youtube Qx3vbgoSNO8 %} #### 8.5.6.1. 如何進行 Tunnel 隧道任務 :::info NOTE: 更改 turtlebot3/turtlebot3_navigation/param/ 文件中的導航參數。如果 SLAM 產生新地圖,請將新地圖放置到 turtlebot3_autorace package 存放的 /turtlebot3_autorace/turtlebot3_autorace_driving/maps/ 目錄下 ::: 1. Ctrl + C 關閉所有 terminal 2. 開新的 terminal 執行 Autorace Gazebo simulation。roscore會在 roslaunch 指令啟動時自動執行 ``` $ roslaunch turtlebot3_gazebo turtlebot3_autorace_2020.launch ``` 3. 開新的 terminal 啟動內部攝影機校準節點 ``` $ roslaunch turtlebot3_autorace_camera intrinsic_camera_calibration.launch ``` 4. 開新的 terminal 啟動 keyboard teleoperation node 控制 TB3 沿賽道行駛到 Tunnel 隧道號誌前停下來 ``` $ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 5. 開新的 terminal 啟動 autorace core node 要加上任務名稱 ``` $ roslaunch turtlebot3_autorace_core turtlebot3_autorace_core.launch mission:=tunnel ``` 6. 開新的 terminal 輸入以下指令。這會讓準備跑 construction 任務設為 decided_mode 為 2。 ``` $ rostopic pub -1 /core/decided_mode std_msgs/UInt8 "data: 2" ``` ## 8.6. TurtleBot3 AutoRace 的過去 AutoRace 過去已經舉辦多屆,內容暫不翻譯。 # **9. [ROS 1] Machine Learning 機器學習** --- :::info Note: 此功能目前支援 ROS Kinetic and Melodic, and ROS2 Dashing. ::: # **10. [ROS 1] 實作 TB3 的不同應用程式** --- :::info Note: 此特色只支援 ROS1 Kinetic 及 ROS2 Dashing 版 ::: # **11. Locomotion 各種 TB3 改裝運動造型** --- 跟 Melodic 相同,請參考 Melodic 內容 **TurtleBot3 Friends 改裝造型列表(locomotion list)** - TurtleBot3 Friends: Car 小車 - TurtleBot3 Friends: OpenManipulator 機器手臂 - TurtleBot3 Friends: Segway 賽格威二輪平衡 - TurtleBot3 Friends: Conveyor 輸送車 - TurtleBot3 Friends: Monster 怪獸四驅車 - TurtleBot3 Friends: Tank 履帶車 - TurtleBot3 Friends: Omni 全向輪 - TurtleBot3 Friends: Mecanum 萬象輪 - TurtleBot3 Friends: Bike 三輪車 - TurtleBot3 Friends: Road Train 聯結車 - TurtleBot3 Friends: Real TurtleBot 真烏龜 - TurtleBot3 Friends: Carrier 多層運送車 # **12. Learn 學習資源課程** --- 跟 Melodic 相同,請參考 Melodic 內容 ## 12.1. Amazon AWS RoboMaker 使用 TurtleBot3 跟 Melodic 相同,請參考 Melodic 內容 ### 12.1.1. AWS RoboMaker 範例使用 TB3 ### 12.1.2. AWS RoboMaker 強化學習範例使用 TB3 ## 12.2 透過 Matlab 蒐集數據 跟 Melodic 相同,請參考 Melodic 內容 ## 12.3. The Construct 線上教學網站 跟 Melodic 相同,請參考 Melodic 內容 ### 12.3.1. MASTER WITH ROS: TurtleBot3 (英文課程) ### 12.3.2. 使用 RDS v2.0 在 5 分鐘內進行 TurtleBot3 模擬 ### 12.3.3. TurtleBot3 光達掃描的訂閱 ## 12.4. TurtleBot3 Blockly 跟 Melodic 相同,請參考 Melodic 內容 ## 12.5. TurtleBot3 Simulation on ROS Indigo 跟 Melodic 相同,請參考 Melodic 內容 ## 12.6. Youtube 影片課程 跟 Melodic 相同,請參考 Melodic 內容 ## 12.7. 實體書 ## 12.7. TurtleBot3 影片分享 跟 Melodic 相同,請參考 Melodic 內容 ### 12.7.1. Open Source Team 的 TB3 影片 ### 12.7.2. ROBOTIS Channel 的 TB3 影片 ### 12.7.3. TB3 的一些有趣專案項目介紹 # **13. 更多產品資訊** --- 跟 Melodic 相同,請參考 Melodic 內容 ## 13.1. 附錄 - TB3 主要零件補充說明 跟 Melodic 相同,請參考 Melodic 內容 ### 13.1.1. Dynamixel 智能馬達 ### 13.1.2. OpenCR 1.0 控制板 ### 13.1.3. LDS-01 光達 ### 13.1.4. LDS-02 光達 ### 13.1.5. Intel RealSense R200 深度攝影機 ### 13.1.6. Raspberry Pi camera v2 樹莓派攝影機 ## 13.2. 相容之第三方設備 跟 Melodic 相同,請參考 Melodic 內容 ### 13.2.1. Computer ### 13.2.2. 感測器 ## 13.3. 添加新感測器到 TB3 OpenCR 板 跟 Melodic 相同,請參考 Melodic 內容 ### 13.3.1. Bumper 碰觸感測器 ### 13.3.2. IR 感測器 ### 13.3.3. Ultrasonic 超音波 ### 13.3.4. Illumination 照明 ### 13.3.5. LED ## 13.4. 開源資源下載及授權 跟 Melodic 相同,請參考 Melodic 內容 ### 13.4.1. TB3 開源軟體下載 ### 13.4.2. 開源硬體下載 ### 13.4.3. 軟體授權 ### 13.4.4. 硬體授權 ### 13.4.5. 文件授權 # **14. 常見問題 FAQ** --- 跟 Melodic 相同,請參考 Melodic 內容 **常見問題**: 1. 如何在 Raspberry Pi 樹莓派啟動 SSH Server 2. 如何在 TB3 及 Remote PC 間同步時間 3. 設定 TB3 上的 Dynamixel 智能馬達 4. 當電池連接在 TB3 時,可以充電嗎? 5. 如何下載 TB3 的 3D 列印 STL 檔案 6. Intel Joule 深度攝影機 USB-C Port 在 Win 10 不能辨識 7. Intel Joule 深度攝影機在開機/安裝時凍結 8. 如何更新軟體 9. 如何更新韌體 # **15. 聯絡採智科技** --- ![](https://i.imgur.com/jZ7APk4.png) ![](https://i.imgur.com/mJ5jCT8.png) 採智科技是 [**TurtleBot3 台灣唯一官方授權代理商**](https://www.turtlebot.com/partners/),如有產品需求,使用,技術或維修上的問題,請聯絡我們。 **採智科技股份有限公司** 台北市11076信義區松德路12號10F Tel: +886-2-2345-7799 Fax: +886-2-2345-0867 mail: info(at)idminer.com.tw 採智科技網站: http://www.idminer.com.tw/ ** **下載 "ROS 機器人編程" 簡中版** (使用 TurtleBot3 為 ROS 1 實作平台) - [**ROS 機器人編程- 簡中 PDF**](https://www.dropbox.com/s/5cqhl5f17e2p1b5/ROS_Robot_Programming_CN.pdf?dl=0) - [**ROS Robot Programming- 英文 PDF**](https://www.dropbox.com/s/x1bj7u878p2hgtq/ROS_Robot_Programming_EN.pdf?dl=0) ![](https://i.imgur.com/R8L7KfX.png) | **簡中版章節列表** | | | |:--------------------- |:----------------------- | --------------- | | 1. 機器人軟件平台 | 6. ROS 工具 | 11. SLAM 和導航 | | 2. 機器人操作系統 ROS | 7. ROS 編程基礎 | 12. 服務機器人 | | 3. 搭建 ROS 開發環境 | 8. 機器人、傳感器和電機 | 13. 機械手臂 | | 4. ROS 的重要概念 | 9. 嵌入式系統 | | | 5. ROS 命令 | 10. 移動機器人 | | ###### tags: `TurtleBot3(ROS1)`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully