Hands-On ROS for Robotics Programming
eBook - ePub

Hands-On ROS for Robotics Programming

Program highly autonomous and AI-capable mobile robots powered by ROS

  1. 432 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On ROS for Robotics Programming

Program highly autonomous and AI-capable mobile robots powered by ROS

About this book

Take your ROS skills to the next level by implementing complex robot structures in a ROS simulation

Key Features

  • Learn fundamental ROS concepts and apply them to solve navigation tasks
  • Work with single board computers to program smart behavior in mobile robots
  • Understand how specific characteristics of the physical environment influence your robot's performance

Book Description

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.

What you will learn

  • Get to grips with developing environment-aware robots
  • Gain insights into how your robots will react in physical environments
  • Break down a desired behavior into a chain of robot actions
  • Relate data from sensors with context to produce adaptive responses
  • Apply reinforcement learning to allow your robot to learn by trial and error
  • Implement deep learning to enable your robot to recognize its surroundings

Who this book is for

If you are an engineer looking to build AI-powered robots using the ROS framework, this book is for you. Robotics enthusiasts and hobbyists who want to develop their own ROS robotics projects will also find this book useful. Knowledge of Python and/or C++ programming and familiarity with single board computers such as Raspberry Pi is necessary to get the most out of this book.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Hands-On ROS for Robotics Programming by Bernardo Ronquillo Japón in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Engineering. We have over one million books available in our catalogue for you to explore.

Information

Section 1: Physical Robot Assembly and Testing

This section focuses on describing and setting up the hardware that will be used alongside this book. Mechanical parts, including sensors and actuators, microcontrollers, and embedded computers, are the core hardware features of any mobile robot. Installation instructions for the required software in order to run GoPiGo3 with ROS will be included.
This section comprises the following chapters:
  • Chapter 1, Assembling the Robot
  • Chapter 2, Unit Testing of GoPiGo3
  • Chapter 3, Getting Started with ROS

Assembling the Robot

This chapter will provide you with a variety of practical assembly guidelines about the mobile robot that the content of this book is based on. With a very practical approach in mind, we'll deep dive into the characteristics of GoPiGo3 and what makes it an ideal platform to learn robotics.
First, we will focus on the hardware and talk about the components that every robot is composed of including the mechanical parts and embedded system, sensor, and motors.
After completing the GoPiGo3 assembly section, you will be acquiring manual skills so that you can start manipulating typical components in robotics. You will also be driven to adopt a systematic approach of applying partial verification tests while assembling your robot, also known as unit tests.
After introducing the GoPiGo3 robot in the first section of this chapter, we will explain these concepts in depth, including the embedded controller, the GoPiGo3 board, and the embedded computer, the Raspberry Pi.
Next, we will describe the sensors and actuators that the robot will use, grouped into what we will call the electromechanics.
Finally, we will provide you with some useful guidelines so that assembling the robot is straightforward. Then, we will test the GoPiGo3 robot using its easy-to-start software, DexterOS. Even though we will adopt Ubuntu as an operating system for running ROS later in this book, it is recommended that you start with DexterOS so that you familiarize yourself with the hardware while avoiding specific software programming tasks, which is something that will be left for later chapters.
In this chapter, we will cover the following topics:
  • Understanding the GoPiGo3 robot
  • Getting familiar with the embedded hardware – GoPiGo3 board and Raspberry Pi
  • Deep diving into the electromechanics motors, sensors, and 2D camera
  • Putting it all together
  • Hardware testing using Bloxter (visual programming) under DexterOS

Understanding the GoPiGo3 robot

GoPiGo3 is a Raspberry Pi-based robot car manufactured by Dexter Industries. It is intended to be used as an educational kit for learning about both robotics and programming, two complementary perspectives that clearly show the transversal knowledge you should acquire to become a robotics engineer. We'll explain what this means by letting Nicole Parrot, Director of Engineering at Modular Robotics, explain it in her own words:
"The GoPiGo originated from a Kickstarter campaign in early 2014 when the Raspberry Pi was still somewhat new. The first users were hobbyists, but soon teachers and coding club volunteers were sharing their GoPiGo with their students. This lead to various changes being made to the board to make a classroom-ready robot. It's robust, it has a full list of features, and it's still based on the Raspberry Pi! The latest iteration has been around since 2017 and is a stable platform.

A Raspberry Pi-based robot offers quite a few advantages in the classroom. It can be programmed in an array of languages, it can be independent of the school Wi-Fi while not requiring Bluetooth, and it can perform advanced applications right on the board, such as computer vision and data collection. The GoPiGo with DexterOS comes with scientific libraries all preinstalled. The GoPiGo with Raspbian for Robots allows the user to install whatever libraries and tools are required for the project at hand. It comes with two Python libraries: easygopigo3.py and gopigo3.py. Both of these offer high-level control of the robot and low-level control, depending on the user's technical skills.

The GoPiGo has become the premier go-to robot for universities, researchers, and engineers seeking a simple, well-documented robot for the Raspberry Pi."
Ready to dive into robotics? Let's go!

The robotics perspective

From the robotics perspective, you will learn how to work with the basic parts:
  • Motors, which allow the robot to move from one point to another. In GoPiGo3, we have DC motors with built-in encoders that provide a precise motion. This is one of the main upgrades from GoPiGo2, where the encoders were external to the motors and not very accurate.
  • Sensors, which acquire information from the environment, such as the distance to near objects, luminosity, acceleration, and so on.
  • The controller—that is, the GoPiGo3 red board—handles the physical interface with sensors and actuators. This is the real-time component that allows GoPiGo3 to interact with the physical world.
  • A single-board computer (SBC) Raspberry Pi 3B+, which provides processing capacity. As such, it works under an operating system, typically a Linux-based distribution, providing wide flexibility from a software point of view.
Most educational kits stop at a level-3 controller; they do not include a level-4 single-board computer. The software in the controller is a small program (only one) that is embedded in the board. Every time you want to modify the code for the robot, you have to fully replace the existing program and flash the new version from an external computer while using the serial connection over a USB port.
A classic example of this is an Arduino-controlled robot. Here, the Arduino board plays the role of our GoPiGo3 board, and if you have worked with it, you will surely remember how you needed to transfer the new program from the Arduino IDE on your laptop to the robot through a USB cable.

The programming perspective

From the programming perspective, GoPiGo3 allows you to start easy by learning a visual programming language, Bloxter, a fork of the open source Google Blockly, that was speci...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. About Packt
  4. Contributors
  5. Preface
  6. Section 1: Physical Robot Assembly and Testing
  7. Assembling the Robot
  8. Unit Testing of GoPiGo3
  9. Getting Started with ROS
  10. Section 2: Robot Simulation with Gazebo
  11. Creating the Virtual Two-Wheeled ROS Robot
  12. Simulating Robot Behavior with Gazebo
  13. Section 3: Autonomous Navigation Using SLAM
  14. Programming in ROS - Commands and Tools
  15. Robot Control and Simulation
  16. Virtual SLAM and Navigation Using Gazebo
  17. SLAM for Robot Navigation
  18. Section 4: Adaptive Robot Behavior Using Machine Learning
  19. Applying Machine Learning in Robotics
  20. Machine Learning with OpenAI Gym
  21. Achieve a Goal through Reinforcement Learning
  22. Assessment
  23. Other Books You May Enjoy