Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learn Robotics Programming

You're reading from   Learn Robotics Programming Build and control cutting-edge AI robots with Raspberry Pi and Python

Arrow left icon
Product type Paperback
Published in May 2026
Publisher Packt
ISBN-13 9781803246987
Length 740 pages
Edition 3rd Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Danny Staple Danny Staple
Author Profile Icon Danny Staple
Danny Staple
Arrow right icon
View More author details
Toc

Table of Contents (28) Chapters Close

Preface 1. Part 1: The Basics – Preparing for Robotics
2. Chapter 1: Introduction to Robotics FREE CHAPTER 3. Chapter 2: Exploring Robot Building Blocks – Code and Electronics 4. Chapter 3: Preparing a Headless Raspberry Pi for a Robot 5. Chapter 4: Protecting Robot Code with Git 6. Part 2: Building an Autonomous Robot – Connecting Sensors and Motors to a Raspberry Pi
7. Chapter 5: Building Robot Basics – Wheels, Power, and Wiring 8. Chapter 6: Drive and Turn – Moving Motors with MQTT and Python 9. Chapter 7: Driving the Robot with a Phone and Python 10. Chapter 8: Programming Distance Sensors with Python 11. Chapter 9: Avoiding Obstacles with Distance Sensors 12. Chapter 10: Using Python to Control Servo Motors 13. Chapter 11: Programming Encoders with Python 14. Chapter 12: Encoder-Based Localisation with Python 15. Chapter 13: IMU-Based Robot Navigation with Python 16. Part 3: Hearing and Seeing – Giving a Robot Intelligent Sensors
17. Chapter 14: Robot Vision – Using a Pi Camera and OpenCV 18. Chapter 15: Line-Following with a Camera in Python 19. Chapter 16: Voice Control AI on a Robot with Python 20. Chapter 17: Robot Localisation and Sensor Fusion with Python 21. Part 4: Taking Robotics Further
22. Chapter 18: Taking Your Robot Programming Skills Further 23. Chapter 19: Unlock Access to the Code Bundle and the PDF Version 24. Other Books You May Enjoy
25. Index
Appendix A: Shopping for Robot Parts 1. Appendix B: Command Cheat Sheet

Modeling a test area

The walls will be modeled using the same X, Y coordinate system as the poses. We'll start by making a drawing of test area C, but using coordinates:

Figure 12.5 – The walls represented as edges

Figure 12.5 – The walls represented as edges

The preceding figure shows the walls or boundaries of our test area. Each corner has a coordinate written in it, a vertex or plural vertices.

You may not have a space large enough or the right shape. You can use a smaller or different shape under these conditions:

The space is approximately the same L shape, a rectangle with a corner cut out of it. Non-right angles make things significantly more complicated, and without the corner feature, all sides look the same to the robot.

You will need to take measurements in mm of the space, all corners, and translate those numbers here, in the walls list, and the boundary-checking conditions.

In the diagram, a numbered list of vertices is shown in the middle of the arena, starting from the vertex at index 0. We will use...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learn Robotics Programming
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon