KRPC.jl

A kRPC client for Julia
Author BenChung
Popularity
3 Stars
Updated Last
3 Months Ago
Started In
April 2018

KRPC

A Julia wrapper library for the KRPC remote procedure call system for Kerbal Space Program.

Example

Setup:

using KRPC
using KRPC.Interface.SpaceCenter.Helpers

KRPC.kerbal_connect("test", "127.0.0.1") do
	# use the connection
end

Get the vessel's current position:

spaceCenter = KRPC.Interface.SpaceCenter.RemoteTypes.SpaceCenter(conn)
vessel = ActiveVessel(spaceCenter)
body_rf = ReferenceFrame(Body(Orbit(vessel)))
println(Position(vessel, body_rf))

Stream the vessel's current position:

spaceCenter = KRPC.Interface.SpaceCenter.RemoteTypes.SpaceCenter(conn)
vessel = ActiveVessel(spaceCenter)
body_rf = ReferenceFrame(Body(Orbit(vessel)))
add_stream(conn, (KRPC.Interface.SpaceCenter.Vessel_Position(vessel, body_rf), )) do stream
	for (position, ) in stream
		println(position)
	end
end

Used By Packages

No packages found.