Turtlebot 2 Setup: Hello World

Shreesh_In_Tech
7 min readJul 9, 2021

--

In this post, I’m going to share the steps I followed to bring up the Turtlebot (with Kobuki base) along with the PC setup, Network Configuration etc.

Turtlebot in Action!

The aim of this post is to bring together all the pieces of information and set up instructions in one place that will make any beginner’s life easier. Following are the references for this post. Feel free to switch between the articles in case you need some additional details.

  1. ROS official tutorial: http://wiki.ros.org/Robots/TurtleBot?distro=indigo
  2. Gaitech EDU tutorial: http://edu.gaitech.hk/getting_started/get-started.html
  3. Another tutorial: https://learn.turtlebot.com/2015/02/01/4/
  4. Ubuntu Installation: https://help.ubuntu.com/community/Installation/FromUSBStickQuick
  5. ROS Indigo Installation : http://wiki.ros.org/indigo/Installation/Ubuntu
  6. Turtlebot 2 Kit (kobuki base, docking station etc. Camera not included): https://www.aliexpress.com/item/32905549807.html

First things first.

Requirements:

  1. Ubuntu Trusty Thar: 14.04 LTS (As ROS Indigo only supports Ubuntu 14.04 LTS or 13.10 from what I know)
  2. ROS: ROS Indigo (As Turtlebot 2 packages are available only in Indigo Version)
  3. 2 PCs required: (Below are the PCs that I used. Any latest PC should work. A notebook will be preferred as a Turtlebot PC due to space restriction on the robot.)
  • Turtlebot PC: HP EliteBook x360 g3
  • Workstation PC: ASUS TUF Gaming F15
The left PC (ASUS) is the workstation PC and the right PC (HP Elitebook) is the Turtlebot PC.

Pre-requisites:

Before you start Ubuntu Installation, for some PCs, you need to make some changes in your BIOS so that it can detect Bootable USB on startup (Details are shared later in the post)

In my case, I suffered a lot to figure out the boot menu bringup for HP Elitebook. For most of the HP PCs, you can just follow and do this in the BIOS:

  • Check for the “Enable Legacy mode and Disable Secure Boot” option and select it.
  • Then, in the BIOS Setup, make sure to uncheck the “fastboot” mode.

Make sure to do this for your PC.

Let’s Dive In!

Step(1/3):

Ubuntu Installation:

Insert the ISO image in a USB either of Original Ubuntu 14.04LTS (for HP Notebook) Or Turtlebot-Trusty Thar ISO from here. (I used this one for ASUS Workstation PC). Depending on your PCs, sometimes Turtlebot’s ISO might not be detected and it will fail to install Ubuntu. Please choose the suitable ISO accordingly.
I would recommend using Turtlebot’s ISO as you don’t have to deal with complicated matters like the space partition etc. Unfortunately, I could not install this on HP PC, so I had to install Ubuntu’s own ISO.
Follow the below steps and install ubuntu on both PCs.

  • Create a bootable USB for installing ubuntu using Rufus by following these instructions.
  • Switch off the laptop, insert the bootable USB into the laptop. Now, Power ON, and hit the right key combination (Esc, F2, F10 etc) to get the Boot Menu. In ASUS, press Esc key once and in Hp, press Esc key multiple times continuously until the Boot Menu appears.
  • You should see the option “Try Ubuntu” or “Install Ubuntu”. Hit “Install Ubuntu”.
  • Follow the instructions, and you will successfully install Ubuntu. Restart and enter the home screen.

NOTE: For installing ubuntu 14.04 original ISO, you need to manually partition the disc. So follow this tutorial.

After following the steps mentioned, you should have your ubuntu running on both PCs.

Workstation PC’s Turtlebot’s Ubuntu Interface(left) & Turtlebot PC’s Ubuntu Original Interface(right)

(Optional) When Wi-Fi Network can not be detected:

After successful installation of Ubuntu, please check if you are able to get connected to Wi-Fi. If it looks all good, you can skip this troubleshoot and go ahead with the next step!

In my case, I could only connect to the Internet via Ethernet Connection on both PCs. This seems to be a kernel and wifi adapter issue that usually occurs when either the Ubuntu version is too old or your PC specifications are too new for the Ubuntu to detect the Wi-Fi driver appropriately.

There are two main workarounds for this.

  1. Update your Ubuntu’s Kernel & Firmware version relevant to your WiFi Adapter.
  • If you have Broadcomm based WiFi Adapters, then try this. Although, I’m not sure if it works 100%.

The following method worked for HP ELITEBOOK x360 G3 having Intel® Dual Band Wireless-AC 8265 WiFi adapter following the steps mentioned here.

You need to have the relevant KERNEL & FIRMWARE in your Ubuntu to solve this issue.

