MechJeb#
Provides functionality to interact with the MechJeb mod. Tested with MechJeb 2.15.4.0. Originally written by Genhis. The service acts on the MechJeb of the active vessel, which needs a part with MechJeb. Its classes follow MechJeb’s windows: a setting is found under the window that shows it.
Example#
The following example launches the active vessel into a 100 km orbit, inclined at 6 degrees, with Ascent Guidance, and waits for the ascent to finish:
import krpc
conn = krpc.connect(name="MechJeb Example")
vessel = conn.space_center.active_vessel
ascent = conn.mech_jeb.ascent_guidance
ascent.desired_orbit_altitude = 100000
ascent.desired_inclination = 6
ascent.settings.autostage = True
ascent.enabled = True
vessel.control.activate_next_stage()
event = conn.add_event(lambda: not ascent.enabled)
with event.condition:
event.wait()
print("Launch complete")