Difference between revisions of "Robotics: Principles and Practice - Software Installation Guide"

From David Vernon's Wiki
Jump to: navigation, search
(Install VirtualBox)
Line 19: Line 19:
  
 
== Install VirtualBox ==
 
== Install VirtualBox ==
I assume that you are running Windows 10 Pro.  Please contact me if you are running a different operating system. For completeness, I have included instructions for Mac OS and Ubuntu (in case you already have Ubuntu but want to use the VM instead of installing all the required tools and utilities).
+
I assume that you are running Windows 10 Pro.  Please let me know if you are running a different operating system. For completeness, I have included instructions for Mac OS and Ubuntu (in case you already have Ubuntu but want to use the VM instead of installing all the required tools and utilities).  
  
 
=== Windows ===
 
=== Windows ===
Line 42: Line 42:
 
   sudo apt update
 
   sudo apt update
 
   sudo apt install virtualbox
 
   sudo apt install virtualbox
 
  
 
== Install the VirtualBox Extension Pack ==
 
== Install the VirtualBox Extension Pack ==

Revision as of 06:19, 23 August 2021

This page provides a step-by-step guide to installing the tools, utilities, and example software for Robotics: Principles and Practice with robot simulators and physical robots on Ubuntu 16.04 with ROS.


Please follow these instructions exactly as they are stated. Do not be tempted to skip through them, assuming that you will be able to figure it out yourself. You might, but it is more likely you will miss something small but important and it won't work as required. Take your time, follow these instructions carefully, and everything will work.


There are two options:

  • Option A: install a VirtualBox Ubuntu 16.04 virtual machine (VM) with everything pre-installed
  • Option B: install all the required tools and utilities directly on a computer running Ubuntu 16.04

We cover both in the following, starting with Option A.


Option A: VirtualBox Ubuntu 16.04 Virtual Machine

Install VirtualBox

I assume that you are running Windows 10 Pro. Please let me know if you are running a different operating system. For completeness, I have included instructions for Mac OS and Ubuntu (in case you already have Ubuntu but want to use the VM instead of installing all the required tools and utilities).

Windows

Open the VirtualBox Download page at https://www.virtualbox.org/wiki/Downloads and select Windows hosts to download the installation file.


VirtualBox Download.jpg


Double click on the downloaded file (VirtualBox-6.1.26-145957-Win.exe at time of writing) and follow the instructions.

To run a VM on Windows 10 you need to enable hardware virtualization in BIOS. Unfortunately, the steps to steps to access BIOS and enable virtualization from the BIOS depends on the PC manufacturer. Normally, BIOS settings can be accessed using the function keys during a restart, i.e. when booting your PC. Try F1, F2, F3, F8, F10, or F12. On some PCs, it’s the ESC, or Delete key. Restart your PC, tap the key about twice per second as soon as the screen turns on. Look for 'Advanced', 'Advanced Mode', or 'Configuration' on the BIOS screen. Now look for the setting which has 'Virtualization' is its name and turn it on. Here are some commonly used names: 'Intel Virtualization Technology', 'AMD-V', 'Hyper-V', 'VT-X', 'Vanderpool', and 'SVM'. Enable it. Now that virtualization support is enabled in the BIOS, you need to enable it on Windows 10. Restart your PC and press the Windows key to get the Search box. Type “turn windows features on or off” and click on it to open it. Scroll down and check the box next to 'Hyper-V'. Click 'OK'. Windows will install the necessary files to enable virtualization. You’ll then be asked to reboot the PC. Click 'Restart Now'. (This is a synopsis of a longer tutorial on enabling virtualization on Windows 10).

MacOS

Download the .dmg installer for OS X systems, execute the file and follow the instructions.

If the VirtualBox installer fails as it is completing the installation, it is probably a problem with a security setting. Go to System Preferences > Security & Privacy. Click the lock to make changes (if necessary). Click the ‘Allow’ button at the bottom and re-run the installer.

Ubuntu Linux

You can install VirtualBox via the Ubuntu Software Center or through command line as follows.

 sudo apt update
 sudo apt install virtualbox

Install the VirtualBox Extension Pack

