ros2-robotics
Installation
SKILL.md
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
- Scaffold the package — Run
ros2 pkg create --build-type ament_python <name>(Python) or--build-type ament_cmake <name>(C++) inside a colcon workspace'ssrc/directory. - Define interfaces — Add custom
.msg,.srv, or.actionfiles undermsg/,srv/,action/only when a standard interface (std_msgs,geometry_msgs,sensor_msgs,nav_msgs) doesn't fit. - 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.
- Write launch files — Compose nodes, parameters, and remappings in a
launch/*.launch.pyfile usinglaunch_ros.actions.Node. - Set QoS profiles intentionally — Match publisher/subscriber QoS (reliability, durability, history depth) for sensor data vs. command/control paths.
- Build the workspace — Run
colcon build --symlink-installfrom the workspace root, thensource install/setup.bash. - Test — Add unit tests (
pytestfor Python,gtest/launch_testingfor C++/integration) and runcolcon test. - Run and inspect — Use
ros2 run,ros2 launch,ros2 topic echo,ros2 node info, andros2 doctorto verify runtime behavior.