RobotForge
Your first 20 minutes with ROS 2
tutorial·12 min read

Your first 20 minutes with ROS 2

No robot required. Install, launch turtlesim, publish a velocity message. The fastest honest intro to ROS 2.

ROS is the air robotics people breathe. It's also the part every beginner bounces off of first. Let's fix that in 20 minutes. No robot required — we'll drive a simulated turtle with a keyboard.

What you'll have at the end

A running ROS 2 install, turtlesim up on your screen, and you driving a cartoon turtle around with the arrow keys by publishing velocity messages over a topic. Nothing impressive — but everything after this uses the same three primitives.

Install (Ubuntu 22.04 / 24.04)

sudo apt update && sudo apt install -y curl gnupg lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
  -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
  http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" \
  | sudo tee /etc/apt/sources.list.d/ros2.list
sudo apt update && sudo apt install -y ros-jazzy-desktop

Mac or Windows? Use a devcontainer or Docker image. ROS on the host outside Linux is pain; it's 2026, use containers.

The three primitives you need

  • Node. A process that does one thing.
  • Topic. A named pub/sub channel between nodes.
  • Message. The payload on a topic, with a fixed schema (geometry_msgs/Twist for velocity, sensor_msgs/Image for camera frames, etc.).

Drive the turtle

Terminal 1:

source /opt/ros/jazzy/setup.bash
ros2 run turtlesim turtlesim_node

Terminal 2:

source /opt/ros/jazzy/setup.bash
ros2 run turtlesim turtle_teleop_key

Arrow keys now move the turtle. Underneath, the teleop node publishes geometry_msgs/Twist to /turtle1/cmd_vel and the sim node subscribes. That's it. That's ROS.

See the actual traffic

In a third terminal:

ros2 topic list
ros2 topic echo /turtle1/cmd_vel

Every arrow press emits one message. This is the mental model for every ROS program you will ever write: nodes publish structured messages on named topics, other nodes subscribe. Services and actions are variations of the same pattern.

What to do next

Write your own node in Python that subscribes to /turtle1/pose and prints it. Then one that publishes velocity commands to make the turtle draw a circle. Five more evenings of that and you're ready for real hardware.

Liked this?

Get a new one in your inbox. No spam. Unsubscribe in one click.