Skip to content

Instantly share code, notes, and snippets.

@KSAMissionCtrl
Created January 26, 2018 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KSAMissionCtrl/dbc5483736fd1d7664824d80bcd8dd81 to your computer and use it in GitHub Desktop.
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
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