/** * Return From Moon - Transfer back to parent body */ import type { KosConnection } from '../../../transport/kos-connection.js'; import { executeManeuverCommand, type ManeuverResult } from '../shared.js'; /** * Create a maneuver node to return from a moon to its parent body. * Only works when orbiting a moon (e.g., Mun, Minmus). * * @param conn kOS connection * @param targetPeriapsis Target periapsis at parent body in meters (e.g., 100000 for 100km at Kerbin) */ export async function returnFromMoon( conn: KosConnection, targetPeriapsis: number ): Promise { const cmd = `SET PLANNER TO ADDONS:MJ:MANEUVERPLANNER. PRINT PLANNER:RETURNFROMMOON(${targetPeriapsis}).`; return executeManeuverCommand(conn, cmd); }