Skip to content

Instantly share code, notes, and snippets.

@jkutner
Created September 20, 2020 14:57
Show Gist options
  • Save jkutner/66084c50013a76e5cbade4edf94f2c67 to your computer and use it in GitHub Desktop.
Save jkutner/66084c50013a76e5cbade4edf94f2c67 to your computer and use it in GitHub Desktop.
def gyro_drive(self, speed, heading, distance):
self.robot.reset()
actual_distance = 0
while actual_distance < distance:
correction = self.gyro.angle() * -10
self.robot.drive(speed, correction)
wait(10)
actual_distance = self.robot.distance()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment