Book Image

ROS Programming: Building Powerful Robots

By : Anil Mahtani, Aaron Martinez, Enrique Fernandez Perdomo, Luis Sánchez, Lentin Joseph
Book Image

ROS Programming: Building Powerful Robots

By: Anil Mahtani, Aaron Martinez, Enrique Fernandez Perdomo, Luis Sánchez, Lentin Joseph

Overview of this book

This learning path is designed to help you program and build your robots using open source ROS libraries and tools. We start with the installation and basic concepts, then continue with the more complex modules available in ROS, such as sensor and actuator integration (drivers), navigation and mapping (so you can create an autonomous mobile robot), manipulation, computer vision, perception in 3D with PCL, and more. We then discuss advanced concepts in robotics and how to program using ROS. You'll get a deep overview of the ROS framework, which will give you a clear idea of how ROS really works. During the course of the book, you will learn how to build models of complex robots, and simulate and interface the robot using the ROS MoveIt motion planning library and ROS navigation stacks. We'll go through great projects such as building a self-driving car, an autonomous mobile robot, and image recognition using deep learning and ROS. You can find beginner, intermediate, and expert ROS robotics applications inside! It includes content from the following Packt products: ? Effective Robotics Programming with ROS - Third Edition ? Mastering ROS for Robotics Programming ? ROS Robotics Projects
Table of Contents (37 chapters)
Title page
Copyright and Credits
Packt Upsell
Preface
Bibliography
Index

Preface

Robot Operating System is one of the most widely used software frameworks for robotic research and for companies to model, simulate, and prototype robots. Applying your knowledge of ROS to actual robotics is much more difficult than people realize, but this learning path will give you what you need to create your own robotics in no time!

This learning path is packed with hands-on examples that will help you program your robot and give you complete solutions using open source ROS libraries and tools. It also shows you how to use virtual machines and Docker containers to simplify the installation of Ubuntu and the ROS framework, so you can start working in an isolated and control environment without changing your regular computer setup. This also will be the perfect companion for a robotics enthusiast who really wants to do something big in the field.

By the end of the learning path, you'll be able to leverage all the ROS Kinetic features to build a fully fledged robot for all your needs and Finally, you will get to know the best practices to follow when programming using ROS.

Who this learning path is for

This course targets robotic enthusiasts, developers, and researchers who would like to build robot applications using ROS. If you are looking to explore the advanced ROS features in your projects, then this learning path is for you. Basic knowledge of ROS, GNU/Linux, and programming concepts is assumed.

What this learning path covers

Section 1, Effective Robotics Programming with ROS, Third Edition gives you a comprehensive review of ROS, the Robot Operating System framework, which is used nowadays by hundreds of research groups and companies in the robotics industry. More importantly, ROS is also the painless entry point to robotics for nonprofessionals and students. This section will guide you through the installation process of ROS, and soon enough, you will be playing with the basic tools and understanding the different elements of the framework.

The content of the section can be followed without any special devices, and each chapter comes with a series of source code examples and tutorials that you can run on your own computer. This is the only thing you need to follow the section. However, we also show you how to work with hardware so that you can connect your algorithms with the real world. Special care has been taken in choosing devices that are affordable for amateur users, but at the same time, the most typical sensors or actuators in robotics research are covered.

Finally, the potential of ROS is illustrated with the ability to work with whole robots in a real or simulated environment. You will learn how to create your own robot and integrate it with a simulation by using the Gazebo simulator. From here, you will have the chance to explore the different aspects of  creating a robot, suchas perceiving the world using computer vision or point cloud analysis, navigating through the environment using the powerful navigation stack, and even being able to control robotic arms to interact with your surroundings using the MoveIt! package. By the end of the section, it is our hope that you will have a thorough understanding of the endless possibilities that ROS gives you when developing robotic systems.

Section 2, Mastering ROS for Robotics Programming is an advanced guide of ROS that is very suitable for readers who already have a basic knowledge in ROS. ROS is widely used in robotics companies, universities, and robotics research institutes for designing, building, and simulating a robot model and interfacing it into real hardware. ROS is now an essential requirement for Robotic engineers; this guide can help you acquire knowledge of ROS and can also help you polish your skills in ROS using interactive examples. Even though it is an advanced guide, you can see the basics of ROS in the fist chapter to refresh the concepts. It also helps ROS beginners. The section mainly focuses on the advanced concepts of ROS, such as ROS Navigation stack, ROS MoveIt!, ROS plugins, nodelets, controllers, ROS Industrial, and so on.

