Book Image

Learn Robotics Programming

By : Danny Staple
Book Image

Learn Robotics Programming

By: Danny Staple

Overview of this book

We live in an age where the most difficult human tasks are now automated. Smart and intelligent robots, which will perform different tasks precisely and efficiently, are the requirement of the hour. A combination of Raspberry Pi and Python works perfectly when making these kinds of robots. Learn Robotics Programming starts by introducing you to the basic structure of a robot, along with how to plan, build, and program it. As you make your way through the book, you will gradually progress to adding different outputs and sensors, learning new building skills, and writing code for interesting behaviors with sensors. You’ll also be able to update your robot, and set up web, phone, and Wi-Fi connectivity in order to control it. By the end of the book, you will have built a clever robot that can perform basic artificial intelligence (AI) operations.
Table of Contents (21 chapters)

Competitive, educational, and hobby robots

The most fun robots can be those built by amateur robot builders. This is an extremely innovative space.

Robotics always had a home in education, with academic builders using them for learning and experimentation platforms. Many commercial ventures have started in this setting. University robots tend to be group efforts, with access to increasingly hi-tech academic equipment to create them, as shown in the following picture:

Kismet and OhBot

Kismet was created at MIT in the late 90s. There are a number of hobbyist robots that are derived from it. It was groundbreaking at the time, using servo motors to drive face movements intended to mimic human expressions. This has been followed in the community with OhBot, an inexpensive hobbyist kit using servo motors, which can be linked with a Raspberry Pi, using voice recognition and facial camera processing to make a convincing display.

Hobby robotics is strongly linked with open source and blogging, sharing designs, and code, leading to further ideas. Hobbyist robots can be created from kits available on the internet, with modifications and additions. The kits cover a wide range of complexity from simple three-wheeled bases to drone kits and hexapods. They come with or without the electronics included. An investigation of kits will be covered in Chapter 6, Building Robot Basics - Wheels, Power, and Wiring. I used a hexapod kit to build SpiderBot to explore walking motion. Refer to the following photo:

Spiderbot - built by me, based on a kit. Controller is an esp8266 + Adafruit 16 Servo Controller

Skittlebot was my Pi Wars 2018 entry, built using toy hacking, repurposing a remote control excavator toy into a robot platform. Pi Wars is an autonomous robotics challenge for Raspberry Pi-based robots, which has both manual and autonomous challenges. There were entries with decorative cases and interesting engineering principles. Skittlebot uses three distance sensors to avoid walls, and we will investigate this kind of sensor in Chapter 11, Programming Distance Sensors with Python. Skittlebot uses a camera to seek out colored objects, as we will see in Chapter 13, Robot Vision - Using A Pi Camera And OpenCV. Here is a photo of Skittlebot:

Skittlebot - My PiWars 2018 Robot - based on a toy

Some hobbyist robots are built from scratch, using 3D printing, laser cutting, vacuum forming, woodwork, CNC, and other techniques to construct the chassis and parts. Refer to the following set of photos:

Building Armbot

I built the robot from scratch, for the London robotics group the Aurorans, in 2009. The robot was known as eeeBot in 2009, since it was intended to be driven by an Eee PC laptop. The Aurorans were a community who met to discuss robotics. The robot was later given a Raspberry Pi, and a robot arm kit seemed to fit it, earning it the name Armbot. In the current market, there are many chassis kits and a beginner will not need to measure and cut materials in this way to make a functioning robot. This was not built to compete, but to inspire other robot builders and kids to code. Towards the end of the book, we will cover some of the communities where robots are being built and shared, along with starting points on using construction techniques to build them from scratch.

The television series Robot Wars is a well known competitive robot event with impressive construction and engineering skills. There is no autonomous behavior in Robot Wars though; these are all manually driven, like remote control cars. Washing machines, although less exciting, are smarter, so they could be more strictly considered robots.