ros2-testing

Solid

Testing: launch_testing, gtest/pytest, rosbag2 C++/Python APIs, ros2trace profiling.

Testing & QA 16 stars 2 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 80/100

Stars 20%
41
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# ROS 2 Testing, Rosbag2 & Tracing Instructions (Ubuntu 24.04 LTS & ROS 2 Jazzy) ## 1. Documentation Entry Points | For | Entry point | | :--- | :--- | | Testing tutorials (CLI, gtest, pytest, integration) | `https://docs.ros.org/en/jazzy/Tutorials/Intermediate/Testing/` | | `launch_testing` / `rosbag2_cpp` / `rosbag2_py` API | `https://docs.ros.org/en/jazzy/p/<package>/` | | rosbag2 source of truth | `https://github.com/ros2/rosbag2` | ## 2. Running Tests ```bash colcon test --packages-select my_package colcon test-result --all --verbose # without --verbose you don't see WHICH case failed ``` `colcon test` reports a summary; the failing assertion lives in `colcon test-result`. A test that was never registered in the build is indistinguishable from a passing one in that summary — always confirm the expected test count, not just the exit code. ## 3. Key Concepts & Code Patterns ### A. Programmatic Rosbag2 Writer (C++) ```cpp #include <rosbag2_cpp/writer.hpp> #include <std_msgs/msg/string.hpp> rosbag2_cpp::Writer writer; writer.open("my_bag"); writer.create_topic({0, "chatter", "std_msgs/msg/String", "cdr", {}, ""}); writer.write<std_msgs::msg::String>(msg, "chatter", clock.now()); ``` ### B. Integration Testing (`launch_testing` Python) ```python import unittest import launch import launch_ros.actions import launch_testing import launch_testing.actions import launch_testing.asserts def generate_test_description(): node = launch_ros.actions.Node(package='demo_n...

Details

Author
Leehyunbin0131
Repository
Leehyunbin0131/claude-ros2-skills
Created
4 days ago
Last Updated
today
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category