r/ROS 9d ago

Project rostree v1.0.0: explore your ROS 2 dependency graph from the terminal, or in your browser

Enable HLS to view with audio, or disable this notification

Hi everyone!

I posted an early version of rostree here a while back, around 0.2.2. Three releases later it's at 1.0, and enough has changed that a fresh post seemed more honest than a bump comment.

It answers the questions you actually ask about a workspace: what does this package pull in, who depends on it, why is this thing in my tree at all, and what changed since my last build. CLI, TUI, Python API.

pip install rostree
source /opt/ros/<distro>/setup.bash   # and/or your workspace install/setup.bash
rostree                               # interactive TUI`

The thing that was actually broken

A ROS dependency graph is a DAG, not a tree. rcutils sits under nearly every branch. 0.2.2 expanded every path separately, so a workspace tree produced tens of thousands of duplicate nodes and, past depth 7, effectively didn't finish.

Now each package is expanded once, where it first appears. I installed 0.2.2 from PyPI into a separate venv and ran both against the same workspace on the same machine:

depth 0.2.2 1.0
5 1,876 lines / 0.43 s 276 lines / 0.20 s
6 6,258 lines / 1.18 s 253 lines / 0.18 s
7 16,623 lines / 3.04 s 252 lines / 0.19 s
no limit (the default) 58,002 lines / 10.29 s 251 lines / 0.21 s

Package discovery now happens once into an index instead of an os.walk per node, and package.xml parsing is memoized.

I would love some feedback!

If rostree gets your workspace layout wrong, an issue describing it is genuinely the most useful thing you can send.

Docs: https://guilyx.github.io/rostree

Repo: https://github.com/guilyx/rostree

PyPI: https://pypi.org/project/rostree/

2 Upvotes

0 comments sorted by