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 640 by 480 colour frame as a plain NumPy array 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 × 480RGB, no 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 # average brightness of the colour frame print("brightness:", np.mean(image)) # the centre pixel as blue, green, red. The NeoRacer is RGB-only, # so reach for the LiDAR (rc.lidar), not a depth frame, for distance. h, w = image.shape[0], image.shape[1] b, g, r = image[h // 2, w // 2] print("centre BGR:", b, g, r) rc.set_start_update(start, update) rc.go()
