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)

The robot object – code for our experiments to talk to the robot

Now we have seen how to move and turn our robot, we come on to a layer of software to group up some of the hardware functions, but isolate them from behavior. Why would we want that? When we chose our motor controller, we made a lot of trade-offs to arrive at one that works for our project. Motor controllers are one of the parts of a robot that can change, because the considerations change or we simply want to build our next robot. Although broadly having two motors and controlling the speed and direction is the same kind of operation, each controller does it slightly differently, so creating a layer in front of it makes a facade—we get to use the same commands to it, even if it changes.

Each controller has a quirks. With this one, we set a run mode and speed. Many controllers use zero to mean stop...