Book Image

Learning ROS for Robotics Programming

By : Aaron Martinez, Enrique Fernández
Book Image

Learning ROS for Robotics Programming

By: Aaron Martinez, Enrique Fernández

Overview of this book

<p>Both the amateur and the professional roboticist who has ever tried their hand at robotics programming will have faced with the cumbersome task of starting from scratch, usually reinventing the wheel. ROS comes with a great number of already working functionalities, and this book takes you from the first steps to the most elaborate designs possible within this software framework.</p> <p>"Learning ROS for Robotics Programming" is full of practical examples that will help you to understand the framework from the very beginning. Build your own robot applications in a simulated environment and share your knowledge with the large community supporting ROS.</p> <p>"Learning ROS for Robotics Programming" starts with the basic concepts and usage of ROS in a very straightforward and practical manner. It is a painless introduction to the fascinating world of robotics, covering sensor integration, modeling, simulation, computer vision, and navigation algorithms, among other topics.</p> <p>After the first two chapters, concepts like topics, messages, and nodes will become daily bread. Make your robot see with HD cameras, or navigate avoiding obstacles with range sensors. Furthermore, thanks to the contributions of the vast ROS community, your robot will be able to navigate autonomously, and even recognize and interact with you, in a matter of minutes.</p> <p>"Learning ROS for Robotics Programming" will give you all the background you need to know in order to start in the fascinating world of robotics and program your own robot. Simply, you put the limit!</p>
Table of Contents (16 chapters)
Learning ROS for Robotics Programming
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

How to install VirtualBox and Ubuntu


VirtualBox is a general-purpose, full virtualizer for x86 hardware, targeted at server, desktop, and embedded use. VirtualBox is free and supports all the major operating systems and pretty much every Linux flavor out there.

As we recommend the use of Ubuntu, you perhaps don't want to change the operating system of your computer. Tools such as VirtualBox exist for this purpose and help us virtualize a new operating system on our computer without making any changes to the original.

In the upcoming sections, we are going to show how to install VirtualBox and a new installation of Ubuntu. Further, with this virtual installation, you could have a clean installation to restart your development machine if you have any problem, or to save the development machine with all the setup files necessary for your robot.

Downloading VirtualBox

The first step is to download the VirtualBox installation file. At the time of writing, the following links had the latest versions available:

Once installed, you need to download the image of Ubuntu. For this tutorial, we will use an Ubuntu copy with ROS Fuerte installed. You can download it from the following URL: http://nootrix.com/wp-content/uploads/2012/08/ROS.ova.

You can find different virtual machines with preinstalled Ubuntu and ROS, but we are going to use this version because it is referred by the official page of ROS.

Creating the virtual machine

Creating a new virtual machine with the downloaded file is very easy; just follow the steps outlined in this section. Open VirtualBox and navigate to File | Import Appliance.... Then, click on Open appliance and select the ROS.ova file downloaded before.

In the next window, you can configure the parameters for the new virtual machine. Keep the default configuration and only change the name of the virtual system. This name helps you distinguish this virtual machine from others. Our recommendation is to put a descriptive name; in our case, the book's name.

Click on the Import button and accept the software license agreement in the next window. Then, you will see a progress bar. It means that VirtualBox is copying the file with the virtual image and is creating a new copy with the new name.

Note that this process doesn't modify the original file ROS.ova, and you could create more virtual machines with different copies from the original file.

The process will take a few minutes depending on the speed of your computer. When it finishes, you can start your virtual machine by clicking on the Start button. Remember to select the right machine before starting it. In our case, we have only one machine but you could have more.

Sometimes you will get the error shown in the following screenshot. It is because your computer doesn't have the correct drivers to use USB 2.0. You can fix it by installing Oracle VM VirtualBox Extension Pack, but you can also disable the USB support to start using the virtual machine.

To disable USB support, right-click on the virtual machine and select Settings. In the toolbar, navigate to Ports | USB and uncheck Enable USB 2.0 (EHCI) Controller. You can now start the virtual machine again, and it should start without problems.

Once the virtual machine starts, you should see the ROS-installed Ubuntu 12.04 window on your screen as shown in the following screenshot:

When you have finished these steps, you will have a full copy of ROS Fuerte that can be used in this book. You can run all the examples and stacks that we are going to work with. Unfortunately, VirtualBox has problems while working with real hardware, and it's possible that you can't use this copy of ROS Fuerte for the steps outlined in Chapter 4, Using Sensors and Actuators with ROS.