Skip to content

Demos ​

Sample applications using PyLoN sensors and control APIs. Each page lists vessels, extra packages, startup order, how to inspect results, and stopping/resuming.

Choose a demo ​

DemoCapabilitiesVessel / sensorsBridge startup
Debris Orbit and ImagingRelative motion estimation, RCS orbit control, imaging every 36°Six-axis RCS, 3D LiDAR, RGB camera, nearby debrisSeparate terminal
2D LiDAR and SLAMMapping, saving maps, Nav2 with saved mapsHorizontally mounted 2D LiDAR, vessel capable of planar movementSeparate terminal
Mun Nav2Local mapping, autonomous driving to RViz goalsFront-steering rover on the Mun, 3D LiDARStarted by launch
Satellite Separation and Retropropulsive LandingLifecycle-managed launch, separation, and return (real flight unvalidated)Included PyLoN PhoenixStarted by launch

The repository also contains pylon_demo_position_estimator for estimating 6DoF position from 3D LiDAR alone. See ../demos/pylon_demo_position_estimator/README.md for startup.

Prepare the repositories ​

Demo implementations are in PyLoN-sim/demos. Clone beside the core repository. Commands in the following guides run from ~/src/PyLoN.

bash
git clone https://github.com/PyLoN-sim/demos.git ~/src/demos
cd ~/src/PyLoN

For another location, adjust PYLON_DEMOS_DIR and command paths using ../demos.

Shared preparation ​

  1. Install the mod and Jazzy bridge in Docker and check communication with Getting Started. The core image does not include demos. Host instructions below additionally require host Jazzy, colcon, rosdep, and PyLoN packages. Dedicated Space ROS container instructions are available in individual guides where provided.
  2. Prepare a suitable vessel using normal KSP operations. Demos do not generate vessels or saves automatically.
  3. Install extra dependencies and sync demos following each page. Build ament packages; debris orbit runs directly from Python source.
  4. Source ROS in every terminal used for startup.
bash
source /opt/ros/jazzy/setup.bash
source ~/ros2_ws/install/setup.bash

If using another workspace, replace ~/ros2_ws with the actual path and set the same ROS2_WS for sync commands.

To install all demos together, run from the repository root.

bash
source /opt/ros/jazzy/setup.bash
rosdep install --from-paths Ros2 ../demos --ignore-src --rosdistro jazzy -y
./sync.sh --skip-ksp-build --skip-ksp-sync --all-demos
source ~/ros2_ws/install/setup.bash

Install debris orbit's NumPy, SciPy, PyYAML, and other Python dependencies using its preparation steps. This demo is synced but not built by colcon.

This sync adds ROS2 components using the mod installed with Getting Started. To update the mod too, exit KSP, run ./sync.sh --all-demos, then restart KSP.

Choose the environment and vessel ​

First install the Docker bridge with Getting Started and check communication with the Minimal Receiver, then prepare the demo vessel. To combine a Space ROS bridge with host Jazzy demos, follow host integration and avoid starting a second host bridge.

Loading a .craft alone does not establish debris orbit's initial state. Check pre/post-separation saves and startup conditions.

Sensor IDs and startup order ​

front_lidar and orbit_camera on each page are examples. Set them with Edit ROS2 Sensor ID in VAB/SPH part menus, or change startup arguments to actual IDs.

Run only one bridge for the same KSP. If a demo starts its own bridge, stop the pylon-jazzy container from Getting Started first. Orbit and 2D SLAM use a separate bridge; Mun Nav2 uses its launch-managed bridge. Run one control demo at a time and stop it before switching.

If inputs are missing ​

First check that /ksp_vessel/lifecycle is ACTIVE and sensor topics are arriving. See Troubleshooting for checks and Bridge Options for endpoints.

Guides and API references for building ROS2 applications with PyLoN