The roboticks SDK ships ROS2-aware test decorators, rclpy assertion helpers, fault injection, and MCAP capture for Python; gtest macros and a confirms registry for C++.
The Roboticks SDK is the only ROS2-specific code in the product. The platform itself is ROS-version-agnostic; the SDK is what gets your tests speaking the wire contract the platform parses.
The SDK is the boundary. Inside the SDK we know about rclpy, MCAP, Gazebo. Outside (in the platform, in the matrix, in evidence packs) we only know about the wire contract. Cross that line cleanly and everything else composes.
Register an arbitrary file as a per-test artifact for upload alongside JUnit. Use it when a test produces a screenshot, a generated report, a coredump, an extra log, or any other file that should land next to the MCAP in the audit trail.
from roboticks import attach_artifact, capture_mcap, KIND_MCAPdef test_obstacle_detection(node): with capture_mcap(node) as mcap_path: # ... drive the test ... pass attach_artifact(mcap_path, kind=KIND_MCAP) attach_artifact("/tmp/before.png", kind="attachments") attach_artifact("/tmp/after.png", kind="attachments") attach_artifact("/tmp/decision_log.jsonl", kind="logs")
The SDK only records the path — the actual upload happens later (in the cloud-runner agent for cloud runs, in rbtk for local runs). Each attachment becomes one roboticks.attach.{kind} property on the testcase (see the wire contract), and the platform lands files at:
kind is any single URL-safe path segment. Reserved values for the common cases:
Constant
Value
Use for
KIND_MCAP
"mcap"
MCAP bag files
KIND_LOGS
"logs"
Log dumps, JSONL traces
KIND_ATTACHMENTS (default)
"attachments"
Screenshots, reports, anything else
Called outside a pytest context (e.g. from a helper or fixture not bound to a test function), pass test_func= explicitly; otherwise the plugin’s thread-local resolution finds the active test.Full module map: SDK modules.
#include <roboticks_cpp/confirms.hpp> // ROBOTICKS_CONFIRMS, ConfirmsRegistry#include <roboticks_cpp/assertions.hpp> // assert_topic_published, etc.
roboticks_cpp is a header-only INTERFACE library so it adds zero compile time outside the test target. The registry has a single inline definition; thread safety is guaranteed by an internal std::mutex.Full C++ surface: C++ reference.
The Python package installs cleanly on a host without ROS2 — rclpy imports are guarded behind try-blocks and raise a clear error only when an assertion helper is actually called. You can pip install roboticks on macOS for local linting, on a CI image without ROS2 for non-ROS test suites, and on a ROS2 Humble/Iron/Rolling box for the real thing.
# Works on macOS without rclpy installed:from roboticks import confirms@confirms("REQ-100")def test_pure_python_logic(): assert 2 + 2 == 4# Raises informative RuntimeError at call time, not import time:from roboticks.assertions import assert_topic_published