Ros-d2: A CLI for exporting .d2 files from ROS2 runtime launch configurations

D2 is a tidy new diagramming language. ros-d2 can be used to generate .d2 files from a ROS2 environment (tested in galactic and humble). Why? I wanted to be able to make pretty architectural diagrams and the first step was to be able to export our current ROS architecture. If this is useful to other people I’ll add some more features!



i can’t be the only one thinking there was a missed opportunity on the name… :sweat_smile:

Ros2-D2 was right there!

cool tool though!


Hi, I don’t if this doubt is relevant but is this in any way similar to rqt which is used to construct graph like these that include details about all the running nodes, topics and subscriptions?

Yep. It is similar to which provides far more features than this for runtime introspection. I didn’t actually look at what sort of data structure rqt uses and if it can be exported… Maybe I should (although I’d like to avoid it as a dependency).

I was really after a simple, serialisable, themeable data format which is why I liked the look of .d2. Critically, I wanted to be able to write it by hand as part of the architecture/design step and potentially add integration tests which make sure the implementation matches the system design.

The data structure this produces is very simple and diffable. ros-d2/ros-diagram.d2 at main · Greenroom-Robotics/ros-d2 · GitHub

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.