sound.play_file("/home/robot/sounds/Speed up.wav") console.reset_console() leds.animate_flash('GREEN', duration=None, block=False) state = "ready" log.debug("Starting control loop") while ok == True: time = get_time() calculate_control_loop_period() calculate_robot_body_angle_and_speed() calculate_wheel_angle_and_speed() calculate_output_power() drive_motors() check_if_robot_fell_down() state = "fell_over" right_motor.stop() left_motor.stop() leds.animate_stop() leds.reset() leds.animate_flash('RED') console.reset_console() sound.play_file("/home/robot/sounds/Speed down.wav") sleep(3.0) running = False log.info("Terminating Gyro Boy")
return request_auth() user, pwd = decoded.split(b":", 1) try: proc = subprocess.run( ["htpasswd", "-i", "-v", ".htpasswd", user], timeout=1, input=pwd) except subprocess.TimeoutExpired: return request_auth() if proc.returncode != 0: return request_auth() LEDS = Leds() LEDS.all_off() LEDS.reset() move_joystick = None motors = {} old_joystick_left_port = None old_joystick_right_port = None old_motor_1_port = None old_motor_2_port = None class EV3InfoHandler(BasicAuthHandler, tornado.websocket.WebSocketHandler): websockets = set() websockets_lock = Lock() def open(self): with EV3InfoHandler.websockets_lock: