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

12

Encoder-Based Localisation with Python

A smart robot can use its sensors with intelligent algorithms to guess its position in a known space, improving its guess as it gathers more information about its movements within that space.

In this chapter, we will see how to build this simple kind of artificial intelligence, making many guesses about where it is with its own mental model. The robot will update these guesses about where it is when it moves, using each movement to make more informed guesses about its position.

For the robot to navigate a space, it needs a mathematical model. We will see how to build and display this model. Then we will look at how to model the robot moving in that space.

We will then see how to refine the guesses and predictions into better predictions.

In this chapter, you will learn about the following topics:

  • Representing and displaying the robot as poses
  • Modeling a test area
  • Moving poses with encoders
  • Localisation debugging tools
  • Refining pose probabilities...
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 R$50/month. Cancel anytime
Modal Close icon
Modal Close icon