Setup scripts for the TurtleBot 4 Raspberry Pi.
Every Turtlebot4 comes with a SD card with a pre-installed Turtlebot4 image. If you wish to install an image on your own SD card or update to a newer image, follow these instructions.
-
Download the latest turtlebot4 image.
-
Install the imaging tool dcfldd
sudo apt install dcfldd
- Insert your SD card into your PC and identify it:
sudo fdisk -l
-
The SD card will have a name like
/dev/mmcblk0
or/dev/sda
-
Get the SD flash script and flash the SD card
wget https://raw.githubusercontent.com/turtlebot/turtlebot4-images/galactic/turtlebot4_setup/scripts/sd_flash.sh
bash sd_flash.sh /path/to/image
-
Follow the instructions and wait for the SD card to be flashed.
-
Ensure your Raspberry Pi 4 is not powered before inserting the flashed SD card.
-
Follow Wi-Fi Setup to configure your Wi-Fi.
Follow these instructions if you wish to create a Turtlebot4 image manually.
First install the Raspberry Pi Imager.
- Insert your SD card into your PC and run the Raspberry Pi Imager. Follow the instructions and install Ubuntu 20.04 LTS onto the SD card.
- Ensure your Raspberry Pi 4 is not powered before inserting the flashed SD card.
- You can set up the Raspberry Pi by either connecting it to your network via Ethernet or by using a keyboard and HDMI monitor via a micro HDMI cable.
- Connect the Raspberry Pi to your Network with an Ethernet cable.
- Boot the Raspberry Pi.
- Find the Raspberry Pi's IP using your router's portal.
- SSH into the Raspberry Pi using the IP address.
- The default login is
ubuntu
and password isubuntu
. You will be prompted to change your password.
- Connect a keyboard to the Raspberry Pi via USB.
- Connect a monitor to the Raspberry Pi via the HDMI0 port.
- Boot the Raspberry Pi.
- The default login is
ubuntu
and password isubuntu
. You will be prompted to change your password.
Once you are logged into the Raspberry Pi, configure the Wi-Fi:
sudo nano /etc/netplan/50-cloud-init.yaml
Add the following lines:
wifis:
wlan0:
optional: true
access-points:
"YOUR_WIFI_SSID":
password: "YOUR_WIFI_PASSWORD"
dhcp4: true
Note: Ensure that wifis:
is aligned with the existing ethernets:
line. All indentations should be 4 spaces. Do not use tabs.
- Reboot the Raspberry Pi. It should now be connected to your Wi-Fi.
- Find the Raspberry Pi's IP using your router's portal.
- SSH into the Raspberry Pi using the IP address.
- Once logged in, create a workspace.
mkdir ~/turtlebot4_ws/src -p
- Clone this repository into the src folder
cd ~/turtlebot4_ws/src
git clone https://github.com/turtlebot/turtlebot4_setup.git
- Run the
turtlebot4_setup.sh
script to automatically set up your turtlebot4.
cd ~/turtlebot4_ws
bash src/turtlebot4_robot/turtlebot4_setup/scripts/turtlebot4_setup.sh -m standard
cd ~/turtlebot4_ws
bash src/turtlebot4_robot/turtlebot4_setup/scripts/turtlebot4_setup.sh -m lite
- Run Wi-Fi Setup to enable the 5G Wi-Fi band.
If you wish to manually setup the workspace, follow these instructions.
Follow https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html and install ros-galactic-ros-base
sudo apt update && sudo apt install -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-flake8 \
python3-pip \
python3-pytest-cov \
python3-rosdep \
python3-setuptools \
python3-vcstool \
wget
sudo apt install -y \
libgpiod-dev \
network-manager \
daemontools
sudo apt install -y \
bluez \
bluez-tools \
pi-bluetooth
cd ~/turtlebot4_ws
vcs import src < src/turtlebot4-images/turtlebot4_setup/turtlebot4_packages.repos
Follow https://github.com/luxonis/depthai-ros/tree/main#install-dependencies
cd ~/turtlebot4_ws
sudo rosdep init
rosdep update
rosdep install -r --from-paths src -i -y --rosdistro galactic
source /opt/ros/galactic/setup.bash
cd ~/turtlebot4_ws
colcon build
source install/setup.bash
cd ~/turtlebot4_ws
sudo cp src/turtlebot4_setup/turtlebot4_setup/udev/turtlebot4.rules /etc/udev/rules.d/
echo "dtoverlay=dwc2,dr_mode=peripheral" | sudo tee -a /boot/firmware/usercfg.txt
sudo sed -i '${s/$/ modules-load=dwc2,g_ether/}' /boot/firmware/cmdline.txt
echo "dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=4,i2c_gpio_scl=5" | sudo tee -a /boot/firmware/usercfg.txt
echo "export CYCLONEDDS_URI='<CycloneDDS><Domain><General><NetworkInterfaceAddress>wlan0,usb0</></></></>'" | sudo tee -a ~/.bashrc
ros2 run robot_upstart install turtlebot4_bringup/launch/standard.launch.py --job turtlebot4
ros2 run robot_upstart install turtlebot4_bringup/launch/lite.launch.py --job turtlebot4
Run Wi-Fi Setup
sudo reboot