Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Artificial Intelligence for Robotics - Second Edition

You're reading from  Artificial Intelligence for Robotics - Second Edition

Product type Book
Published in Mar 2024
Publisher Packt
ISBN-13 9781805129592
Pages 344 pages
Edition 2nd Edition
Languages
Concepts
Author (1):
Francis X. Govers III Francis X. Govers III
Profile icon Francis X. Govers III

Table of Contents (18) Chapters

Preface Part 1: Building Blocks for Robotics and Artificial Intelligence
Chapter 1: The Foundation of Robotics and Artificial Intelligence Chapter 2: Setting Up Your Robot Chapter 3: Conceptualizing the Practical Robot Design Process Part 2: Adding Perception, Learning, and Interaction to Robotics
Chapter 4: Recognizing Objects Using Neural Networks and Supervised Learning Chapter 5: Picking Up and Putting Away Toys using Reinforcement Learning and Genetic Algorithms Chapter 6: Teaching a Robot to Listen Part 3: Advanced Concepts – Navigation, Manipulation, Emotions, and More
Chapter 7: Teaching the Robot to Navigate and Avoid Stairs Chapter 8: Putting Things Away Chapter 9: Giving the Robot an Artificial Personality Chapter 10: Conclusions and Reflections Answers Index Other Books You May Enjoy Appendix

Setting Up Your Robot

This chapter begins with some background on my thoughts on what a robot is, and what robots are made of – a fairly standard list of parts and components. This chapter aims to allow you to duplicate the exercises and use the source code that is found throughout the book. I will describe how I set up my environments for development, what tools I used to create my code, and how to install the Robotic Operating System version 2 (ROS 2). The assembly of Albert, the robot I use for all the examples, is covered in the GitHub repository for this book. There are many other types and configurations of robots that can work with the code in this book with some changes. I’ll try to provide all the shortcuts I can, including a full image of my robot’s SD card, in the Git repo.

In this chapter, we will be covering the following topics:

  • Understanding the anatomy of a robot
  • Introducing subsumption architecture
  • A brief introduction to ROS...

Technical requirements

To complete the practical exercises in this chapter, you will need the requirements specified in the Preface at the beginning of this book. The code for this chapter can be found at https://github.com/PacktPublishing/Artificial-Intelligence-for-Robotics-2e/.

Understanding the anatomy of a robot

A robot is a machine that is capable of carrying out complex actions and behaviors by itself. Most robots are controlled by a computer or digital programmable device. Some key characteristics of robots are as follows:

  • Automation: Robots can operate automatically without direct human input, based on their programming. This allows them to do repetitive or dangerous tasks consistently.
  • Sensors: Robots use sensors such as cameras, optics, lidar, and pressure sensors to gather information about their environment so they can navigate and interact. This sensory information is processed to determine what actions the robot should take.
  • Programming: A robot’s brain consists of an onboard computer or device that runs code and algorithms that define how it will behave. Robots are programmed by humans to perform desired behaviors.
  • Movement: Most robots are able to move around to some degree through wheels, legs, propellers, or other...

Introducing subsumption architecture

At this point, I want to spend a bit of time on the idea behind the subsumption architecture, and point out some specifics of how we will be using this concept in the design of our robot project. Many of you will be familiar with the concept from school or from study, so you can look at my diagram and then move on. For the rest of us, let’s talk a bit about this biologically inspired robot concept.

Subsumption architecture was originally described by Dr. Rodney Brooks, a professor at MIT, who would later help found iRobot Corporation and invent the Baxter robot. Rodney was trying to develop analogs of insect brains in order to understand how to program intelligent robots. Robots before this time (1986) were very much single-threaded machines that pretty much only did one thing at a time. They read sensors, made decisions, and then acted – and only had one goal at any one time. Creatures such as flies or ants have very simple brains...

A brief introduction to ROS

OK, before we do all of the work described in the following section to be able to use ROS 2 – the second version of the Robotic Operating System – let’s answer your questions. What is ROS, and what are its advantages?

The first thing to know is that ROS is not an actual operating system, such as Linux or Windows. Rather it is a middleware layer that serves as a means of connecting different programs to work together to control a robot. It was originally designed to run Willow Garage’s PR2 robot, which was complex indeed. ROS is supported by a very large open source community and is constantly updated.

I used to be a ROS skeptic, and frankly, reading the documentation did not help my first impression that it was cumbersome at best and difficult to use. However, at the insistence of one of my business partners, we started using ROS for a very complex self-guided security guard robot called RAMSEE, designed for Gamma 2 Robotics...

Hardware and software setup

To match the examples in this book, and to have access to the same tools that are used in the code samples, you will have to set up three environments:

  • A laptop or desktop computer: This will run our control panel, and also be used to train neural networks. I used a Windows 10 computer with Oracle VirtualBox supporting a virtual machine running Ubuntu 20.04. You may run a computer running Ubuntu or another Linux operating system by itself (without Windows) if you want. Several of the AI packages we will use in the tutorial sections of the book will require Ubuntu to run. We will load ROS 2 on this computer. I will also be using a PlayStation game controller on this computer for teleoperation (remote control) of the robot when we teach the robot how to navigate. I also have ROS 2 for Windows installed, which may obviate running the virtual machine. Either approach will work, since the Python programs we will use for control run in either mode.
  • ...

Summary

This chapter covered several important topics. It started with some of the basics of robotics, for readers who needed a bit more background. We talked about common robot parts, such as sensors, computers, and motors/actuators. We discussed the subsumption architecture in more depth and showed how it helps the robot arbitrate between responding to different events and commands. The next section covered the software setup for running the robot, including the offboard development environment and the onboard Jetson Nano computer environments. We set up the ROS and installed the Python tools.

The final section covered ROS 2 and explained what it is and what it does for us. ROS 2 is a middleware layer that lets us build modular components and multiple single-use programs, rather than having to lump everything into one executable. ROS also has logging, visualization, and debugging tools that help our task of designing a complex robot. ROS 2 is also a wonderful repository of additional...

Questions

  1. Name three types of robot sensors.
  2. What does the acronym PWM stand for?
  3. What is analog-to-digital conversion? What goes in and what comes out?
  4. Who invented the subsumption architecture?
  5. Compare my diagram of the three-layer subsumption architecture to the Three Laws of Robotics postulated by Isaac Asimov. Is there a correlation? Why is there one, or why not?

    Hint: Think about how the laws change the behavior of the robot. Which is the lowest level law (from a subsumption perspective)? Which is the highest?

  6. Do you think I should have given our robot project – Albert – a name? Do you name your robots? What about your washing machine? Why not?
  7. What is the importance of the environment variable ROS_ROOT?

Further reading

lock icon The rest of the chapter is locked
You have been reading a chapter from
Artificial Intelligence for Robotics - Second Edition
Published in: Mar 2024 Publisher: Packt ISBN-13: 9781805129592
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}