Skip to content

Instantly share code, notes, and snippets.

@MCarlomagno
Created September 25, 2020 16:36
Show Gist options
  • Save MCarlomagno/7b8428a306497393da3e2c3283616e40 to your computer and use it in GitHub Desktop.
Save MCarlomagno/7b8428a306497393da3e2c3283616e40 to your computer and use it in GitHub Desktop.
// 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