THE CAMERA.
The forward-facing colour camera mounted on the front of the chassis. Your code reads it as a steady stream of 640 x 480 BGR colour frames at 60 fps. The sensor can capture up to 120 fps; the driver runs it at 60, which is the recommended rate. It is an RGB camera, not a depth camera, so use the LiDAR when you need distance. The same frame size the racecar-neo-library hands you in the Playground sim and on the car, so what you tune in simulation is what runs on the track.
THE FRAME.
The colour image arrives as a NumPy array shaped (480, 640, 3): 480 rows, 640 columns, three colour channels in BGR order. The physical sensor can capture up to 1080p, but the library normalises every frame to 640 x 480 so that the sim and the car return the exact same shape. That is why the helpers below report a width of 640 and a height of 480 in both places.
pythoncolor = rc.camera.get_color_image() # NDArray (480, 640, 3), uint8, BGR print(color.shape) # (480, 640, 3) print(rc.camera.get_width()) # 640 print(rc.camera.get_height()) # 480 # BGR, not RGB: the blue channel comes first. b, g, r = color[240, 320] # centre pixel, one per channel # The NeoRacer is RGB-only: get_depth_image() returns all zeros here. # Use rc.lidar for distance.
SPECIFICATIONS.
THE METHODS.
rc.camera.get_color_image() → NDArray (480, 640, 3)· the colour frame, uint8, BGR order.rc.camera.get_depth_image() → NDArray (480, 640)· for depth-camera cars; all zeros on the NeoRacer (RGB-only), so use rc.lidar for distance.rc.camera.get_width() → 640· the frame width in pixels.rc.camera.get_height() → 480· the frame height in pixels.
The full reference for the camera object lives at API Reference · rc.camera.
THE ROS 2 TOPIC.
In the racecar_neo ROS 2 stack, camera_node publishes sensor_msgs/Image on /camera with the encoding field set to "jpeg", which means the message carries JPEG bytes rather than raw pixels. That keeps the topic light on the network. When you want a plain image that RViz can render directly, the optional decode_camera node republishes a decoded frame on /camera/decoded.
| Topic | Message type | Notes |
|---|---|---|
| /camera | sensor_msgs/Image | Encoding "jpeg": JPEG bytes in an Image message. |
| /camera/decoded | sensor_msgs/Image | Optional. RViz-friendly decoded image from decode_camera. |
