Fix sensor code.
This commit is contained in:
parent
2a61dc6777
commit
f5e80f3687
2 changed files with 8 additions and 6 deletions
|
@ -44,8 +44,8 @@ function Hover {
|
|||
}
|
||||
|
||||
function alignForHover {
|
||||
if ReadSensor("pres") = 0 {
|
||||
// if we're in a vacuum, cancel all velocity first...
|
||||
if ReadSensor("PRES") = 0 {
|
||||
// if we're in a vacuum, align with retrograde for smoother horizontal control.
|
||||
lock STEERING to SHIP:SRFRETROGRADE.
|
||||
print "Aligning with retrograde.".
|
||||
wait until done or VAng(SHIP:FACING:FOREVECTOR, SHIP:SRFRETROGRADE:FOREVECTOR) < 0.1.
|
||||
|
@ -54,7 +54,7 @@ function alignForHover {
|
|||
return.
|
||||
}
|
||||
} else {
|
||||
// ... otherwise just cancel vertical velocity
|
||||
// ... otherwise just align vertically.
|
||||
lock STEERING to SHIP:UP.
|
||||
print "Aligning vertical.".
|
||||
wait until done or VAng(SHIP:FACING:FOREVECTOR, SHIP:UP:FOREVECTOR) < 1.
|
||||
|
@ -76,6 +76,6 @@ function restoreControl {
|
|||
unlock THROTTLE.
|
||||
unlock STEERING.
|
||||
SAS on.
|
||||
print "Stabilized operation ended. Returning control to pilot.".
|
||||
print "Done.".
|
||||
set done to false.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue