Book Image

Learn Robotics Programming - Second Edition

By : Danny Staple
Book Image

Learn Robotics Programming - Second Edition

By: Danny Staple

Overview of this book

We live in an age where the most complex or repetitive tasks are automated. Smart robots have the potential to revolutionize how we perform all kinds of tasks with high accuracy and efficiency. With this second edition of Learn Robotics Programming, you'll see how a combination of the Raspberry Pi and Python can be a great starting point for robot programming. The book starts by introducing you to the basic structure of a robot and shows you how to design, build, and program it. As you make your way through the book, you'll add different outputs and sensors, learn robot building skills, and write code to add autonomous behavior using sensors and a camera. You'll also be able to upgrade your robot with Wi-Fi connectivity to control it using a smartphone. Finally, you'll understand how you can apply the skills that you've learned to visualize, lay out, build, and code your future robot building projects. By the end of this book, you'll have built an interesting robot that can perform basic artificial intelligence operations and be well versed in programming robots and creating complex robotics projects using what you've learned.
Table of Contents (25 chapters)
1
Section 1: The Basics – Preparing for Robotics
7
Section 2: Building an Autonomous Robot – Connecting Sensors and Motors to a Raspberry Pi
15
Section 3: Hearing and Seeing – Giving a Robot Intelligent Sensors
21
Section 4: Taking Robotics Further

What does robot mean?

A robot is a machine that makes autonomous decisions based on input from sensors. A software agent is a program that automatically processes input and produces output. Perhaps a robot is best described as an autonomous software agent with sensors and moving outputs, or it could be described as an electromechanical platform with software running on it. Either way, a robot requires electronics, mechanical parts, and code.

The word robot conjures up images of fantastic sci-fi creations, devices with legendary strength and intelligence. These often follow the human body plan, making them an android, a human-like robot. They're often given a personality and behave like a person who is, in some simple way, naïve:

Figure 1.1 – Science fiction and real-world robots. Images used are from the public domain OpenClipArt library

The word robot comes from science fiction (also known as sci-fi). The word is derived from the Czech word for slave and was first used in the 1921 Karel Capek play, Rossum's Universal Robots. The science fiction author Isaac Asimov coined the word robotics as he explored intelligent robot behavior.

Most real robots in our homes and industries are not cutting-edge and eye-catching. Most do not stand on two legs, or indeed any legs at all. Some are on wheels, and some are not mobile but still have moving parts and sensors.

Robots such as modern washing machines, autonomous vacuum cleaners, fully self-regulating boilers, and air sampling fans have infiltrated our homes and are part of everyday life. They aren't threatening and have become just another machine around us. The 3D printer, robot arm, and learning toys are a bit more exciting, though:

Figure 1.2 – The robot, simplified and deconstructed

At their core, robots can all be simplified down to outputs such as a motor, inputs such as a sensor, and a controller for processing or running code. So, a basic robot would look something like this:

  • It has inputs and sensors to measure and sample properties of its environment.
  • It has outputs such as motors, lights, sounds, valves, or heaters to alter its environment.
  • It uses data from its inputs to make autonomous decisions about how it controls its outputs.

Now, we will go ahead and look at some advanced robots in the next section.