2D / 3D LiDAR
2D LiDAR streams planar scans; 3D LiDAR streams forward hemisphere point clouds. Both use ROS sensor coordinates: +X forward, +Z up.
Input and output topics
| Part | Input Topic | Output Topic | Type |
|---|---|---|---|
| PyLoN LiDAR 2D | None | /ksp_vessel/lidar_2d/<lidar_2d_id>/scan | sensor_msgs/msg/LaserScan |
| PyLoN LiDAR 3D | None | /ksp_vessel/lidar_3d/<lidar_3d_id>/points | sensor_msgs/msg/PointCloud2 |
2D LaserScan
angle_minis-1/2of horizontal FOV.- A 360° scan uses
angle_increment = FOV / horizontalCount; narrower scans include both endpoints and useFOV / (horizontalCount - 1). scan_timeis1 / scanRateHz;time_incrementisscan_time / horizontalCount.range_minis0.0;range_maxis the part's maximum distance.- KSP no-hit values
-1, nonfinite values, and out-of-range values become ROS+Inf. intensitiesis empty.
ros2 topic echo /ksp_vessel/lidar_2d/front_lidar/scan3D PointCloud2
- This is an unorganized point cloud with
height = 1. - Fields are
x,y,z, all little-endianFLOAT32. point_step = 12bytes.- Misses are excluded from the cloud, and
is_dense = true. - Current 3D parts use a Fibonacci hemisphere layout. KSP sends ranges only; the bridge reconstructs known ray directions and converts them to points.
ros2 topic echo --once /ksp_vessel/lidar_3d/roof_lidar/pointsDefaults
| Setting | 2D | 3D |
|---|---|---|
| Scan rate | 10 Hz | 10 Hz |
| Horizontal FOV | 360° | 360° |
| Ray count | 180 | About 2011 with Medium |
| Maximum distance | 2000 m | 100 m with Medium |
| UDP destination | 127.0.0.1:49010 | 127.0.0.1:49010 |
| Ignore own-vessel collisions | Enabled | Enabled |
For 3D, select these profiles in the Part Action Window.
| Profile | Distance range | Density | Default distance | Approximate ray count |
|---|---|---|---|---|
| Near | 10〜30 m | 160 rays/sr | 30 m | 1005 |
| Medium | 50〜150 m | 320 rays/sr | 100 m | 2011 |
| Long | 150–250 m | 1024 rays/sr | 250 m | 4096 (ray limit) |
Topic creation and removal
Transmission starts in Flight with lidarEnabled and udpEnabled enabled. Topics are created on the first scan and removed on the Flight-exit inactive notification or reception timeout. streamAt20Fps ignores scanRateHz and fixes the rate at 20 Hz.
Each LiDAR has a persistent ID editable with Edit ROS2 Sensor ID in the VAB/SPH. New 2D and 3D parts receive lidar_2d_<8-digit UID> and lidar_3d_<8-digit UID>, passed to the bridge as UDP sensorId.
Frame
When partFlightId matches the active vessel model, frame_id is a child LiDAR frame of the vessel link. Without a model, these fallbacks apply:
<frame_prefix>_<sensor_id>_lidarThe default frame_prefix is pylon.
Mounting and measurement origin
The 2D origin is part-local (0, 0, -0.032); the 3D origin is (0, 0, 0.059), 2 mm beyond the dome apex. 3D scans a hemisphere centered on the outward normal of the mounting surface. See Part Configuration for axes and origins.
Laser preview
Right-click a LiDAR in the VAB/SPH or Flight and select Show Laser Preview to display its laser lines. Use Hide Laser Preview to hide them. Add Toggle Laser Preview to an action group if desired.