These docs are public and open source.Edit on GitHub
API REFERENCE / PYTHON
RC.DRIVE.
The Drive module is how your code moves the car: one call sets the rear-wheel speed and the front-wheel steering angle. It is the only part of the car your program writes to, and the same three methods run unchanged in the Playground sim and on the physical NeoRacer.
Sim ↔ car identical3 methodsspeed, angle in [-1, 1]
METHODS
THE METHODS.
TYPICAL USE
EXAMPLE USAGE.
pythonimport racecar_core rc = racecar_core.create_racecar() def start(): # Raise the throttle cap once. The library defaults it to 0.25. rc.drive.set_max_speed(0.4) rc.drive.stop() def update(): # Hold the A button to creep forward, steer with the left stick x-axis. x, _ = rc.controller.get_joystick(rc.controller.Joystick.LEFT) speed = 0.3 if rc.controller.is_down(rc.controller.Button.A) else 0.0 rc.drive.set_speed_angle(speed, x) rc.set_start_update(start, update) rc.go()
