万本电子书0元读

万本电子书0元读

顶部广告

Hands-On Robotics Programming with C++电子书

售       价:¥

0人正在读 | 0人评论 9.8

作       者:Dinesh Tavasalkar

出  版  社:Packt Publishing

出版时间:2019-03-30

字       数:22.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
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.
目录展开

Dedication

About Packt

Why subscribe?

Packt.com

Contributors

About the author

About the reviewers

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Section 1: Getting Started with wiringPi on a Raspberry Pi

Introduction to the Raspberry Pi

Technical requirements

Software required

Hardware requirements

For Raspberry Pi 3B+ and Raspberry Pi Zero W

Additional hardware for Raspberry Pi 3B+

Additional hardware requirements for Raspberry Pi Zero W

Understanding the Raspberry Pi

The Raspberry Pi 3B+

The Raspberry Pi Zero W

Setting up a Raspberry Pi 3B+ as a desktop computer

Installing Raspbian OS on an SD card

Downloading and installing Etcher

Downloading the Raspbian Stretch image

Writing the Raspbian Stretch image to a microSD card

Setting up the Raspberry Pi 3B+

Connecting the Raspberry Pi 3B+ to the internet

Connecting the Raspberry Pi 3B+ to a laptop via Wi-Fi

Creating an SSH file on a microSD card

Connecting the Raspberry Pi 3B+ to a Wi-Fi network using PuTTY

Enabling the VNC server

Viewing the Raspberry Pi output on the VNC Viewer

Increase the VNC's screen resolution

Handling VNC and PuTTY errors

Setting up the Raspberry Pi Zero W as a desktop computer

Setting up the Raspberry Pi Zero W

Connecting the Raspberry Pi Zero W to a laptop via Wi-Fi

Connecting the Raspberry Pi Zero W to a Wi-Fi network using PuTTY

Enabling VNC Viewer for Raspberry Pi Zero W

Viewing Raspberry Pi Zero W output on VNC Viewer

Summary

Questions

Implementing Blink with wiringPi

Technical requirements

Installing the wiringPi library in the Raspberry Pi

Accessing Raspberry Pi GPIO pins via wiringPi

Making an LED blink

Wiring connections

The blinking program

Uploading the code to the Raspberry Pi

Smart light – working with digital sensor

The LDR sensor and the way it works

Wiring connection

Smart light program

Pulse Width Modulation using softPWM

How PWM works

The softPWM library

Making an LED blink with the softPWM library

Summary

Questions

Section 2: Raspberry Pi Robotics

Programming the Robot

Technical requirements

Choosing a robot chassis

Constructing and connecting the robot

Constructing the robot

Connecting the motor driver to the Raspberry Pi

What is a motor driver?

Wiring connections

Working with H-bridge

Moving the robot

Moving the robot backward

Stopping the robot

Different types of turns

Axial turns

Axial left turn

Axial right turn

Radial turn

Radial left turn

Radial right turn

Summary

Questions

Building an Obstacle-Avoiding Robot

Technical requirements

Using an ultrasonic sensor

How an ultrasonic sensor measures distances

The arithmetic equation for determining the time taken

Wiring the ultrasonic sensor to the Raspberry Pi

The HC-SR04 sensor program

Using an LCD

Wiring the 16x2 LCD to the Raspberry Pi

Programming the LCD

The LCD program

The LCD and the ultrasonic sensor program

What is the I2C protocol?

Wiring the I2C LCD and the Raspberry Pi

Programming the LCD with the I2C LCD module

The I2C LCD and the ultrasonic sensor program

Building an obstacle-avoiding robot

Wiring connections

Programming the obstacle-avoiding robot

Summary

Questions

Controlling a Robot Using a Laptop

Technical requirements

Installing the ncurses library

ncurses functions

Writing a HelloWorld program with ncurses

Compiling and running the program

Controlling LEDs and a buzzer using ncurses

Wiring connections

Writing the LEDBuzzer.cpp program

Controlling a rover using a laptop keyboard

Building a laptop-controlled rover program

Tracing a square path

Installing and setting up QT5

Setting up QT5

Controlling LEDs with GUI buttons

Creating a QT project

Dealing with errors

Controlling a rover using a laptop with QT5

Summary

Questions

Section 3: Face and Object Recognition Robot

Accessing the RPi Camera with OpenCV

Technical requirements

Installing OpenCV 4.0.0 on Raspberry Pi

Uninstalling Wolfram and LibreOffice

Updating your RPi

Installing the cmake, image, video, and gtk packages

Downloading and unzipping OpenCV 4.0 and its contribution repository

Installing Python

Compiling and installing OpenCV

Linking OpenCV to Python

Enabling and connecting the RPi camera to RPi

Connecting the RPi camera to RPi

Mounting the RPi camera on the robot

Capturing images and video with the RPi camera

Recording a video with the RPi camera

Installing the v4l2 driver

Reading an image using OpenCV

Summary

Questions

Building an Object-Following Robot with OpenCV

Technical requirements

Image processing with OpenCV

Important functions in OpenCV

Object recognition using OpenCV

Capturing the image

Finding the RGB pixel values

The object detection program

The OpenCV camera feed program

Building an object-following robot

Ball tracing using moments

Programming logic

The ball tracing program

Setting up the object-following robot

Object-following robot program

Summary

Questions

Face Detection and Tracking Using the Haar Classifier

Technical requirements

Face detection using the Haar cascade

Basic working of the Viola-Jones algorithm

Face-detection program

Detecting the eyes and smile

Detecting the eyes

Eye detection using haarcascade_eye

Eye detection using haarcascade_lefteye_2splits and haarcascade_righteye_2splits

Detecting the left eye

Detecting the right eye

Recognizing a smile

Programming logic for smile recognition

Face-tracking robot

Wiring connections

The programming logic

Using the white dot on the face triangle to move the robot

Summary

Questions

Section 4: Smartphone-Controlled Robot

Building a Voice-Controlled Robot

Technical requirements

An introduction to App Inventor

Creating a Talking Pi Android app

Designing the app

Programming the blocks

Main block

Intermediate block

Final block

The Talking Pi program

Importing and exporting the .aia file of the app

Creating a voice-controlled bot app

Designing the app

Adding and customizing the components

Programming the voice-controlled bot block

Pairing the Android smartphone and RPi via Bluetooth

Enabling the Bluetooth serial port

Developing the Bluetooth program for RPi

Socket programming

VoiceBot server program

Testing the code

Summary

Questions

Assessments

Chapter 1: Introduction to the Raspberry Pi

Chapter 2: Implementing Blink with wiringPi

Chapter 3: Programming the Robot

Chapter 4: Building an Obstacle-Avoiding Robot

Chapter 5: Controlling a Robot Using a Laptop

Chapter 6: Building an Object-Following Robot with OpenCV

Chapter 7: Accessing the RPi Camera with OpenCV

Chapter 8: Face Detection and Tracking Using the Haar Classifier

Chapter 9: Building a Voice-Controlled Robot

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部