SimuCode Logo
SimuCode
← Back to Blog
Back to Resources
#ROS2#beginners#practice problems#robotics coding#tutorial

ROS2 Practice Problems for Beginners: Where to Start in 2026

Published on 2026-04-23 By SimuCode

You've installed ROS2. You've followed the official tutorials. You've maybe gotten a Turtlesim window to spin. Now what?

The gap between "I completed the ROS2 tutorials" and "I can build real robotics software" is enormous — and it's where most beginners get stuck. The official docs are excellent references, but they don't give you the kind of progressive, hands-on practice that builds real skill.

This guide maps out a learning path through practical ROS2 problems, from your first publisher to multi-node systems.

Wondering how interviews are structured, not just what to code? Read How Do Companies Test ROS2 Skills in Interviews?.

Why Practice Problems Matter

Reading documentation teaches you syntax. Solving problems teaches you thinking. In ROS2, the difference is stark:

  • Documentation tells you that create_publisher takes a message type, topic name, and QoS depth
  • A practice problem forces you to choose the right message type, pick a meaningful topic name, set appropriate QoS, and handle the timer callback correctly

The muscle memory of writing ROS2 code — declaring parameters, structuring packages, wiring up callbacks — only comes from repetition.

The Beginner Path: 5 Stages

Stage 1: Your First Node (Problems 1–3)

Every ROS2 application starts with nodes. Your first problems should cover:

Problem: Simple Publisher Create a node that publishes a std_msgs/String message to /hello_topic at 1 Hz. The message content should be "Hello, ROS2!".

This sounds trivial, but it teaches the complete lifecycle:

  1. Create a class that inherits from Node
  2. Initialize a publisher with the right message type
  3. Set up a timer callback
  4. Spin the node

Problem: Simple Subscriber Create a node that subscribes to /hello_topic and logs each received message. This completes the pub/sub loop and introduces callback functions.

Problem: Publisher with Parameters Modify your publisher to read the message content and publish rate from ROS2 parameters declared at node startup. This is how real robots are configured — through YAML files, not hardcoded values.

What you'll learn: Node structure, the pub/sub pattern, timer callbacks, parameter declaration.

Stage 2: Services and Request/Response (Problems 4–6)

Topics are fire-and-forget. Services are synchronous request/response — like calling a function on another node.

Problem: Add Two Ints Service Implement a service server for example_interfaces/srv/AddTwoInts. A client sends two integers; your server returns their sum.

Problem: Trigger Service Create a service that, when called, toggles a boolean flag and starts or stops a publisher. This combines services with publishers — a common real-world pattern (e.g., "start recording sensor data").

What you'll learn: Service servers, request/response types, combining communication patterns.

Stage 3: Coordinate Frames with TF2 (Problems 7–8)

Every robot needs to know where things are relative to other things. TF2 is how ROS2 manages coordinate frames.

Problem: Static Transform Broadcaster Publish a static transform between a base_link frame and a camera_link frame. This is fundamentally how you tell ROS2 "the camera is mounted 0.3 meters forward and 0.5 meters up from the robot's base."

Problem: Dynamic Transform Listener Subscribe to TF2 transforms and compute the distance between two frames that change over time. This is the core skill behind any robot that needs to track moving objects.

What you'll learn: The TF2 tree, static vs dynamic transforms, TransformBroadcaster, TransformListener, and Buffer.

Stage 4: Robot Description with URDF (Problems 9–10)

URDF (Unified Robot Description Format) is the XML format that describes a robot's physical structure — its links, joints, and visual geometry.

Problem: Publish a URDF Load a URDF file and publish it via robot_state_publisher. Verify that the TF tree matches the expected joint hierarchy.

Problem: Debug a Broken URDF Given a URDF with intentional errors (typos in joint names, invalid parent references), fix the file so robot_state_publisher runs without errors and the TF tree is complete.

What you'll learn: URDF syntax, robot_state_publisher, debugging TF trees, joint types.

Stage 5: Putting It Together (Problems 11+)

Once you have the fundamentals, combine them into mini-systems:

  • Multi-node launch files — Start multiple nodes with a single command
  • Parameter-driven behavior — Configure an entire system from YAML
  • Watchdog patterns — Detect when a sensor node stops publishing and trigger recovery
  • Action servers — Handle long-running tasks with feedback and cancellation

Where to Practice

The biggest barrier to ROS2 practice has historically been setup. You need Ubuntu, the right ROS2 distribution, a workspace, colcon, and patience. For beginners, this friction kills motivation before learning even starts.

SimuCode eliminates that barrier entirely. Every problem runs in a browser-based IDE connected to a real ROS2 Humble container. You write code, click "Run," and see real colcon build output, topic data, and test results — no installation required.

The platform offers:

  • 49+ problems organized by concept (Nodes, Topics, Services, TF2, URDF, Actions, Nav2)
  • Structured sections that follow the beginner path described above
  • Instant feedback with automated test scripts that verify your node's behavior
  • Visual tools — a live ROS2 node graph and TF tree visualization
  • AI debugging (Pro) that explains why your code failed and suggests fixes

Tips for Beginners

1. Don't skip the easy problems. Even if you "know" how to write a publisher, do the problem. The act of writing it from scratch, without copy-pasting from a tutorial, reveals gaps in your understanding.

2. Read the error messages. ROS2 error messages are verbose but informative. Learn to read colcon build output, runtime exceptions, and topic mismatch warnings. This is the #1 skill that separates beginners from intermediates.

3. Use ros2 topic list and ros2 node info constantly. Understanding what your running system looks like — which topics exist, which nodes are connected — is how you debug effectively.

4. Build incrementally. Don't try to write a full node in one pass. Start with the class structure, add the publisher, verify it works, then add the timer, verify again. Small steps prevent large debugging sessions.

5. Practice regularly. Like any skill, ROS2 fluency comes from consistent practice. Even 30 minutes a day solving one problem builds lasting competence.

What Comes After Beginner

Once you're comfortable with the fundamentals, the next steps are:

  • Navigation (Nav2) — Path planning, costmaps, and behavior trees
  • Perception — Working with camera and LIDAR data in ROS2
  • Simulation — Gazebo integration for testing without hardware
  • Real-time — Understanding executors, callback groups, and deterministic behavior

SimuCode's Industry Assessment section covers these advanced topics with problems modeled after real production challenges at robotics companies.


Start practicing ROS2 today — no setup required. Try SimuCode free and work through hands-on problems with instant feedback.

Related ROS2 Resources