cpp-node-boilerplate

Generate ROS 2 C++ rclcpp node boilerplate with standalone and component templates.

18|2|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill cpp-node-boilerplate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-node-boilerplate
Source: https://github.com/wimblerobotics/ros2-copilot-skills/tree/main/cpp-node-boilerplate
Command: npx skills add https://github.com/wimblerobotics/ros2-copilot-skills --skill cpp-node-boilerplate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create ROS 2 C++ rclcpp nodes quickly by providing boilerplate patterns including a minimal standalone node and a composable component template.

Core Features & Use Cases

  • Minimal Standalone Node example with a publisher and timer.
  • Component-Style Node (Composable) template with parameter handling and lifecycle patterns.
  • Build guidance and CMake setup for ROS 2 Jazzy/Rolling.
  • Practical snippets for publishers, subscribers, and parameter descriptors.

Quick Start

Use the Minimal Standalone Node example to scaffold a new ROS 2 C++ node and adapt the publisher, timer, and topics to your application.

Frequently Asked Questions about cpp-node-boilerplate

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

FAQPage Schema
How do I create a ROS 2 C++ node with rclcpp boilerplate?

To create a ROS 2 C++ node, use a boilerplate scaffold to generate the minimal rclcpp structure, including standard publisher, subscriber, and timer setups. This provides a ready-to-compile foundation for your application logic.

What is the difference between a standalone ROS 2 node and a composable component?

A standalone ROS 2 node runs independently as its own executable process, whereas a composable component is designed to be dynamically loaded into a shared process container. Boilerplate templates provide structural patterns for both architectural designs.

Does this ROS 2 C++ boilerplate support Jazzy and Rolling distributions?

Yes, the ROS 2 C++ boilerplate is explicitly built for the Jazzy and Rolling distributions. It includes tailored build guidance and CMake setup instructions to ensure proper compilation and parameter descriptor usage on these platforms.

How do I add parameter descriptors to a ROS 2 rclcpp node?

You add parameter descriptors to an rclcpp node by declaring them within the node class using the provided component-style template. This boilerplate demonstrates practical implementation patterns for handling parameters safely.

What is the best way to set up CMake for a ROS 2 C++ component?

The best way to set up CMake for a ROS 2 C++ component is to follow the included build guidance, which configures the rclcpp_components package. This ensures your composable nodes are properly registered and exported for dynamic loading.

Can I get a minimal ROS 2 rclcpp publisher and subscriber example?

Yes, you can obtain a minimal ROS 2 rclcpp publisher and subscriber example directly from the standalone node boilerplate. It provides functional snippets that can be quickly adapted to define your custom topics and message types.