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

Exploring robots in industry

Another place where robots are commonly seen is in industry. The first useful robots were used in factories, and have been there for a long time.

Robot arms

Robot arms range from tiny delicate robots for turning eggs, to colossal monsters moving shipping containers. Robot arms tend to use stepper and servo motors. We will look at servo motors in the pan and tilt mechanism used in this book. Most industrial robot arms (for example, ABB welding robots) follow a predetermined pattern of moves, and do not possess any decision making. However, for a more sensor-based and smart system, take a look at the impressive Baxter from Rethink Robotics in Figure 1.7. Baxter is a collaborative robot designed to work alongside humans:

Figure 1.7 – The Rethink Robotics Baxter Robot (Image credit: Baxter at Innorobo by © Xavier Caré / Wikimedia Commons [CC-BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0)])

Many robot arms are unsafe to work next to and could result in accidents, requiring cages or warning markings around them. Not so with Baxter; it can sense a human and work around or pause for safety. In the preceding image, these sensors are seen around the head. The arm sensors and soft joints also allow Baxter to sense and react to collisions.

Baxter has a training and repeat mechanism for workers to adapt it to a task. It uses sensors to detect joint positions when being trained or playing back motions. Our robot will use encoder sensors to precisely control wheel movements.

Warehouse robots

Another common type of robot used in industry is those that move items around a factory floor or warehouse:

Figure 1.8 – Warehouse robot systems: Stingray system by TGWmechanics [CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0)], and Intellicart by Mukeshhrs [public domain]

Figure 1.8 picture 1 shows robotic crane systems for shifting pallets in storage complexes. They receive instructions to move goods within shelving systems.

Smaller item-moving robots, like Intellicart in Figure 1.8 picture 2, employ line sensors, by following lines on the floor, magnetically sensing wires underneath the floor, or by following marker beacons like ASIMO. Our robot will follow lines such as these. These line-following carts frequently use wheels because these are simple to maintain and can form stable platforms.