DEV Community

Eric Young
Eric Young

Posted on

ROS2 SYSTEMS ANALYSIS: Visualizing Workspaces, Nodes & Communication

Visualizing ROS2**## A beginner-friendly way to understand ROS2 workspaces, nodes, topics, and DDS without drowning in commands

I almost quit ROS2 because none of the tutorials explained what it actually was.
They taught me commands, but never the system those commands were controlling.
ROS2 felt like a maze of terminals, build steps, and cryptic errors with no map.
Everything changed when I stopped thinking about ROS2 as software and started seeing it as a living system - a workspace filled with rooms, communication pipes, and active conversations.
Once I had that picture in my head, every command, node, and topic suddenly made sense.
This article is that picture.
The ROS2 Structure
A ROS2 workspace contains a src directory that holds all packages.
these packages can be setup with cpp or py. within their structure you create node code.
A single package can have 0-many nodes in it.
nodes may publish/subscribe(one method of communication) to various topics. 
These topics are shared and anytime a topic is published then those that have subscribed to the topic may read and act upon it.
Nodes may be pub, sub or both. this might take the form of source(of information), relay(processing that info for consumption), sink(the end product cleaned up with an interface(possibly)
When a package has been created, developed and saved we need to go to the workspace.

A ROS2 workspace is the build and runtime boundary.
You can think of it as a workshop with multiple rooms. This is where we go to: 
-BUILD it(colcon build ( - packages-select nameOfPackage)), 
-SOURCE it (source install/setup.bash) and 
-RUN it(ros2 run pkg_name exe_name.
I look at ros2(visually) is as a workshop with distinct rooms:

  • a knowledge room(src) that holds all of the packages,
  • a development lab where I modify the package contents and finally
  • a BUILD, SOURCE, RUN room that allows me to visualize the results. oh, yeah, there is also
  • an install room that holds all of the developed components for the BSR room to draw/pull from.

When dealing with packages or even performing BSR I will use ros2 commands such as colcon build, source install and others but also there is a CLI side of things that begin with ros2. Things like run, topic, node and these are used to interrogate ROS2 to discover its states, values, what is operational, etc.

A node graph is like a communications fabric that is stretched across a table. even with nothing on the fabric to take advantage of it there is still a communications network.
When we add a node to that fabric we have part 1 of a potential conversation. when we add another node and sync it up to the same communication channel as the first one then we have the breeding ground for communications.

ROS is the underlayment for everything.
The Middle Layer consists of RMW(ros middleware) and DDS(distributed data system)

As a Robot Overlord, I play on the Upper layer with the workspace, packages and BSR

If this helped:
❤️ React • 💬 Comment • 🔖 Save • 🚀 Boost • 🔗 Share
Follow for ROS2, robotics, and systems tutorials.

Top comments (0)