Connecting to sources…

How to build TurtleBot 4: the whole process

151 steps to build TurtleBot 4, from buying parts, printing and assembly to software, calibration and training, with the bill of materials, shop links and the official s…

Price not on the page checked

Buy parts

  • Choose a Dual-Band Router

    Use a router that supports both 2.4 GHz and 5 GHz for the best performance.

Assemble

  • Power on the robot

    Place the TurtleBot 4 on its dock. The dock's green LED turns on for a few seconds and the TurtleBot 4 powers on; allow the robot time to boot.

  • Connect to Raspberry Pi by Ethernet

    Connect the PC directly to the Raspberry Pi with an Ethernet cable; a USB-to-Ethernet adapter may be needed.

  • Power Off and Remove microSD Card

    Power off the robot, then remove the microSD card from the Raspberry Pi.

  • Insert microSD Card into PC

    Insert the microSD card into the PC; an adapter may be needed.

  • Connect the Two Computing Units

    Connect the Create® 3 and Raspberry Pi with a USB-C cable; it powers the Raspberry Pi and establishes an Ethernet connection between the units.

Software

  • SSH into the Raspberry Pi

    SSH into the Raspberry Pi on the TurtleBot 4.

  • Enable IPv4 forwarding

    Edit /etc/sysctl.conf and uncomment net.ipv4.ip_forward=1.

  • Get and install discovery files

    Clone the specified turtlebot4_setup branch, move the discovery configuration and installer to their target locations, then remove the cloned directory.

  • Source other workspaces if needed

    If needed, configure and source other workspaces in /etc/turtlebot4_discovery/setup.bash.

  • Update the Bash startup configuration

    Add source /etc/turtlebot4_discovery/setup.bash to .bashrc.

  • Reinstall the upstart job

    Reinstall the upstart job with the updated install.py script and specify the discovery settings workspace.

  • SSH into the Raspberry Pi again

    SSH into the Raspberry Pi on the TurtleBot 4 again.

  • Exit the setup tool

    Exit the setup tool after completing the configuration.

  • Apply the new settings in the terminal

    Run turtlebot4-source in the terminal to apply the new settings to it.

  • Restart the ROS 2 Daemon

    Use turtlebot4-daemon-restart, or run ros2 daemon stop followed by ros2 daemon start, to restart the ROS 2 daemon.

  • Update Create 3 Firmware

    Use the webserver to update the Create® 3 to the latest firmware.

  • Factory Reset and Disconnect Wi-Fi

    After updating the firmware, perform a factory reset to disconnect the Create® 3 from any Wi-Fi networks.

  • SSH into the Raspberry Pi

    SSH into the TurtleBot 4 Raspberry Pi.

  • Run the TurtleBot 4 Setup Tool

    Run the TurtleBot 4 setup tool on the Raspberry Pi.

  • Open the Discovery Server Menu

    Enter the Discovery Server menu through ROS Setup in the setup tool.

  • Exit the Setup Tool

    Exit the TurtleBot 4 setup tool shown in the document.

  • Load the New Environment

    Run turtlebot4-source in the terminal to apply the new settings to the terminal environment.

  • Restart the ROS 2 Daemon Again

    Use turtlebot4-daemon-restart again, or run ros2 daemon stop and ros2 daemon start, to restart the ROS 2 daemon.

  • Install User PC Discovery Files

    Under User PC Setup, clone the turtlebot4_setup repository and install the ip_route service, script, and discovery_super_client files into the documented system directories. The shown command uses the galactic branch, while the page also lists humble and jazzy tabs.

  • Enable and Start the IP Route Service

    Reload the systemd daemon, enable ip_route.service, and start the service.

  • Load the Bash Environment

    Run source ~/.bashrc to load the Bash configuration.

  • Restart the User PC ROS 2 Daemon

    Run ros2 daemon stop and ros2 daemon start to restart the ROS 2 daemon on the user PC.

  • Run the Discovery Configuration Script

    Run configure_discovery.sh to configure the user PC's Discovery Server connection.

  • Create the discovery configuration directory

    Create a directory named /etc/turtlebot4_discovery/.

  • Create the discovery server configuration file

    Create a setup.bash file containing the required configurations in /etc/turtlebot4_discovery/.

  • Add the configuration file to Bashrc

    Add the line source /etc/turtlebot4_discovery/setup.bash to the ~/.bashrc file.

  • Check and delete an existing IP route

    Check whether an IP route from the previous discovery server configuration method exists, and delete the route if it does.

  • Load the Bashrc configuration

    Run source ~/.bashrc to load the configuration in ~/.bashrc.

  • Restart the ROS 2 daemon

    Stop the ROS 2 daemon and then start it again.

  • Run the discovery server configuration script

    Download and run configure_discovery.sh from the jazzy branch of the turtlebot4_setup repository.

  • Set the robot ROS domain ID

    Enter the ROS_DOMAIN_ID of your robot or robots; the default is 0.

  • Set the discovery server ID

    Enter the Discovery Server ID; the default is 0, and each server must have a unique server ID.

  • Set the discovery server IP address

    Enter the Discovery Server IP address, which will most often be the TurtleBot4 Raspberry Pi WiFi IP address.

  • Set the discovery server port

    Enter the Discovery Server port; the default is 11811.

  • Apply Discovery Server Environment

    Set ROS_DOMAIN_ID=0 and ROS_DISCOVERY_SERVER with both server addresses.

  • Source Bash Configuration Changes

    Source the ~/.bashrc file to apply the changes.

  • Configure the First Discovery Server

    Enter discovery server ID 0, IP address 192.168.131.5, and the default port 11811, then select a to add another server.

  • Configure the Next Discovery Server

    Enter discovery server ID 1, IP address 192.168.131.6, and the default port 11811, then select d to finish the configuration.

  • Confirm Discovery Server Environment Variables

    Confirm ROS_DOMAIN_ID is 0 and ROS_DISCOVERY_SERVER contains both server addresses, then enter the sudo password when prompted.

  • Source bashrc to Apply Changes

    Source the ~/.bashrc file so the discovery server configuration changes take effect.

