def lineUp(backBumper, gate): motors.backward(80) time.sleep(0.2) motors.turnRight(80, 180) atWall = False #motors.backwardsUnlimited() <--How go backwards???? ;) while not atWall: if bumper.leftBumped() and not bumper.rightBumped(): omni.stopA() elif not bumper.leftBumped() and bumper.rightBumped(): omni.stopB() elif bumper.leftBumped() and bumper.rightBumped(): time.sleep(1) omni.stopMotors() atWall = True gate.openGate() time.sleep(2.5) gate.closeGate()
import arduino, time, math, omni l = 0.159 W = math.sqrt(0.084914 - 0.466 * l + l * l) sina = 0.175 / W if __name__ == "__main__": ard = arduino.Arduino() omni = omni.Omni(ard) ard.run() omni.turnLeft(80, 90) time.sleep(5) omni.stopMotors() print "lol" ard.stop()