Skip to content

doktorjet/MechJet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MechJet

Scripts for kOS, partially repeating MechJeb functionality.


deorbit.ks (%L)

No compilation needed.
Dependencies: lib.ks

Deorbits from LKO at L longitude (default 174.7) and stage till stage 0 when in atmosphere.


exec.ks (%THR)

Compilation recommended.
Dependencies: lib.ks (GUI/stat.ks removed for now)

Program to execute the next maneuver node. Optional parameter sets threshold for maneuver dV (default 0.1 m/s).


launch.ks (%ORB, %INC, %TSH, %PLM, %DN)

Compilation recommended.
Dependencies: lib.ks (GUI/stat.ks removed for now)

Launch to orbit program with "MechJeb Classic" trajectory. Will also autostage boosters (but not droptanks), jettison fairings and open solar panels when needed.
Launch to target orbital plane is only possible now via GUI/gui_launch.ks.

Parameters:
ORB - Wanted orbit height (km), default 90.
INC - Wanted orbit inclination, default 0.
TSH - Trajectory Sharpness, default 0.5 (it is MechJeb's 50).
PLM - Final pitch limiter, default 0.
DN - Start at Descending Node, default False.


lib.ks

No compilation needed.
No dependencies.

Functions:
POP(STRING) - wrapper for standard HUD message.
MSG(STRING) - standard HUD message with console echo.
WRN(STRING) - HUD warning with console echo.
ERR(STRING) - HUD error with console echo.
HMS(TIME) - returns H:M:S string.
OrbN(ORBIT) - returns normalized normal vector to orbit.
RInc(Orbitable,Orbitable) - returns relative inclination (°).
TTLng(Longitude)- returns time to longitude (s).
VNODE**(Vector,Seconds) - creates a maneuver node with DeltaV = Vector in set Seconds from now.
BURN(VectorFunction,%Threshold) - burns along Vector returned by VectorFunction until it's magnitude is less than Threshold (optional, default 0.1). (Causes unexpected bugs sometime).


prepare_to.ks (MODE)

No compilation needed.
No dependencies.

Makeshift mission manager. Will clean vessel disk and load files needed.
MODE is either "launch_rocket" or "orbital_stuff" for now.


rndzvs.ks (%DST)

No compilation needed.
No dependencies.

Mostly a wrapper around other programs to perform a rendezvous sequence. Does not use iterative calculations like "Lambert solver". Parameter DST is wanted final distance from target, defaults to 80 (though it's most likely to end at 100-160).


GUI/gui_launch.ks

Compilation needed?
No dependencies.

Pre-launch GUI for selecting MechJeb-like launch parameters.

GUI elements:
ORB - Wanted orbit height (km), defaults to 90.
INCL - Wanted orbit inclination(°), defaults to 0.
TS - trajectory steepness, defaults to 0.5.
FPit - pitch at final part of pseudo-GT, defaults to 0.
DN - checkbox for the case of launching at DN of target.


GUI/stat_gui.ks

Compilation needed?
No dependencies.

Supplementary GUI to be ran from launch.ks and exec.ks. Shows some flight parameters. Removed from code temporarily. MJ or KER are much better as displaying things.


MP/mp_altin.ks (ALT, T)

No compilation needed.
No dependencies.

Creates a maneuver node in T seconds from now, setting an ALT orbital height in opposite node.

Examples:
run mp_altin(SHIP:APOAPSIS,ETA:APOAPSIS). - Circularize at Apoapsis.
run mp_altin(SHIP:PERIAPSIS,ETA:PERIAPSIS). - Circularize at Periapsis.
run mp_altin(20000,TTLng(174.7)). - Deorbit trajectory to start over 174.7 longitude and land near KSC. (Start longitude may vary, depending on vessel used).


MP/mp_hoh.ks (%PE)

Compilation recommended.
No dependencies.

Creates a Hohmann maneuver node to reach target in coplanar circular orbit.
PE is optional parameter to aim radius + periapsis "under" the center of target body, defaults to 0.


MP/mp_inc.ks (%INC)

No compilation needed.
Dependencies: lib.ks

If target selected - creates a maneuver node to match target inclination.
In target is not selected - must set INC parameter for inclination wanted.

Examples:
RUN mp_inc(90). - Create a node to make a polar orbit.
RUN ONCE lib. IF HASTARGET AND RInc(SHIP,TARGET)>0.5 {RUN mp_inc.} - Load a lib for RInc function. If relative inclination is more than 0.5° - create a node to match inclination.


MP/mp_preland.ks (TLAT, TLNG, %PE)

Compilation needed?
No dependencies.

Creates a maneuver node for bringing orbit periapsis over the landing site with TLAT,TLNG coordinates and lowering it to PE (default 20000 m).
Idea of this maneuver © TheGreatFez.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published