\(\def\dt{\Delta t}\)
\(\newcommand{\transpose}[0]{^\mathrm{T}}\)
\(\newcommand{\half}[0]{\tfrac{1}{2}}\)
\(\newcommand{\Half}[0]{\frac{1}{2}}\)
\(\newcommand{\norm}[1]{\left\lVert#1\right\rVert}\)
\(\newcommand\given[1][]{\:#1\vert\:}\)
UP | HOME

Exploring a Nontrivial Example

Table of Contents

1 Introduction

In this lecture we will use standard ROS command line and graphical tools to explore a nontrivial example of a set of ROS nodes all running in parallel to accomplish a particular task. The example will give us a chance to see how topics, services, and parameters can all be used simultaneously to enable communications between a set of nodes. It will also provide an opportunity to start exploring many of the ROS tools used for debugging and inspecting systems.

The package that we are going to use is a demo I wrote a few years ago that uses a piece of software called trep to interactively simulate the dynamics of a humanoid marionette in real-time. The demo is an ideal nontrivial ROS example as it contains many important ROS concepts in a single package with only one non-standard ROS dependency. There are several nodes communicating with each other via a set of services and topics, plus, there are several parameters that can dramatically modify details of the demo. The package can be found on GitHub as the trep_puppet_demo package.

2 Related Concepts and Tools

Before diving into this package, it is worthwhile to be sure you are at least familiar with the ROS concepts and tools discussed below. Most of the concepts have already been discussed in class, and all of them are covered in the ROS Glossary.

2.1 Important Concepts

  • Nodes
  • Packages
  • Workspaces
  • Catkin
  • Topics
  • Services
  • Parameters
  • URDFs
  • Launch files
  • Names

2.2 Useful Tools

  • rqt and many of its plugins. Most useful plugins:
    • rqt_plot
    • rqt_graph
    • rqt_console
    • rqt_tf_tree
  • ROS command line tools Specifically, we will use rostopic, roslaunch, rosparam, rospack, and rosservice
  • tf introspection tools. Specifically view_frames and tf_monitor
  • plotjuggler

2.3 Other packages used in this demo

robot_state_publisher
This package needs to be provided with a description of a robot (a URDF). It then listens to a particular topic that contains information on the current joint configurations, velocities, and accelerations of this robot – the topic is of type sensor_msgs/JointState. With this data, the robot_state_publisher broadcasts the state of the robot as /tf data. This is one of the most useful packages when working with robot geometry in ROS.
joint_state_publisher
This package provides an easy way to generate the the sensor_msgs/JointState data that the robot_state_publisher requires. The URDF of your robot is parsed, and a GUI is created that allows you to on-the-fly adjust the current configuration of your robot. This is a great tool for debugging URDFs.
tf
This is the primary way that coordinate systems in ROS are managed. The tf package tracks the time evolution of the transformations between all coordinate systems relevant to a robotic application. With this data, the user can query transforms between arbitrary frames, calculate relative velocities between frames, and transform a variety of geometric data between frames.
visualization_msgs
This is a ROS package that describes a variety of visualization-specific ROS messages. These messages are of interest, primarily, because rviz has plugins that allow easy display of any topics containing these messages. Thus, this package provides a very easy way to build a 3D graphical representation of a robotic system.
interactive_markers
This package allows two-way communication between arbitrary ROS nodes and rviz. It is one of the most common ways of building user interfaces in rviz.

3 Walkthrough

The package that we will be using has a decent README that explains the basic functionality of the demo. I've also prepared a document that explains how to setup the package, and provides examples of how to run the demos. At the bottom of this document there are also a set of explorations that mimic what is covered during the in-class session. Following these on your own would be a useful exercise, especially for those that miss class.

Creative Commons License
ME 495: Embedded Systems in Robotics by Jarvis Schultz is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.