Skip to main content
██████╗  ██████╗ ███████╗████████╗██████╗ ███████╗███████╗
██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔══██╗██╔════╝██╔════╝
██████╔╝██║   ██║███████╗   ██║   ██████╔╝█████╗  █████╗
██╔══██╗██║   ██║╚════██║   ██║   ██╔══██╗██╔══╝  ██╔══╝
██║  ██║╚██████╔╝███████║   ██║   ██║  ██║███████╗███████╗
╚═╝  ╚═╝ ╚═════╝ ╚══════╝   ╚═╝   ╚═╝  ╚═╝╚══════╝╚══════╝

CI codecov PyPI version PyPI downloads Python versions License

Explore your ROS 2 dependency graph — from the command line, in a TUI, or in your browser.

rostree demo

Full demo reel · how the demo was made

Docs: docs/README.md — overview, package discovery, dependency trees, usage, development.

Quick start

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

The graph, in your browser

rostree graph my_robot_bringup -f html --open

One self-contained file — no CDN, no fonts, no network at all — so it survives being mailed, committed next to a design doc, or opened on a robot with no route out.

It never draws the whole graph at once, because a workspace drawn all at once is a hairball nobody opens twice. You are always looking at one package's neighbourhood:

Click re-centre on that package
Hover light up everything upstream and downstream of it, dim the rest
Shift-click pin a second package and list the shortest paths between the two
/ search; d u b for dependencies · dependents · both; [ ] for depth

rostree's interactive HTML dependency graph

Why it is fast

A ROS dependency graph is a DAG, not a tree: rcutils sits under almost every branch. Expanding each path separately is exponential.

rostree expands each package once, where it first appears, and references it elsewhere (↩ see above), the way cargo tree does with (*). Package discovery happens once per run instead of once per node, and manifests are parsed once.

Measured on a 146-package workspace (122 installed + a 24-package source overlay), rostree tree my_robot_bringup -r:

depth 0.2.2 now
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 depth limit (the default) 58,002 lines / 10.29 s 251 lines / 0.21 s

Nothing is hidden: every edge is still shown, once. --full restores the fully expanded tree if you want it. (What is real in these numbers.)

CLI commands

rostree                      # Launch interactive TUI
rostree scan                 # Scan host for ROS 2 workspaces
rostree list --by-source     # List packages grouped by source
rostree list -f nav2         # Filter the package list

rostree tree rclcpp          # Dependency tree
rostree tree rclcpp -r -d 3  # Runtime deps only, 3 levels
rostree tree rclcpp --json   # Machine-readable

rostree why nav2_bringup rcutils   # How did this get into my tree?
rostree rdeps rclcpp               # What depends on this package?
rostree check                      # Cycles + unresolved deps (non-zero exit for CI)
rostree check --junit report.xml   # ...as a JUnit report for CI dashboards

rostree diff nav2_bringup nav2_route        # What differs between two packages?
rostree diff my_pkg --save deps.json        # Snapshot now...
rostree diff my_pkg --against deps.json     # ...and catch drift after a rebuild

rostree graph rclcpp -f html --open     # Interactive, one self-contained file
rostree graph rclcpp --render png       # PNG via Graphviz
rostree graph -w ~/ros2_ws -f html      # Whole workspace, explorable
rostree graph rclcpp -f mermaid         # Mermaid text

Scope: most of what you can see is not yours

On a sourced machine most packages belong to the distro. Every command that walks the graph takes the same filters:

rostree tree my_robot_bringup -w                 # ignore anything under /opt/ros
rostree tree my_robot_bringup --include 'nav2_*'
rostree tree my_robot_bringup --exclude '*_msgs' --exclude 'rosidl_*'
rostree tree my_robot_bringup --dep-type build   # runtime · build · test · all

A filtered package is neither shown nor followed, so anything reachable only through it goes too. Commands report what they held back rather than passing a smaller tree off as the whole truth.

TUI

rostree tui                  # Interactive terminal UI
rostree tui rclcpp           # Start on a package's tree

/ filters every package as you type, Enter opens a tree, v flips to "what depends on this", t switches between runtime and all dependencies, and ? shows the full keymap. Scanning and tree building run off the UI thread, and rows are created as you expand them, so nothing blocks.

rostree TUI showing a dependency tree

rostree TUI package list, grouped by source rostree TUI reverse dependency view

Python API

from rostree import list_known_packages, get_package_info, build_tree, scan_workspaces
from rostree.api import build_graph, reverse_dependencies, tree_stats

packages = list_known_packages()
root = build_tree("rclcpp", runtime_only=True)
print(tree_stats(root))                  # nodes, packages, depth, repeats, missing

graph = build_graph("nav2_bringup")      # the resolved DAG, linear to build
print(graph.cycles(), sorted(graph.missing))

print(reverse_dependencies("rclcpp"))    # who depends on it

Stability

From 1.0, the CLI commands and their flags and the names exported from rostree.api follow semantic versioning: no incompatible changes without a 2.0. Anything under rostree.core is internal and may move.

The exact text and layout rostree prints is not covered — output is for people. Pin --json if you are parsing it.

One thing worth knowing before you rely on it: the test suite runs entirely on generated fixtures and has never been exercised against a real ROS 2 install. The <ws>/install/src bug fixed in 0.3.0 had shipped in every release before it for exactly that reason. Running against a ros:jazzy container is the top roadmap item. 1.0 means the interface has settled, not that every layout in the wild is covered — please open an issue if yours is not.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rostree-1.0.0.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rostree-1.0.0-py3-none-any.whl (71.6 kB view details)

Uploaded Python 3

File details

Details for the file rostree-1.0.0.tar.gz.

File metadata

  • Download URL: rostree-1.0.0.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rostree-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e92fa52d651950c5ad169d4330dcf4abfc358c5ee268b6d517286a17931a6844
MD5 ee2dd893c9762569efb174b75fe0ca76
BLAKE2b-256 b99694aed63a78923aa05d6447d193be819ab5c45bc652a37cb9aa2ff5404bb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rostree-1.0.0.tar.gz:

Publisher: publish.yml on guilyx/rostree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rostree-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: rostree-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 71.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rostree-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 859e4a956a8ba1e62da960ffb64f400bac742f3bcebc679470b4c2e325409810
MD5 3bc98481eb64bb1b60ce4915cd2db1d6
BLAKE2b-256 9b0aa91d80a369bea23105e3cd9aa3ef62b974bc953692be484f6b299ee5cca7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rostree-1.0.0-py3-none-any.whl:

Publisher: publish.yml on guilyx/rostree

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page