ROS2 Diagnostics

Implements ROS2 diagnostic_updater health monitoring within Clean Architecture layers.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill ros2-diagnostics-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ROS2 Diagnostics
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/ros2_diagnostics
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill ros2-diagnostics-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires diagnostic_updater, diagnostic_msgs, rclcpp.

What problem does it solve? Robotics developers need a structured way to monitor component health, topic frequencies, and hardware status in ROS2 systems without scattering diagnostic logic across nodes, and this Skill provides Clean Architecture patterns for both Python and C++. ## Core Features & Use Cases - Domain Health Entities: Defines HealthLevel enums (OK, WARN, ERROR, STALE) and ComponentHealth dataclasses decoupled from ROS dependencies. - C++ DiagnosticsManager: Wraps diagnostic_updater::Updater with hardware ID registration and callback-based monitors. - Frequency Monitoring: Uses HeaderlessTopicDiagnostic with FrequencyStatusParam to track topic publication rates against min/max thresholds. - Use Case: A motor controller node checks temperature in a callback, reporting ERROR when exceeding 80 degrees and publishing the value via stat.add for rqt_robot_monitor visibility. ## Quick Start Show me how to add a diagnostic_updater health check with frequency monitoring to my ROS2 C++ node following Clean Architecture.

Frequently Asked Questions about ROS2 Diagnostics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add diagnostics to a ROS2 C++ node?

Create a diagnostic_updater::Updater instance with your node, call setHardwareID, then register callbacks with updater.add(name, callback). Each callback fills a DiagnosticStatusWrapper with summary level and key-value entries.

How to monitor topic frequency in ROS2?

Use diagnostic_updater::HeaderlessTopicDiagnostic with FrequencyStatusParam specifying min and max frequency, tolerance, and window size. Call tick() each time a message arrives on the monitored topic.

Does diagnostic_updater work with both Python and C++ in ROS2?

Yes, diagnostic_updater supports both rclpy and rclcpp. The Skill shows a C++ DiagnosticsManager implementation and references the equivalent Python pattern, both publishing standard diagnostic_msgs.

What diagnostic status levels should I use in ROS2?

Use the standard levels OK, WARN, ERROR, and STALE from diagnostic_msgs. Map domain health states to these levels in your status callback so tools like rqt_robot_monitor interpret them consistently.

Why set a hardware ID in ROS2 diagnostics?

Setting a unique hardware ID via updater.setHardwareID groups all diagnostic entries from one device together in monitoring tools. Without it, statuses from multiple components become hard to attribute to physical hardware.