Book Image

ROS Robotics Projects

Book Image

ROS Robotics Projects

Overview of this book

Robot Operating System is one of the most widely used software frameworks for robotic research and for companies to model, simulate, and prototype robots. Applying your knowledge of ROS to actual robotics is much more difficult than people realize, but this title will give you what you need to create your own robotics in no time! This book is packed with over 14 ROS robotics projects that can be prototyped without requiring a lot of hardware. The book starts with an introduction of ROS and its installation procedure. After discussing the basics, you’ll be taken through great projects, such as building a self-driving car, an autonomous mobile robot, and image recognition using deep learning and ROS. You can find ROS robotics applications for beginner, intermediate, and expert levels inside! This book will be the perfect companion for a robotics enthusiast who really wants to do something big in the field.
Table of Contents (20 chapters)
ROS Robotics Projects
Credits
About the Author
Acknowledgements
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Preface

ROS Robotics Projects is a practical guide to learning ROS by making interesting projects using it. The book assumes that you have some knowledge of ROS. However, if you do not have any experience with ROS, you can still learn from this book. The first chapter is dedicated to absolute beginners. ROS is widely used in robotics companies, universities, and robot research labs for designing and programming robots. If you would like to work in the robotics software domain or if you want to have a career as a robotics software engineer, this book is perfect for you.

The basic aim of this book is to teach ROS through interactive projects. The projects that we are discussing here can also be reused in your academic or industrial projects. This book handles a wide variety of new technology that can be interfaced with ROS. For example, you will see how to build a self-driving car prototype, how to build a deep-learning application using ROS, and how to build a VR application in ROS. These are only a few highlighted topics; in addition, you will find some 15 projects and applications using ROS and its libraries.

You can work with any project after meeting its prerequisites. Most of the projects can be completed without many dependencies. We are using popular and available hardware components to build most of the projects. So this will help us create almost all of these projects without much difficulty.

The book starts by discussing the basics of ROS and its variety of applications. This chapter will definitely be a starting point for absolute beginners. After this chapter, we will explore a wide variety of ROS projects.

Let’s learn and make cool projects with ROS!

What this book covers

Chapter 1, Getting Started with ROS Robotics Application Development, is for absolute beginners to ROS. No need to worry if you don’t have experience in ROS; this chapter will help you get an idea of the ROS software framework and its concepts.

Chapter 2, Face Detection and Tracking Using ROS, OpenCV and Dynamixel Servos, takes you through a cool project that you can make with ROS and the OpenCV library. This project basically creates a face tracker application in which your face will be tracked in such a way that the camera will always point to your face. We will use intelligent servos such as Dynamixel to rotate the robot on its axis.

Chapter 3, Building a Siri-Like Chatbot in ROS, is for those of you who want to make your robot interactive and intelligent without much hassle. This project creates a chatterbot in ROS that you can communicate with using text or speech. This project will be useful if you're going to create social or service robots.

Chapter 4, Controlling Embedded Boards Using ROS, helps you build a robot using Arduino, an embedded compatible board, Raspberry Pi, or Odroid and an interface to ROS. In this chapter, you will see a wide variety of embedded boards and interfacing projects made with them.

Chapter 5, Teleoperate a Robot Using Hand Gestures, will teach you how to build a gesture-control device using Arduino and IMU. The gestures are translated into motion commands by ROS nodes.

Chapter 6, Object Detection and Recognition, has interesting project for detecting objects. You will learn both 2D and 3D object recognition using powerful ROS packages.

Chapter 7, Deep Learning Using ROS and TensorFlow, is a project made using a trending technology in robotics. Using the TensorFlow library and ROS, we can implement interesting deep-learning applications. You can implement image recognition using deep learning, and an application using SVM can be found in this chapter.

Chapter 8, ROS on MATLAB and Android, is intended for building robot applications using ROS, MATLAB, and Android.

Chapter 9Building an Autonomous Mobile Robot, is about creating an autonomous mobile robot with the help of ROS. You can see how to use packages such as navigation, gmapping, and AMCL to make a mobile robot autonomous.

Chapter 10, Creating a Self-driving Car Using ROS, is one of the more interesting projects in this book. In this chapter, we will build a simulation of self-driving car using ROS and Gazebo.

Chapter 11, Teleoperating Robot Using VR Headset and Leap Motion, shows you how to control a robot's actions using a VR headset and Leap Motion sensor. You can play around with virtual reality, a trending technology these days.

Chapter 12, Controlling Your Robots over the Web, we will see how to build interactive web applications using rosbridge in ROS.

What you need for this book

You should have a powerful PC running a Linux distribution, preferably Ubuntu 16.04 LTS.

You can use a laptop or desktop with a graphics card, and RAM of 4-8 GB is preferred. This is actually for running high-end simulations in Gazebo, as well as for processing point clouds and computer vision.

You should have the sensors, actuators, and I/O boards mentioned in the book and should be able to connect them all to your PC.

You also need Git installed to clone the package files.

If you are a Windows user, then it will be good to download VirtualBox and set up Ubuntu on it. You can have issues when you try to interface real hardware to ROS when working with VirtualBox. So, it is best if you can work from a real Linux system.

Who this book is for

If you are a robotics enthusiast or researcher who wants to learn more about building robot applications using ROS, this book is for you. In order to learn from this book, you should have a basic knowledge of ROS, GNU/Linux, and C++ programming concepts. The book is also good for programmers who want to explore the advanced features of ROS.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The next lines of code read the link and assign it to the to the BeautifulSoup function."

A block of code is set as follows:

    ros::init(argc, argv,"face_tracker_controller");
    ros::NodeHandle node_obj;
    ros::Subscriber number_subscriber =   
    node_obj.subscribe("/face_centroid",10,face_callback);
    dynamixel_control = node_obj.advertise<std_msgs::Float64> 
    ("/pan_controller/command",10);

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

    ros::init(argc, argv,"face_tracker_controller");
    ros::NodeHandle node_obj;
    ros::Subscriber number_subscriber = 
    node_obj.subscribe("/face_centroid",10,face_callback);
    dynamixel_control = node_obj.advertise<std_msgs::Float64>  
    ("/pan_controller/command",10);

Any command-line input or output is written as follows:

$ git clone https://github.com/qboticslabs/ros_robotics_projects

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In order to download new modules, we will go to FilesSettings | Project Name | Project Interpreter."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/ROS-Robotics-Projects. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/ROSRoboticsProjects_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.