Lab 1 · Hello Racer

The car

The GOAT Racer: depth camera on its mast, lidar, Jetson, chassis

A 1/10 car with a Jetson for the brain, a depth camera and a lidar for the eyes, and a motor controller for the muscle.

Everything that drives it sends two numbers: steer and throttle, each in [-1, 1]. A gamepad, your code and a trained policy all speak this one language.

Do this: drive the car below with the arrow keys. Reach the lit disc and the next one lights up. Watch the readout under the stage: those are the two numbers your keys send.

Drive it

loading the simulator
racer.drive(steer=+0.00, throttle=+0.00) waypoints 0/6

// Arrow keys or W A S D. The lit disc is the waypoint. Reach it and the next one lights up. F710: left stick throttle, right stick steer.

Make it drive itself

The Code card below is five lines of Python. It asks where the waypoint is and sends steer and throttle, the same two numbers your keys just sent.

Do this: replace the ? with a throttle. Start small, like 0.4. Hit Run and watch the car drive to the waypoints on its own. Then try 1.0 and watch what a car does when it steers at full throttle.

// Next: race the keeper policy, a network that learned the same two numbers by itself.

Code

// Real Python, run in your browser. It does not run yet: one blank to fill. Fix it, hit Run, then change the numbers and run again. The script drives the simulated car: waypoint() reads where the next disc is, drive(...) moves the car. When the script ends, the page jumps to the car and plays what it did.