Skip to content

Getting Started

Tom Howard edited this page Apr 6, 2022 · 31 revisions

Please read this page in full before you do anything else!

Quick Links

  1. Introduction
  2. The WSL-ROS Environment
    1. Launching WSL-ROS for the first time
  3. Configuring Visual Studio Code
  4. A Quick Introduction to the Linux Terminal
  5. The WSL-ROS Environment Part 2 (other things to be aware of)
    1. Returning or Re-Launching the Environment
    2. Backing-Up (and Restoring) your Data
    3. Accessing the Environment Remotely
    4. Windows Terminal Settings

Introduction

Throughout this course you will be working with the most up-to-date version of ROS1: ROS Noetic Ninjemys (or "ROS Noetic" for short). Every version of ROS is tied to a particular version of the Ubuntu Operating System. While it's possible to run ROS on other operating systems (including Windows), we have opted for Ubuntu for stability, reliability and ease! ROS Noetic runs on Ubuntu 20.04 (Focal Fossa).

You will therefore interact with ROS using Linux and so a basic understanding of how to use Linux would be useful. We will also be programming robots using Python, and so a bit of background on how to use this programming language would also help too.

We therefore recommend that you have a look at the following free online courses from the Construct, which are tailored specifically to learning these two subjects with ROS in mind:

The WSL-ROS Environment

For this course we have created a custom ROS and Ubuntu 20.04 environment which runs as a virtual machine on Windows, using the Windows Subsystem for Linux (WSL). Throughout this Wiki we refer to this as the "WSL-ROS Environment" or "WSL-ROS".

WSL-ROS is installed on all of the University of Sheffield Managed Desktop Computers located in Computer Rooms 1, 2, 3 & 4 of the Diamond. You can also access this on some remote-access machines. See the "Accessing the Environment Remotely" Section below for more details on this.

Each time you launch WSL-ROS on an applicable University Machine the WSL-ROS environment will be installed from a custom OS image that we have created, which contains the Ubuntu 20.04 operating system, ROS and all the additional ROS packages that you will need for this lab course. The environment that you install will only remain on the machine that you install it on for a limited time, and will also not be preserved across different computers that you may log into. It is therefore essential that you back up your work every time you use the WSL-ROS environment.

Launching WSL-ROS for the first time

Click the Windows Start Menu button , start typing "wsl-ros" and click on the application shortcut that should then appear in the list:

You will be presented with the following screen:

WSL-ROS is now being installed from the custom OS image, which may take a couple of minutes to complete. Once it's done, the Windows Terminal should automatically launch:

The tab that is opened when the Windows Terminal app launches is an Ubuntu Terminal Instance, giving us access to the Ubuntu 20.04 operating system that we have just installed. This is the WSL-ROS Environment that we have created for this lab course!

You are all set up and ready to go!

Configuring Visual Studio Code

Visual Studio Code (or 'VS Code', for short) should be installed on all of the University of Sheffield Managed Desktop Computers in the Diamond Computer Rooms. This is a great Integrated Development Environment (IDE) that we will rely on quite a lot for this course. We need to make sure it's set up correctly to begin with though, so follow the steps below now to install the "Remote - WSL" VS Code extension, in preparation for later.

Note: You should only ever need to do this bit once: the configurations should be saved to your user profile, and should be carried over to any University Desktop Machine that you log into!

  1. Click the Windows Start Menu button , type "vscode" and the Visual Studio Code application shortcut should then appear in the list:

    Click on it to launch the application.

  2. In the left-hand toolbar click the "Extensions" icon (or use the Ctrl+Shift+X keyboard shortcut):

  3. In the search bar (where is says "Search Extensions in Marketplace") type "remote", find the "Remote - WSL" extension in the list and then click the blue "Install" button next to it:

    Once installed, you should see a page similar to the one below:

    On this page, it should state that "This extension is enabled globally" (as shown in red), and you should also see a green icon with two arrows in the bottom left-hand corner of the application window.

  4. You can close down VS Code now, we'll launch it again when we need it.

A Quick Introduction to the Linux Terminal

As explained earlier, you will be working extensively with the Linux Terminal throughout this lab course. An idle WSL-ROS terminal instance will look like this:

Here, the presence of the $ symbol indicates that the terminal is ready to accept a command. Text before the $ symbol has two parts separated by the : symbol:

  • Text to the left of the : tells us the name of the Linux user ("student" in this case) followed by the WSL-ROS version that you are working with.

  • Text to the right of the : tells us where in the Linux Filesystem we are currently located (~ means "The Home Directory", which is an alias for the path: /home/student/).

