Skip to main content

ros2-composition

ROS 2 component composition, intra-process communication, UniquePtr callbacks, loaned messages, and Nav2-style container bringup. Use when loading composable nodes, component_container, intra-process, loaned messages, iceoryx, or type adaptation.

Source facts

Repository
guilyx/dotfiles
Last source activity
August 12, 2026 at 19:39
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
ros2-composition
description
ROS 2 component composition, intra-process communication, UniquePtr callbacks, loaned messages, and Nav2-style container bringup. Use when loading composable nodes, component_container, intra-process, loaned messages, iceoryx, or type adaptation.
# ROS 2 Composition and Zero-Copy ## Components Composable nodes: `rclcpp::Node` with `NodeOptions`, registered via: ```cpp RCLCPP_COMPONENTS_REGISTER_NODE(my_pkg::MyComponent) ``` CMake: `rclcpp_components_register_node` on a **SHARED** lib. Launch: `ComposableNodeContainer` or `ros2 component load`. No `rclcpp::init` / `spin` inside the component — the **container** spins. ## Containers (stack practice) | Container | Executor | Use | |-----------|----------|-----| | `component_container` | Single-threaded | Simple; no parallel callbacks | | `component_container_mt` | Multi-threaded | Need callback groups (Nav2-style servers) | | Isolated process per server | Separate container | Fault isolation / RT control away from perception | Composition ≠ free concurrency: ST container ignores your MT hopes (`ros2-executors`). ## Intra-process `NodeOptions.use_intra_process_comms(true)` on components that should zero-copy. Requires: - Sub callback `UniquePtr<Msg>` (not `SharedPtr`) - `publish(std::move(unique_msg))` - Compatible QoS; **same process only** ## Loaned messages (inter-process) `borrow_loaned_message()` needs RMW support; unbounded strings/sequences often disable loans; static `Type[N]` friendlier (`ros2-interfaces`). Measure — fallback is copy. ## Type adaptation `rclcpp::TypeAdapter` for native types in-process; still ROS msgs on the wire to others.
View on GitHub