Preface


 

The Robot Operating System (ROS) is becoming the de facto standard programming approach for modern robotics. The ROS wiki (https://www.ros.org/history/) claims:

The ROS ecosystem now consists of tens of thousands of users worldwide, working in domains ranging from tabletop hobby projects to large industrial automation systems.

Why ROS? In 1956, Joseph Engelberger founded Unimation, Inc., the world's first robotics company[7]. Over the last half century, however, advances in robotics have been disappointing.

Robotics research around the world has largely produced demonstrations and curiosities that died in the lab. New researchers in the field typically started from scratch, buildingnew robots from the ground up, tackling the problems of actuator and sensor interfacing, building low-level servo controls, and typically running out of resources before achieving higher levels of robot competence. These custom machines and custom software were seldom re-used for follow-on work.

It was recognized that this pattern of building Towers of Babel was unproductive, and that the task of building more intelligent robots would require a sustained, collaborative effort that could build on foundations to reach higher levels of competence. In 1984, Vincent Hayward and Richard Paul introduced RCCL (Robot Control C Library) [15] as an approach to address this long-standing problem. Unfortunately, RCCL did not gain sufficient acceptance among robotics researchers. Both National Instruments [24] and Microsoft [39], [40] introduced products to attempt to bring standardization to robot programming. However, researchers found these approaches burdensome and/or expensive.

The origins of the ROS were initiated at the Stanford Artificial Intelligence Lab in 2007 [26]. This attempt to unify fragmented approaches to robotics was adopted by Google and supported via Willow Garage from 2008 to 2013 [12], and subsequently by Google's Open Source Robotics Foundation [10] (OSRF) from 2013 to present. The ROS approach followed the modern trend of open-source software and distributed collaboration. Further, it bridged to and leveraged parallel open-source efforts, including OpenCV [28], PointCloudLibrary [21], Open Dynamics Engine [8], Gazebo [19], and Eigen [20]. While ROS may be similar to RCCL in its openness and accessibility to researchers, Google's 7 years of ongoing support may be credited with ROS surviving a crucial incubation period.

ROS is now used throughout the world in academia, industry and research institutions.

Developers have contributed thousands of packages, including solutions from some of the world's leading experts in targeted areas. New robot companies are offering ROS interfaces with their products, and established industrial robot companies are introducing ROS interfaces as well. With widespread adoption of ROS as the de facto standard approach to robot programming, there is new hope for accelerating the capabilities of robots. In the recent DARPA Robotics Challenge, most of the teams that qualified used ROS. Developers of new self-driving cars are exploiting ROS. New robot companies are springing up with leaps in capability, in part driven by ROS resources. Given the momentum and track record of ROS, it is clear that today's robotics engineer must be skilled in ROS programming.

What is ROS? The name obot operating system" is arguably a misnomer. Defining ROS succinctly is dificult, since it encompasses myriad aspects, including style of programming (notably, relying on loosely-coupled, distributed nodes); interface definitions and paradigms for communications among nodes; interface definitions for incorporation of libraries and packages; a collection of tools for visualization, debugging, data logging and system diagnostics; a repository of shared source code; and bridges to multiple useful, independent open-source libraries. ROS is thus more of a way of life for robot programmers than simply an operating system. Definitions of ROS are drawn from the following sources.

From the ROS wiki (https://wiki.ros.org/ROS/Introduction):

ROS is an open-source, meta-operating system for your robot. It provides the services you would expect from an operating system, including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management. It also provides tools and libraries for obtaining, building, writing, and running code across multiple computers.

The primary goal of ROS is to support code reuse in robotics research and development. ROS is a distributed framework of processes (aka nodes) that enables executables to be individually designed and loosely coupled at runtime.

These processes can be grouped into Packages, which can be easily shared and distributed. ROS also supports a federated system of code Repositories that enable collaboration to be distributed as well. This design, from the file system level to the community level, enables independent decisions about development and implementation, but all can be brought together with ROS infrastructure tools.

Online comment by Brian Gerkey: 1

I usually explain ROS in the following way:

  1. plumbing: ROS provides publish-subscribe messaging infrastructure designed to support the quick and easy construction of distributed computing systems.
  2. tools: ROS provides an extensive set of tools for configuring, starting, introspecting, debugging, visualizing, logging, testing, and stopping distributed computing systems.
  3. capabilities: ROS provides a broad collection of libraries that implement useful robot functionality, with a focus on mobility, manipulation, and perception.
  4. ecosystem: ROS is supported and improved by a large community, with a strong focus on integration and documentation. ros.org is a one-stop-shop for finding and learning about the thousands of ROS packages that are available from developers around the world.

From the text ROS by Example [13]:

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.

Regarding ROS plumbing (from ROS by Example [13]):

The core entity in ROS is called a node. A node is generally a small program written in Python or C++ that executes some relatively simple task or process.Nodes can be started and stopped independently of one another and they communicate by passing messages. A node can publish messages on certain topics or provide services to other nodes.

For example, a publisher node might report data from sensors attached to your robot's microcontroller. A message on the /head/sonar topic with a value of 0.5 would mean that the sensor is currently detecting an object 0.5 meters away.Any node that wants to know the reading from this sensor need only subscribe to the /head/sonar topic. To make use of these values, the subscriber node defines a callback function that gets executed whenever a new message arrives on the subscribed topic. How often this happens depends on the rate at which the publisher node updates its messages.

A node can also define one or more services. A ROS service produces some behavior or sends back a reply when sent a request from another node. A simple example would be a service that turns an LED on or off. A more complex example would be a service that returns a navigation plan for a mobile robot when given a goal location and the starting pose of the robot.

Approach to this Presentation: ROS has many features, tools, style expectations and quirks. ROS has a steep learning curve, since there is much detail to master before one can be productive. The ROS wiki has links to documentation and a sequence of tutorials. However, these can be hard to follow for one new to ROS, as the definitions are scattered and the level of detail presented varies broadly from unexplained examples to explanations oriented toward sophisticated users. The intent of this book is to introduce the reader to essential components of ROS with detailed explanations of simple code examples along with the corresponding theory of operation. This introduction only scratches the surface, but it should get the reader started on building useful ROS nodes and bring the reader to a state where the tutorials become more readable.

ROS code can be written in either C++ or Python. This text uses C++ exclusively. For Python, the reader is referred to Programming Robots with ROS: A Practical Introduction to the Robot Operating System [34].

Accompanying code examples for this text assume use of Linux Ubuntu 14.04 and ROS Indigo. If one is using a PC running Windows or a Mac running OSX, an option is to install VirtualBox to set up a virtual Linux computer that can be run without disrupting the native operating system. Instructions for installing VirtualBox, Ubuntu, ROS and the accompanying code examples and tools are included at: https://github.com/wsnewman/learning_ros within the subdirectory additional_documents. (This directory also includes an introductory guide to using git.)

Getting one's computer configured to use ROS can be a challenge. It may be helpful to refer to A Gentle Introduction to ROS [27] to further illuminate and assist with ROS installation and obtain greater detail and behind-the-scenes explanations of ROS organization and communications. (Additional books on ROS are listed at: https://wiki.ros.org/Books.)

Installation of ROS is described on-line at: https://wiki.ros.org/indigo/Installation/Ubuntu.

When installing ROS, one has the option to name a ROS workspace. In this text, it will be assumed that this directory resides under the user's home directory and is named ros_ws. If you choose another name for your ROS workspace, substitute that name for ros_ws in all places referred to herein by ros_ws.

Code examples referred to herein may be found at: https://github.com/wsnewman/learning_ros. Some additional packages used with this code are contained in https://github.com/wsnewman/learning_ros_external_packages. Both repositories should be cloned into the user's ROS workspace in the subdirectory ~/ros_ws/src to be able to compile the examples. To install these manually, after setting up your ROS environment, cd to ~/ros_ws/src and enter:

image

and

image

This will cause all of the example code referred to herein to appear within these two subdirectories

Alternatively (and recommended), a repository https://github.com/wsnewman/learning_ros_setup_scripts contains scripts that automate installing ROS, installing the example code for for this text, and installing additional useful tools, and setting up your ROS workspace. Instructions for obtaining and running these scripts are provided on-line at that site. These instructions are applicable to either a native Ubuntu 14.04 installation, or a VirtualBox installation of Ubuntu 14.04. (Note, though, that VirtualBox can bog down when running computationally intensive or graphically intensive code. A native Linux installation and a compatible GPU processor are preferable.)

This text is not intended to be exhaustive. The interested student, researcher, automation engineer or robot enthusiast will find thousands of ROS packages to explore. Further, on-line tutorials describe details and extensions of the basics presented here. Rather, the intent of this text is to provide an introduction that will enable readers to understand the organization of ROS, ROS packages, ROS tools, incorporation of existing ROS packages into new applications, and developing new packages for robotics and automation. It is also the intent to facilitate continuing education by preparing the reader to better understand the existing on-line documentation.

This text is organized in six sections:

  • ROS Foundations
  • Simulation and Visualization with ROS
  • Perceptual Processing in ROS
  • Mobile Robots in ROS
  • Robot Arms in ROS
  • System Integration and Higher-Level Control

Each of these topics lies within broad fields with considerable specialization and evolving research developments. This text cannot attempt to teach the reader these fields. However, a robot system requires integration of elements spanning hardware integration, human/machine interfacing, control theory, kinematics and dynamics, manipulation planning, motion planning, image processing, scene interpretation, and an array of topics in artificial intelligence. The robot engineer must be a generalist and thus needs an understanding of at least rudimentary practice in each of these areas. An intent of the ROS ecosystem is to import existing packages that contribute in each of these areas and integrate them into a custom system without having to be an expert in every field. Thus understanding ROS interfacing and ROS approaches to each of these areas offers value to the system integrator who can ideally leverage the expertise contributed by robotics researchers, computer scientists, and software engineers around the world.

Footnote

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.181.52