Calibrate and test

  • Save discovery server settings

    In the webserver, open Application -> Configuration and save the displayed discovery server settings.

  • Enter the Discovery Server menu

    Use ROS Setup to enter the Discovery Server menu.

  • Enable the discovery server

    Set Enabled to True.

  • Keep the onboard server port

    Leave the onboard server port set to 11811.

  • Set the onboard server ID

    Assign a unique onboard server ID. It can remain 0 for one robot; with multiple robots, give each robot a different number from 0 to 255.

  • Keep the default server settings

    Leave the remaining settings at their defaults. When the offboard IP address is blank, all offboard server settings are ignored.

  • Save and apply the settings

    Save the settings, return to the main menu, and apply the settings.

  • List Create 3 Topics

    When the Create® 3 chimes, run ros2 topic list to view the topics.

  • Enable Discovery Server

    Set Enabled to True.

  • Keep the Onboard Server Port

    Leave the onboard server port set to 11811.

  • Set the Onboard Server ID

    Set the onboard server ID to a unique number in the system. It can remain 0 for one robot; with multiple robots, give each robot a unique number from 0 to 255.

  • Keep Default Offboard Settings

    Leave the remaining offboard server settings at their defaults. When the offboard IP address is blank, all offboard server settings are ignored.

  • Save and Apply Settings

    Save the settings, navigate to the main menu, and apply the settings.

  • Confirm the Topic List

    When the Create® 3 chimes, run ros2 topic list again to view the topics.

  • Edit the IP Route Script

    Replace 10.42.0.1 in /usr/local/sbin/ip_route.sh.

  • Edit the Discovery Client XML

    Replace 127.0.0.1 in /etc/turtlebot4_discovery/discovery_super_client.xml.

  • Edit the Discovery Setup Script

    Replace 127.0.0.1 in /etc/turtlebot4_discovery/setup.bash.

  • Check User PC Topics

    Run ros2 topic list in the user PC terminal to inspect the visible topics.

  • Set the Robot ROS_DOMAIN_ID

    Enter the ROS_DOMAIN_ID of the robot or robots; the default is 0.

  • Set the Discovery Server ID

    Enter the Discovery Server ID. It defaults to 0, and each server must have a unique server ID.

  • Set the Discovery Server IP Address

    Enter the Discovery Server IP address, which most often should be the TurtleBot 4 Raspberry Pi Wi-Fi IP.

  • Set the Discovery Server Port

    Enter the Discovery Server port; the default is 11811.

  • List ROS 2 topics

    Run ros2 topic list to list ROS 2 topics.

  • Set Robot 1 Namespace

    Set ROBOT_NAMESPACE to /robot1.

  • Enable Robot 1 Onboard Server

    Enable the onboard server, set its port to 11811, and set its server ID to 0.

  • Set Robot 1 Offboard Server

    Leave the offboard server IP empty, set its port to 11811, and set its server ID to 1.

  • Set Robot 1 Wi-Fi

    Set Wi-Fi mode to Client, SSID to my_ttb4_network, password to secure_password, and band to 5GHz. Enable DHCP and leave the IP address empty.

  • Set Robot 2 Namespace

    Set ROBOT_NAMESPACE to /robot2.

  • Enable Robot 2 Onboard Server

    Enable the onboard server, set its port to 11811, and set its server ID to 1.

  • Set Robot 2 Offboard Server

    Leave the offboard server IP empty, set its port to 11811, and set its server ID to 1.

  • Set Robot 2 Wi-Fi

    Set Wi-Fi mode to Client, SSID to my_ttb4_network, password to secure_password, and band to 5GHz. Enable DHCP and leave the IP address empty.

  • Set ROS Domain ID

    Accept ROS_DOMAIN_ID 0 on the user computer.

  • Add First Discovery Server

    Enter discovery server ID 0 and IP 192.168.131.5, and use port 11811. Then select a to add another server.

  • Add Second Discovery Server

    Enter the next discovery server ID 1 and IP 192.168.131.6, and use port 11811. Select d when finished.

  • Find the new Raspberry Pi IP

    After the Wi-Fi settings are applied, the Raspberry Pi reboots and connects to the network, and DHCP assigns a new IP address. The IP address is shown at the top of the TurtleBot 4 display; for TurtleBot 4 Lite, check the /ip topic.

  • Check IP with Galactic

    Set the RMW implementation and ROS_DOMAIN_ID in the ROS Galactic environment, then listen to the /ip topic.

  • Check IP with Humble

    Set the RMW implementation and ROS_DOMAIN_ID in the ROS Humble environment, then listen to the /ip topic.

  • Check IP with Jazzy

    Set the RMW implementation and ROS_DOMAIN_ID in the ROS Jazzy environment, then listen to the /ip topic.

  • Confirm the printed IP address

    Confirm that the IP address is printed periodically in the terminal, such as 192.168.28.24.

  • Find IP through gateway

    If the previous methods do not find the IP address, log into the gateway and look for a device with the host name “ubuntu”.

