def GET(self, path): if path == 'forward': runRobot.run(1,100,0) message = "Robot moving " + path + "\n" elif path == 'backward': runRobot.run(1,-100,0) message = "Robot moving " + path + "\n" elif path == 'left': runRobot.run(0.75,100,-100) message = "Robot turning " + path + "\n" elif path == 'right': runRobot.run(0.75,100,100) message = "Robot turning " + path + "\n" else: message = "ERROR: Unknown direction \"" + path + "\"\n" return message
def backward(runtime=1, power=-100, turn=0): runRobot.run(runtime, power, turn)
def forward(runtime=1, power=100, turn=0): runRobot.run(runtime, power, turn)
def left(runtime=1, power=-100, turn=0): runRobot.run(runtime=0.75, power=100, turn=-100)
def POST(self): form = self.form() if not form.validates(): return render.new(form) runRobot.run(self.runTime,100,0) raise web.seeother('/runrobot')