Chapter 3
Programming Your Robot Rover in Python
IN THIS CHAPTER
Learning how to move and sense with your robot
Understanding autonomous vehicles
Playing and using the Adeept software
Okay, let’s review where you are now. You have a basic understanding of robots and (more importantly) of the major components of robots and how they work. You understand that these components can be controlled with Python and that they can work together to accomplish robotic tasks. That’s really a lot of information. Next, we show you how to string these things together to make a very, very simple “robotic brain” to make our robot move by itself. This won’t quite be a fully self-driving car, but after doing this you will have some sense of how those cars are programmed.
Building a Simple High-Level Python Interface
Let’s first make a short Python wrapping function that allows us to build much more complicated programs while hiding the complexity of the robot hardware.
Our high-level interface is a python
class file called RobotInterface.py
. The code length is beyond what we want to show in this book, so let us describe a couple of functions and then document the rest.
The motorForward function ...
Get Python All-in-One For Dummies now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.