finds.dev← search

// the find

mikeferguson/ros2_cookbook

★ 1,139 · Shell · NOASSERTION · updated Jun 2025

Code snippets for ROS2

A community-maintained reference of copy-paste snippets and recipes for ROS2, covering both the C++ (rclcpp) and Python (rclpy) client libraries, launch files, rosbag2, DDS networking, and CMake patterns. It is for ROS2 developers who know what they want to do but keep forgetting the exact API incantation or CMakeLists boilerplate. Not a tutorial — assumes you already understand ROS2 concepts.

CC0 license means you can drop snippets directly into proprietary or GPL code without thinking about it. Covers the genuinely annoying parts of ROS2 that the official docs gloss over: QoS override syntax, TF2 usage in both rclcpp and rclpy, PCL point cloud handling, and the CMake edge cases like depending on messages in the same package. Actively maintained against recent distros (Humble, Jazzy, Kilted, Rolling) with build status links so you know if your distro's packages are broken upstream. The workarounds page for rclcpp is unusually honest — it names real bugs instead of pretending the framework is perfect.

Coverage is uneven: rclcpp gets logging, nodes, parameters, PCL, time, TF2, and workarounds, while rclpy gets nodes, services, parameters, time, and TF2 — no equivalent of the PCL or workarounds pages, and nothing on actions for either library. No executable examples or a test suite; snippets are written to be read, not run, so you find out if they still compile by trying them. The repo is Markdown files with a MkDocs wrapper, so there is no mechanism to validate that snippets actually work against the distros listed in the status badges. Navigation between related snippets is sparse — if you are on the rclcpp parameters page and want the rclpy equivalent, you have to know to go look.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →