misc changes + new circ mode

This commit is contained in:
2026-04-20 02:44:11 -04:00
parent 7431ab7946
commit 25212af055
6 changed files with 21 additions and 25 deletions
+18 -9
View File
@@ -3,7 +3,6 @@ import("library/lib_math").
import("library/lib_vessel_utils").
import("library/lib_orbits").
declare function Ascent{
parameter targetOrbit is 100000.
parameter vericalAscent is 1000.
@@ -11,7 +10,6 @@ declare function Ascent{
parameter circ is 1.
parameter inc is 0.
print "Params (" + targetOrbit + ", " + vericalAscent + ", " + ascentProfile + ", " + circ + ", " + inc + ")".
print "Vertical Climb to " + vericalAscent.
@@ -59,6 +57,9 @@ declare function Ascent{
CircularizeBrute(targetOrbit, head).
}else if circ = 2{
Circularize(targetOrbit, head).
}else if circ = 3 {
lock steering to heading(head, 0, 270).
CreateCircularizationNode(apoapsis).
}
set isDone to true.
@@ -68,9 +69,8 @@ declare function Ascent{
wait until throttle = 0.
}
local function Circularize{
parameter targetOrbit.
parameter tgt.
parameter head.
lock throttle to 0.
@@ -78,7 +78,7 @@ local function Circularize{
local warpTime is eta:apoapsis.
local burnDv is CalculateCircularizationDV(targetOrbit, orbit:semimajoraxis).
local burnDv is CalculateCircularizationDV(tgt, orbit:semimajoraxis).
local burnDuration is CalculateMultiStageBurnDuration(burnDv).
local remDv is ship:deltav:current - burnDv.
print "Warping to Circularization. " + round(burnDv) + "m/s. T: " + round(burnDuration, 2) + "s" at(0, 5).
@@ -94,18 +94,27 @@ local function Circularize{
lock throttle to 1.
// wait burnDuration.
wait until periapsis >= targetOrbit.
wait until periapsis >= tgt.
lock throttle to 0.
wait 0.01.
}
local function CircularizeBrute{
parameter targetOrbit.
parameter tgt.
parameter head.
lock throttle to 1.
lock steering to heading(head, 0, 270).
wait until periapsis >= targetOrbit.
wait until periapsis >= tgt.
lock throttle to 0.
}
local function CreateCircularizationNode{
parameter tgt.
lock throttle to 0.
wait until altitude > 80000.
local burnDv is CalculateCircularizationDV(tgt, orbit:semimajoraxis).
set circNode to Node(eta:apoapsis, 0, 0, burnDv).
add circNode.
}