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 frames, colour as BGR plus a matching depth array. 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 depth image is the same grid without the colour channels, shaped (480, 640). 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 depth = rc.camera.get_depth_image() # NDArray (480, 640) 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
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)· the depth frame on the same grid.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. |
