logo资料库

ROS by example.pdf

第1页 / 共254页
第2页 / 共254页
第3页 / 共254页
第4页 / 共254页
第5页 / 共254页
第6页 / 共254页
第7页 / 共254页
第8页 / 共254页
资料共254页,剩余部分请下载后查看
Preface
Printed vs PDF Versions of the Book
Changes Since Electric and Fuerte
1. Purpose of this Book
2. Real and Simulated Robots
2.1 Gazebo, Stage, and the ArbotiX Simulator
2.2 Introducing the TurtleBot, Maxwell and Pi Robot
3. Operating Systems and ROS Versions
3.1 Installing Ubuntu Linux
3.2 Getting Started with Linux
3.3 A Note about Updates and Upgrades
4. Reviewing the ROS Basics
4.1 Installing ROS
4.2 Installing rosinstall
4.3 Creating Your Personal ROS Directory
4.4 Working through the Official ROS Tutorials
4.5 RViz: The ROS Visualization Tool
4.6 Using ROS Parameters in your Programs
4.7 Using rqt_reconfigure (formerly dynamic_reconfigure) to set ROS Parameters
4.8 Networking Between a Robot and a Desktop Computer
4.8.1 Time Synchronization
4.8.2 ROS Networking using Zeroconf
4.8.2.1 Testing Connectivity
4.8.2.2 Setting the ROS_MASTER_URI and ROS_HOSTNAME Variables
4.8.2.3 Opening New Terminals
4.8.2.4 Running Nodes on both Machines
4.8.3 ROS Networking across the Internet
4.9 ROS Recap
4.10 The Official ROS Cheat Sheet
4.11 What is a ROS Application?
4.12 Installing Packages with SVN, Git, and Mercurial
4.12.1 SVN
4.12.2 Git
4.12.3 Mercurial
4.13 Removing Packages from your Personal ROS Directory
4.14 How to Find Third-Party ROS Packages
4.14.1 Searching the ROS Wiki
4.14.2 Using the roslocate Command
4.14.3 Browsing the ROS Software Index
4.14.4 Doing a Google Search
4.15 Getting Further Help with ROS
5. Installing the ros-by-example Code
5.1 Installing the Prerequisites
5.2 Cloning the ros-by-example Repository
5.3 About the Code Listings in this Book
6. Installing the Arbotix Simulator
6.1 Installing the Simulator
6.2 Testing the Simulator
6.3 Running the Simulator with Your Own Robot
7. Controlling a Mobile Base
7.1 Units and Coordinate Systems
7.2 Levels of Motion Control
7.2.1 Motors, Wheels, and Encoders
7.2.2 Motor Controllers and Drivers
7.2.3 The ROS Base Controller
7.2.4 Frame-Base Motion using the move_base ROS Package
7.2.5 SLAM using the gmapping and amcl ROS Packages
7.2.6 Semantic Goals
7.2.7 Summary
7.3 Twisting and Turning with ROS
7.3.1 Example Twist Messages
7.3.2 Monitoring Robot Motion using RViz
7.4 Calibrating Your Robot's Odometry
7.4.1 Linear Calibration
7.4.2 Angular Calibration
7.5 Sending Twist Messages to a Real Robot
7.6 Publishing Twist Messages from a ROS Node
7.6.1 Estimating Distance and Rotation Using Time and Speed
7.6.2 Timed Out-and-Back in the ArbotiX Simulator
7.6.3 The Timed Out-and-Back Script
7.6.4 Timed Out and Back using a Real Robot
7.7 Are We There Yet? Going the Distance with Odometry
7.8 Out and Back Using Odometry
7.8.1 Odometry-Based Out and Back in the ArbotiX Simulator
7.8.2 Odometry-Based Out and Back Using a Real Robot
7.8.3 The Odometry-Based Out-and-Back Script
7.8.4 The /odom Topic versus the /odom Frame
7.9 Navigating a Square using Odometry
7.9.1 Navigating a Square in the ArbotiX Simulator
7.9.2 Navigating a Square using a Real Robot
7.9.3 The nav_square.py Script
7.9.4 The Trouble with Dead Reckoning
7.10 Teleoperating your Robot
7.10.1 Using the Keyboard
7.10.2 Using a Logitech Game Pad
7.10.3 Using the ArbotiX Controller GUI
7.10.4 TurtleBot Teleoperation Using Interactive Markers
7.10.5 Writing your Own Teleop Node
8. Navigation, Path Planning and SLAM
8.1 Path Planning and Obstacle Avoidance using move_base
8.1.1 Specifying Navigation Goals Using move_base
8.1.2 Configuration Parameters for Path Planning
8.1.2.1 base_local_planner_params.yaml
8.1.2.2 costmap_common_params.yaml
8.1.2.3 global_costmap_params.yaml
8.1.2.4 local_costmap_params.yaml
8.2 Testing move_base in the ArbotiX Simulator
8.2.1 Point and Click Navigation in RViz
8.2.2 Navigation Display Types for RViz
8.2.3 Navigating a Square using move_base
8.2.4 Avoiding Simulated Obstacles
8.2.5 Setting Manual Goals with Obstacles Present
8.3 Running move_base on a Real Robot
8.3.1 Testing move_base without Obstacles
8.3.2 Avoiding Obstacles using the TurtleBot's Fake Laser Scan
8.4 Map Building using the gmapping Package
8.4.1 Laser Scanner or Depth Camera?
8.4.2 Collecting and Recording Scan Data
8.4.3 Creating the Map
8.4.4 Creating a Map from Bag Data
8.4.5 Can I Extend or Modify an Existing Map?
8.5 Navigation and Localization using a Map and amcl
8.5.1 Testing amcl with Fake Localization
8.5.2 Using amcl with a Real Robot
8.5.3 Fully Autonomous Navigation
8.5.4 Running the Navigation Test in Simulation
8.5.5 Understanding the Navigation Test Script
8.5.6 Running the Navigation Test on a Real Robot
8.5.7 What's Next?
9. Speech Recognition and Synthesis
9.1 Installing PocketSphinx for Speech Recognition
9.2 Testing the PocketSphinx Recognizer
9.3 Creating a Vocabulary
9.4 A Voice-Control Navigation Script
9.4.1 Testing Voice-Control in the ArbotiX Simulator
9.4.2 Using Voice-Control with a Real Robot
9.5 Installing and Testing Festival Text-to-Speech
9.5.1 Using Text-to-Speech within a ROS Node
9.5.2 Testing the talkback.py script
10. Robot Vision
10.1 OpenCV, OpenNI and PCL
10.2 A Note about Camera Resolutions
10.3 Installing and Testing the ROS Camera Drivers
10.3.1 Installing the OpenNI Drivers
10.3.2 Installing Webcam Drivers
10.3.3 Testing your Kinect or Xtion Camera
10.3.4 Testing your USB Webcam
10.4 Installing OpenCV on Ubuntu Linux
10.5 ROS to OpenCV: The cv_bridge Package
10.6 The ros2opencv2.py Utility
10.7 Processing Recorded Video
10.8 OpenCV: The Open Source Computer Vision Library
10.8.1 Face Detection
10.8.2 Keypoint Detection using GoodFeaturesToTrack
10.8.3 Tracking Keypoints using Optical Flow
10.8.4 Building a Better Face Tracker
10.8.5 Dynamically Adding and Dropping Keypoints
10.8.6 Color Blob Tracking (CamShift)
10.9 OpenNI and Skeleton Tracking
10.9.1 Viewing Skeletons in RViz
10.9.2 Accessing Skeleton Frames in your Programs
10.10 PCL Nodelets and 3D Point Clouds
10.10.1 The PassThrough Filter
10.10.2 Combining More than One PassThrough Filter
10.10.3 The VoxelGrid Filter
11. Combining Vision and Base Control
11.1 A Note about Camera Coordinate Axes
11.2 Object Tracker
11.2.1 Testing the Object Tracker with rxplot
11.2.2 Testing the Object Tracker with a Simulated Robot
11.2.3 Understanding the Object Tracker Code
11.2.4 Object Tracking on a Real Robot
11.3 Person Follower
11.3.1 Testing the Follower Application in Simulation
11.3.2 Understanding the Follower Script
11.3.3 Running the Follower Application on a TurtleBot
11.3.4 Running the Follower Node on a Filtered Point Cloud
12. Dynamixel Servos and ROS
12.1 A TurtleBot with a Pan-and-Tilt Head
12.2 Choosing a Dynamixel Hardware Controller
12.3 A Note Regarding Dynamixel Hardware
12.4 Choosing a ROS Dynamixel Package
12.5 Understanding the ROS JointState Message Type
12.6 Controlling Joint Position, Speed and Torque
12.6.1 Setting Servo Position
12.6.2 Setting Servo Speed
12.6.3 Controlling Servo Torque
12.7 Checking the USB2Dynamixel Connection
12.8 Setting the Servo Hardware IDs
12.9 Configuring and Launching dynamixel_controllers
12.9.1 The dynamixel_controllers Configuration File
12.9.2 The dynamixel_controllers Launch File
12.10 Testing the Servos
12.10.1 Starting the Controllers
12.10.2 Monitoring the Robot in RViz
12.10.3 Listing the Controller Topics and Monitoring Joint States
12.10.4 Listing the Controller Services
12.10.5 Setting Servo Position, Speed and Torque
12.10.6 Using the relax_all_servos.py Script
12.11 Tracking a Visual Target
12.11.1 Tracking a Face
12.11.2 The Head Tracker Script
12.11.3 Tracking Colored Objects
12.11.4 Tracking Manually Selected Targets
12.12 A Complete Head Tracking ROS Application
13. Where to Go Next?
ROS By Example A Do-It-Yourself Guide to the Robot Operating System VOLUME 1 A PI ROBOT PRODUCTION R. PATRICK GOEBEL Version 1.03 For ROS Groovy
ROS BY EXAMPLE. Copyright © 2012 by R. Patrick Goebel All Rights Reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN: 5-800085-311092 Version 1.03 for ROS Groovy: April 2013 LEGO® is a trademark of the LEGO group which does not sponsor, authorize, or endorse this book. Other products and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademark name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Information contained in this work (Paperback or eBook) has been obtained from sources believed to be reliable. However, the author does not guarantee the accuracy or completeness of any information contained in it, and the author shall not be responsible for any errors, omissions, losses, or damages caused or alleged to be caused directly or indirectly by the information published herein. This work is published with the understanding that the author is supplying information but is not attempting to render professional services. This product almost certainly contains errors. It is your responsibility to examine, verify, test, and determine the appropriateness of use, or request the assistance of an appropriate professional to do so.
PREFACE This book is about programming your robot to do amazing things, whether it be detecting people's faces and other visual objects, navigating autonomously around your house, or responding to spoken commands. We will be using some of the most advanced robotics software available today thanks to ROS, the Robot Operating System created by California-based Willow Garage and now maintained by the Open Source Robotics Foundation (OSRF). The primary goal of ROS (pronounced "Ross") is to provide a unified and open source programming framework for controlling robots in a variety of real world and simulated environments. ROS is certainly not the first such effort; in fact, doing a Wikipedia search for "robot software" turns up over 25 such projects. But Willow Garage is no ordinary group of programmers banging out free software. Propelled by some serious funding, strong technical expertise, and a well planned series of developmental milestones, Willow Garage has ignited a kind of programming fever among roboticists with hundreds of user-contributed ROS packages already created in just a few short years. ROS now includes software for tasks ranging from navigation and localization (SLAM), 3D object recognition, action planning, motion control for multi-jointed arms, machine learning and even playing billiards. In the meantime, Willow Garage has also designed and manufactured a $400,000 robot called the PR2 to help showcase its operating system. Using the latest in robot hardware, including two stereo cameras, a pair of laser scanners, arms with 7 degrees of freedom, and an omni-directional drive system, only a lucky few will be able to run ROS directly on the PR2, including 11 research institutions that were awarded free PR2s as part of a beta-test contest. However, you do not need a PR2 to leverage the power of ROS; packages have already been created to support lower-cost platforms and components including the iRobot Create, TurtleBot, Arduino, WowWee Rovio, LEGO® NXT, Phidgets, ArbotiX, Serializer, Element and Robotis Dynamixels. The guiding principle underlying ROS is "don't reinvent the wheel". Many thousands of very smart people have been programming robots for over fifty years—why not bring all that brain power together in one place? Fortunately, the Web is the perfect medium for sharing code. Many universities, companies and individuals now openly share their ROS code repositories, and with free cloud space available through services such as Google Code, anyone can share their own ROS creations easily and at no cost. Perhaps the best part of jumping on the ROS train is the excitement that comes from working with thousands of like-minded roboticists from around the world. Not only will you save many days of frustration by not duplicating someone else's work, you can also feel the satisfaction that comes from contributing back to this rapidly developing field.
分享到:
收藏