Skip to content

Software

ros2_snapshot

By Christopher Newport University Robotics, United States (checked on github.com/CNURobotics (opens in a new tab)), from github.com/CNURobotics/ros2_snapshot (opens in a new tab)

  • Middleware
  • Tool
  • Apache-2.0

Python tools for ROS 2 that capture a specification model of a workspace's packages and a deployment model of a running ROS system, for documentation and model-based engineering.

Facts

GitHub stars
0read on 29 Nov 2026
Last update
30 Apr 2026Newest commit on main
Maintenance
Maintaineda commit in the last 12 months
Difficulty
Intermediate

Checked on GitHub on 29 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit b09cd1a (opens in a new tab), on 16 Oct 2026.

Commercial use
Yes

At a glance

What it is
  • Captures a specification model of the ROS 2 packages available in a workspace.
  • Captures a deployment model of a currently running ROS 2 system.
  • Models can be loaded, manipulated and exported for documentation and interface control documents.
  • Writes yaml and pickle outputs by default; the -a option adds json, text and DOT graph output.
  • Multi-machine mode uses lightweight remote snapshot services on other machines to associate nodes with hosts.
  • Tested under ROS Jazzy, Kilted and Rolling on Ubuntu 24.04.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Maintained, last commit on 30 Apr 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit b09cd1a

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by Christopher Newport University Robotics, at commit b09cd1a, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

ROS 2 Snapshot Tools

Description

ROS 2 Snapshot provides Python-based ROS 2 (opens in a new tab) tools for capturing:

  • a specification model of the ROS 2 packages available in a workspace
  • a deployment model of a currently running ROS system

The captured model can be loaded, manipulated, and exported for documentation, interface control documentation (ICD), and model-based engineering workflows.

This repository includes the following modules:

  • core - ROS entity metamodel classes and tools for marshalling and unmarshalling model instances
  • workspace_modeler - captures a specification model of an existing ROS 2 workspace
  • snapshot - captures a model of a currently running ROS 2 deployment
Requirements

This version of the package has been tested under ROS Jazzy, Kilted, and Rolling running Ubuntu 24.04.

Before using ros2_snapshot, make sure:

Install the Python dependencies with:

pip install -r requirements.txt

Note: the apt Python module is optional and is only used on Debian/Ubuntu systems to enrich workspace package version detection. On non-Debian platforms such as RHEL, workspace_modeler will still run without it.

Source Build

Clone this project into your colcon (opens in a new tab) workspace, then build and source it:

colcon build
source <ros_ws_location>/setup.bash

After that, the package is available through ros2 run ros2_snapshot ....

Quick Start

ros2_snapshot is typically used in two steps:

  1. Generate a specification model of the workspace.
  2. Snapshot the currently running ROS deployment using that specification model.

Generate the workspace model first:

ros2 run ros2_snapshot workspace

Then snapshot a running system:

ros2 run ros2_snapshot running

The running command expects an existing specification model. By default it loads that model from ~/.snapshot_modeling/yaml, so the workspace step should normally be run first. If your specification files live elsewhere, use --spec-input to point running at the correct folder.

By default, both tools write yaml and pickle outputs under ~/.snapshot_modeling. Use -a to also save json, human-readable text, and the DOT graph output for the running snapshot.

For command-line details, use -h or see the module READMEs:

Basic Demonstration

First generate the workspace specification model:

ros2 run ros2_snapshot workspace -a

Inspect the generated files under ~/.snapshot_modeling.

Then start a few ROS nodes:

ros2 run turtlesim turtlesim_node --ros-args -r __ns:=/demo
ros2 run turtlesim turtle_teleop_key --ros-args -r __ns:=/demo
ros2 run demo_nodes_py talker
ros2 run demo_nodes_py listener

With those nodes running, capture a deployment snapshot:

ros2 run ros2_snapshot running -a

Inspect the resulting deployment model files under ~/.snapshot_modeling.

Multi-Machine Process Snapshots

For distributed systems, start a lightweight snapshot remote on each machine other than the central machine that will run ros2_snapshot running:

ros2 run ros2_snapshot remote

By default, the remote namespaces itself using the machine hostname and serves a get_process_snapshot service. The running tool automatically discovers all visible snapshot-remote services and uses their local process data to associate ROS nodes with the machines that host them. The central snapshot machine is always inspected locally. If a remote is also running on the central machine, duplicate local/remote process records are merged using the machine ID when the operating system provides one. If no remotes are discovered, running falls back to the original local-process behavior.

The remote implementation lives in ros2_snapshot/snapshot/snapshot_remote.py and is intentionally self-contained enough to copy to a remote host that has ROS 2 Python support, std_srvs, and psutil available.

Known issues

This project is an ongoing development effort and may be subject to future changes.

See the individual module READMEs for additional information.

License Information

Released under Apache 2.0 license

Copyright (c) 2026 Capable Humanitarian Robotics and Intelligent Systems Lab (CHRISLab) Christopher Newport University

All rights reserved.

See LICENSE for more information.

Publications

Please use the following publications for reference when using ROS 2 Snapshot:

This work is based on earlier work for ROS 1:

Credit

The code is formatted using Black (opens in a new tab).

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.