You can work with the examples in the section without any special hardware; however, in some sections you can see the interfacing of I/O boards, vision sensors, and actuators to ROS. To work with this hardware, you will need to buy it.

The section starts with an introduction to ROS and then discusses how to build a robot model in ROS for simulating and visualizing. After the simulation of robots using Gazebo, we can see how to connect the robot to Navigation stack and MoveIt!. In addition to this, we can see ROS plugins, controllers, nodelets, and interfacing of I/O boards and vision sensors. Finally, we can see more about ROS Industrial and troubleshooting and best practices in ROS.

Section 3, ROS Robotics Projects is a practical guide to learning ROS by making interesting projects using it. The section assumes that you have some knowledge of ROS.

However, if you do not have any experience with ROS, you can still learn from this section. The first chapter is dedicated to absolute beginners. ROS is widely used in robotics companies, universities, and robot research labs for designing and programming robots. If you would like to work in the robotics software domain or if you want to have a career as a robotics software engineer, this section is perfect for you.

The basic aim of this section is to teach ROS through interactive projects. The projects that we are discussing here can also be reused in your academic or industrial projects. This section handles a wide variety of new technology that can be interfaced with ROS. For example, you will see how to build a self-driving car prototype, how to build a deep-learning application using ROS, and how to build a VR application in ROS. These are only a few highlighted topics; in addition, you will find some 15 projects and applications using ROS and its libraries.

You can work with any project after meeting its prerequisites. Most of the projects can be completed without many dependencies. We are using popular and available hardware components to build most of the projects. So this will help us create almost all of these projects without much difficulty.

To get the most out of this learning path

Section 1, Effective Robotics Programming with ROS, Third Edition was written with the intention that almost everybody can follow it and run the source code examples provided with it. Basically, you need a computer with a Linux distribution. Although any Linux distribution should be fie, it is recommended that you use a version of Ubuntu 16.04 LTS. Then, you will use ROS Kinetic, which is installed according to the instructions given in Chapter 1, GettingStarted with ROS.

As regards the hardware requirements of your computer, in general, any computer or laptop is enough. However, it is advisable to use a dedicated graphics card in order to run the Gazebo simulator. Also, it will be good to have a good number of peripherals so that you can connect several sensors and actuators, including cameras and Arduino boards.

You will also need Git (the git-core Debian package) in order to clone the repository with the source code provided with this section. Similarly, you are expected to have a basic knowledge of the Bash command line, GNU/Linux tools, and some C/C++ programming skills.

For Section 2 Mastering ROS for Robotics Programming and Section 3 ROS Robotics Projects, You should have a good PC running Linux distribution, preferably Ubuntu 14.04.3 or Ubuntu 15.04 and Ubuntu 16.04 LTS respectively.

Readers can use a laptop or PC with a graphics card, and a RAM of 4 GB to 8 GB is preferred. This is actually for running high-end simulation in Gazebo and also for processing Point cloud and for computer vision.

The readers should have sensors, actuators, and the I/O board mentioned in the section and should have the provision to connect them all to their PC. The readers also need a Git tool installed to clone the packages files.

If you are a Windows user, then it will be good to download Virtual box and set up Ubuntu in that. Working with Virtual box can have issues when we try to interface real hardware with ROS, so it would be good if you could work with the real system itself.

Download the example code files

You can download the example code files for this learning path from your account at www.packtpub.com. If you purchased this learning path elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the learning path in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the learning path is also hosted on GitHub at https://github.com/PacktPublishing/ROS-Programming-Building-Powerful-Robots. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this learning path.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The *-ros-pkg is a community repository for developing high-level libraries easily. "

A block of code is set as follows:

…
source /opt/ros/indigo/setup.bash
source /opt/ros/jade/setup.bash
source /opt/ros/kinetic/setup.bash
…

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<launch> 
  <node pkg="hokuyo_node" type="hokuyo_node" name="hokuyo_node"/> 
  <node pkg="rviz" type="rviz" name="rviz" 
  args="-d $(find chapter8_tutorials)/config/laser.rviz"/> 
 
  <node pkg="chapter8_tutorials" type="c8_laserscan" 
   name="c8_laserscan" /> 
</launch> 

Any command-line input or output is written as follows:

$ rosrun openni_camera openni_node$ roslaunch openni_launch openni.launch

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Two windows must appear, one with a 3D figure that represents the pose of the IMU and a 2D figure with the Roll, Pitch, and Yaw."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email [email protected] and mention the learning path title in the subject of your message. If you have questions about any aspect of this learning path, please email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this learning path, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your learning path, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this learning path, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.