Created
September 25, 2020 16:36
-
-
Save MCarlomagno/7b8428a306497393da3e2c3283616e40 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// calculate angle | |
let angle = 0.0; | |
angle = angleBetween(wrists); | |
// right condition | |
if(angle < -25) { | |
turnRight(); | |
toRight = true; | |
toLeft = false; | |
} else if(toRight) { | |
straight(); | |
toRight = false; | |
} | |
// left condition | |
if(angle > 25) { | |
turnLeft(); | |
toLeft = true; | |
turningRight = false; | |
} else if(toLeft) { | |
toLeft = false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment