Practice the ROS2 Implement Pure Pursuit Controller for Mobile Robot coding problem in Control. Browser-based execution with automated grading — no local ROS install required. 63% of engineers pass this challenge.
Implement a Pure Pursuit path-tracking controller as a ROS2 node.
Pure Pursuit works in two steps every control cycle:
lookahead_distance ahead of the robotParameters (declare all with defaults):
lookahead_distance (default 1.0 m) — how far ahead to aimmax_linear_vel (default 0.5 m/s) — cruising speedmin_lookahead (default 0.3 m) — clamp lookahead to this minimumTopics:
/path (std_msgs/String) — JSON array of waypoints: [[x1,y1], [x2,y2], ...]/robot_pose (std_msgs/String) — JSON: {"x": 1.0, "y": 2.0, "theta": 0.5}/cmd_vel (geometry_msgs/Twist)Control loop (create_timer(0.1, ...)):
min distance to robot pose)lookahead_distance from the robotdx = lp_x - robot_x
dy = lp_y - robot_y
# rotate into robot frame
local_x = dx * cos(theta) + dy * sin(theta)
local_y = -dx * sin(theta) + dy * cos(theta)
kappa = 2 * local_y / (local_x**2 + local_y**2)omega = max_linear_vel * kappaTwist(linear.x=max_linear_vel, angular.z=omega)0.2m of the last waypoint, publish zero Twist and log "Goal reached"Log "Pure Pursuit Ready" on startup.
Nav2's RegulatedPurePursuit controller is used on every Clearpath, PAL, and Fetch robot. The lookahead distance parameter directly controls the trade-off between path accuracy (short lookahead = tight tracking) and smoothness (long lookahead = smoother but cuts corners). Understanding this from scratch is essential before tuning Nav2.
It is a hands-on Control challenge on SimuCode where you implement and run ROS2 code in the browser with runtime-verified tests.
Open this page, sign in, and solve the problem in the built-in IDE. Your solution is graded against real ROS2 execution checks.
This Hard problem focuses on pure-pursuit, control, path-tracking skills used in robotics interviews and production systems.