Data and training

  • Launch Galactic keyboard teleop

    Start the CLI interface and command the robot to drive using keyboard keys.

  • Launch Humble keyboard teleop

    Start the CLI interface and command the robot to drive using keyboard keys.

  • Launch Jazzy keyboard teleop

    Start the CLI keyboard teleop interface with stamped:=true and command the robot using keyboard keys.

  • Drive with keyboard keys

    Press i to drive forward and j to rotate left; use the other available keys to control the robot.

  • Adjust linear and angular speeds

    Adjust the robot's linear and angular speeds while it is driving.

  • Teleoperate with the joystick

    To drive the robot, hold either L1 or R1 and move the left joystick. By default, L1 drives at normal speed and R1 drives at turbo speed; the buttons can be changed in the configuration file.

Use it

  • Publish velocity commands

    Publish velocity messages on the /cmd_vel topic using geometry_msgs/Twist or geometry_msgs/msg/TwistStamped. All velocity components in the examples are initially set to 0.0.

  • Set linear and angular velocity

    Set linear.x to drive the robot forwards or backwards, and set angular.z to rotate it left or right.

  • Send a Create 3 action

    Use the DriveDistance, DriveArc, and RotateAngle ROS 2 actions to drive the robot. The example commands the robot to drive 0.5 m forwards at 0.3 m/s.

  • SSH back using the new IP

    After finding the new IP address, use it to SSH back into the robot.

  • Update Wireless Network Before Moving

    Before moving TurtleBot 4 to a location with a different Wi-Fi network, reconfigure the Raspberry Pi for that network or place it into AP mode; otherwise it will continue trying to connect to the previous network.

Parts

  • iRobot Create 3 base
  • Raspberry Pi 4B 4GB
  • OAK‑D‑Lite (Lite) or OAK‑D‑Pro (Standard)
  • RPLIDAR A1M8

Tools

  • Delivered assembled; no printing

Skills

  • ROS 2

Software

  • ROS 2 user manual

Documents