rubato
    • 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
    • Make a copy
    • 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 Make a copy 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
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    <style> .red {color: red;} </style> <style> .sol {color: green; font-weight: bold;} </style> ###### tags: `vsclab` `turtlebot` `ubuntu` `ros` `raspberry pi` # TurtleBot3 Setup :::spoiler 文章目錄 [toc] ::: --- :::warning * [Install TP-link TL-WN725N USB wifi driver on Ubuntu 20.04](https://askubuntu.com/a/1356730) * Ubuntu 20.04 需要額外安裝套件才有 `ifconfig` ``` $ sudo apt install net-tools ``` * 查看是否已安裝 ROS 套件 ``` $ dpkg --list | grep ROS ``` ::: - [品瑄版本](https://hackmd.io/Ah_pIkbvQ-OqW9vd1amglw) - [TurtleBot 3 Quick Guide](https://emanual.robotis.com/docs/en/platform/turtlebot3/quick-start/#pc-setup) ## 🍒Raspberry Pi: connect to the Internet :::warning 若使用<span class="red">手機熱點</span>,請將頻寬設定成 <span class="red">**2.4 GHz**</span> ::: #### 1. Open Configuration File ```linux $ sudo vim /etc/netplan/50-cloud-init.yaml ``` #### 2. Edit Configuration File ##### 2-1. For Wi-Fi * [See Example](https://linuxconfig.org/how-to-configure-static-ip-address-on-ubuntu-18-04-bionic-beaver-linux) * [Multiple SSID Example](https://askubuntu.com/questions/1245253/set-multiple-wifi-access-points-in-ubuntu-20-04) * To select the wifi, first show the wifi list ``` $ sudo wpa_cli -i wlan0 list_networks ``` * it will show you the network_id and network_ssid, then select by network_id. ``` $ sudo wpa_cli -i wlan0 select_network network_id ``` ##### 2-2. For Static IP * 請參考此格式 https://blog.toright.com/posts/6293/ubuntu-18-04-%E9%80%8F%E9%81%8E-netplan-%E8%A8%AD%E5%AE%9A%E7%B6%B2%E8%B7%AF%E5%8D%A1-ip.html * 注意**子網路遮罩**的格式需要轉換 https://www.calculator.net/ip-subnet-calculator.html ##### :page_facing_up: Netplan Example `/etc/netplan/50-cloud-init.yaml` ``` # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no addresses: [140.116.215.151/27] gateway4: 140.116.215.157 nameservers: addresses: [8.8.8.8] wifis: wlan0: dhcp4: yes dhcp6: yes access-points: "VSCLAB": password: "VSCLAB-pwd" wlan0: dhcp4: yes dhcp6: yes access-points: "rubato_phone": password: "rubato_phone-pwd" ``` #### 3. Apply Changes ```linux $ sudo netplan --debug apply # more details # or $ sudo netplan apply # or (for ssh user) $ sudo netplan try # apply only 120 sec then restore ``` #### 4. Confirm IP Address ``` $ ip a # IP address $ ip r # default gateway IP address ``` #### 5. [Check Internet Connectivity in Linux Terminal](https://linuxhint.com/check-internet-connectivity-terminal/) ##### Method 1: PING Command ``` $ ping -c 3 google.com ``` ![](https://linuxhint.com/wp-content/uploads/2021/06/1.png) ##### Method 2: CURL Command ``` $ curl -I https://linuxhint.com/ ``` ![](https://linuxhint.com/wp-content/uploads/2021/06/2.png) ## 固定裝置的 DHCP 位址 :::info 每次裝置重新連線時,分享器會再重新分配 IP,導致 ROS IP 也要跟著重新設定 **若希望固定 IP 位址,請參考以下教學** ::: ### 1. 查詢 TurtleBot 的 MAC 位址 ### 2. 更改分享器設定 1. 使用 Wi-Fi 或是有線網路連到分享器 2. 打開瀏覽器,網址列輸入`192.168.1.1` 3. 登入分享器設定(帳密請洽網管) ![](https://i.imgur.com/ysRtooB.png) 4. **DHCP伺服器**>**保留指定IP位址**>**新增** ![](https://i.imgur.com/wlJEvbP.png) 5. **系統工具**>**重新開機** ## SSH Login Automatically * [How to automate SSH login with password?](https://serverfault.com/a/241593) # Raspberry Pi 相關 ## :battery:電源方面 #### 進行長時間操作建議不要使用電池(例如:更新軟體、重灌系統) * [OpenCR 電源規格表](https://emanual.robotis.com/docs/en/parts/controller/opencr10/#specifications) ![](https://emanual.robotis.com/assets/images/parts/controller/opencr10/opencr_pinout.png) * [論壇討論](https://answers.ros.org/question/359856/turtlebot3-wired-power-operation/) :::danger **結論:** SMPS (12V 5A) 與 Battery (11.1V) 不能同時供電!**一次僅能使用一個電源輸入** ![](https://i.imgur.com/G945Qwt.jpg) ::: <!-- * https://goodspeedlee.blogspot.com/2018/04/raspberry-pi.html --> # Day 2-3 | ROS ## Install ROS & ros_menu * [Official](http://wiki.ros.org/noetic/Installation/Ubuntu) * [Adlink/ros_menu](https://github.com/Adlink-ROS/ros_menu) :::warning <span class="red">Server 啟動 ros1 遇到 $shell 名稱錯誤問題</span> `/tmp/host_sourcefile.txt:source:3: 沒有此一檔案或目錄: /opt/ros/noetic/setup./usr/bin/zsh` <!-- shell=`cat /proc/$$/cmdline | tr -d '\0' | tr -d '-'` --> <span class="sol">Solution:</span> 重新定義`/proc/$$/cmdline` PID執行緒參數 1. For Terminal ![](https://i.imgur.com/tAwWw34.png) 2. For tmux ![](https://i.imgur.com/bCUixef.png) ::: * [連線埠查詢](https://askubuntu.com/questions/9368/how-can-i-see-what-ports-are-open-on-my-machine) ``` $ sudo netstat -ntlp ``` ## Run Example Code * [TurtleBot3 Bringup](https://emanual.robotis.com/docs/en/platform/turtlebot3/bringup/#bringup) :::warning <span class="red"> [sensor_msgs/BatteryState] 問題 </span> `[ERROR] [1642758400.659716]: Creation of publisher failed: Checksum does not match: 4ddae7f048e32fda22cac764685e3974,476f837fa6771f6e16e3bf4ef96f8770` <span class="sol"> Solution: </span> [OpenCR 的版本必須與 PC 的 ROS 相同](https://discourse.ros.org/t/turtlebot3-software-and-firmware-update-and-waffle-pi/3729/4) ::: # ==ROS 2== foxy for TB3 ## Install ros2 & ros_menu <span class="red">on SBC</span> * [Foxy > Click to expand : Manual SBC Setup Instructions](https://emanual.robotis.com/docs/en/platform/turtlebot3/sbc_setup/#sbc-setup) <!-- * [Install ROS2 Foxy on Raspberry Pi 4](https://roboticsbackend.com/install-ros2-on-raspberry-pi/) --> * [Adlink/ros_menu](https://github.com/Adlink-ROS/ros_menu) ## Communicate with Windows using PuTTY * [Download PuTTY](https://www.putty.org/) ![](https://i.imgur.com/pU8Zuht.png) :::warning <span class="red">如何在 PuTTY 對 tmux 視窗貼上</span> <span class="sol"> Solution:</span> [Press shift](https://superuser.com/questions/1410591/how-to-paste-when-using-tmux-on-a-remote-server-with-putty) ::: ## :+1: Communicate with Windows using Bitvise SSH * [Download Bitvise SSH](https://www.bitvise.com/ssh-client-download) * 有 GUI 介面可直接複製、瀏覽 Server、Client 檔案 ![](https://i.imgur.com/MOhBPdw.png) ## MATLAB ROS Toolbox ## Joysticks x Raspberry Pi ### Wiring PS3 * [Connect PS3 Joystick to Raspberry 4b with ROS](https://jepeloa.medium.com/connect-ps3-joystick-to-raspberry-4b-with-ros-6c4603f2c752) ### Wireless PS2 {%youtube gshsbqfgJmE %} * https://pinout.xyz/pinout/pin1_3v3_power #### GPIO Library Installation * [GPIO 簡介](https://medium.com/geekculture/gpio-programming-on-the-raspberry-pi-python-libraries-e12af7e0a812) * [Pin 接線圖](http://wiringpi.com/download-and-install/) * https://atceiling.blogspot.com/2014/02/raspberry-pi-wiringpi-gpio.html :::warning 由於 GPIO 原作者 Gordon 已不再維護,請使用 `git clone https://github.com/WiringPi/WiringPi` ::: ### Xbox * [Xbox搖桿選購](https://blog.xuite.net/e613011/book/588868619) * [e-Manual](https://emanual.robotis.com/docs/en/platform/turtlebot3/teleoperation/#xbox-360-joystick) * [ROS使用XBOX ONE 手柄](https://www.cnblogs.com/lizhensheng/p/11117708.html) * {%youtube 4cSRdS83PX4 %} * [樹梅派藍芽設定](https://medium.com/@r3850355/%E7%94%A8-raspberry-pi-4-%E4%BE%86%E5%81%9A-line-beacon-%E5%9B%9B-%E8%A8%AD%E5%AE%9A%E8%97%8D%E7%89%99-e06901d0602a) ### ROS Library * [teleop_twist_joy](https://index.ros.org/p/teleop_twist_joy/github-ros2-teleop_twist_joy/) * [teleop_twist_joy](http://wiki.ros.org/teleop_twist_joy) # Pi Camera Module install on TB3 burger ## Hardware Installation Tutorial {%youtube VzYGDq0D1mw %} * See [TurtleBot3 Waffle Pi 3D Model](https://emanual.robotis.com/docs/en/platform/turtlebot3/features/#open-source-hardware) ## System Settings ### Install `raspi-config` * [Follow this instruction](https://github.com/EmilGus/install_raspi-config) ```shell $ git clone https://github.com/EmilGus/install_raspi-config $ cd install_raspi-config $ sudo sh install.sh ``` ### Enable Camera Module :::warning <span class="red"> [Your firmware appears to be out of date (no start_x.elf). Please update] 問題 </span> <span class="sol"> Solution: </span> [树莓派通过raspi-config启动摄像头时,出错:Your firmwave appears to be out of date (no start_x.elf). Please update](https://blog.csdn.net/qq_34493401/article/details/107672691) ```shell $ df -h $ sudo mount /dev/mmcblk0p1 /boot $ sudo raspi-config ``` ::: ## Take a photo ### Camera Module with Raspberry Pi4 {%youtube 0hrF8Wq8SSQ %} ``` $ vcgencmd get_camera > supported=1 detected=1 # success $ ls /dev/video* # raspistill $ sudo apt install libraspberrypi-bin $ raspistill -v $ sudo modprobe bcm2835-v4l2 $ sudo raspistill -o test.jpg # fswebcam $ sudo apt-get install fswebcam $ sudo fswebcam image.jpg $ sudo fswebcam /dev/video10 image.jpg ``` ## Use ROS ### Install ROS Package `raspicam` (TurtleBot) * [Github: raspicam_node/Build Instructions](https://github.com/UbiquityRobotics/raspicam_node/tree/noetic-devel#build-instructions) ### Run `raspicam` Node * [Run raspicam Node](https://emanual.robotis.com/docs/en/platform/turtlebot3/appendix_raspi_cam/#run-raspicam-node)

    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