a. Firstly, identify the type of WiFi Adapter (Check in your Windows WiFi properties). Then go to Intel’s website and download the relevant Firmware required.

Important: Ubuntu 14.04 LTS can support a kernel version of 4.4 max. Anything beyond that cannot be installed. But, I think as long as the minimum supported kernel version is 4.xx it should be fine. Although the HP PCs WiFi adapter kernel requirement was 4.6+(exceeding 4.4), it still worked fine! If it is 5.x+, then follow step 2 below.

b. Then, proceed to Kernel installation. Select the appropriate version from here. Then, follow the instructions on this page to install the kernel via CLI and restart. Or you need to download those 4 files manually and transfer them to the PC & install.

I downloaded v4.10/ Kernel and followed the below steps.

Something like this:

cd /tmp/

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10/linux-headers-4.10.0-041000_4.10.0-041000.201702191831_all.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10/linux-headers-4.10.0-041000-generic_4.10.0-041000.201702191831_amd64.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10/linux-image-4.10.0-041000-generic_4.10.0-041000.201702191831_amd64.deb

sudo dpkg -i *.deb

If it throws some dpkg errors, do this:

sudo apt-get cleansudo apt-get updatesudo apt-get install dpkgsudo dpkg -i *.deb

and restart & Your Wi-Fi should be detected!

2. Use an External USB Wi-Fi Adapter.

My Asus laptop had Intel WiFi 6 AX201 160 MHz Wifi Adapter. Min. required kernel version was 5.2+. So clearly, I could not follow the previous method. So, I went with using an external USB WiFi adapter.

  • Bought TP-Link USB Wifi Adapter from here.
  • You might need to follow this. But, for me, as soon as I inserted the TP-Link Wifi Adapter into the ASUS USB port, it started to detect wifi networks right away!

(Optional) Solve Proxy-related network issues:

In case, your workspace network uses a proxy, then you need to make some changes beforehand so that both of your PCs can communicate without any errors.
Solve the proxy issue via Ubuntu CLI. Otherwise, It will create a mess when trying to run “apt-get update”, “apt-install” etc.
Follow this page.
If you are not sure whether “gksudo gedit” is installed or not, you can always use “sudo nano” like below.

sudo nano /etc/apt/apt.conf.d/01proxy
Acquire::http::Proxy “http://<YourProxyAddress>:<Port>";

Needless to say, replace the Proxy Address and Port according to your workspace network details.
Now try,

sudo apt-get update

and confirm that it works without any error.

NOTE: Sometimes Firefox doesn’t seem to work in Ubuntu after you make the above changes. In that case, Go to the Network settings of Firefox and change to “No Proxy or Auto Proxy”. Then it will load pages.

Step(2/3):

For steps 2 and 3, I am going to follow the main tutorial provided by ROS on the Turtlebot setup. Since you will be doing Deb Installation, follow all the instructions accordingly (Not the Source installation!).

ROS Indigo Installation:

I followed the steps mentioned here. During the process, I could not install “1.3 Set Up your Keys” due to some proxy issues. So, I manually accessed this site, copy-pasted the details in the notepad and save it as “ROS.key”.

Or alternatively, you could copy-paste the below content in a NotePad and save it as “ROS.key”.

