Programming Robots with ROS

Book description

Want to develop novel robot applications, but don’t know how to write a mapping or object recognition system? You’re certainly not alone, but you’re not without help. By combining real-world examples with valuable knowledge from the Robot Operating System (ROS) community, this practical book provides a set of motivating recipes for solving specific robotics use cases.

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Who Should Read This Book?
    2. Who Should Not Read This Book?
    3. What You’ll Learn
    4. Prerequisites
    5. Conventions Used in This Book
    6. Using Code Examples
    7. Safari® Books Online
    8. How to Contact Us
    9. Acknowledgments
  2. I. Fundamentals
  3. 1. Introduction
    1. Brief History
    2. Philosophy
    3. Installation
    4. Summary
  4. 2. Preliminaries
    1. The ROS Graph
    2. roscore
    3. catkin, Workspaces, and ROS Packages
      1. catkin
      2. Workspaces
      3. ROS Packages
    4. rosrun
    5. Names, Namespaces, and Remapping
    6. roslaunch
    7. The Tab Key
    8. tf: Coordinate Transforms
      1. Poses, Positions, and Orientations
      2. tf
    9. Summary
  5. 3. Topics
    1. Publishing to a Topic
      1. Checking That Everything Works as Expected
    2. Subscribing to a Topic
      1. Checking That Everything Works as Expected
    3. Latched Topics
    4. Defining Your Own Message Types
      1. Defining a New Message
      2. Using Your New Message
      3. When Should You Make a New Message Type?
    5. Mixing Publishers and Subscribers
    6. Summary
  6. 4. Services
    1. Defining a Service
    2. Implementing a Service
      1. Checking That Everything Works as Expected
      2. Other Ways of Returning Values from a Service
    3. Using a Service
      1. Checking That Everything Works as Expected
      2. Other Ways to Call Services
    4. Summary
  7. 5. Actions
    1. Defining an Action
    2. Implementing a Basic Action Server
      1. Checking That Everything Works as Expected
    3. Using an Action
      1. Checking That Everything Works as Expected
    4. Implementing a More Sophisticated Action Server
    5. Using the More Sophisticated Action
      1. Checking That Everything Works as Expected
    6. Summary
  8. 6. Robots and Simulators
    1. Subsystems
      1. Actuation: Mobile Platform
      2. Actuation: Manipulator Arm
      3. Sensors
      4. Computation
    2. Complete Robots
      1. PR2
      2. Fetch
      3. Robonaut 2
      4. TurtleBot
    3. Simulators
      1. Stage
      2. Gazebo
      3. Other Simulators
    4. Summary
  9. 7. Wander-bot
    1. Creating a Package
    2. Reading Sensor Data
    3. Sensing and Actuation: Wander-bot!
    4. Summary
  10. II. Moving Around Using ROS
  11. 8. Teleop-bot
    1. Development Pattern
    2. Keyboard Driver
    3. Motion Generator
    4. Parameter Server
    5. Velocity Ramps
    6. Let’s Drive!
    7. rviz
    8. Summary
  12. 9. Building Maps of the World
    1. Maps in ROS
    2. Recording Data with rosbag
    3. Building Maps
    4. Starting a Map Server and Looking at a Map
    5. Summary
  13. 10. Navigating About the World
    1. Localizing the Robot in a Map
      1. Getting a Good Initial Localization
      2. What’s Going on Behind the Scenes
      3. Tips for Setting a Better Initial Pose
    2. Using the ROS Navigation Stack
      1. The ROS Navigation Stack
      2. Navigating in rviz
      3. Seeing What’s Going On
    3. Navigating in Code
    4. Summary
  14. 11. Chess-bot
    1. Joints, Links, and Kinematic Chains
      1. Joint Space
      2. Inverse Kinematics
    2. The Key to Success
    3. Installing and Running a Simulated R2
    4. Moving R2 from the Command Line
    5. Moving R2 Around a Chessboard
    6. Operating the Hand
    7. Modeling a Chessboard
    8. Playing Back a Famous Chess Game
    9. Summary
  15. III. Perception and Behavior
  16. 12. Follow-bot
    1. Acquiring Images
    2. Detecting the Line
    3. Following the Line
    4. Summary
  17. 13. On Patrol
    1. Simple Patrolling
    2. State Machines
      1. State Machines in ROS
    3. Defining State Machines with smach
      1. A Slightly More Relevant Example
      2. Defining State Machines Procedurally
    4. Patrolling with State Machines
      1. A Better Way to Patrol
    5. Summary
  18. 14. Stockroom-bot
    1. Stockroom Simulation
    2. Driving to Bins
    3. Picking Up the Item
    4. Summary
  19. IV. Bringing Your Own Stuff into ROS
  20. 15. Your Own Sensors and Actuators
    1. Adding Your Own Sensors
      1. A (Fake) Sensor
      2. Designing the ROS Wrapper
      3. Design 1: Periodic Measurements over a Topic
      4. Design 2: Streaming Measurements over a Topic
      5. Design 3: Streaming Measurements Published at a Fixed Rate
      6. Design 4: Sensor Measurements on Demand
    2. Adding Your Own Actuators
      1. A (Fake) Actuator
      2. Designing the ROS Wrapper
      3. Design 1: Continuous Actuation
      4. Design 2: Infrequent, Instantaneous Actuation
      5. Design 3: Infrequent, Extended Actuation
    3. Summary
  21. 16. Your Own Mobile Robot
    1. TortoiseBot
    2. ROS Message Interface
    3. Hardware Driver
    4. Modeling the Robot: URDF
    5. Simulation in Gazebo
    6. Summary
  22. 17. Your Own Mobile Robot: Part 2
    1. Verifying Transforms
    2. Adding a Laser Sensor
    3. Configuring the Navigation Stack
    4. Using rviz to Localize and Command a Navigating Robot
    5. Summary
  23. 18. Your Own Robot Arm
    1. CougarBot
    2. ROS Message Interface
    3. Hardware Driver
    4. Modeling the Robot: URDF
    5. Simulation in Gazebo
    6. Verifying Transforms
    7. Configuring MoveIt
    8. Using rviz to Send Goals
    9. Summary
  24. 19. Adding a Software Library
    1. Make Your Robot Talk: pyttsx
      1. Action Interface
      2. Parameters
      3. Event Loops
      4. The Speech Server
      5. The Speech Client
      6. Checking That Everything Works as Expected
    2. Summary
  25. V. Tips and Tricks
  26. 20. Tools
    1. The Master and Friends: roscore
    2. Parameters: rosparam
    3. Navigating the Filesystem: roscd
    4. Starting a Node: rosrun
    5. Starting Many Nodes: roslaunch
    6. Testing a Many-Node System: rostest
    7. Introspection: rosnode, rostopic, rosmsg, rosservice, and rossrv
    8. Summary
  27. 21. Debugging Robot Behavior
    1. Log Messages: /rosout and rqt_console
      1. Generating Log Messages: /rosout
      2. Logger Levels
      3. Reading Log Messages: rqt_console
      4. /rosout Versus /rosout_agg
    2. Nodes, Topics, and Connections: rqt_graph and rosnode
      1. Visualizing the Graph: rqt_graph
      2. Problem: Mismatched Topic Names
      3. Problem: Mismatched Topic Types and/or Checksums
      4. Problem: Incorrect Network Settings
    3. Sensor Fusion: rviz
    4. Plotting Data: rqt_plot
    5. Data Logging and Analysis: rosbag and rqt_bag
      1. Logging and Playing Back Data: rosbag
      2. Visualizing Bags: rqt_bag
      3. Analyzing ROS Bags with Other Tools: rostopic echo -b
    6. Summary
  28. 22. The ROS Community: Online Resources
    1. Etiquette
    2. The ROS Wiki
    3. ROS Answers
    4. Trackers (Bugs and Feature Requests)
    5. Mailing Lists and Special Interest Groups
    6. Finding and Sharing Code
    7. Summary
  29. 23. Using C++ in ROS
    1. When Should You Use C (or Some Other Language)?
    2. Building C++ with catkin
      1. package.xml
      2. CMakeLists.txt
      3. catkin_make
    3. Translating from Python to C++ (and Back Again)
      1. A Simple Node
      2. Topics
      3. Services
    4. Summary
  30. Index

Product information

  • Title: Programming Robots with ROS
  • Author(s): Morgan Quigley, Brian Gerkey, William D. Smart
  • Release date: December 2015
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781449323899