Agent skill · mindrally

ros2-robotics

Best practices for ROS 2 robotics development, covering package structure, nodes, topics/services/actions, launch files, QoS, tf2 transforms, and testing. Use when creating ROS 2 packages, writing nodes in rclpy or rclcpp, defining custom messages/services/actions, writing launch files, configuring QoS profiles, working with tf2 transforms, or building and testing a colcon workspace.

What it needs

About 4k tokens when loaded.

What this skill does

ROS 2 Robotics Development This skill covers building ROS 2 packages and nodes, including package structure, communication patterns (topics, services, actions), timing and frames, build/test workflows with colcon, and common pitfalls in robotics software. Workflow for Building a ROS 2 Package 1. Scaffold the package — Run ros2 pkg create --build-type amentpython <name> (Python) or --build-type amentcmake <name> (C++) inside a colcon workspace's src/ directory. 2. Define interfaces — Add custom .msg, .srv, or .action files under msg/, srv/, action/ only when a standard interface (stdmsgs, geometrymsgs, sensormsgs, navmsgs) doesn't fit. 3. Implement nodes — Write focused, composable nodes; declare parameters explicitly; choose topics for streams, services for quick request/response, and actions for long-running goals with feedback and cancellation. 4. Write launch files — Compose nodes, parameters, and remappings in a launch/.launch.py file using launchros.actions.Node. 5. Set QoS profiles intentionally — Match publisher/subscriber QoS (reliability, durability, history depth) for sensor data vs. command/control paths. 6. Build the workspace — Run colcon build --symlink-install from the workspace root, then source install/setup.bash. 7. Test — Add unit tests (pytest for Python, gtest/launchtesting for C++/integration) and run colcon test. 8. Run and inspect — Use ros2 run, ros2 launch, ros2 topic echo, ros2 node info, and ros2 doctor to verify runtime behavior. Package Structure Keep each package focused on one robot capability or integration boundary (e.g., lidardriver, pathplanner, armcontroller) rather than a monolithic package. Use package.xml consistently with the build type declared in it, and either CMakeLists.txt (amentcmake, C++) or setup.py/setup.cfg (amentpython). Organize files with launch/ for launch scripts, config/ for YAML parameter files, msg/ for message definitions, srv/ for services, action/ for actions, and urdf//xacro/ for robot descriptions. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills mindrally/ros2-robotics

View the source on GitHub

Browse the @skills marketplace