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 New
    • 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 Note Insights Versions and GitHub Sync 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    **TurtleBot3(Windows)-ROS1 中文線上手冊** === - 20220509 中譯發布,不會即時修正,內容如有差異不同,請以[**英文線上手冊**](https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/) 的 Windows 內容為主 # **3. TB3 快速入門指南** --- ## 3.1 Remote PC(桌電/筆電) 設定 :::info NOTE: 此指南在 Windows 10 IoT Enterprise 及 ROS1 Melodic Morenia 或 ROS1 Noetic Ninjemys 測試過 ::: :::warning 警示: - Windows SBC 設定章節是在 TB3 配置 Intel UP2 板或 Intel NUC 上測試過 - 此 SBC 是同時作為 Remote PC 跟 SBC 來操作 - 安裝時需要供電及時間較久,不適合使用電池 - 需另備 HDMI 螢幕、鍵盤、滑鼠以完成設定 ::: ### 3.1.1. 設定 Remote PC 1. 如果在 Remote PC(桌電,筆電,SBC)上沒有 Windows 10,可以下載 Windows 10 IoT Enterprise 試用版 - 下載 [Windows 10 IoT Enterprise LTSC(Trial)](https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise) 2. 請參考 [ROS Wiki 指南](https://wiki.ros.org/Installation/Windows)來安裝 ROS 到 Windows 上 3. 安裝 LDS-01 光達 driver - [CP2102 driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers) 4. 新增 workspace 及下載 TurtleBot3 package 詳細資訊請參考 [Microsoft Instructions](https://ms-iot.github.io/ROSOnWindows/Turtlebot/Turtlebot3.html)。 ``` > mkdir c:\ws\turtlebot3\src > cd c:\ws\turtlebot3\src > curl -o tb3.repos https://raw.githubusercontent.com/ms-iot/ROSOnWindows/master/docs/Turtlebot/turtlebot3_ros1.repos > vcs import src < tb3.repos ``` 5. 自定義 TurtleBot3 Launch 啟動檔 修改 ROS Launch 檔來對映連接的設備到正確 COM port。要決定哪個 COM ports 是需要的,在右下角 Windows 開始選單,點擊滑鼠右鍵,選擇 Device Manager 裝置管理員。 - 在連接埠(Ports(COM & LPT)) 節點 - USB Serial Device(COMx) 是 OpenCR 控制板 - Silicon Labs CP210x USB to UART Bridge (COMy) 是光達 - 在 launch 檔的正確欄位輸入 COM port - turtlebot3_bringup/launch/turtlebot3_core.launch ``` <node pkg="rosserial_python" type="serial_node.py" name="turtlebot3_core" output="screen"> <param name="port" value="COMx"/> ``` - turtlebot3_bringup/launch/turtlebot3_lidar.launch ``` <node pkg="hls_lfcd_lds_driver" type="hlds_laser_publisher" name="turtlebot3_lds" output="screen"> <param name="port" value="COMy"/> ``` 6. 建立 workspace ``` > cd c:\ws\turtlebot3 > catkin_make > c:\ws\turtlebot3\devel\setup.bat ``` ### 3.1.2. 網路設置 要從 Windows 10 跟遠端 TB3 上的 SBC 通訊,請在環境變數設定: ``` > set ROS_MASTER_URI=http://<IP address of the PC>:11311 > set ROS_HOSTNAME=<name of the windows computer> ``` ## 3.2. SBC 設置 :::warning 警示: - Windows 版的 TB3 是運行於一台組裝在 TB3 上的 PC,不是樹莓派 - 如果你用 Intel UP2 板或 Intel NUC 取代樹莓派,且依照 3.1. 節內容操作,那本節可以跳過。 ::: ## 3.3. OpenCR 板設置 :::info OpenCR Arduino board manager 不支援 Arm-based 的處理器,如 Raspberry or Jetson Nano。請在 PC 上用 Arduino IDE 來上傳韌體。 ::: 1. 安裝 Arduino IDE - [下載最新的 Arduino IDE](https://www.arduino.cc/en/software) 2. 安裝好後,執行 Arduino IDE 3. 按 Ctrl + , 來打開 Preferences menu 4. 在 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) 5. 打開 TurtleBot3 韌體。因你的平台選擇對應的韌體。 - **Burger**: File > Examples > turtlebot3 > turtlebot3_burger > turtlebot3_core - **Waffle/Waffle Pi**: File > Examples > turtlebot3 > turtlebot3_waffle > turtlebot3_core 6. 連接 OpenCR 板到 PC 上,從 Tools > Board 選單選擇 OpenCR > OpenCR Board 7. 從 Tools > Port 選單中選擇連接 OpenCR 的 USB port 8. upload 圖示或 Ctrl+U 來上傳韌體 ![](https://i.imgur.com/S3zNgU6.png) ![](https://i.imgur.com/fxp7cNS.png) 9. 如果上傳失敗,可以嘗試在 recovery mode 下重新上傳韌體。OpenCR 的 recovery mode 啟動順序如下。在 recovery mode 時,OpenCR 的 STATUS led 燈會定時的閃爍。 - 按住 PUSH SW2 鍵 - 按一下 Reset 鍵然後鬆開 - 再鬆開 PUSH SW2 鍵 ![](https://i.imgur.com/ZilkkEU.png) ### 3.3.1. OpenCR 測試 :::info Note: 如果測試後,輪子並沒有照設定的移動,請參照 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 開始啟用 ### 3.5.1. Bringup 啟用 TB3 從 TB3 啟用基本套件來開始 TB3 應用 ``` > roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` ### 3.5.2. 在 RViz 載入 TurtleBot3 1. 啟動基本套件開始 TB3 應用。請選擇對應的 TURTLEBOT3_MODEL 參數: burger, waffle, waffle_pi ``` > set TURTLEBOT3_MODEL=waffle > roslaunch turtlebot3_bringup turtlebot3_remote.launch ``` 2. 開新的 ROS command 視窗,輸入指令啟動 RViz ``` > rosrun rviz rviz -d "<full path to turtlebot3_description>/rviz/model.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 執行 turtlebot3_teleop_key node 來使用鍵盤遙控。如 TURTLEBOT3_MODEL 參數未指定,請替換 ${TB3_MODEL} 為 burger 或 waffle 或 waffle_pi ``` > set TURTLEBOT3_MODEL=waffle > roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 2. 如果所需節點都開啟成功,terminal 會顯示操作訊息 ``` 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 ``` #### 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 的任一 UART port 2. 使用 RC-100 遙控 TB3 - Up / Down: 直線加速或減速 - Left / Right: 角速度加速或減速 #### 3.6.1.3. 搖桿 Windows 使用 [Open Source Simple DirectMedia Layer](https://www.libsdl.org/) 來實現搖桿控制,能夠支援許多不同的搖桿。搖桿目前的版本(2020年1月份)是部署為開源套件,你需要複製到你的 catkin workspace ``` > git clone -b init_windows https://github.com/ms-iot/joystick_drivers ``` ### 3.6.2. Topic Monitor :::info 要檢視TB3的 topics,可使用 ROS 提供的 [**rqt**](http://wiki.ros.org/rqt),它是 ROS GUI 開發的 Qt-based 框架。它是一個工具可以顯示 TB3 所有 topics 包含 topic name,type,bandwidth,Hz,value in GUI等資訊 ::: 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 智能馬達、LDS-01 光達、電池及 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)** 即時定位與地圖構建, 是一種通過估算在任一空間中的當前位置, 來繪製地圖的技術. SLAM 已是前代的 TurtleBot2 機器人就廣為所知的特色功能. 以下的影片展示 TurtleBot3, 如何以小巧且實惠的平台來精確的繪製地圖. {%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. 在 TB3 啟動 Bringup。如果已經啟動,可跳過此步 ``` > roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` 2. 從 Remote 開新視窗,啟動 SLAM node。Gmapping 方法是預設方法。也請正確替換 TURTLEBOT3_MODEL 參數: burger, waffle, or waffle_pi ``` > set TURTLEBOT3_MODEL=waffle > roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping ``` :::info **使用其他的 SLAM 方法** - **Cartographer** ([ROS Wiki](http://wiki.ros.org/cartographer),[Github](https://github.com/googlecartographer/cartographer)) 1. 在 Remote PC 使用 choco 安裝相關套件。 ``` > choco upgrade ros-melodic-cartographer_ros -y ``` 2. 啟動 Cartographer SLAM node。也請正確替換 TURTLEBOT3_MODEL 參數: burger, waffle, or waffle_pi ``` > c:\ws\turtlebot3\devel\setup.bat > set TURTLEBOT3_MODEL=waffle > roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=cartographer ``` ::: ## 4.2. 執行 Teleoperation Node 一旦 SLAM node 成功執行,TB3 就會使用 teleoperation 開始對未知區域繪製地圖。此時避免機器人做出劇烈的運動很重要,比如直線速度變化太快或旋轉太快。使用機器人製作地圖時,機器人應該要掃描需量測環境的每個角落。它需要一些經驗來建立一個乾淨的地圖,所以我們需要多次練習 SLAM 以學習建圖技巧。 1. 在 PC 開新 terminal 執行 teleoperation node。TURTLEBOT3_MODEL 參數需對應好 - burger,waffle,waffle_pi ``` > set TURTLEBOT3_MODEL=waffle > 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 兩個檔。 ``` > rosrun map_server map_saver -f %USERPROFILE%\map ``` : -f 選項是用來指定資料夾位置以及要儲存的檔名。以上的指令是指 map.pgm 及 map.yaml 檔,會被儲存在 user 資料夾,其位置儲存在環境變數 %USERPROFILE%。 ## 4.5. 地圖 地圖是 ROS 社群中常用的二維 **Occupancy Grid Map(OGM)** 地圖。儲存的地圖大略如下圖所示,**白色**是機器人可以移動的空白區域,**黑色**是機器人不能移動的佔用區域,**灰色**則是未知區域。地圖可在 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 章節所述,地圖是由感測器得到的距離訊息,和機器人本身的方位訊息來創建。 導航讓機器人能夠通過使用圖資、機器人編碼器、IMU 感測器、和距離感測器等,從當前的方位,移動到地圖上指定的目標方位。執行此任務的過程如下節所述。 ## 5.1. 執行 Navigation node 1. 在 TB3 啟動 Bringup。如果已經啟動,可跳過此步。 ``` > roslaunch turtlebot3_bringup turtlebot3_robot.launch ``` 2. 在 Remote PC 啟動 Navigation。另外 TURTLEBOT3_MODEL 的參數需設定 burger, waffle, 或 waffle_pi。 ``` > set TURTLEBOT3_MODEL=burger > roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=%USERPROFILE%\map.yaml ``` ## 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 來準確定位在地圖上的機器人位置 ``` > roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch ``` 5. 來回移動機器人一點以收集周圍環境信息,並縮小 TurtleBot3 在地圖上的估計位置,地圖上是以微小的綠色箭頭顯示。 ![](https://i.imgur.com/X3Dq64y.png) ![](https://i.imgur.com/H9R3zpy.png) 6. 在 teleop node terminal 上按 Ctrl + C 來結束 keyboard teleoperation node,這可以防止在導航期間從多個節點發布不同的 cmd_vel 值。 ## 5.3. 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 **備註**: 手冊中的影片內容可能隨時更新,恕不另行通知。 ::: :::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 stack 有許多參數可用來改變其效能。你可以在 [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 value。因為它是一個反比的因素,所以如這個參數增加,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,因此必須事先安裝適合的 Gazebo 版本。 ### 6.1.1. 啟動 Simulation 如果是跑 ROS1 Noetic,請將指令內的 melodic 取代為 noetic 即可。 1. 開命令提示字元視窗,啟動 simulation ``` > c:\opt\ros\melodic\x64\setup.bat > c:\ws\turtlebot3\devel\setup.bat > set TURTLEBOT3_MODEL=waffle > roslaunch turtlebot3_fake turtlebot3_fake.launch ``` 2. 開另一個命令提示字元視窗 ``` c:\opt\ros\melodic\x64\setup.bat c:\ws\turtlebot3\devel\setup.bat set TURTLEBOT3_MODEL=waffle roslaunch turtlebot3_gazebo turtlebot3_simulation.launch ``` ## 6.2. SLAM 模擬 我們可以在 Gazebo 模擬器中來用不同的虛擬機器人來進行虛擬 SLAM,而無須使用實體的機器人來實作。在 Gazebo 中,SLAM 模擬跟用 TB3 實作 SLAM 會很相似。 下列操作會需要之前章節為先決條件,請回看 Simulation 章節內容。 ### 6.2.1. 啟動 SLAM simulation 如果是跑 ROS1 Noetic,請將指令內的 melodic 取代為 noetic 即可。另外 TURTLEBOT3_MODEL 的參數需設定 burger, waffle, 或 waffle_pi。 開命令提示字元視窗, ``` > c:\opt\ros\melodic\x64\setup.bat > c:\ws\turtlebot3\devel\setup.bat > set TURTLEBOT3_MODEL=waffle > curl -o turtlebot3_demo.launch https://raw.githubusercontent.com/ms-iot/ROSOnWindows/master/docs/Turtlebot/turtlebot3_demo.launch > roslaunch turtlebot3_demo.launch ``` 在一段時間後,可看到 Gazebo 跑一個虛擬地圖世界,內有模擬的 TB3。RViz 跑建圖程序,simulation node 帶著 TB3 四處隨機移動。 ![](https://ms-iot.github.io/ROSOnWindows/Extras/Turtlebot3_Gazebo_SLAM.gif) ## 6.3. Navigation Simulation 模擬導航 :::info NOTE: 此功能只支援 ROS1 Kinetic,ROS1 Noetic,ROS2 Dashing,ROS2 Foxy 版 ::: ## 6.4. Fake Node Simulation :::info NOTE: 此功能只支援 ROS1 Kinetic,ROS1 Noetic,ROS2 Dashing,ROS2 Foxy 版 ::: ## 6.5. 單獨的 Gazebo 模擬 :::info NOTE: 此功能只支援 ROS1 Kinetic 版 ::: # **7. Manipulation 機器手臂** --- :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.1. TurtleBot3 跟 OpenManipulator-X 機器手臂 :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.2. 手臂軟體設定 :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.3. 手臂硬體組裝 - [CAD 檔](http://www.robotis.com/service/download.php?no=767) for (TurtleBot3 Waffle Pi + OpenMANIPULATOR) ![](https://i.imgur.com/uuJYUEI.png) - 首先拆下 LDS 光達並將其移到 TurtleBot3 的前半部(紅圈代表螺絲的位置)。 - 接著在 TurtleBot3 上固定 OpenManipulator 手臂(黃色圓圈表示螺絲的位置)。 ![](https://i.imgur.com/Lmu2YDc.png) ![](https://i.imgur.com/Uan7SJU.png) TurtleBot3 Waffle Pi + OpenMANIPULATOR-X 組合示意圖 ## 7.4. OpenCR 控制板設定 :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.5. Bringup 啟動 TB3 與機器手臂 :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.6. 模擬 :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.7. 操作實體的 OpenManipulator-X 手臂 :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.8. SLAM :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.9. Navigation 導航 :::info 機器手臂尚未支援 ROS1 Windows 版 ::: ## 7.10. TurtleBot3 Home Service Challenge 居家服務挑戰賽 :::info NOTE: 此功能只支援 ROS1 Kinetic 及 Noetic 版 ::: # **8. [ROS1] Automonous Driving 自駕車挑戰賽** --- :::info NOTE: 此功能只支援 ROS1 Kinetic,ROS1 Noetic 版 ::: # **9. [ROS 1] Machine Learning 機器學習** --- :::info Note: 此功能支援 ROS1 Kinetic, Melodic 及 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