Roboticks

Roboticks SDK

Apache 2.0 open-source toolkit for ROS2 verification: @confirms decorators, rclpy/rclcpp assertion helpers, MCAP capture, fault injection. Drops into pytest, launch_testing, or gtest with one line.

Install

# Python
pip install roboticks

# Optional extras
pip install "roboticks[ros2]"     # rclpy helpers
pip install "roboticks[mcap]"     # MCAP capture

# C++ (ament_cmake)
# Add to package.xml:
#   <depend>roboticks_cpp</depend>

pytest example

# pytest + Roboticks SDK
from roboticks import confirms, requires_sim, tags
from roboticks.assertions import assert_topic_published
from roboticks.mcap_capture import mcap_capture

@confirms("ISO10218-1-5.10.3")
@requires_sim("gazebo")
@tags("safety", "regression")
def test_protective_stop_under_bus_disconnect(robot_node):
    with mcap_capture("protective_stop.mcap"):
        robot_node.disconnect_safety_bus()
        assert_topic_published(
            topic="/robot/state",
            msg_type="lifecycle_msgs/State",
            within_seconds=0.5,
            predicate=lambda m: m.id == State.PROTECTIVE_STOP,
        )

gtest example

// gtest + roboticks_cpp
#include <gtest/gtest.h>
#include <roboticks/confirms.hpp>
#include <roboticks/assertions.hpp>

TEST(SafetyTests, ProtectiveStopUnderBusDisconnect) {
  ROBOTICKS_CONFIRMS("ISO10218-1-5.10.3");
  ROBOTICKS_TAGS("safety", "regression");

  auto node = std::make_shared<MyRobotNode>();
  node->disconnect_safety_bus();

  EXPECT_TRUE(roboticks::wait_for_state(
      node, lifecycle_msgs::State::PROTECTIVE_STOP,
      std::chrono::milliseconds(500)));
}

What ships in the box

  • Decorators: @confirms(req_id), @requires_sim(engine), @tags(*tags), @deadline(milliseconds=...).
  • Assertion helpers: assert_topic_published, assert_service_response, assert_action_result, assert_param_equals, assert_tf_transform.
  • launch_testing helpers: reduce typical launch_test files to one assertion per step.
  • MCAP capture: mcap_capture(path) context manager that scopes a recording to a test's duration.
  • Fault injection: drop_messages, delay_messages, kill_node, corrupt_topic.
  • pytest11 plugin: handles user_properties emission so the platform side reads the linkage automatically.
  • C++ counterpart: roboticks_cpp ament_cmake INTERFACE library with the same wire contract.

Frequently Asked Questions

Related