print("========== Speed Control ==========") print "left motor: ", move_control.speedleft print "right motor: ", move_control.speedright if __name__ == "__main__": print("w/s: direction") print("a/d: steering") print("y/c: rotate") print("q: stops the motors") print("p: print motor speed (L/R)") print("x: exit") run = True move_control = MoveControl() while run: char = getch() if char == "w": move_control.move_foward() elif char == "s": move_control.move_backward() elif char == "a": move_control.move_left() elif char == "d": move_control.move_right() elif char == "y": move_control.rotate_left() elif char == "c":
def move_robot(self, photo): movementalgorithm = "../movementalgorithm/bin/movimentalgorithm" direction = str(commands.getoutput(movementalgorithm + " " + photo.path())) print "direction: " + direction control = MoveControl() control.move(direction)