If you don't see the $ symbol, then this means that the terminal is currently running a command or process. To stop any running process enter Ctrl+C simultaneously on your keyboard.

The WSL-ROS Environment Part 2 (other things to be aware of)

Returning or Re-Launching the Environment

As discussed above, the WSL-ROS Environment that you created in the above step will only be preserved for a limited time on the machine that you installed it on! In general, any work that you do within this environment will not be preserved between sessions or across different University machines automatically. You will therefore have to re-install the environment at the beginning of each practical session, or whenever else you need to work with it. You must therefore make sure that you follow the steps below to backup your work to your University U: Drive every time you finish working in the environment, so that you can then restore it the next time you return (we'll remind you about this at the start and end of every practical session too).

The WSL-ROS Environment will be preserved for a limited time if you happen to login to the same University machine within a few hours. If this is the case, then (on launching WSL-ROS) you will be presented with the following message:

Enter Y to continue where you left things previously, or N to start from a fresh installation.

Note: If you select N then any work that you have created in the existing environment will be deleted! Always make sure you backup your work using the procedure outlined below!

Backing-Up (and Restoring) your Data

Every time you do any work in the WSL-ROS Environment it's really important that you run a backup script before you close it down and log out of the University Machine that you are working on. To do so is very easy, simply run the command below from any WSL-ROS Terminal Instance:

wsl_ros backup

This will create an archive of your Linux Home Directory and save it to your University U: Drive. Remember, that your work will not be preserved within the WSL-ROS Environment between sessions (unless you happen to log back in to the same computer again within a couple of hours). As such, whenever you launch a fresh WSL-ROS Environment again, simply run the following command to restore your work to it:

wsl_ros restore

To make things a little easier, when you launch a fresh WSL-ROS Environment the system will check to see if a backup file already exists from a previous session. If it does, then the system will ask you if you want to restore it straight away:

Enter Y to restore your data from your backup file, or N to leave the backup file alone and work from fresh (where none of your previous work will be available in the environment).

Accessing the Environment Remotely

The WSL-ROS environment is also available remotely on some University machines via the University Remote Desktop Service.

Note: You will need to use your university account credentials to access this service and will also need to have multi-factor authentication (MFA) set up on your account. See here for more information on how to set up MFA on your University Account.

  1. The environment has been installed on all the machines in Virtual Classroom 1, which can be accessed here (University of Sheffield sign-in required).
  2. From here, you should see a long list of PCs. Any that have a blue "Connect" button next to them are available to use.
  3. Click on the "Connect" button next to an available machine. This will download a .rdp file to your computer.
  4. Once downloaded, double click on the .rdp file and log in to the PC using your university account credentials. Look out for an MFA notification on your MFA-linked device.
  5. Once you are logged into the remote machine follow the steps in the Launching WSL Section to launch the WSL-ROS environment.
  6. When you are finished, close the RDP connection and then close the Remote Desktop app on your own machine.

Note: Only the computers in Virtual Classroom 1 have the WSL-ROS environment installed, so make sure you only use this room if you want to work on this remotely.

Remote Access Support

Note: We (the COM2009 Teaching Team) are not able to deal with issues relating to the University Remote Desktop Service!

If you are facing any issues then you should have a look at this IT Services support page. You can also contact the IT Services Helpdesk for help and support (Monday-Friday between 8am-5pm).

If you are having issues related to WSL-ROS however, then please let us know.

Windows Terminal Settings

We will use the Windows Terminal to interact with Ubuntu and ROS for this lab course, and we have created a custom settings file to configure this appropriately for the WSL-ROS Environment. If you have used the Windows Terminal before on a University Machine, or if you have used the WSL-ROS environment previously and have modified the settings file that we have provided, then you will be presented with the following prompt:

Enter Y to use the settings file that we have provided and overwrite whatever was there previously (we recommend this, but be aware that any existing Windows Terminal settings that you may have configured previously will be deleted). Alternatively, enter N to preserve your own settings, but note that your experience will then differ to that presented throughout this Wiki and some of the instructions may no longer work in the same way.

You are all good to go now! Head on over to the Week 1 Page now to get started on this lab course!

Navigating This Wiki:
← Welcome [Previous] | [Next] Week 1: ROS and Linux Basics →

Clone this wiki locally