Edit on GitHub

SBC Setup

WARNING

  • This process may take long time. Do not attempt to complete setup on battery power, connect your SBC to a wall power supply.
  • An HDMI monitor and input devices such as a keyboard and a mouse will be required to complete this setup.
  • In order to use the webOS Robotics Platform, please refer to webOS Robotics Platform for further instructions. Packages will be cross-compiled using OpenEmbedded on a higher performance PC and an image file created for installation on the SBC.

Prepare microSD Card and Reader

If your PC does not have a microSD slot, please use a microSD card reader to burn the recovery image.

The microSD card reader is not included in the TurtleBot3 package.

Install Raspberry Pi Imager

Download the Raspberry Pi Imager to install Ubuntu Server 22.04 for Raspberry Pi.
If the Raspberry Pi Imager is already installed, update to the latest version.
Please refer to this article to find more information about Raspberry Pi Imager.

Click here to expand more details about How to install Raspberry Pi Imager.

Install either the deb or apt rpi-imager release.

  1. deb
    Download deb file
    $ cd Downloads
    $ sudo dpkg -i imager_[you_rversion]_amd64.deb #check the file name downloaded
    

    If you have any dependency errors, use the following command to force the install.

    $ sudo apt-get install -f
    $ rpi-imager
    
  2. apt
$ sudo apt install rpi-imager
$ rpi-imager

Install Ubuntu 22.04

  1. Run Raspberry Pi Imager
  2. Click CHOOSE OS.
  3. Select Other gerneral-purpose OS.
  4. Select Ubuntu.
  5. Select Ubuntu Server 22.04.5 LTS (64-bit) that support RPi 3/4/400.
    (Choose Server OS, not desktop OS)
  6. Click CHOOSE STORAGE and select the micro SD card.
  7. Click WRITE to install Ubuntu.

Configure the Raspberry Pi

The HDMI cable must be connected before powering on the Raspberry Pi, or the HDMI port of the Raspberry Pi will be disabled.

  1. Boot Up the Raspberry Pi
    * More information about where to connect HDMI, power and input devices is available here
    a. Connect the HDMI cable to the HDMI port of Raspberry Pi.
    b. Connect input devices (generally keyboard) to the USB port of the Raspberry Pi.
    c. Insert the microSD card into Raspberry Pi.
    d. Connect the power (either USB or OpenCR) to turn on the Raspberry Pi.
    e. Login with ID ubuntu and PASSWORD ubuntu. Once logged in, you’ll be asked to change the password.

  2. Open the network configuration file with the command below.
    [TurtleBot3 SBC]
    $ sudo nano /etc/netplan/50-cloud-init.yaml
    
  3. Edit the content to match the image below while replacing WIFI_SSID and WIFI_PASSWORD with your actual wifi SSID and password.

  4. Save the file with Ctrl+S and exit with Ctrl+X.

  5. Enter the command below to edit the automatic update settings file.
    [TurtleBot3 SBC]
    $ sudo nano /etc/apt/apt.conf.d/20auto-upgrades
    
  6. Change the update settings to match those below.
    [TurtleBot3 SBC]
    APT::Periodic::Update-Package-Lists "0";
    APT::Periodic::Unattended-Upgrade "0";
    
  7. Save the file with Ctrl+S and exit with Ctrl+X.

  8. Set systemd to prevent boot-up delay even if there is no network at startup. Run the command below to set mask for the systemd process using the following command.
    [TurtleBot3 SBC]
    $ systemctl mask systemd-networkd-wait-online.service
    
  9. Disable Suspend and Hibernation
    [TurtleBot3 SBC]
    $ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
    
  10. Reboot the Raspberry Pi.
    [TurtleBot3 SBC]
    $ reboot
    
  11. After rebooting the Raspberry Pi, if you wish to work from a Remote PC using SSH, use the command below from the remote PC terminal. Make sure to use the password you set in Step 1.
    [Remote PC]
    $ ssh ubuntu@{IP Address of Raspberry PI}
    

Click here to expand more details about how to connect through ssh

  1. Edit the SSH configuration files
    [TurtleBot3 SBC]
    $ sudo nano /etc/ssh/sshd_config.d/50-cloud-init.conf
    

  2. Install net-tools and check your ip.
    [TurtleBot3 SBC]
    $ reboot
    $ sudo apt update
    $ sudo apt install net-tools
    $ ifconfig
    

  3. Enter the command below on the remote PC and use your password for the Ubuntu system.
    [Remote PC]
    $ ssh ubuntu@{IP Address of Raspberry PI}
    

