ros2-standards

Enforce production-grade ROS 2 Python node design and lifecycle guidelines.

2|Updated Nov 28, 2025
One-click install
npx skills add https://github.com/uneezaismail/Physical-AI-Humanoid-Robotics --skill ros2-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ros2-standards
Source: https://github.com/uneezaismail/Physical-AI-Humanoid-Robotics/tree/main/.claude/skills/ros2-standards
Command: npx skills add https://github.com/uneezaismail/Physical-AI-Humanoid-Robotics --skill ros2-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides authoritative guidelines for writing production-grade ROS 2 Python 3.11+ code (Humble compatibility).

Core Features & Use Cases

  • Versioning & compatibility: Use Humble and Python 3.11+ features.
  • Lifecycle, parameters, logging: Best practices for robust nodes.

Quick Start

Refactor a monolithic ROS 2 node into a class-based, parameter-driven driver following the guidelines.

Frequently Asked Questions about ros2-standards

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

FAQPage Schema
How do I write production-grade ROS 2 Python code that follows best practices?

Production-grade ROS 2 Python code uses class-based nodes inheriting from rclpy.node.Node or LifecycleNode, implements comprehensive type hints, manages parameters declaratively, replaces time.sleep with timers, and logs via ROS 2 utilities. This Skill provides authoritative guidelines for Python 3.11+ on Humble compatibility.

What's the best way to structure a ROS 2 Python node for reliability and maintainability?

Structure nodes as classes inheriting from Node or LifecycleNode, declare parameters upfront, use async/await for asynchronous I/O, apply type hints throughout, implement consistent logging, and handle errors with safe-stop behavior. This approach ensures robust, production-ready Python nodes on ROS 2 Humble.

Can I use Python 3.11+ features in ROS 2 Humble projects?

Yes. This Skill covers ROS 2 Humble projects written in Python 3.11+ that leverage 3.12+ features where compatible, including modern async/await patterns, type hints, and lifecycle management best practices for production deployments.

Why should I avoid time.sleep in ROS 2 Python nodes?

time.sleep blocks the entire node and prevents responsive handling of callbacks and lifecycle events. ROS 2 best practices use timers instead, allowing asynchronous execution and reliable node behavior in production environments.

How do I manage parameters and lifecycle in ROS 2 Python nodes?

Declare parameters in node constructors using declare_parameter, retrieve them via get_parameter, and inherit from LifecycleNode to manage node state transitions. This ensures consistent parameter handling and safe lifecycle transitions for Humble-based systems.