JuliaCon 2025

Interfacing Julia with Kerbal Space Program using KRPC.jl
2025-07-23 , Main Room 5

Kerbal Space Program (KSP) is an entry point for many to aerospace as an easy-to-use, understandable way to build and fly flying machines. The community mod KRPC is then a gateway to automatic control of said vehicles, allowing external software to integrate with KSP to control spacecraft. KRPC.jl is an interface library to KRPC, allowing Julia software to control Kerbal rockets; we describe its architecture, use, and show an application where we use Julia to land an orbital rocket.


Kerbal Space Program (KSP) is a fun way to design and fly rockets, but is very human-input-focused. Several mods, including KOS and KRPC, allow users to write external software that interfaces with the world of and rockets in KSP. I implemented an interface library from Julia for KRPC called KRPC.jl, allowing Julia to control the game in both physically accurate (by adjusting controls) and cheaty (by directly manipulating game state) ways with a friendly Julia Interface. I'll talk about the library, its implementation, and illustrate its use with an aerodynamic characterization script and a closed loop controller/trajectory optimizer that's able to land a reusable launch vehicle in the game.

Benjamin Chung is a modeling & simulation consultant with JuliaHub. Previously, he was a postdoc at the University of Washington with Behcet Acikmese working on aerospace trajectory optimization after finishing his PhD with Jan Vitek on type systems for Julia.

This speaker also appears in: