Book Image

Hands-On ROS for Robotics Programming

By : Bernardo Ronquillo Japón
Book Image

Hands-On ROS for Robotics Programming

By: Bernardo Ronquillo Japón

Overview of this book

Connecting a physical robot to a robot simulation using the Robot Operating System (ROS) infrastructure is one of the most common challenges faced by ROS engineers. With this book, you'll learn how to simulate a robot in a virtual environment and achieve desired behavior in equivalent real-world scenarios. This book starts with an introduction to GoPiGo3 and the sensors and actuators with which it is equipped. You'll then work with GoPiGo3's digital twin by creating a 3D model from scratch and running a simulation in ROS using Gazebo. Next, the book will show you how to use GoPiGo3 to build and run an autonomous mobile robot that is aware of its surroundings. Finally, you'll find out how a robot can learn tasks that have not been programmed in the code but are acquired by observing its environment. You'll even cover topics such as deep learning and reinforcement learning. By the end of this robot programming book, you'll be well-versed with the basics of building specific-purpose applications in robotics and developing highly intelligent autonomous robots from scratch.
Table of Contents (19 chapters)
1
Section 1: Physical Robot Assembly and Testing
5
Section 2: Robot Simulation with Gazebo
8
Section 3: Autonomous Navigation Using SLAM
13
Section 4: Adaptive Robot Behavior Using Machine Learning

To get the most out of this book

The book takes a practical approach to things and will encourage you to practice what you are learning with a physical robot. We choose GoPiGo3 (https://www.dexterindustries.com/gopigo3/) because of its modularity, moderate cost, and the fact that it's based on the Raspberry Pi. You can acquire a Raspberry Pi board from online stores worldwide. Before purchasing any component of the kit, we recommend that you first read Chapter 1, Assembling the Robot, to get basic information on all the components that you will need to purchase. To purchase GoPiGo3 kit, you can visit https://www.dexterindustries.com/gopigo3/ and apply the coupon code BRJAPON@PACKT to get a 10% discount.

Some knowledge of Python and/or C++ programming and familiarity with single-board computers such as the Raspberry Pi are required to get the most out of this book.

Finally, you will need a laptop with Ubuntu 16.04 Xenial Xerus or Ubuntu 18.04 Bionic Beaver. The code of the book has been tested using both operating systems. If you have to start from scratch, we recommend that you use Ubuntu 18.04 because it is the latest Long-term Support (LTS) version provided by Canonical and will be supported until April 2023.

All the installation instructions you'll need are given in the Technical requirements section at the beginning of each chapter.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book 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.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book 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 book is also hosted on GitHub at https://github.com/PacktPublishing/Hands-On-ROS-for-Robotics-Programming. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Code in Action

Conventions used

There are a number of text conventions used throughout this book.

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: "It seems that only the last line is executed, which is my_gopigo.left()."

A block of code is set as follows:

msg_range.header.frame_id = "distance"
msg_range.radiation_type = Range.INFRARED
msg_range.min_range = 0.02
msg_range.max_range = 3.0

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

std_msgs/Header header
uint8 radiation_type
float32 field_of_view
float32 min_range

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

$ cd./Chapter2_Unit_Tests/drivingAround
$ python <name_of_script.py>

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: "Check the vital signs by clicking Check Vital Signs."

Warnings or important notes appear like this.
Tips and tricks appear like this.