Created
April 4, 2017 12:39
-
-
Save kthoms/3a8ab67142a5026a16febdf2e74826dc to your computer and use it in GitHub Desktop.
Cozmo tutorial program: Drive and turn
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
'''Drive And Turn | |
Make Cozmo drive forwards and then turn 90 degrees to the left. | |
''' | |
import cozmo | |
from cozmo.util import degrees, distance_mm, speed_mmps | |
def cozmo_program(robot: cozmo.robot.Robot): | |
# Drive forwards for 150 millimeters at 50 millimeters-per-second. | |
robot.drive_straight(distance_mm(150), speed_mmps(50)).wait_for_completed() | |
# Turn 90 degrees to the left. | |
# Note: To turn to the right, just use a negative number. | |
robot.turn_in_place(degrees(90)).wait_for_completed() | |
cozmo.run_program(cozmo_program) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment