Practice the ROS2 Velocity Profiling for Smooth Stops coding problem in Control. Browser-based execution with automated grading — no local ROS install required. 0% of engineers pass this challenge.
Implement generate_velocity_profile(distance, max_vel, accel, dt) that returns a list of velocity setpoints for moving a robot a given distance.
def generate_velocity_profile(distance: float, max_vel: float, accel: float, dt: float) -> list[float]:
Generate a trapezoidal velocity profile:
accel * dt each step until max_vel is reachedmax_vel until deceleration must beginaccel * dt each step until velocity reaches 0The robot needs d_decel = v² / (2 * accel) metres to decelerate from velocity v to 0. Start decelerating when remaining distance ≤ d_decel.
Trapezoidal profiles are built into every industrial servo drive (Beckhoff, Siemens, Fanuc). In ROS2, the joint_trajectory_controller and follow_joint_trajectory action server both interpolate between waypoints using exactly this profile. Understanding it from scratch is prerequisite to working with ros2_control's trajectory execution.
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 Medium problem focuses on Control skills used in robotics interviews and production systems.