# ROS diagram tools

**URL:** <https://discourse.openrobotics.org/t/ros-diagram-tools/31451>\
**Category:** Projects\
**Tags:** ros, noetic\
**Created:** [May 17, 2023, 3:51pm UTC](https://discourse.openrobotics.org/t/ros-diagram-tools/31451 "2023-05-17T15:51:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://discourse.openrobotics.org/u/george)\
**Post date:** [May 17, 2023, 3:51pm UTC](https://discourse.openrobotics.org/t/ros-diagram-tools/31451/1 "2023-05-17T15:51:39Z")

</div>

Hello,

I’ve recently hacked few lines of code allowing me to visualize various aspects of ROS workspace in form of diagrams. The most interesting one is connection diagram of ROS nodes and topics, and sequence diagram of rosbag messages (all interactive).

What do You think about it?

The project can be found here:  
[https://github.com/anetczuk/ros-diagram-tools](https://github.com/anetczuk/ros-diagram-tools)

---

<div class="post-metadata">

**Author:** ![tfoote](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/tfoote/32/3813_2.png) [@tfoote](https://discourse.openrobotics.org/u/tfoote)\
**Post date:** [May 17, 2023, 6:01pm UTC](https://discourse.openrobotics.org/t/ros-diagram-tools/31451/2 "2023-05-17T18:01:42Z")

</div>

Thanks for sharing those. Great visualizations help us understand what’s going on better.

A bunch of these capabilities look like they might be good candidates to extend some of the current tools such as [`rqt_dep`](http://wiki.ros.org/rqt_dep), [`rqt_graph`](http://wiki.ros.org/rqt_graph?distro=noetic), and [`rqt_bag`](http://wiki.ros.org/rqt_bag)

I’d encourage you to consider submitting these as feature enhancements to the existing tools. It would be awesome to see these improvements added to the core tools which will help many more people find and be able to take advantage of your work.

---

<div class="post-metadata">

**Author:** ![Michel\_Albonico](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Michel\_Albonico](https://discourse.openrobotics.org/u/Michel_Albonico)\
**Post date:** [May 17, 2023, 6:58pm UTC](https://discourse.openrobotics.org/t/ros-diagram-tools/31451/3 "2023-05-17T18:58:27Z")

</div>

This is great work. ROS bags contain rich timestamped data that can indeed help in the extraction of consistent architectural information.

Look at this repo of us: [https://github.com/S2-group/icra-ws-robotics-rosbag](https://github.com/S2-group/icra-ws-robotics-rosbag)

It is part of a research poster we’re going to present at ICRA this year at the Robotic Software Architecture (RSA) Workshop.

---

<div class="post-metadata">

**Author:** ![ipa-hsd](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/ipa-hsd/32/2373_2.png) [@ipa-hsd](https://discourse.openrobotics.org/u/ipa-hsd)\
**Post date:** [May 19, 2023, 9:54am UTC](https://discourse.openrobotics.org/t/ros-diagram-tools/31451/4 "2023-05-19T09:54:51Z")

</div>

are these diagrams visualized from a running system or are there static code analyzers implemented which can extract the connections from source code as well?

---

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://discourse.openrobotics.org/u/george)\
**Post date:** [May 19, 2023, 3:32pm UTC](https://discourse.openrobotics.org/t/ros-diagram-tools/31451/5 "2023-05-19T15:32:55Z")

</div>

At the moment majority of data is gathered from running system (nodes, topics, services etc). Some data is taken from ‘catkin’ and ‘cloc’ commands.  
Static analysis of C++ code is doable with support of gcc, but I still haven’t figured out how to extract data from Python code.

---

<div class="post-metadata">

**Author:** ![george](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@george](https://discourse.openrobotics.org/u/george)\
**Post date:** [May 24, 2023, 8:52pm UTC](https://discourse.openrobotics.org/t/ros-diagram-tools/31451/6 "2023-05-24T20:52:41Z")

</div>

> [@tfoote](#):
>
> I’d encourage you to consider submitting these as feature enhancements to the existing tools. It would be awesome to see these improvements added to the core tools which will help many more people find and be able to take advantage of your work.

I found `buildtime` and `rosnodegraph` and `rosbagflow` diagrams to be most useful. The first one is more of catkin tool, because presents build time of packages. Second tool presents connections between nodes and messages definitions of topics and services - it presents broad scope. The last one presents rosbag from different perspective: in form of sequence diagram.  
There is one problem with rosbag format: it does not contain information about subscribers, so building sequence graph based only on rosbag file is impossible.