Install packages on Raspberry PI

If you are using the TurtleBot3 2GB, make sure to create swap memory for building packages. Otherwise, you may run out of memory and package building may fail.

  • Create 2GB swap memory. [Remote PC]
    $ sudo fallocate -l 2G /swapfile
    $ sudo chmod 600 /swapfile
    $ sudo mkswap /swapfile
    $ sudo swapon /swapfile
    
  • The following command ensures that the swap file is automatically activated when the system is rebooted.
    $ echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
    
  • Check swap memory.
    $ free -h
    

  1. Install ROS2 Humble Hawksbill
    [TurtleBot3 SBC]
    Follow the instructions from the official ROS2 Humble installation guide. Installing ROS-Base(Bare Bones) is recommended.

  2. Install and Build ROS Packages.
    Building the turtlebot3 package may take longer than an hour. Please use a wall plug power supply to ensure the system is always powered.
    [TurtleBot3 SBC]
    $ sudo apt install python3-argcomplete python3-colcon-common-extensions libboost-system-dev build-essential
    $ sudo apt install ros-humble-hls-lfcd-lds-driver
    $ sudo apt install ros-humble-turtlebot3-msgs
    $ sudo apt install ros-humble-dynamixel-sdk
    $ sudo apt install libudev-dev
    $ mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src
    $ git clone -b humble https://github.com/ROBOTIS-GIT/turtlebot3.git
    $ git clone -b humble https://github.com/ROBOTIS-GIT/ld08_driver.git
    $ cd ~/turtlebot3_ws/src/turtlebot3
    $ rm -r turtlebot3_cartographer turtlebot3_navigation2
    $ cd ~/turtlebot3_ws/
    $ echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc
    $ source ~/.bashrc
    $ colcon build --symlink-install --parallel-workers 1
    $ echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc
    $ source ~/.bashrc
    
  3. USB Port Settings for OpenCR
    [TurtleBot3 SBC]
    $ sudo cp `ros2 pkg prefix turtlebot3_bringup`/share/turtlebot3_bringup/script/99-turtlebot3-cdc.rules /etc/udev/rules.d/
    $ sudo udevadm control --reload-rules
    $ sudo udevadm trigger
    
  4. ROS Domain ID Setting In ROS2 DDS communication, ROS_DOMAIN_ID must match between the Remote PC and TurtleBot3 for communication in the same network environment.The following commands show how to assign a ROS_DOMAIN_ID to the SBC of the TurtleBot3.
    • The default ID of the TurtleBot3 is 30.
    • Configuring the ROS_DOMAIN_ID for the Remote PC and SBC of the TurtleBot3 to 30 is recommended.
      [TurtleBot3 SBC]
      $ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc
      $ source ~/.bashrc
      

WARNING : Do not use an identical ROS_DOMAIN_ID to others in the same network. It will cause a conflict of communication between users under the same network environment.

LDS Configuration

The TurtleBot3 LDS has been updated to the LDS-02 since 2022.
If you have purchased a TurtleBot3 after 2022, please use LDS-02 for your LDS_MODEL.

LDS-01 LDS-02

Depending on your LDS model, use LDS-01 or LDS-02.
[TurtleBot3 SBC]

$ echo 'export LDS_MODEL=LDS-02' >> ~/.bashrc

Apply changes with the command below.
[TurtleBot3 SBC]

$ source ~/.bashrc

Rpi Camera

Introducing the use of the RPi camera with TurtleBot3. There are various ways to publish the output of a RPi camera as a topic.
One method is to use the camera-ros package, and another method is to use the v4l2-camera package.

Using the camera-ros package to use the Pi Camera..

  1. Install camera-ros, ros-humble-image-transport-plugins, v4l-utils.
    [TurtleBot3 SBC]
    $ sudo apt-get install ros-humble-camera-ros ros-humble-image-transport-plugins v4l-utils
    
    • camera-ros: A package that publishes camera output as a topic.
    • ros-humble-image-transport-plugins: Converts image_raw to compressed images for smoother transmission.
    • v4l-utils: A utility that assists with connection.
  2. Run camera_node.
    [TurtleBot3 SBC]
    $ ros2 run camera_ros camera_node --ros-args -p format:='RGB888' -p width:=640 -p height:=480
    
  3. The error message Unable to open camera calibration file [/home/ubuntu/.ros/camera_info/imx219__base_soc_i2c0mux_i2c_1_imx219_10_640x480.yaml] will appear if the camera calibration file is missing. After performing camera calibration, place the corresponding info file in the specified folder.
    The camera_name should be set as imx219__base_soc_i2c0mux_i2c_1_imx219_10_640x480
    Calibration yaml file example
    image_width: 640
    image_height: 480
    camera_name: imx219__base_soc_i2c0mux_i2c_1_imx219_10_640x480
    frame_id: camera
    camera_matrix:
      rows: 3
      cols: 3
      data: [322.0704122808738, 0, 199.2680620421962, 0, 320.8673986158544, 155.2533082600705, 0, 0, 1]
    distortion_model: plumb_bob
    distortion_coefficients:
      rows: 1
      cols: 5
      data: [0.1639958233797625, -0.271840030972792, 0.001055841660100477, -0.00166555973740089, 0]
    rectification_matrix:
      rows: 3
      cols: 3
      data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
    projection_matrix:
      rows: 3
      cols: 4
      data: [329.2483825683594, 0, 198.4101510452074, 0, 0, 329.1044006347656, 155.5057121208347, 0, 0, 0, 1, 0]
    

