ROS2 Node Creation

Creates ROS2 nodes in Python and C++ following Clean Architecture layering.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building ROS2 nodes often leads to tangled code where business logic is mixed with ROS middleware calls, making nodes hard to test and maintain. This Skill provides templates and structure for creating ROS2 nodes that follow Clean Architecture principles, separating domain logic from ROS2 infrastructure. ## Core Features & Use Cases - Layered Architecture Template: Organizes code into domain (entities, repositories, use cases), application (services, interfaces), and infrastructure (ROS2 nodes, publishers, subscribers, services) layers. - Python Base Node: Provides an abstract BaseNode class with lifecycle hooks for parameters, publishers, subscribers, services, and timers, plus a default QoS profile. - C++ Implementation: Includes header/source templates for BaseNode and concrete nodes with dependency injection of application services and reusable QoS profile presets. - Use Case: When adding a new sensor processing node to a robot, use this Skill to scaffold the node so the sensor processing logic lives in a testable application service while the ROS2 node only handles topic wiring. ## Quick Start Ask the AI to create a new ROS2 node for your robot using this Skill, specifying the node name, topics, and whether you want Python or C++.

Frequently Asked Questions about ROS2 Node Creation

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

FAQPage Schema
How do I create a ROS2 node with Clean Architecture?

Define your business logic in domain and application layers first, then implement a ROS2 node in the infrastructure layer that inherits from a base node template. The node handles only topic wiring and delegates processing to injected application services.

How to structure a ROS2 Python node with publishers and subscribers?

Use an abstract BaseNode class that calls setup methods for parameters, publishers, subscribers, services, and timers during initialization. Concrete nodes override these hooks to declare their specific topics and message types.

Should I use Python or C++ for ROS2 nodes?

Python with rclpy suits rapid prototyping and perception logic, while C++ with rclcpp offers lower latency for control loops. This Skill provides templates for both, using the same Clean Architecture layering in each language.

What QoS profile should I use for ROS2 sensor data?

Sensor data typically uses best-effort reliability with volatile durability and a queue depth of 1 to always process the latest reading. Command topics use reliable delivery with transient local durability and a depth of 10.

Why is calling virtual setup methods in a C++ ROS2 constructor risky?

Virtual calls in C++ constructors dispatch to the base class implementation, not the derived one, so overridden setup methods will not run. Use a separate init() method or the lifecycle node pattern to trigger setup after construction completes.