-
Notifications
You must be signed in to change notification settings - Fork 0
Real Robot Labs
So far in this Wiki you have worked in simulation only. The material in this section however is here to help you apply your simulation-based ROS knowledge to our Real TurtleBot3 Waffle Robots! We start off on this page with the fundamentals: how to get started with the robots and our dedicated Robot Laptops, and how to get ROS up and running between the two. After that, the following pages take you through some exercises that you can have a go at to get more familiar with the hardware, to support the real-robot based assignments that you will need to complete for your course.
TODO
TODO
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.
Next, there are three important things you need to do...
Our robot laptops are also setup to work with our friendly MiRo robots, and so there are two different modes that the laptops can operate in: 'MiRo Mode' and 'Waffle Mode'. Clearly, we will want to use the latter, so make sure the laptop is indeed in Waffle Mode by opening up an Ubuntu Terminal Instance on the laptop (using the Ctrl+Alt+T
keyboard shortcut) and running the follow command:
$ robot_switch tb3
The following message indicates that the laptop has successfully been switched into Waffle Mode (if it wasn't already):
The robot laptops can also be used to work in simulation too (but you've probably had enough of that by now, haven't you?!). To work with the physical robots, make sure that you are in 'Real Robot Mode' by running the following command:
$ robot_mode robot
... which should present you with the following message:
Switching into 'Real Robot Mode' (run 'robot_mode sim' to work in simulation instead).
Shortly, we will launch ROS on the robot. This establishes the ROS Master on the robot itself, and the laptop therefore needs to know where to look to connect to the same ROS Network. Identify the number of the robot that you are working with by looking at the label printed on its body, which will be of the form:
dia-waffleX
... where X
indicates the 'Robot Number' (a number between 1 and 50). To tell the laptop that this is the robot that you will be working with, run the following command:
$ pair_with_waffle X
... replacing X
with the actual number of the robot, as determined above.
You should then see the following message:
Pairing with robot: dia-waffleX...
Done. Re-source the .bashrc (by typing 'src') for the changes to take effect.
Do as instructed and re-source your environment now:
$ src
Once you've done all three of these things, it's a good idea to close down the terminal window. Don’t worry if you see a pop-up message saying that "there is a process still running," just click the "Close Terminal" button to proceed. Every new terminal window you open from now on should have the correct settings applied, so you're good to go!
The Robots and Laptops will communicate with one another (via a ROS Network) on a special wireless network running in the Diamond called 'DIA-LAB'. Laptops must be connected to the DIA-LAB network in order for you to communicate with the robots, so make sure that this is the case now. DIA-LAB is an internal network, so you will not be able to access the internet and you should use the Computer Room 3 workstations to access any external resources (such as this Wiki) instead.
Credentials for DIA-LAB should have already been set on the laptops, allowing you to connect straight away, but speak to a member of the teaching team if you are having any issues.
If you do want to connect the laptop to the internet temporarily, then you can also connect it to 'eduroam', but be aware that this will break any ROS network that may be running between the laptop and a robot. Credentials for eduroam have already been setup too, so you should be able to connect the laptop to it straight away, but - once again - speak to the teaching team if you are having any issues.
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:
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!
-
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). -
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
. -
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. -
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.
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.
COM2009/3009 Robotics Lab Course
Updated for the 2021-22 Academic Year
Dr Tom Howard | Multidisciplinary Engineering Education (MEE) | The University of Sheffield
The documentation within this Wiki is licensed under Creative Commons License CC BY-NC:
You are free to distribute, remix, adapt, and build upon this work (for non-commercial purposes only) as long as credit is given to the original author.