<style> .red {color: red;} </style> <style> .sol {color: green; font-weight: bold;} </style> ###### tags: `vsclab` `ros` `turtlebot` `youbot` # ROS Tutorial (VSCLab 新訓) ## 新生訓練課程規劃 [:page_with_curl:](https://docs.google.com/spreadsheets/d/1RkdhyIlwrzTrHGTgUTGpP1WRDBARuc9srYCiW3LK8Es/edit#gid=0) ![](https://i.imgur.com/j0qjOfC.png) ## :star: PART1 基礎教學 > 內容由淺入深,適合完全不懂 ROS 的人 ### ==:male-teacher: <span class="red"> **2021_ROS Taoyuan Summer School**==</span> <!-- * [:arrow_down: OneDrive 載點](https://ncku365-my.sharepoint.com/:f:/g/personal/e14054112_ncku_edu_tw/EkVtvsclXvpEoapSPWFrDOQBc8Zgq-fhovPsx9DuVcPrfQ?e=5G7GFh) --> <!-- * [:arrow_down: Google Drive 載點](https://drive.google.com/drive/folders/1VXdFACpAK9vKSlvyGd9uV-tZj_iXUrgi?usp=sharing) --> 請依序閱讀以下資料夾內的內容,並且搭配<span class="red">課程影片</span>與<span class="red">講義</span>來學習: * :open_file_folder: `01_專業講座` * `ROS 1 簡介 1.mp4` * `ROS 1 簡介 2.mp4` * `ROS 2 簡介 DDS 通訊機制 1.mp4` * `ROS 2 簡介 DDS 通訊機制 2.mp4` * `模擬器學習機器人建圖與導航.mp4` * `ROS 應用程式開發.mp4` ::: success :ballot_box_with_check: 完成以上教學者,即可進行「[PART2 實體機台操作](###-PART2-實體機台操作)」 ::: ::: info :information_source: **Notes:** ROS 通常運行在 [Ubuntu Linux 系統](https://ubuntu.com/), 以下提供兩種作法來安裝 [Ubuntu 20.04 LTS](https://www.ubuntu-tw.org/modules/tinyd0/) 1. 在 Windows 環境中使用**虛擬機** (詳見 :open_file_folder:`02_初階工作坊/1.ROS 系統開發環境設定.pdf`) > 使用虛擬機會消耗較多電腦資源(因同時跑兩個作業系統),若後續要連接其他實體感測器可能會出問題,但安裝容易。 2. [安裝雙系統 Win10 + Ubuntu](https://hackmd.io/@rubato/HJTUVxAqY)<span class="red"> (推薦 :+1:)</span> > 使用雙系統雖然安裝步驟繁瑣,而且可能會搞砸電腦(對於完全不懂重灌電腦的新手),但是安裝完便一勞永逸,還多學會一項實驗室必備技能。 * ==實驗室的 TurtleBot 工作區有一台 Ubuntu 的電腦供無法安裝者操作== * [Linux/vim 基本指令與操作](https://hackmd.io/oedMupzURPuxBnQlaEp0Mg) ::: :::spoiler :books: **其他 ROS 教學資源** <!-- * [:film_projector: 2021 Tauyuan ROS Youtube](https://youtube.com/playlist?list=PL-sR9o5TrdFp3fcZgauh_7oYkvls8rYlK) --> * [:fire: ROS Courses Library | Robot Ignite Academy](https://www.theconstructsim.com/robotigniteacademy_learnros/ros-courses-library/) * [Tutorials — ROS 2 Documentation: Humble documentation](https://docs.ros.org/en/humble/Tutorials.html) * [瑞士蘇黎世聯邦理工學院 Programming for Robotics - ROS](https://rsl.ethz.ch/education-students/lectures/ros.html) * [ROS-wiki](http://wiki.ros.org/noetic/Installation/Ubuntu) * [The construct](https://www.theconstructsim.com/) * [古月居](https://www.guyuehome.com/) * ROBOTICS * https://github.com/ROBOTIS-GIT/ros_seminar * https://github.com/ROBOTIS-GIT/turtlebot3_simulations ::: ## :star: PART2 實體機台操作 ### (1) [TurtleBot3 Tutorial](#TurtleBot3) >:::success >TurtleBot 的連線已經事先設定好,**建議大家使用 TurtleBot 實驗區的電腦來進行操作** >::: >![](https://emanual.robotis.com/assets/images/platform/turtlebot3/overview/turtlebot3_with_logo.png) ### (2) KUKA YouBot >![](https://www.researchgate.net/profile/Christian-Scheurer/publication/261074766/figure/fig1/AS:650155929899018@1532020661723/KUKA-youBot-an-open-source-enabled-omnidirectional-mobile-manipulator-for-research-and.png) >[:arrow_down: YouBot 新訓教材下載](https://ncku365-my.sharepoint.com/:b:/g/personal/e14054112_ncku_edu_tw/EdMfdusS8t1DrqMk7BY-nZwBzWosBooOKtAbmEuES--qZQ?e=SJsd27) # TurtleBot3 ## PART 1. TurtleBot 基礎操作 ### (1) TurtleBot3 (簡稱TB3) 零件介紹 [:link:更多詳細資訊](https://emanual.robotis.com/docs/en/platform/turtlebot3/features/#features) ![](https://emanual.robotis.com/assets/images/platform/turtlebot3/hardware_setup/turtlebot3_burger_components.png) ![](https://i.imgur.com/aI1xAHm.jpg) <!-- ![](https://i.imgur.com/sVv5vQf.jpg) --> :::info TB3 零件盒放在實驗桌的抽屜 ::: ### (2) TurtleBots in VSCLab ![](https://i.imgur.com/qEzLJR6.jpg) :::info 馬達上有貼 IP 標籤以供識別 ::: ### <span class="red"> (3) :battery: 電源注意事項(重要!) </span> * [OpenCR 電源規格表](https://emanual.robotis.com/docs/en/parts/controller/opencr10/#specifications) ![](https://emanual.robotis.com/assets/images/parts/controller/opencr10/opencr_pinout.png) :::danger [:question: **可否將電池 :battery: 與充電座 :electric_plug: 同時插在 OpenCR 板子上?**](https://answers.ros.org/question/359856/turtlebot3-wired-power-operation/) :a: **Answer:** * <span class="red">:no_entry: **充電座 SMPS (圖左, 12V 5A) 與 鋰電池 (圖右, 11.1V) 不能同時供電!**</span> * <span class="red">:no_entry: **僅允許使用一種電源輸入**</span> * <span class="red">:no_entry: **進行長時間操作(如:更新軟體、重灌系統),請使用充電座**</span> * <span class="red">:warning: **請務必一手按住 OpenCR,一手小力插拔充電座(SMPS),避免接頭從板子脫落** ![](https://i.imgur.com/G945Qwt.jpg) ::: * 充電接線配置 ![](https://i.imgur.com/rMksKjw.jpg =603x425) :::warning :warning: 移除電池時,請使用**扳手**來拆卸電池充電線,如下圖 ![](https://i.imgur.com/vdujybA.jpg =504x672) ::: ### (4) :desktop_computer: 連接螢幕 ![](https://i.imgur.com/ReZWx2W.jpg) :::warning :warning: 插入 Micro HDMI 之前,樹梅派必須<span class="red">先關機</span>。 ::: ### (5) SSH 連線至 TurtleBot | Username | Password | | -------- | -------- | | ubuntu | turtlebot | :::spoiler **1. Master OS is Win10** 利用 SSH 軟體,如 [Bitvise](https://www.bitvise.com/ssh-client-download), [PuTTY](https://www.putty.org/) 等,並依照以下設定 ![](https://i.imgur.com/MOhBPdw.png) ::: :::spoiler **2. Master OS is Ubuntu** * command: `ssh` ```shell $ ssh ubuntu@192.168.1.101 $ ssh ubuntu@192.168.1.102 ``` * 其他 SSH 相關操作教學 * [How to copy files from one machine to another using ssh](https://unix.stackexchange.com/a/106482) * [How to automate SSH login with password?](https://serverfault.com/a/241593) ::: :::warning :warning: 連線出問題時,進行以下 SOP 1. 確認 TurtleBot、電腦是否連線到 `VSCLAB` Wi-Fi 2. 檢查 `ROS_Master_URI`、`ROS_HOSTNAME` 的設定是否正確 3. 檢查 `連線埠(port)` 的設定是否正確 **其他參考資料:** * [Network Configuration](https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/#network-configuration) * [🍒Raspberry Pi: connect to the Internet](https://hackmd.io/NXKxrEFqT1mkq5_tfAcL1Q#%F0%9F%8D%92Raspberry-Pi-connect-to-the-Internet) ::: ### ==(6) :female-teacher: <span class="red">**依官網教學範例練習**</span>== 請至 [TurtleBot3 Official Website](https://emanual.robotis.com/docs/en/platform/turtlebot3/bringup/#bringup) 完成以下練習 >* 3. [Quick Start Guide](https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/) > * 3.5 [Bringup](https://emanual.robotis.com/docs/en/platform/turtlebot3/bringup/#bringup) > * 3.6 [Basic Operation/Teleporation/Keyboard](https://emanual.robotis.com/docs/en/platform/turtlebot3/basic_operation/#keyboard-2) >* 4. [SLAM](https://emanual.robotis.com/docs/en/platform/turtlebot3/slam/) >* 5. [Navigation](https://emanual.robotis.com/docs/en/platform/turtlebot3/navigation/#navigation) >* 6. [Simulation](https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/) ### ==(7) :camera_with_flash: 使用 Pi Camera 拍照== >* Install ROS Package `raspicam` (TurtleBot) > * [Github: raspicam_node/Build Instructions](https://github.com/UbiquityRobotics/raspicam_node/tree/noetic-devel#build-instructions) > >* [Run `raspicam` Node](https://emanual.robotis.com/docs/en/platform/turtlebot3/appendix_raspi_cam/#run-raspicam-node) ### (8) :golf: 小挑戰:使用 RealSense 拍照 :::spoiler :bulb: 提示 - [ ] 硬體:可以使用 D435i 替代 D455,這樣才能連接傳輸線 - [ ] 軟體:[ROS Wrapper for Intel® RealSense™ Devices](https://github.com/IntelRealSense/realsense-ros) ::: ## PART 2. AutoRace 競賽題目:beginner: AutoRace 包含以下比賽項目: > * 道路偵測駕駛 > * 影像辨識 > * 自動避障 > * 自動停車 > * SLAM導航 **請大家參考以下教學來共同完成此項目。** #### ==:female-teacher: <span class="red">[AutoRace ROS 自動駕駛線上研習</span> ](https://www.youtube.com/playlist?list=PLAjn8M2MeXX32ZnJaoGPbkIqnVOdzs8Jk)== :::info :information_source: 我們的目標是希望大家可以從暑假開始,漸漸地完成 AutoRace 的競賽項目,同時熟悉 TurtleBot 的操作,並且藉此發想其他能夠在 TurtleBot 完成的題目。 > 例如: > [line follower](https://github.com/VSCLAByouBot/find_line) :::