Skip to content

Instantly share code, notes, and snippets.

@DaniruKun
Created May 20, 2020 20:47
Show Gist options
  • Save DaniruKun/793c42b8f2cc3e2825591857525bc05e to your computer and use it in GitHub Desktop.
Save DaniruKun/793c42b8f2cc3e2825591857525bc05e to your computer and use it in GitHub Desktop.
Dragon Autopilot control driver demo
(defn roll
"Roll the Crew Dragon left or right (CCW or CW)."
([driv dir max-roll-rate]
(if (or
(< (math/abs (@tel/telem :roll-rate)) max-roll-rate)
(and
(pos? (@tel/telem :roll-rate)) (= dir "left"))
(and
(neg? (@tel/telem :roll-rate)) (= dir "right")))
(case dir
"left" (fill-active driv comma)
"right" (fill-active driv point)))
(Thread/sleep min-rot-impulse-interval))
([driv dir]
(roll driv dir max-def-rot-rate)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment