Hands-On Robotics Programming with C++
Leverage Raspberry Pi 3 and C++ libraries to build intelligent robotics applications
Dinesh Tavasalkar
- 312 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Hands-On Robotics Programming with C++
Leverage Raspberry Pi 3 and C++ libraries to build intelligent robotics applications
Dinesh Tavasalkar
About This Book
Enhance your programming skills to build exciting robotic projects
Key Features
- Build an intelligent robot that can detect and avoid obstacles and respond to voice commands
- Detect and track objects and faces using OpenCV
- Control your robot with a GUI button designed using Qt5
Book Description
C++ is one of the most popular legacy programming languages for robotics, and a combination of C++ and robotics hardware is used in many leading industries. This book will bridge the gap between Raspberry Pi and C/C++ programming and enable you to develop applications for Raspberry Pi. To follow along with the projects covered in the book, you can implement C programs in Raspberry Pi with the wiringPi library.
With this book, you'll develop a fully functional car robot and write programs to move it in different directions. You'll then create an obstacle - avoiding robot using an ultrasonic sensor. Furthermore, you'll find out how to control the robot wirelessly using your PC/Mac. This book will also help you work with object detection and tracking using OpenCV, and guide you through exploring face detection techniques. Finally, you will create an Android app and control the robot wirelessly with an Android smartphone.
By the end of this book, you will have gained experience in developing a robot using Raspberry Pi and C/C++ programming.
What you will learn
- Install software in Raspberry Pi compatible with C++ programming
- Program the Raspberry Pi in C++ to run a motor
- Control RPi-powered robot wirelessly with your laptop or PC
- Program an RPi camera using OpenCV Control a Raspberry Pi robot with voice commands
- Implement face and object detection with Raspberry Pi
Who this book is for
This book is for developers, programmers, and robotics enthusiasts interested in leveraging C++ to build exciting robotics applications. Prior knowledge of C++ is necessary to understand the projects covered in this book.
Frequently asked questions
Information
Section 1: Getting Started with wiringPi on a Raspberry Pi
- Chapter 1, Introduction to the Raspberry Pi
- Chapter 2, Implementing Blink with wiringPi
Introduction to the Raspberry Pi
- Understanding the Raspberry Pi
- Installing Raspbian OS on a Raspberry Pi 3B+
- Connecting a Raspberry Pi 3B+ to a laptop via Wi-Fi
- Installing Raspbian OS on a Raspberry Pi Zero W
- Connecting a Raspberry Pi Zero W to a laptop via Wi-Fi
Technical requirements
Software required
- Raspbian Stretch: Raspbian Stretch is the operating system (OS) that we will write to a microSD card. Stretch is the OS that will run our Raspberry Pi. It can be downloaded from https://www.raspberrypi.org/downloads/raspbian/ This OS is developed specifically for the Raspberry Pi.
- Balena Etcher: This software will format the microSD card and write the Raspbian Stretch image to the microSD card. It can be downloaded from https://www.balena.io/etcher/.
- PuTTY: We will use PuTTY to connect our Raspberry Pi to a Wi-Fi network and find the IP address that the Wi-Fi network assigns to it. It can be downloaded from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html.
- VNC Viewer: With VNC Viewer, we will be able to view the Raspberry Pi display on our laptop. It can be downloaded from https://www.realvnc.com/en/connect/download/viewer/.
- Bonjour: This is generally used to connect printers to computers over Wi-Fi. It can be downloaded from https://support.apple.com/kb/DL999?viewlocale=en_MY&locale=en_MY.
- Notepad++: We will need Notepad++ to edit the code in the Raspbian Stretch image. It can be downloaded from https://notepad-plus-plus.org/download/v7.5.9.html.
- Brackets: Brackets allows those using macOS to edit the code in the Rapbian Stretch image. To download Brackets, go to http://www.brackets.io/.
Hardware requirements
For Raspberry Pi 3B+ and Raspberry Pi Zero W
- Keyboard
- Mouse
- SD cardâthis should have a minimum of 8 GB of storage, but 32 GB is recommended
- MicroSD card reader
- Display unitâa computer monitor or TV that contains an HDMI port
- HDMI cable
- 5V mobile charger or power bank. This will power the Raspberry Pi
Additional hardware for Raspberry Pi 3B+
- An Ethernet cable
Additional hardware requirements for Raspberry Pi Zero W
- A USB hub
- A micro USB B-to-USB connector (also known as an OTG connector)
- An HDMI-to-mini HDMI connector