Robotics · Step 7 of 8 · 6 min
ROS 2 basics
You know what ROS 2 is, its core ideas, and how to take your first steps.
What ROS 2 is
ROS 2, the Robot Operating System, is not an operating system. It is a free, open-source framework and set of tools that lets the parts of a robot's software talk to each other. It is the common language of research labs and many robot companies.
It runs best on Ubuntu Linux. Use the current long-term support release: Jazzy Jalisco (2024) is supported until 2029, and a new LTS release arrives every two years in May.
Nodes and topics
A node is one small program with one job: read the lidar, plan a path, drive the wheels. Nodes share data by publishing and subscribing to named topics, like /scan or /cmd_vel.
The lidar node publishes on /scan without knowing who listens. Any node that needs the scan subscribes. This loose coupling lets you swap parts without rewriting everything.
Services, actions and tools
Services are quick request and reply calls. Actions are long tasks with progress updates and the option to cancel, such as navigating to a room. You write nodes in Python with rclpy or in C++ with rclcpp.
Tools do a lot of the work. RViz shows what the robot sees. ros2 topic echo prints live messages. Gazebo simulates the robot. Nav2 handles navigation, and MoveIt 2 plans arm motion.
Be patient with setup
Installation and build tools trip up most beginners. Follow the official tutorials in order, starting with turtlesim. If you are not on Linux, a Docker container or a virtual machine running Ubuntu works.
Try it
Sketch a ROS 2 node graph
- 1.Pick a robot: a small rover that drives to a room and avoids people.
- 2.Ask a chatbot to propose the nodes, topics, services and actions it would need.
- 3.Check its topic names against the ROS 2 docs, such as /scan and /cmd_vel.
- 4.If you have Ubuntu or Docker, follow the official turtlesim tutorial on docs.ros.org.
I am learning ROS 2. Propose a node graph for a small indoor rover with a lidar and a camera that drives to named rooms and stops for people. List nodes, topics with message types, services and actions. Mark which parts Nav2 already provides.