RGB Camera
PyLoN RGB Camera captures the Flight scene from the camera part's viewpoint and streams RGB images and intrinsics to ROS2. Images include the galaxy background, terrain, clouds, and atmosphere, without the screen UI.
Configure viewing direction, resolution, frame rate, and FOV on the part. Capture load depends on sensor settings, game resolution, and rendering mods. EVE and Scatterer rendering are supported; Scatterer's TAA is not applied to sensor images. Other rendering mods may affect appearance.
The default useGameClipPlanes = true uses the game's near/far rendering range. With false, limit local rendering using nearClipMeters / farClipMeters. Scaled Space and galaxy backgrounds are outside this limit.
Input and output topics
| Direction | Topic | Type | Content |
|---|---|---|---|
| Input | None | — | No camera control topic from ROS2 |
| Output | /ksp_vessel/camera/<camera_id>/image_raw | sensor_msgs/msg/Image | Raw RGB image |
| Output | /ksp_vessel/camera/<camera_id>/camera_info | sensor_msgs/msg/CameraInfo | Camera intrinsics |
Image
| Field | Value |
|---|---|
encoding | rgb8 |
is_bigendian | false |
step | width * 3 |
| Row order | Top row first |
header | Same stamp / frame_id as CameraInfo |
ros2 topic hz /ksp_vessel/camera/orbit_camera/image_raw
ros2 run rqt_image_view rqt_image_view /ksp_vessel/camera/orbit_camera/image_rawCameraInfo
Images are generated by a distortion-free pinhole camera.
distortion_model = "plumb_bob"d = [0, 0, 0, 0, 0]- Focal length is calculated from vertical FOV and image height as
height / (2 * tan(vertical_fov / 2)). - Principal point is
((width - 1) / 2, (height - 1) / 2). - Stereo baseline is zero.
ros2 topic echo --once /ksp_vessel/camera/orbit_camera/camera_infoDefaults and operation
The model is a dedicated onboard camera. The mount and side supports are fixed; only the camera body and lens tilt vertically. Set Camera Tilt from 0–180° in the VAB/SPH or Flight right-click menu. The angle is saved in craft/save data. Set the initial angle for new parts with cameraTiltDegrees in ModulePyLoNRgbCamera in part.cfg.
cameraTiltDegrees = 90
cameraPivotTransformName = CameraPivot
cameraOpticalTransformName = CameraOptical| Angle | Lens direction (part-local coordinates) |
|---|---|
| 0° | +Y: upward along the mounting surface |
| 90° (default) | −Z: outward from the mounting surface |
| 180° | −Y: downward along the mounting surface |
“Up/down” is relative to the part's mounting pose. Rotating the entire mounted part also changes its tilt direction. At 90°, image up is +Y. Capture, preview, and transmitted camera pose all follow the rotated CameraOptical. The bridge sends the optical frame pose at image time as dynamic TF. The model origin is the base mounting surface. Changing the angle in the VAB/SPH updates the body orientation immediately.
| Setting | Default | Range |
|---|---|---|
| Resolution | 320 × 240 | Width 16–1280, height 16–720 |
| frame rate | 5 Hz | 1〜15 Hz |
| Vertical FOV | 60° | 20–120° |
| Use game clip planes | true | Set with useGameClipPlanes |
| Near clip (custom range) | 0.05 m | 0.01–10 m |
| Far clip (custom range) | 20000 m | At least near + 1 m |
| Chunk size | 12000 bytes | 512–36000 bytes |
| Maximum frame | 4 MiB | 1 KiB–16 MiB |
The Part Action Window offers resolution presets of 160 × 120, 320 × 240, and 640 × 480, plus frame rate and FOV controls.
In the VAB/SPH or on the active vessel in Flight, right-click the camera and select Show RGB Preview to open a live preview. Drag its title bar to move it; close with X or Hide RGB Preview in the part menu. The window shows the Sensor ID, allowing multiple camera previews for comparison.
Preview uses the same capture path as Flight UDP streaming and reflects resolution, frame rate, FOV, and Camera Tilt changes. With Camera: On, local preview works even with UDP: Off, without a ROS2 bridge. In the VAB/SPH, it shows the hangar from the camera viewpoint and never transmits UDP. Camera: Off stops the image. F2 hides it with the game UI; vessel switches and scene exit close it.
Set <camera_id> using Edit ROS2 Sensor ID in the VAB/SPH. New parts receive camera_<8-digit UID>, passed to the bridge as UDP sensorId.
Frame
Camera frames follow the REP-103 optical convention.
+X: image right+Y: image down+Z: camera forward
When connected to the active vessel model, the optical frame is a child camera_optical_frame of the corresponding link. Without a model, the fallback is:
<frame_prefix>_<camera_id>_camera_optical_frameMissing frames
A frame missing even one chunk is not published. Incomplete frame assemblies are discarded after two seconds. Sensor topics are removed when --topic-timeout-sec elapses after the last complete frame publication.