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

Chapter 1. Getting Started with ROS

Welcome to the first chapter of this book where you will learn how to install ROS, the new standard software framework in robotics. With ROS, you will start to program and control your robots the easy way using tons of examples and source code that will show you how to use sensors and devices or add new functionalities to your robot, such as autonomous navigation and visual perception. Thanks to the open source motto and the community that is developing the state-of-the-art algorithms and providing new functionalities, ROS is growing every day.

In this book you will learn the following:

  • Installing the ROS framework on a version of Ubuntu

  • Learning the basic operation of ROS

  • Debugging and visualizing the data

  • Programming your robot using this framework

  • Creating a 3D model to use it in the simulator

  • Using the navigation stack to make your robot autonomous

In this chapter we are going to install a full version of ROS in Ubuntu. We will use Ubuntu because it is fully supported by and recommended for ROS. However, you can use a different operating system instead of Ubuntu, but in these operative systems, ROS is still experimental and could have some errors. So, for this reason, we recommend you to use Ubuntu while you follow the samples in this book.

Before starting with the installation, we are going to learn the origin of ROS and its history.

Robot Operating System (ROS) is a framework that is widely used in robotics. The philosophy is to make a piece of software that could work in other robots by making little changes in the code. What we get with this idea is to create functionalities that can be shared and used in other robots without much effort so that we do not reinvent the wheel.

ROS was originally developed in 2007 by the Stanford Artificial Intelligence Laboratory (SAIL) with the support of the Stanford AI Robot project. As of 2008, development continues primarily at Willow Garage, a robotics research institute, with more than 20 institutions collaborating within a federated development model.

A lot of research institutions have started to develop projects in ROS by adding hardware and sharing their code samples. Also, the companies have started to adapt their products to be used in ROS. In the following image, you can see some fully supported platforms. Normally, these platforms are published with a lot of code, examples, and simulators to permit the developers to start their work easily.

The sensors and actuators used in robotics have also been adapted to be used with ROS. Every day an increasing number of devices are supported by this framework.

ROS provides standard operating system facilities such as hardware abstraction, low-level device control, implementation of commonly used functionalities, message passing between processes, and package management. It is based on graph architecture with a centralized topology where processing takes place in nodes that may receive or post, such as multiplex sensor, control, state, planning, actuator, and so on. The library is geared towards a Unix-like system (Ubuntu Linux is listed as supported while other variants such as Fedora and Mac OS X are considered experimental).

The *-ros-pkg package is a community repository for developing high-level libraries easily. Many of the capabilities frequently associated with ROS, such as the navigation library and the rviz visualizer, are developed in this repository. These libraries give a powerful set of tools to work with ROS easily, knowing what is happening every time. Of these, visualization, simulators, and debugging tools are the most important ones.

ROS is released under the terms of the BSD (Berkeley Software Distribution) license and is an open source software. It is free for commercial and research use. The *-ros-pkg contributed packages are licensed under a variety of open source licenses.

ROS promotes code reutilization so that the robotics developers and scientists do not have to reinvent the wheel all the time. With ROS, you can do this and more. You can take the code from the repositories, improve it, and share it again.

ROS has released some versions, the latest one being Groovy. In this book, we are going to use Fuerte because it is a stable version, and some tutorials and examples used in this book don't work in the Groovy version.

Now we are going to show you how to install ROS Electric and Fuerte. Although in this book we use Fuerte, you may need to install the Electric version to use some code that works only in this version or you may need Electric because your robot doesn't have the latest version of Ubuntu.

As we said before, the operating system used in the book is Ubuntu and we are going to use it in all tutorials. If you are using another operating system and you want to follow the book, the best option is to install a virtual machine with an Ubuntu copy. Later, we will explain how to install a virtual machine in order to use ROS in it.

Anyway, if you want to try installing it in an operating system other than Ubuntu, you can find the required instructions in the following link: http://wiki.ros.org/fuerte/Installation.