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)
Section 1: The Basics – Preparing for Robotics
Section 2: Building an Autonomous Robot – Connecting Sensors and Motors to a Raspberry Pi
Section 3: Hearing and Seeing – Giving a Robot Intelligent Sensors
Section 4: Taking Robotics Further

Looking at what's inside a robot

We can start by looking at a robot as a physical system. In Figure 2.1, we can see a simple hobby robot:

Figure 2.1 – An assembled hobby robot

Figure 2.2 shows it in its disassembled form:

Figure 2.2 – A hobby robot's components laid out

The component groups in Figure 2.2 include nine types of components:

  1. The chassis or body forms the main structure of the robot; other parts are attached here.
  2. A castor wheel balances this robot.
  3. Two drive wheels. Other robots may use more wheels or legs here.
  4. Motors are essential for the robot to move.
  5. A motor controller bridges between a controller and connected motors.
  6. A controller, here a Raspberry Pi, runs instructions, takes information from the sensors, and processes this information to drive outputs, such as motors, through the motor controller.
  7. All robots must have power, usually one or more...