Select All supported platforms to download the VirtualBox Extension Pack. This is needed to provide access to USB devices such as the iRobot Create 2 mobile robot, the Lynxmotion AL5D robot manipulator, and the webcam we will use later in the course.

Double click on the downloaded file (Oracle_VM_VirtualBox_Extension_Pack-6.1.26.vbox-extpack at time of writing) and follow the instructions.


VirtualBox Extension Pack.jpg


VirtualBox Setup

Step 1: Download the Virtual Disk Image

The virtual disk image rpp_vm.vdi can be downloaded from here. It contains a VirtualBox virtual machine with Ubuntu 16.04, ROS Kinetic, and example code pre-installed. Store it in some convenient, easily-identified folder.


Step 2: Launch VirtualBox

In VirtualBox, you first need to create a new virtual machine. Click on the 'New' button.


VirtualBox Configuration 1.jpg


Usually the guided menu will open. Change to expert mode,


VirtualBox Configuration 2.jpg


Step 3: Configure and create the virtual machine

In the expert menu:

  • Set the name to rpp-vm
  • Select 'Linux' for the operating system type
  • Select 'Ubuntu (64-bit)' for the operating system version
  • Set the VM's memory size (RAM); choose 4096 MB or more if your PC's capacity allows; we set it to 8192 MB in the screenshot
  • Select 'Use an existing virtual hard disk file'


VirtualBox Configuration 3.jpg


Using the button on the right, open the file explorer, click 'Add', browse to where you stored rpp-vm.vdi, and select the virtual disk image.


VirtualBox Add Disk Image.jpg


Finally, click 'Create'.


VirtualBox Configuration 3.jpg


Step 4: Configure the settings

Choose the newly created virtual machine and click on 'Settings'.


VirtualBox Configuration 4.jpg


Click on 'System' and 'Processor' and choose how many processor cores you want to allocate to the VM. Here, we have allocated four cores.


VirtualBox Configuration 5.jpg


Step 5: Enable USB devices

Choose the newly created VM and click on 'Ports'. Click on 'USB' and select 'USB 2.0'. Choose the device you want to add from the list by clicking the connector icon with the green cross at the right hand side. Notice that none of the devices you want to add are in the list.


VirtualBox Configuration 6.jpg


This is because the device needs to be connected before it can be added. Here is what you would see if the iRobot Create 2 mobile robot was connected. You can skip this part for now, but remember to do it when you want to use any USB device later in the course.


VirtualBox Configuration 7.jpg


Hint: you can check what USB devices are present using the following command in a terminal.

 $ ioreg -p IOUSB 

This can be useful to check that the device has been registered by the host PC.


Everything is now set up (almost: there is one additional optional step below). The virtual machine can now be started. When Ubuntu 16.04 boots, log into the only account with the username rpp and password rpp.


Step 6: Enable Host OS to Guest OS Copy and Paste

When doing exercises and assignments, you may wish to copy text from the host OS (Windows 10, probably) to the guest OS (Ubuntu 16.04).

Before we can configure the settings for this, we have to install Guest Additions in the virtual machine. So, if you haven't already done so, go ahead and start the virtual machine and log in.

Select 'Devices' from the menu and select the Insert Guest Additions CD Image option. Click 'Run' when prompted and follow the instructions.


Install-Virtualbox-Guest-Additions 1.jpg


Now, power off your Ubuntu guest OS.

Finally, we need to enable Shared Clipboard and Drag’n’Drop functionality between Guest and Host Machine.

Choose the rpp-vm virtual machine and click on 'Settings'.

Click on 'General' and 'Advanced' and select 'Shared Clipboard' and choose the 'Bidirectional' option.


Install-Virtualbox-Guest-Additions 2.jpg


Option B: Install Required Tools and Utilities on a Computer running Ubuntu 16.04

Install Ubuntu 16.04

If you don’t already have it, install Ubuntu 16.04

You can get an Ubuntu 16.04 image here.

There is a tutorial on installing Ubuntu 16.04 alongside Windows 10 (dual boot) here.

Disclaimer: I have not validated this tutorial. If you know of a better one, please tell me


Install ROS


Back to Robotics: Principles and Practice