diff --git a/remote_control/keyboard_controller.py b/remote_control/keyboard_controller.py index 770e8f2..9e47cb7 100644 --- a/remote_control/keyboard_controller.py +++ b/remote_control/keyboard_controller.py @@ -28,27 +28,27 @@ while running: if event.key == pygame.K_LEFT: u1 = -vmax u2 = vmax - print("turn left: ({},{})".format(u1, u2)) + print(f"turn left: ({u1},{u2})") elif event.key == pygame.K_RIGHT: u1 = vmax u2 = -vmax - print("turn right: ({},{})".format(u1, u2)) + print(f"turn right: ({u1},{u2})") elif event.key == pygame.K_UP: u1 = vmax u2 = vmax - print("forward: ({},{})".format(u1, u2)) + print(f"forward: ({u1},{u2})") elif event.key == pygame.K_DOWN: u1 = -vmax u2 = -vmax - print("backward: ({},{})".format(u1, u2)) + print(f"backward: ({u1},{u2})") elif event.key == pygame.K_ESCAPE: print("quit") - running = False + running = False u1 = 0.0 u2 = 0.0 - rc_socket.send('({},{})\n'.format(u1, u2)) + rc_socket.send(f'({u1},{u2})\n'.encode()) elif event.type == pygame.KEYUP: print("key released, resetting: ({},{})".format(u1, u2)) - rc_socket.send('({},{})\n'.format(u1, u2)) + rc_socket.send(f'({u1},{u2})\n'.encode())