NOTE
Depending on the network, subscribing directly to the image_raw topic may result in very slow transmission. You can access the image by decoding the image_raw/compressed topic using image_transport.

Using the v4l2-camera package to use the Pi Camera..

  1. Install ros-humble-v4l2-camera, raspi-config, ros-humble-image-transport-plugins, v4l-utils.
    [TurtleBot3 SBC]
    $ sudo apt-get install ros-humble-v4l2-camera raspi-config ros-humble-image-transport-plugins v4l-utils
    
    • ros-humble-v4l2-camera: A package that publishes camera output as a topic.
    • raspi-config: A tool for configuring camera device connections on Raspberry Pi.
    • ros-humble-image-transport-plugins: Converts image_raw to compressed images for smoother transmission.
    • v4l-utils: A utility that assists with connection.
  2. Run raspi-config. v4l2-camera package uses the legacy driver. So we must configure the use of the legacy driver.
    If this step is completed, the camera node of the camera-ros package will no longer be able to detect the camera. To use the camera-ros package after this step, you must disable the legacy driver again.
    [TurtleBot3 SBC]
    $ sudo raspi-config
    

    Select Interface Options.

    Select I1 and set enable legacy camera support. This allows the use of the legacy driver, bcm2835 MMAL.

  3. Create a YAML file containing calibration information. You can create the file using the camera_calibration package. (Currently, this step is skipped in the manual.)
    [TurtleBot3 SBC]
    $ nano ~/calibration.yaml
    
    image_width: 640
    image_height: 480
    camera_name: your_camera_name
    frame_id: camera
    camera_matrix:
      rows: 3
      cols: 3
      data: [322.0704122808738, 0, 199.2680620421962, 0, 320.8673986158544, 155.2533082600705, 0, 0, 1]
    distortion_model: plumb_bob
    distortion_coefficients:
      rows: 1
      cols: 5
      data: [0.1639958233797625, -0.271840030972792, 0.001055841660100477, -0.00166555973740089, 0]
    rectification_matrix:
      rows: 3
      cols: 3
      data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
    projection_matrix:
      rows: 3
      cols: 4
      data: [329.2483825683594, 0, 198.4101510452074, 0, 0, 329.1044006347656, 155.5057121208347, 0, 0, 0, 1, 0]
    
  4. You can check camera_name by this command.
    [TurtleBot3 SBC]
    $ v4l2-ctl --list-devices
    

    In this case, camera name is mmal_service_16.1.

  5. Run v4l2_camera_node.
    [TurtleBot3 SBC]
    $ ros2 run v4l2_camera v4l2_camera_node --ros-args -p image_size:=[640,480] -p camera_info_url:="file:///home/ubuntu/calibration.yaml" -p output_encoding:="yuv422_yuy2"
    

    output_encoding parameter refers to the image encoding type. The default value is rgb8, but since it involves a conversion process, it can be slow.
    Therefore, it is recommended to set it to “yuv422_yuy2” and perform the conversion on the remote PC after subscribing to the topic. In this case, the image_compressed topic cannot be viewed directly using rqt. So if you want to view the camera using rqt, change it to rgb8.

NOTE
Depending on the network, subscribing directly to the image_raw topic may result in very slow transmission. You can access the image by decoding the image_raw/compressed topic using image_transport.


This is it! Now you are done with SBC setup :)
Next Step : OpenCR Setup

SBC Setup

WARNING

  • This process may take long time. Do not use battery power while following this section, plug your PC into a DC wall power supply.
  • An HDMI monitor and input devices such as a keyboard and a mouse will be required to complete this setup.

