Learn Robotics Programming
Second Edition
Build and control AI-enabled autonomous robots using the Raspberry Pi and Python
Danny Staple
BIRMINGHAMMUMBAI
Learn Robotics Programming
Second Edition
Copyright 2021 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Wilson D'souza
Publishing Product Manager: Rahul Nair
Senior Editor: Rahul Dsouza
Content Development Editor: Nihar Kapadia
Technical Editor: Sarvesh Jaywant
Copy Editor: Safis Editing
Project Coordinator: Neil D'mello
Proofreader: Safis Editing
Indexer: Manju Arasan
Production Designer: Aparna Bhagat
First published: November 2018
Second edition: February 2021
Production reference: 1140121
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-83921-880-4
www.packt.com
Packt.com
Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
- Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
- Improve your learning with Skill Plans built especially for you
- Get a free eBook or video every month
- Fully searchable for easy access to vital information
- Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Danny Staple builds robots and gadgets as a hobby, makes videos about robots, and attends community events such as Pi Wars and Arduino Day. He has worked as a professional software engineer since 2000, and he became a Python programmer in 2009 with a strong focus on DevOps and automation. Danny has worked with embedded systems, including embedded Linux systems, throughout the majority of his career. He mentors at CoderDojo Ham, where he shows kids how to code, and also used to run LEGO Robotics clubs.
The robots he has built with his children include TankBot, SkittleBot, Bangers N Bash (a lunchbox robot), Big Ole Yellow (more tank tracks), ArmBot, and SpiderBot.
I would like to thank David Anderson for being a great person to bounce ideas off and for his motivational energy. I would like to thank Ben Nuttall and Dave Jones (@waveform80) for GPIOZero, and for helping me out countless times on Twitter. Dave Jones kickstarted my journey into computer vision in a restaurant in Cardiff and is the author of the PiCamera library. Finally, I would like to thank my children, Helena and Jonathan, for their support and patience, even occasionally reviewing diagrams for me.
About the reviewers
Leo White is a professional software engineer and graduate of the University of Kent, whose interests include electronics, 3D printing, and robotics. He first started programming on the Commodore 64, then later wrote several applications for the Acorn Archimedes, and currently programs set-top boxes for his day job. Utilizing the Raspberry Pi as a foundation, he has mechanized children's toys and driven robot arms, blogging about his experiences and processes along the way, as well as given presentations at Raspberry Jams and entered a variety of robots into the Pi Wars competition.
Ramkumar Gandhinathan is a roboticist and a researcher by profession. He started building robots in sixth grade and has been in the robotics field for over 15 years through personal and professional connections. He has built over 80+ robots of different types. With an overall professional experience of 7 years (4 years full-time and 3 years part-time/internships) in the robotics industry, he has 5 years of ROS experience. As a part of his professional career, he has built over 15 industrial robot solutions using ROS. He is also fascinated with building drones and is a drone pilot by practice. His research interests and passions are in the field of SLAM, motion planning, sensor fusion, multi-robot communication, and systems integration.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.