ROS2 The 24-Hour Robot

Hard Code Audit 0% pass rate
#qos#KEEP_ALL#KEEP_LAST#memory-leak#laserscan#ros2

Practice the ROS2 The 24-Hour Robot coding problem in Code Audit. Browser-based execution with automated grading — no local ROS install required. 0% of engineers pass this challenge.

A sensor processing node works perfectly in short tests. In production the team must restart it every 16–20 hours — memory usage climbs steadily throughout the shift.

The node subscribes to /scan (LaserScan), computes the minimum valid range, and publishes it to /min_range (Float32). There are no memory leaks in application logic. The culprit is a QoS setting.

The bug: HistoryPolicy.KEEP_ALL with depth=0 on the subscriber creates an unbounded DDS message queue. Every message the publisher produces — faster than the callback drains it — is retained in the middleware layer forever.

Fix the QoS profile so the subscriber uses a bounded queue. Verify that:

  1. The node still processes LaserScan messages and publishes correct minimum-range values.
  2. The subscriber no longer uses KEEP_ALL.

Frequently asked questions

What is the ROS2 The 24-Hour Robot practice problem?

It is a hands-on Code Audit challenge on SimuCode where you implement and run ROS2 code in the browser with runtime-verified tests.

How do I practice ROS2 The 24-Hour Robot online?

Open this page, sign in, and solve the problem in the built-in IDE. Your solution is graded against real ROS2 execution checks.

What skills does ROS2 The 24-Hour Robot test?

This Hard problem focuses on qos, KEEP_ALL, KEEP_LAST skills used in robotics interviews and production systems.