ebook img

ROS Robotics Projects: Build And Control Robots Powered By The Robot Operating System, Machine Learning, And Virtual Reality PDF

449 Pages·2019·95.634 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview ROS Robotics Projects: Build And Control Robots Powered By The Robot Operating System, Machine Learning, And Virtual Reality

ROS Robotics Projects Second Edition Build and control robots powered by the Robot Operating System, machine learning, and virtual reality Ramkumar Gandhinathan Lentin Joseph BIRMINGHAM - MUMBAI ROS Robotics Projects Second Edition Copyright © 2019 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Commissioning Editor: Vijin Boricha Acquisition Editor: Meeta Rajani Content Development Editor: Pratik Andrade Senior Editor: Rahul Dsouza Technical Editor: Dinesh Pawar Copy Editor: Safis Editing Project Coordinator: Anish Daniel Proofreader: Safis Editing Indexer: Rekha Nair Production Designer: Alishon Mendonsa First published: March 2017 Second edition: December 2019 Production reference: 1181219 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-83864-932-6 www.packt.com To my dear mother and father, for their sacrifices and for exemplifying the power of determination. To my influential sister, for her constant love and motivation. To my loving wife, for being supportive, understanding my passion, and accepting me the way I am throughout our life and beyond. To all my friends and colleagues who've been by my side, encouraging and inspiring me to do more. To Meeta, Pratik, and other Packt employees for working closely with me, bringing the best out of me, and shaping the book. – Ramkumar Gandhinathan I dedicate this book to my parents, C. G. Joseph and Jancy Joseph, for giving me strong support in making this project happen. – Lentin Joseph Packt.com Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website. Why subscribe? Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals Improve your learning with Skill Plans built especially for you Get a free eBook or video every month Fully searchable for easy access to vital information Copy and paste, print, and bookmark content Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. Contributors About the authors Ramkumar Gandhinathan is a roboticist and researcher by profession. He started building robots in the sixth grade and has been in the robotics field for over 15 years through personal and professional connections. He has personally built over 80 robots of different types. With 7 years' overall professional experience (4 years full-time and 3 years part- time/internship) in the robotics industry, he has 5 years of ROS experience. As a part of his professional career, he has built over 15 industrial robot solutions using ROS. He is also fascinated by building drones and is a drone pilot. His research interests and passion are in the fields of SLAM, motion planning, sensor fusion, multi-robot communication, and systems integration. Lentin Joseph is an author, roboticist, and robotics entrepreneur from India. He runs a robotics software company called Qbotics Labs in Kochi, Kerala. He has 8 years of experience in the robotics domain, primarily in ROS, OpenCV, and PCL. He has authored several books on ROS, namely Learning Robotics Using Python, first and second edition; Mastering ROS for Robotics Programming, first and second edition; ROS Robotics Projects, first edition; and Robot Operating System for Absolute Beginners. He completed his master's degree in robotics and automation in India and has worked at Robotics Institute, CMU, USA. He is also a TEDx speaker. Packt is searching for authors like you If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea. Table of Contents Preface 1 Chapter 1: Getting Started with ROS 7 Technical requirements 8 Getting started with ROS 8 ROS distributions 9 Supported OSes 10 Robots and sensors supported by ROS 11 Why use ROS? 13 Fundamentals of ROS 14 The filesystem level 15 The computation graph level 16 The ROS community level 18 Communication in ROS 19 ROS client libraries 20 ROS tools 21 ROS Visualizer (RViz) 21 rqt_plot 22 rqt_graph 23 ROS simulators 24 Installing ROS Melodic on Ubuntu 18.04 LTS 25 Getting started with the installation 26 Configuring Ubuntu repositories 26 Setting up source.list 28 Setting up keys 29 Installing ROS Melodic 29 Initializing rosdep 29 Setting up the ROS environment 30 Getting rosinstall 30 Setting up ROS on VirtualBox 31 Introduction to Docker 33 Why Docker? 34 Installing Docker 35 Installing from the Ubuntu repository 35 Removing Docker 35 Installing from the Docker repository 36 Working with Docker 37 Setting up the ROS workspace 39 Opportunities for ROS in industries and research 41 Summary 41 Table of Contents Chapter 2: Introduction to ROS-2 and Its Capabilities 42 Technical requirements 44 Getting started with ROS-2 44 ROS-2 distributions 46 Supported operating systems 46 Robots and sensors supported in ROS-2 47 Why ROS-2? 47 Fundamentals of ROS-2 48 What is DDS? 49 How is DDS implemented? 49 Computational graph 50 ROS-2 community level 50 Communication in ROS-2 51 Changes between ROS-1 and ROS-2 52 ROS-2 client libraries (RCL) 53 ROS-2 tools 54 Rviz2 55 Rqt 56 Installing ROS-2 57 Getting started with the installation 57 Setting up the system locale 57 Adding ROS-2 repositories 58 Installing development and ROS tools 59 Getting the ROS-2 source code 59 Installing dependencies using rosdep 60 Installing DDS implementations (optional) 61 Building code 62 Setting up ROS-1, ROS-2, or both environments 63 Running test nodes 65 Setting up the ROS-2 workspace 67 Writing ROS-2 nodes 68 ROS-1 example code 69 ROS-2 example code 70 Differences between ROS-1 and ROS-2 talker nodes 74 Bridging ROS-1 and ROS-2 75 Testing the ros1_bridge package 76 Summary 78 Chapter 3: Building an Industrial Mobile Manipulator 79 Technical requirements 80 Understanding available mobile manipulators 81 Applications of mobile manipulators 83 Getting started building mobile manipulators 84 Units and coordinate system 85 Gazebo and ROS assumptions 85 [ ii ] Table of Contents Building the robot base 87 Robot base prerequisites 87 Robot base specifications 87 Robot base kinematics 88 Software parameters 89 ROS message format 89 ROS controllers 90 Modeling the robot base 90 Initializing the workspace 92 Defining the links 93 Defining the joints 95 Simulating the robot base 96 Defining collisions 96 Defining actuators 97 Defining ROS_CONTROLLERS 98 Testing the robot base 100 Getting started building the robot arm 104 Robot arm prerequisites 104 Robot arm specifications 104 Robot arm kinematics 105 Software parameters 106 The ROS message format 106 ROS controllers 106 Modeling the robot arm 107 Initializing the workspace 107 Defining the links 108 Defining the joints 109 Simulating the robot arm 110 Defining collisions 110 Defining actuators 111 Defining ROS_CONTROLLERS 112 Testing the robot arm 113 Putting things together 115 Modeling the mobile manipulator 115 Simulating and testing the mobile manipulator 116 Summary 117 Chapter 4: Handling Complex Robot Tasks Using State Machines 118 Technical requirements 119 Introduction to ROS actions 119 The client-server concept 120 An actionlib example – robot arm client 121 An actionlib example – battery simulator server-client 124 Creating a package and a folder action inside it 125 Creating an action file that has the goal, result, and feedback 125 Modifying the package files and compiling the package 126 Defining a server 127 Defining a client 129 [ iii ] Table of Contents Waiter robot analogy 131 Introduction to state machines 133 Introduction to SMACH 135 SMACH concepts 135 Outcome 137 User data 137 Preemption 137 Introspection 137 Getting started with SMACH examples 139 Installing and using SMACH-ROS 139 Simple example 139 Restaurant robot analogy 143 Summary 147 Chapter 5: Building an Industrial Application 148 Technical requirements 149 Application use case – robot home delivery 149 Setting up the environment in Gazebo 152 Making our robot base intelligent 153 Adding a laser sensor 153 Configuring the navigation stack 156 Mapping the environment 158 Localizing the robot base 159 Making our robot arm intelligent 160 Introduction to Moveit 160 Installing and configuring Moveit for our mobile robot 162 Installing Moveit 162 Configuring the Moveit setup assistant wizard 162 Loading the robot model 163 Setting up self-collisions 164 Setting up planning groups 164 Setting up arm poses 165 Setting up passive joints 166 Setting up ROS controllers 167 Finalizing the Moveitconfig package 167 Controlling the robot arm using Moveit 168 Simulating the application 172 Mapping and saving the environment 172 Choosing the points on the environment 173 Adding the points to our library 174 Completing the state machine 174 Improvements to the robot 174 Summary 175 Chapter 6: Multi-Robot Collaboration 176 Technical requirements 177 [ iv ]

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.