— — -BEGIN PGP PUBLIC KEY BLOCK — — -Comment: Hostname:Version: Hockeypuck ~unreleasedxsFNBFzvJpYBEADY8l1YvO7iYW5gUESyzsTGnMvVUmlV3XarBaJz9bGRmgPXh7jcVFrQhE0L/HV7LOfoLI9H2GWYyHBqN5ERBlcA8XxG3ZvX7t9nAZPQT2Xxe3GT3trou5oCR+SyHN9xPnUwDuqUSvJ2eqMYb9B/Hph3OmtjG30jSNq9kOF5bBTk1hOTGPH4K/AY0jzT6OpHfXU6ytlFsI47ZKsnTUhipGsKucQ1CXlyirndZ3V3k70YaooZ55rGaIoAWlx2H0J7sAHmqS29N9jV9mo135d+d+TdLBXI0PXtiHzE9IPaX+ctdSUrPnp+TwR99lxglpIG6hLuvOMAaxiqFBB/Jf3XJ8OBakfS6nHrWH2WqQxRbiITl0irkQozpwNEF2Bv0+Jvs1UFEdVGz5a8xexQHst/RmKrtHLct3iOCvBNqoAQRbvWvBhPjO/pV5cYeUljZ5wpHyFkaEViClaVWqa6PIsyLqmyjsruPCWlURLsQoQxABcL8bwxX7UThM6CtH6tGlYZ85RIzRifIm2oudzV5l+8oRgFr9yVcwyOFT6JCioqkwldW52P1pk//SnuexC6LYqqDuHUs5NnokzzpfS6QaWfTY5P5tz4KHJfsjDIktly3mKVfY0fSPVVokdGpcUzvz2hq1fqjxB6MlB/1vtk0bImfcsoxBmF7H+4E9ZN1sX/tSb0KQARAQABzSZPcGVuIFJvYm90aWNzIDxpbmZvQG9zcmZvdW5kYXRpb24ub3JnPsLBlAQTAQoAPhYhBMHPbjHmut6IaLFytPQu1vurF8ZUBQJc7yaWAhsDBQkDwmcABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEPQu1vurF8ZUkhIP/RbZY1ErvCEUy8iLJm9aSpLQnDZl5xILOxyZlzpg+Ml5bb0EkQDr92foCgcvLeANKARNCaGLyNIWkuyDovPV0xZJrEy0kgBrDNb3++NmdI/+GA92pkedMXXioQvqdsxUagXAIB/sNGByJEhs37F05AnFvZbjUhceq3xTlvAMcrBWrgB4NwBivZY6IgLvl/CRQpVYwANShIQdbvHvZSxRonWhNXr6v/Wcf8rsp7g2VqJ2N2AcWT84aa9BLQ3Oe/SgrNx4QEhA1y7rc3oaqPVu5ZXOK+4O14JrpbEZ3Xs9YEjrcOuEDEpYktA8qqUDTdFyZrxb9S6BquUKrA6jZgT913kjJ4e7YAZobC4rH0w4u0PrqDgYOkXA9Mo7L601/7ZaDJob80UcK+Z12ZSw73IgBix6DiJVfXuWkk5PM2zsFn6UOQXUNlZlDAOj5NC01V0fJ8P0v6GO9YOSSQx0j5UtkUbRfp/4W7uCPFvwAatWEHJhlM3sQNiMNStJFegr56xQu1a/cbJH7GdbseMhG/f0BaKQqXCI3ffB5y5AOLc9Hw7PYiTFQsuY1ePRhE+J9mejgWRZxkjAH/FlAubqXkDgterCh+sLkzGf+my2IbsMCuc+3aeNMJ5Ej/vlXefCH/MpPWAHCqpQhe2DET/jRSaM53USAHNx8kw4MPUkxExgI7Sd=nDgR— — -END PGP PUBLIC KEY BLOCK — — -

Then, transfer this key file to ubuntu via USB store it somewhere. Then, go to the ubuntu terminal and run

sudo apt-key add ROS.key

It should Output “OK”. Follow the rest of the instructions on the page. With this, you should have installed ROS Indigo along with the necessary Turtlebot packages.

Step(3/3):

Network Configuration & Turtlebot BringUp!

You are almost there to get your Turtlebot started! Now move to PC Installation(You can skip here as we are already done with the necessary steps.) → Network Configuration.

Carefully follow the instructions when configuring the IP address details for both Turtlebot PC and Workstation PC. This is how the last few lines of the “bashrc” file look like for both of them.

For Workstation PC:

source /opt/ros/indigo/setup.bash
export ROS_MASTER_URI=http://192.168.0.16:11311
export ROS_HOSTNAME=192.168.0.14

For Turtlebot PC:

source /opt/ros/indigo/setup.bash
export ROS_MASTER_URI=http://localhost:11311
export ROS_HOSTNAME=192.168.0.16

Then, run in the sourced environment,

roslaunch turtlebot_bringup minimal.launch — screen

If everything goes well you will hear a sound from kobuki base indicating successful connection!

Turtlebot bringup

Hurray! Now you are all set! After the bringup, follow the tutorials to check sensors, control using keyboard etc via Gaitech EDU. For example, you can try Keyboard-teleoperation. It's quite cool!. You can control your Turtlebot from the Workstation PC. This is how it looks!

Operating Turtlebot wirelessly with Workstation PC Keyboard!

Hope you found this article useful and interesting! Thanks for reading😄! In the next post, I will post some updates on how to control Turtlebot using the Camera attached to the Turtlebot system.

Others:

Dpkg installation and other third-party package installation won’t continue properly with secure-boot enabled. Disable secure boot in Ubuntu by typing this command.

sudo mokutil — disable-validation

You will be asked to set at least 8 digit password. Remember it and then

sudo reboot

Then Mok screen appears. Press change secure-boot. The system will ask you to enter a specific character. Press character and enter. You will do this a couple of times. Then select “yes” to disable secure boot.

--

--

Shreesh_In_Tech
Shreesh_In_Tech

Written by Shreesh_In_Tech

Interested in Robotics, Automation, IoT and Computer Vision!

No responses yet