Skip to content

Commit

Permalink
adding to main
Browse files Browse the repository at this point in the history
  • Loading branch information
robinsp committed Oct 29, 2025
1 parent 967de86 commit 84c93f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
9 changes: 7 additions & 2 deletions py/src/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ def forward(self, speed):
def backward(self, speed):
self.driveBase.drive(speed, 0 )

def turn(self, speed, angle):
self.driveBase.drive(speed, angle)
def left(self, speed, angle):
self.driveBase.drive(speed, 90)

def right(self, speed, angle):
self.driveBase.drive(speed, -90)

def stop(self, speed):
self.driveBase.drive(0,0)

16 changes: 5 additions & 11 deletions py/src/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@ def __init__(self, drive: Drive, sensors: Sensors):
self.drive = drive
self.sensors = sensors

def start(self):
def start(self, duration_ms = 5000):
self.drive.forward(50)
while True:
timer = StopWatch()
while timer.time() < duration_ms:
wait(50)
this.stop()

self.stop()

def stop(self):
self.drive.forward(0)

def turn_left(self):
self.drive.turn(50, 90)


def turn_right(self):
self.drive.turn(50, -90)

0 comments on commit 84c93f4

Please sign in to comment.