-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
5,378 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Open Terminal"). | ||
set terminal:width to 80. | ||
set terminal:height to 50. | ||
print "Hello Guido.". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// burn the next maneuver node | ||
run once libguido. | ||
|
||
myinit(). | ||
set mynode to nextnode. | ||
exec_n(mynode). | ||
myexit(). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// Dock Two Vessels | ||
|
||
run once libguido. | ||
|
||
declare parameter v_max is 1. | ||
|
||
function rcs_ctl { | ||
parameter d. | ||
parameter v. | ||
if d > 0.1 { set tv to -max(min(v_max, d/30),0.1). } | ||
else if d < -0.1 { set tv to max(min(v_max,-d/30),0.1). } | ||
else {set tv to 0.} | ||
if v > tv {return -0.1.} | ||
if v < tv {return 0.1.} | ||
return 0. | ||
} | ||
|
||
myinit(). | ||
|
||
rcs off. | ||
|
||
set tr to target. | ||
set cp to ship:controlpart. | ||
|
||
print "Docking to : "+tr:name. | ||
print "Control from: "+cp:name. | ||
print "Port status : "+cp:state. | ||
|
||
// Adjust direction | ||
|
||
print "adjusting direction.". | ||
lock steering to lookdirup(-tr:portfacing:forevector, tr:portfacing:upvector). | ||
|
||
set da1 to 9. | ||
set da2 to 9. | ||
until da1 < 1 AND da2 < 1 { | ||
set da1 to vang(ship:facing:forevector, -tr:portfacing:forevector). | ||
set da2 to vang(ship:facing:upvector, tr:portfacing:upvector). | ||
print "ang diff:" + round(da1,1) + "/" + round(da2,1). | ||
wait 0.2. | ||
} | ||
|
||
// Align horizontally and vertically. | ||
|
||
rcs on. | ||
|
||
set done to false. | ||
|
||
until cp:state <> "Ready" { | ||
set tr_dis to tr:portfacing:forevector. | ||
set tr_ver to tr:portfacing:upvector. | ||
set tr_hor to tr:portfacing:rightvector. | ||
|
||
set tr_vec to tr:position-cp:position. | ||
set tr_vel to tr:ship:velocity:orbit-ship:velocity:orbit. | ||
|
||
set d_dis to vdot(tr_vec, tr_dis). | ||
set d_ver to vdot(tr_vec, tr_ver). | ||
set d_hor to vdot(tr_vec, tr_hor). | ||
|
||
set v_dis to vdot(tr_vel, tr_dis). | ||
set v_ver to vdot(tr_vel, tr_ver). | ||
set v_hor to vdot(tr_vel, tr_hor). | ||
|
||
print1s("dis/ver/hor: "+round(d_dis,1)+" / "+round(d_ver,1)+" / "+round(d_hor,1)+" "+ | ||
round(v_dis,1)+" / "+round(v_ver,1)+" / "+round(v_hor,1)). | ||
|
||
set ship:control:starboard to rcs_ctl(d_hor,v_hor). | ||
set ship:control:top to -rcs_ctl(d_ver,v_ver). | ||
|
||
if abs(d_hor) > 0.2 or abs(d_ver) > 0.2 { | ||
set ship:control:fore to rcs_ctl(0, v_dis). | ||
} else { | ||
set ship:control:fore to rcs_ctl(d_dis,v_dis). | ||
} | ||
wait 0.1. | ||
} | ||
|
||
set ship:control:neutralize to true. | ||
rcs off. | ||
lock throttle to 0. | ||
unlock steering. | ||
sas on. | ||
|
||
print "done.". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Launch from Kerbin to Dres | ||
print "Dres 1.0". | ||
|
||
KUniverse:QUICKSAVETO("x0-prelaunch"). | ||
if body = Kerbin { | ||
if ship:altitude < 65000 { | ||
run go_orb(250000). | ||
lock throttle to 0. | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x1-orbit"). | ||
} | ||
if ship:orbit:inclination > 0.01 { | ||
run incl. | ||
} | ||
if ship:apoapsis < 1000000*0.99 { | ||
run reorb(1000000). | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x2-pretransfer"). | ||
} | ||
run tr_pl(Dres). | ||
} else { | ||
// In SOI, but not yet on a stable orbit. | ||
if ship:apoapsis < 0 OR ship:apoapsis > 200000 { run tr_pl(Dres). } | ||
} | ||
print "You arrived at Dres!". | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Launch from Kerbin to Duna | ||
print "Duna 1.0". | ||
|
||
KUniverse:QUICKSAVETO("x0-prelaunch"). | ||
if body = Kerbin { | ||
if ship:altitude < 65000 { | ||
run go_orb(250000). | ||
lock throttle to 0. | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x1-orbit"). | ||
} | ||
if ship:orbit:inclination > 0.01 { | ||
run incl. | ||
} | ||
if ship:apoapsis < 1000000*0.99 { | ||
run reorb(1000000). | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x2-pretransfer"). | ||
} | ||
run tr_pl(Duna). | ||
} else { | ||
// In SOI, but not yet on a stable orbit. | ||
if ship:apoapsis < 0 OR ship:apoapsis > 200000 { run tr_pl(Duna). } | ||
} | ||
|
||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x3-dstorbit"). | ||
print "You arrived at Duna!". | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
print "Eve 1.0". | ||
|
||
KUniverse:QUICKSAVETO("x0-prelaunch"). | ||
if body = Kerbin { | ||
if ship:altitude < 65000 { | ||
run go_orb(250000). | ||
lock throttle to 0. | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x1-orbit"). | ||
} | ||
if ship:orbit:inclination > 0.01 { | ||
run incl. | ||
} | ||
if ship:apoapsis < 1000000*0.99 { | ||
run reorb(1000000). | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x2-pretransfer"). | ||
} | ||
run tr_pl(Eve). | ||
} else { | ||
// In SOI, but not yet on a stable orbit. | ||
if ship:apoapsis < 0 OR ship:apoapsis > 200000 { run tr_pl(Eve). } | ||
} | ||
|
||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x5-dstlow"). | ||
print "You arrived at Eve!". | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Launch from Kerbin to Minmus | ||
print "Minmus 1.0". | ||
|
||
KUniverse:QUICKSAVETO("x0-prelaunch"). | ||
if body = Kerbin { | ||
if ship:altitude < 65000 { | ||
run go_orb. | ||
} | ||
lock throttle to 0. | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x1-orbit"). | ||
if ship:orbit:inclination < 5 { | ||
run reorb(80000). | ||
run incl. | ||
run incl(6,Minmus:orbit:lan). | ||
|
||
} | ||
run reorb(80000). | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x2-pretransfer"). | ||
run tr_min. | ||
} else { | ||
// In SOI of Minimus, but not yet on a stable orbit. | ||
if ship:apoapsis < 0 OR ship:apoapsis > 100000 { run tr_min. } | ||
} | ||
|
||
if ship:apoapsis > 11000 { run reorb(10000). } | ||
//if ship:orbit:inclination > 0.1 { run incl. } | ||
wait until KUniverse:CANQUICKSAVE. | ||
KUniverse:QUICKSAVETO("x3-dstorbit"). | ||
//run hit(0,6). | ||
print "You arrived on Minmus!". | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Launch from Kerbin to the Mun | ||
print "Mun 1.0". | ||
|
||
run go_orb. | ||
run reorbit2(80000). | ||
run tr_mun. | ||
|
||
print "done.". | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.