Prepare microSD Card and Reader

If your PC do not have a microSD slot, use a microSD card reader to burn the required recovery image to the SD card.

Download TurtleBot3 SBC Image

Download the correct image file for your hardware and ROS version.
Noetic version images are created based on Ubuntu 20.04.

Download Raspberry Pi 3B+ ROS Noetic image

SHA256 : a7c57e20f2ee4204c95315866f4a274886094f7c63ed390b6d06d95074830309

Download Raspberry Pi 4B (2GB or 4GB) ROS Noetic image

SHA256 : 9d48925a78381885916a6f3bb77891adbfae2b271b05fe2ae9a9b7ebd12c46cc

  • Please note that this image may not compatible with the Raspberry Pi 4B with 8GB RAM.

Recovery image files may be modified without any prior notice.

Unzip the downloaded image file

Extract the .img file and save it to your local disk.

Burn the image file

Choose your preferred tool to burn the image to the microSD card. For example, the Raspberry Pi Imager or Linux Disks utility can be used.

Raspberry Pi Imager

Please refer to this article to find more information about Raspberry Pi Imager.

If you have a dependency error for the .deb installation of the imager, use snap install. (This version of imager is not the latest, so it may be a little different from the picture below)
[Remote PC]

$ sudo snap install rpi-imager
$ rpi-imager  

  1. Click CHOOSE OS.
  2. Click Use custom and select the extracted .img file from local disk.
  3. Click CHOOSE STORAGE and select the microSD card.
  4. Click WRITE to start burning the image.

Disks Utility

Disks utility is included in the recent Ubuntu Desktop. Search for “Disks” and launch the app.

  1. Select the microSD card in the left panel.
  2. Select Restore Disk Image option.
  3. Open the .img file from local disk.
  4. Click Start Restoring... > Restore button.

Resize the Partition

In order to reduce the size of recovery image file and to decrease the time to burn the image onto microSD, the recovery partition is minimized.
Please resize the partition to use any available unallocated space.

Be careful not to select an incorrect disk or partition. Partitioning a system disk of your PC may cause serious system malfunctions.

Download or install GParted GUI tool

  1. Select the microSD card from the menu (mounted location may vary by system).
  2. Right click on the yellow partition.
  3. Select Resize/Move option.
  4. Drag the right edge of the partition to all the way to the right end.
  5. Click Resize/Move button.
  6. Click the Apply All Operations green check button at the top.

Configure the WiFi Network Setting

  1. Open a terminal window with Alt+Ctrl+T and go to the netplan directory on the microSD card.
    Start editing the 50-cloud-init.yaml file with superuser permissions.
    [Remote PC]
    $ cd /media/$USER/writable/etc/netplan
    $ sudoedit 50-cloud-init.yaml
    

    Replace the WIFI_SSID and WIFI_PASSWORD with your wifi SSID and password.

    Save the file with Ctrl+S and exit with Ctrl+X.

