misc changes + new circ mode
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
import("library/lib_ascent").
|
||||
|
||||
WaitForEngineStart().
|
||||
@@ -25,7 +23,7 @@ wait until kuniverse:timewarp:rate = 0.
|
||||
|
||||
lock steering to srfRetrograde.
|
||||
|
||||
wait until surfaceSpeed < 1000.
|
||||
wait until altitude <= 20000.
|
||||
|
||||
unlock steering.
|
||||
set kuniverse:timewarp:rate to 5.
|
||||
|
||||
@@ -12,7 +12,7 @@ set profile to 1.2.
|
||||
set turn_start to 1000.
|
||||
set target_orbit to 120000.
|
||||
|
||||
Ascent(target_orbit, turn_start, profile, 0, 73).
|
||||
Ascent(target_orbit, turn_start, profile, 3, 90 + 12).
|
||||
|
||||
print "Orbit Achieved, Releasing Controls".
|
||||
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal").
|
||||
|
||||
@@ -10,7 +10,7 @@ set profile to 1.2.
|
||||
set turn_start to 1000.
|
||||
set target_orbit to 130000.
|
||||
|
||||
Ascent(target_orbit, turn_start, profile, 0).
|
||||
Ascent(target_orbit, turn_start, profile, 3).
|
||||
|
||||
print "Orbit Achieved, Releasing Controls".
|
||||
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Close Terminal").
|
||||
|
||||
+18
-9
@@ -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.
|
||||
}
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
|
||||
declare function CreateDeorbit{
|
||||
parameter target.
|
||||
parameter dv is 300.
|
||||
parameter offsetX is 0.0.
|
||||
parameter offsetZ is 0.0.
|
||||
|
||||
|
||||
}
|
||||
|
||||
declare function CalculateCircularizationDV{
|
||||
parameter ap is 0.
|
||||
parameter sma is 0.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import("library/lib_math").
|
||||
|
||||
declare function WaitForEngineStart{
|
||||
wait until AnyEngineActive().
|
||||
|
||||
Reference in New Issue
Block a user