These docs are public and open source.Edit on GitHub
API REFERENCE / PYTHON
RC.CAMERA.
The Camera module gives you what the car sees: a colour frame and a matching depth frame, both as plain NumPy arrays you can hand straight to . The same 640 by 480 frames come back in the Playground sim and on the car, so your vision code ports without a change.
Sim ↔ car identical640 × 480colour + depthNumPy / OpenCV
METHODS
THE METHODS.
TYPICAL USE
READING A FRAME.
pythonimport racecar_core import numpy as np rc = racecar_core.create_racecar() def start(): pass def update(): image = rc.camera.get_color_image() # (480, 640, 3), BGR, 0-255 depth = rc.camera.get_depth_image() # (480, 640), cm # average brightness of the colour frame print("brightness:", np.mean(image)) # distance straight ahead, at the centre pixel print("centre depth:", depth[240, 320]) rc.set_start_update(start, update) rc.go()
