Skip to content

Real Robot Labs

Tom Howard edited this page Apr 5, 2022 · 21 revisions

Working with the Real TurtleBot3 Waffles

Read this page IN FULL before you do anything else!

This section is here to help you apply your simulation-based ROS knowledge to our Real TurtleBot3 Waffle Robots!

Quick Links

Handling the Robots

You'll be very familiar with the simulated version of our TurtleBot3 Waffle robots by now, but the real ones are even better! You may recall the overview of the robots from the Home Page, but here is the figure again, to remind you what the real ones look like:

As you can see, the robots have lots of exposed sensors and electronics and so you must take great care when handling them to avoid the robots becoming damaged in any way. When handling a robot, always hold it by either the black waffle layers, or the vertical support pillars.

Do not pick the robot up or carry it by the camera or LiDAR sensor! These are delicate devices that could be easily damaged!

A lot of the electronics are housed on the middle waffle layer. Try not to touch any of the circuit boards, and take care not to pull on any of the cabling or try to remove or rehouse any of the connections. If you have any concerns with any of the electronics or cabling, if something has come loose, or if your robot doesn't seem to be working properly then ask a member of the teaching team to have a look for you.

The robots will be provided to you with a battery already installed and ready to go. Don't try to disconnect or remove the battery yourselves! The robot will beep when the battery is low, and if this happens ask a member of the team to get you a replacement (we have plenty).

Local vs. Remote Deployment

There are two options when working with the real robots:

  1. "Local" Deployment: The robot has an Up Squared Single Board Computer on-board, which runs Linux and ROS. We can therefore create ROS packages and nodes directly on the robot's filesystem and execute them on the robot itself, i.e. executing them "locally".
  2. "Remote" Deployment: ROS is network-based and can work over a WiFi connection, so we can very easily add additional external ("remote") devices into our ROS network (e.g. a laptop computer), create ROS packages and Nodes, and execute these on the remote device to invoke changes to a robot connected to the same ROS network.

To start with, we'll explore how to get the robots working and how to deploy ROS packages and nodes 'locally'. Read on and we'll get to this shortly.

Eventually though, you'll want to do some more advanced things, for which you will want to take advantage of the 'ROS visualisation tools' such as RViz and rqt_image_view. We'll need an external computer (with a display!) to do this though, so we have a fleet of pre-configured Robot Laptops in the lab that are set up to allow you to do this...

The Robot Laptops

The WSL-ROS environment that you used throughout Weeks 1-6 of this Wiki ran Ubuntu 20.04 and ROS Noetic, and the laptops (and robots) that we have in the robotics lab run exactly the same OS/Software.

On the laptops there is a "student" user account that you should use when working in the lab. The laptop should log you into this user account automatically on startup, but we will provide you with the account password as well, during the lab sessions, should you need it.

WiFi

The Robots and Laptops connect to a dedicated wireless network running in the Diamond called 'DIA-LAB'. There are a few things that you shoudk bear in mind:

  • Laptops must be connected to the DIA-LAB network in order us to establish a ROS network between them and the robots.
  • Laptops do not have internet access when conected to DIA-LAB.
  • You'll need to connect the laptop to eduroam (or use a Computer Room 3 workstations) to access any external resources (such as this Wiki).

Credentials for DIA-LAB and eduroam have already been set on the laptops, allowing you to connect to either network straight away, but speak to a member of the teaching team if you are having any issues.

Available IDE

Visual Studio Code is installed on the laptops for you to use when writing/editing your Python ROS nodes. Launch VS Code from any terminal by simply typing code, or you could also launch it by clicking the icon in the favourites bar on the left-hand-side of the screen:

Shutting Down the Robot

TODO

Real Robot Lab Instructions:
Next: Local Deployment →

END

Working with the Robot Laptops

The WSL-ROS environment that you used throughout Weeks 1-6 of this Wiki ran Ubuntu 20.04 and ROS Noetic, and the laptops (and robots) that we have in the robotics lab run exactly the same OS/Software.

On the laptops there is a "student" user account that you should use when working in the lab. The laptop should log you into this user account automatically on startup, but we will provide you with the account password as well, during the lab sessions, should you need it.

Launching ROS on the Robot

There are a number of initial steps that need to be carried out in order to start up your robot and get ROS running.

Note: As you will have experienced whilst working with ROS in simulation over the last six weeks: you will often need to have several terminal windows running simultaneously. Only close down terminals or shutdown processes (using Ctrl+C) when instructed to do so otherwise your robot may not function correctly!

We will be accessing the robot over the DIA-LAB WiFi network via a secure shell connection from the laptop, giving us a Linux terminal running on the robot's single board computer (the UP Squared board). We do this using ssh.

Remember to make sure the laptop is connected to the DIA-LAB WiFi network!

  1. Open up a terminal instance on the laptop, which we will refer to as TERMINAL 1. Then, enter the following to establish a connection to your robot via ssh:

     [TERMINAL 1] $ ssh robot@dia-waffleX
    

    ... replacing X with the number of the robot that you are working with. Enter the password when requested (we'll tell you what this is in the lab).

  2. The terminal prompt should change as follows:

     robot@dia-waffleX:~$  
    

    This indicates that you are now logged in to the computer on the robot (dia-waffleX) via the local username: robot.

  3. Then, launch a tmux session to provide some advanced functionality for the remote session:

     [TERMINAL 1] $ tmux
    

    Any text in the terminal should now clear and a green banner should appear across the bottom of the terminal window indicating that you are now working within a tmux session. tmux gives us a more robust connection to the robot and you can find a (very quick) guide for how to work with it here. We will refer to this terminal window as TERMINAL 1: TMUX 0 for the remainder of these instructions.

  4. We need to launch the ROS Master and all the core packages on the robot that provide its basic functionality. We can do this using a single launch file located within a convenience package called turtlebot3_bringup, which is installed locally on the robot. Enter the following in TERMINAL 1: TMUX 0:

     [TERMINAL 1: TMUX 0] $ roslaunch turtlebot3_bringup turtlebot3_robot.launch
    

    Pro Tip: Alternatively, you could use one of our handy bash aliases for this command instead.

    Once you see a message containing the text:

     [INFO] [#####] Calibration End  
    

    then the robot core packages are up and running.

Job done. The ROS Master and the basic functionality on our robot are now up and running, so we can get to work.

Lab Exercises

Over the next two pages you can find some lab exercises that you can run through to help you to familiarise yourself with the robots and how they work. Some of these may be familiar from Weeks 1-6: and here you will see how, with ROS, working in simulation or on a real robot works pretty much the same.

To get you started, have a look at the "Lab Exercises for Beginners" page now and, when you are happy with all that, you might like to move on to the "Lab Exercises for Pros!" page.