Skip to content

ros2-snapshot: save the whole running ROS 2 graph to one YAML file and diff it later

ROS Discourse — Community updates1fitzyracing1

fitzyracing1 released ros2-snapshot, a Python CLI tool that captures the entire live ROS 2 system state into a single YAML file for debugging. The tool records node parameters, publishers, subscribers, services, clients, action servers, topic types, and per-endpoint QoS settings. It provides a 'diff' command to compare two snapshots in plain English, JSON, or Markdown, and an 'apply' command to push saved parameter values back to the system. Currently in v0.1, it has been tested in CI environments with ROS Humble and Jazzy but not yet on large-scale real robots. The tool is open-source under the MIT license.

Hi all,

I kept running into the same question: what changed between yesterday’s working robot and today’s broken one? ros2 param dump covers one node’s parameters, and ros2 node info / ros2 topic info -v show one thing at a time. I wanted one command that captures the whole live system and a second one that tells me what’s different.

So I wrote a small Python CLI, ros2-snapshot:

  • ros2-snapshot save good.yaml uses rclpy to record every node’s parameters, publishers, subscribers, services, clients and action servers/clients, plus every topic’s types and per-endpoint QoS. It writes them to one sorted YAML file, along with metadata (distro, timestamp, hostname, domain id, RMW).
  • ros2-snapshot diff good.yaml broken.yaml gives a plain-English diff. Exit code 0 means the snapshots match and 1 means they differ. Output can be text, JSON or Markdown, and --ignore globs skip noise like param:*:use_sim_time. The diff side is plain Python, so it also runs on a laptop without ROS.
  • ros2-snapshot apply good.yaml pushes saved parameter values back. It only previews unless you pass --execute.
  • It also registers a ros2 snapshot verb.

Here is real output, from two snapshots CI captured on Jazzy with the demo nodes. Between them I swapped listener for listener_best_effort, stopped the Fibonacci action server, started a second talker and changed two parameters:

before: examples/before.yaml (jazzy on 427eb3512ba0 at 2026-11-29T06:53:42Z)
after:  examples/after.yaml (jazzy on 427eb3512ba0 at 2026-11-29T06:53:53Z)

Nodes:
  - node /fibonacci_action_server removed (was: 6 params; publishes /parameter_events, /rosout; subscribes to /parameter_events; provides action /fibonacci)
  + node /status_talker added (6 params; publishes /parameter_events, /robot_status, /rosout; subscribes to /parameter_events)

Parameters:
  ~ /parameter_blackboard param mode: "auto" -> "manual"
  ~ /parameter_blackboard param robot_speed: 1.0 -> 2.5

Topics:
  + topic /robot_status added [std_msgs/msg/String]

QoS:
  ~ topic /chatter subscriber /listener qos reliability: "reliable" -> "best_effort"

6 differences: 2 nodes, 2 parameters, 1 topic, 1 QoS setting.

The last line is the kind of thing I was after: the replacement listener kept the name /listener, so ros2 node list looks the same, but its subscription quietly became best-effort.

Caveats, honestly:

  • It’s a v0.1. So far it’s only been tested in CI (ros:humble and ros:jazzy containers, Fast DDS, demo_nodes_cpp + action_tutorials_cpp), not on a big real robot.
  • QoS comes from discovery, so a remote endpoint’s history/depth usually shows as unknown/0.
  • apply only sets parameters that are already declared, and it doesn’t start or stop nodes.

Install: pip install ros2-snapshot (in the same Python as your sourced ROS 2)
Repo: GitHub - fitzyracing1/ros2-snapshot: Save a live ROS 2 system (nodes, topics, services, parameters) to one snapshot file and diff two snapshots. CLI. · GitHub (MIT)

I’d really like feedback. What’s missing from the snapshot for your debugging (TF tree? lifecycle states? launch args?), and does the diff wording make sense? Issues and PRs are welcome.

Source notes

  1. ros2-snapshot: save the whole running ROS 2 graph to one YAML file and diff it later↩
Source evidence

Reported by the source; not independently verified.

robots
0[2]
trajectories
0[2]
hours
0[2]
percent
0[2]
  1. so a remote endpoint’s history/depth usually shows as unknown/0. apply only sets parameters that are already declared, and it doesn’t start or stop nodes. Install: pip install ros2-snapshot (in the same Python as your sourced ROS 2) Repo: GitHub - fitzyracing1/ros2-snapshot: Save a live ROS 2 system (nodes, topics, services, parameters) to one snapshot file and diff two snapshots. CLI. · GitHub (MIT) I’d really like
    Exact source↩

Automatically extracted; no manual editorial approval recorded.

Article details
Signal

The author, fitzyracing1, released a Python CLI tool named ros2-snapshot to capture the entire live ROS 2 graph—including nodes, topics, services, parameters, and QoS settings—into a single YAML file for debugging and diffing system changes.

Timezone · UTC

Article dates follow your selected timezone. Briefing editions use Hong Kong time (UTC+8).