class Chariot: ### Creates a chariot object but does not start the loop thread. ### To start operation call (Chariot).start() from your Main script. def __init__(self, rangeFinderAbstract, motorAbstract, locationObserverAbstractList, chariotcf ): self.x, self.y = [160,47] self.bearing = 90 #self.run = True #self.cb = ControlBoard() self.location = Location(rangeFinderAbstract, motorAbstract, locationObserverAbstractList) self.location.moveUntilObstacle()
def drive(self, motorAbstract, rangeAbstract, locationObserverAbstractList): self.location = Location(motorAbstract, rangeAbstract, locationObserverAbstractList) self.location.forward(200) time.sleep(1) self.location.left(126) time.sleep(1) self.location.right(200)
def __init__(self, rangeFinderAbstract, motorAbstract, locationObserverAbstractList, chariotcf ): self.x, self.y = [160,47] self.bearing = 90 #self.run = True #self.cb = ControlBoard() self.location = Location(rangeFinderAbstract, motorAbstract, locationObserverAbstractList) self.location.moveUntilObstacle()
class Chariot: def __init__(self, motorAbstract, rangeAbstract, locationObserverAbstractList, chariotcf , waypoints): self.thread = threading.Thread(target = self.drive, args= (motorAbstract, rangeAbstract, locationObserverAbstractList, )) self.thread.daemon = True self.thread.start() ## Function Calls Here ### def drive(self, motorAbstract, rangeAbstract, locationObserverAbstractList): self.location = Location(motorAbstract, rangeAbstract, locationObserverAbstractList) #self.location.forward(200) time.sleep(1) self.location.left(20) time.sleep(1) self.location.right(100) self.location.forward(240) self.location.reverse(50)
class Chariot: ### Creates a chariot object but does not start the loop thread. ### To start operation call (Chariot).start() from your Main script. def __init__(self, motorAbstract, rangeAbstract, locationObserverAbstractList, chariotcf , waypoints): self.thread = threading.Thread(target = self.drive, args= (motorAbstract, rangeAbstract, locationObserverAbstractList, )) self.thread.daemon = True self.thread.start() ## Function Calls Here ### def drive(self, motorAbstract, rangeAbstract, locationObserverAbstractList): self.location = Location(motorAbstract, rangeAbstract, locationObserverAbstractList) self.location.forward(200) time.sleep(1) self.location.left(126) time.sleep(1) self.location.right(200)