ROS 2

“Don't blame you," said Marvin and counted five hundred and ninety-seven thousand million sheep before falling asleep again a second later. ― Douglas Adams, The Hitchhiker's Guide to the Galaxy

Photo by Maximalfocus on Unsplash

Differences Between ROS 2 and ROS

In a previous post I extolled the virtues of the Robot Operating System and mentioned how I have used it extensively in my work. As things tend to do, ROS has evolved and there is now a ROS 2 as well as ROS. The following post is meant to be a crash course in ROS 2.

First a history lesson:

[The] ROS environment was developed by Willow Garage for the PR2 robot…. PR2 is a humanoid robot that can navigate autonomously in a known environment.

At this time, they knew that PR2 would not be the only robot on the market and instead of developing a personalized program working only for PR2, they wanted to implement a scalable and standard software to improve or modify the robot in the future. So, they worked on a middleware, ROS, by defining levels of abstraction to be useful on other robots.

In my work I employ swarms of robots and that very much stretches the limits of the capabilities of ROS. Among the enabling technologies of ROS 2 is the Data Distribution Service, which simplifies somewhat the networking topology. Like the original ROS, DDS employs a pub-sub pattern among nodes. Also, with the end of life for Python 2 being Jan 1st, 2020, it just seems like a good time to switch to ROS 2.

Introduction to ROS 2

The latest version of ROS 2 at the time of this writing is Galactic Geochelone. To get you started, follow these instructions from ROS. For those following along, my installation environment is Kubuntu 20.04 in a VirtualBox VM.

After you've gone through the installation procedure you are ready to start the ROS 2 tutorials. The first one is here. A good paragraph from that page is:

ROS 2 relies on the notion of combining workspaces using the shell environment. “Workspace” is a ROS term for the location on your system where you’re developing with ROS 2. The core ROS 2 workspace is called the underlay. Subsequent local workspaces are called overlays. When developing with ROS 2, you will typically have several workspaces active concurrently.

Another good concept to be aware of is the ROS domain ID, described here. An item of interest on that page is ephemeral ports, which are dynamic or private ports defined near the top limit of the port range.

Turtlesim and rqt

Two GUIs available from ROS include Turtlesim and rqt. Turtlesim is based on Logo, a programming language I took a class on in high school. The cursor in Logo (and Turtlesim) is known as the "turtle." Rqt is based on the Qt libraries. There is a tutorial on both provided on the ROS website.

Pro tip: It was not clear at first to me I needed to run Turtlesim together with rqt. Open two terminal windows to do so and don't forget to source your setup.bash file (source /opt/ros/galactic/setup.bash) in BOTH windows.

Credits:

http://design.ros2.org/articles/changes.html

https://www.theconstructsim.com/infographic-ros-1-vs-ros-2-one-better-2/

Previous
Previous

ROS 2 Nodes

Next
Next

VS Code: GitLens