Created
May 20, 2020 20:47
-
-
Save DaniruKun/793c42b8f2cc3e2825591857525bc05e to your computer and use it in GitHub Desktop.
Dragon Autopilot control driver demo
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
(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