Racetrack Lab
Draw a track and race a car driven by a Python controller.
Pick a circuit or draw your own with the mouse, then race the yellow car around it. It's driven by a real Python controller running in your browser. It uses a kinematic bicycle model with heading and lateral-error feedback. Arrow keys or WASD to drive. Beat it if you can.
Pick a circuit above, or drag here to draw your own
You–best –
AI–best –
Target–drive a lap
StatusWarming up Python…drawing works already
Tuning: the AI's gains
vmax and alat apply to both cars, so the race stays fair. Changing anything here clears the lap records for this circuit.
controller.py: edit the Python that drives the AI
The full simulator (vehicle model, error computation, lap logic) is in lab_sim.py. Only controller() is swapped in when you apply.