Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
def backward(runtime=1, power=-100, turn=0):
    runRobot.run(runtime, power, turn)
Ejemplo n.º 3
0
def forward(runtime=1, power=100, turn=0):
    runRobot.run(runtime, power, turn)
Ejemplo n.º 4
0
def left(runtime=1, power=-100, turn=0):
    runRobot.run(runtime=0.75, power=100, turn=-100) 
Ejemplo n.º 5
0
 def POST(self):
     form = self.form()
     if not form.validates():
         return render.new(form)
     runRobot.run(self.runTime,100,0)
     raise web.seeother('/runrobot')