If “No such file or directory” is returned, make sure the microSD is mounted correctly

  1. Boot Up the Raspberry Pi
    a. Connect the HDMI cable of the monitor to the HDMI port of the Raspberry Pi.
    b. Connect the input devices to the USB port of Raspberry Pi. c. Insert the microSD card.
    d. Connect power (either with USB or the OpenCR) to turn on the Raspberry Pi.
    e. Login with ID ubuntu and PASSWORD turtlebot.`

The HDMI cable has to be connected before powering on the Raspberry Pi, or else the HDMI port of the Raspberry Pi will be disabled.

ROS Network Configuration

NOTE : If you encounter apt failures related to the ROS GPG key (due to the existing GPG expiration), you may need to update your GPG key. Please see ROS GPG Key Expiration Incident, and proceed to the given solution.

Please follow the instructions below on the SBC (Raspberry Pi).

  1. Confirm the WiFi IP address.
    [Turtlebot3 SBC]
    $ ifconfig  
    
  2. Edit the .bashrc file.
    [Turtlebot3 SBC]
    $ nano ~/.bashrc  
    
  3. Find the ROS_MASTER_URI and ROS_HOSTNAME setting section, then modify the IP addresses to the correct addresses for your devices. [Turtlebot3 SBC]
    export ROS_MASTER_URI=http://{IP_ADDRESS_OF_REMOTE_PC}:11311  
    export ROS_HOSTNAME={IP_ADDRESS_OF_RASPBERRY_PI_3}  
    
  4. Save the file with Ctrl + S and exit the nano editor with Ctrl + X.

  5. Apply changes with the command below.
    [Turtlebot3 SBC]
    $ source ~/.bashrc  
    

NEW LDS-02 Configuration

LDS-01 LDS-02

The TurtleBot3 LDS has been updated to LDS-02 since 2022 models.
Please follow the instructions below on the SBC (Raspberry Pi) of TurtleBot3.

  1. Install the LDS-02 driver and update TurtleBot3 package
    [Turtlebot3 SBC]
    $ sudo apt update
    $ sudo apt install libudev-dev
    $ cd ~/catkin_ws/src
    $ git clone -b noetic 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 the LDS_MODEL to the bashrc file. Depending on your LDS model, use LDS-01 or LDS-02.
    [Turtlebot3 SBC]
    $ echo 'export LDS_MODEL=LDS-02' >> ~/.bashrc
    $ source ~/.bashrc
    

This is it! Now you are done with the SBC setup :)
Next Step : OpenCR Setup

Click to expand : Manual SBC Setup Instructions

Please be aware that this manual setup takes a lot more time than burning the recovery image file, but allows flexible choice of package installation. This instruction is not recommended for beginners.

  1. Download the proper Ubuntu 20.04.1(Focal) Preinstalled Server image on your PC.
  2. Extract the downloaded file.

  3. Burn the .img file to the microSD card.

  4. Boot Up the Raspberry Pi
    a. Connect the HDMI cable of the monitor to the HDMI port of Raspberry Pi.
    b. Connect input devices to the USB port of Raspberry Pi.
    c. Insert the microSD card.
    d. Connect the power (either with USB or OpenCR) to turn on the Raspberry Pi.

  5. Configure the Raspberry Pi
    a. Log in with the default username (ubuntu) and password (ubuntu). After logging in, system will ask you to change the password.
    b. Open the automatic update settings file.
    $ sudo nano /etc/apt/apt.conf.d/20auto-upgrades
    
  6. Change the update settings as below.
    APT::Periodic::Update-Package-Lists "0";
    APT::Periodic::Unattended-Upgrade "0";
    

    a. Save the file with Ctrl+S and exit with Ctrl+X.

  7. Configure the WiFi network settings.
    $ sudoedit /etc/netplan/50-cloud-init.yaml
    
  8. When the editor is opened, append below contents at the end of the file.
    Replace the WIFI_SSID and WIFI_PASSWORD with your wifi SSID and password.

    Save the file with Ctrl+S and exit with Ctrl+X.

  9. Reboot the Raspberry Pi.
    $ sudo reboot
    
  10. Set systemd to prevent boot-up delay even if there is no network at startup. Run the command below to mask the systemd process using the following command.
    $ systemctl mask systemd-networkd-wait-online.service
    
  11. Disable Suspend and Hibernation
    $ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
    
  12. After rebooting the Raspberry Pi, if you wish to work from the Remote PC using SSH, use the below command to log in from the remote PC terminal. The default password is ubuntu.
    $ ssh ubuntu@{IP Address of Raspberry PI}
    
  13. Install ROS Noetic Ninjemys Enter the below commands to the terminal one at a time.
    In order to check the details of the easy installation script, please refer to the script file.
    $ 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
    

    If the above installation fails, please refer to the official ROS Noetic installation guide.

  14. Install and 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 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. USB Port Settings
    $ rosrun turtlebot3_bringup create_udev_rules
    
  16. ROS Network Configuration Confirm the WiFi IP address and edit the .bashrc file
    $ nano ~/.bashrc
    
  17. Modify the IP addresses of ROS_MASTER_URI and ROS_HOSTNAME.
    export ROS_MASTER_URI=http://{IP_ADDRESS_OF_REMOTE_PC}:11311
    export ROS_HOSTNAME={IP_ADDRESS_OF_RASPBERRY_PI_3}
    
  18. Save the file and exit the nano editor.

  19. LDS Configuration The TurtleBot3 LDS has been updated include the LDS-02 since 2022.
    Please follow the instructions below on the SBC (Raspberry Pi) of the TurtleBot3 to configure the LDS.
    $ sudo apt update
    $ sudo apt install libudev-dev
    $ cd ~/catkin_ws/src
    $ git clone -b noetic https://github.com/ROBOTIS-GIT/ld08_driver.git
    $ cd ~/catkin_ws && catkin_make
    
  20. Export the LDS_MODEL in the bashrc file. Depending on your LDS model, use LDS-01 or LDS-02.
    $ echo 'export LDS_MODEL=LDS-01' >> ~/.bashrc
    $ source ~/.bashrc
    
  21. Apply changes with the command below.
    $ source ~/.bashrc