Skip to content

Instantly share code, notes, and snippets.

@DaniruKun
Created May 20, 2020 21:36
Show Gist options
  • Save DaniruKun/9d8133a7ba7b8ccb94e899529f62c07e to your computer and use it in GitHub Desktop.
Save DaniruKun/9d8133a7ba7b8ccb94e899529f62c07e to your computer and use it in GitHub Desktop.
Auto docking alignment demo
(defn align-y
"docstring"
[driv]
(let [y (@tel/telem :y)
vy (@tel/telem :vy)]
(if (pos? y)
(when (or (> (math/abs y) deadzone)
(pos? vy))
(translate driv "left"))
(when (or (> (math/abs y) deadzone)
(neg? vy))
(translate driv "right")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment