Created
January 26, 2018 11:56
-
-
Save KSAMissionCtrl/dbc5483736fd1d7664824d80bcd8dd81 to your computer and use it in GitHub Desktop.
Automatic control of wheel friction to prevent spinouts at high speeds on takeoff/landing
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
set tailwheel to ship:partstagged("tail")[0]:getmodule("modulewheelbase"). | |
set mainwheels to ship:partstagged("main"). | |
set state to "speedup". | |
until false { | |
if state = "speedup" and ship:velocity:surface:mag >= 25 { | |
set state to "slowdown". | |
tailwheel:setfield("friction control", 0). | |
mainwheels[0]:getmodule("kspwheelbase"):setfield("friction multiplier", 0). | |
mainwheels[1]:getmodule("kspwheelbase"):setfield("friction multiplier", 0). | |
} | |
if state = "slowdown" and ship:velocity:surface:mag <= 25 { | |
set state to "speedup". | |
tailwheel:setfield("friction control", 1). | |
mainwheels[0]:getmodule("kspwheelbase"):setfield("friction multiplier", 1). | |
mainwheels[1]:getmodule("kspwheelbase"):setfield("friction multiplier", 1). | |
} | |
wait 0.01. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment