ros2-testing

Solid

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

Testing & QA 18 stars 3 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 81/100

Stars 20%
43
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 `colcon test` only prints a summary, so read results with `colcon test-result --all --verbose` — without `--verbose` you cannot see which case failed, and a test that was never registered with the build looks identical to a passing one, so confirm the expected test count rather than 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) In `generate_test_description()`, return a `LaunchDescription` ending in `launch_testing.actions.ReadyToTest()` — everything before it is launch setup, plain `unittest.TestCase` classes run after it against the live processes, and `@launch_testing.post_shutdown_test()` classes run once the processes have exited (where `launch_te...

Details

Author
Leehyunbin0131
Repository
Leehyunbin0131/claude-ros2-skills
Created
5 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