def point_keyboard(chassis_command_output, command_lock): delta = .5 x, y, z = 0.0, 0.5, 0 bezier = True getch = _Getch() while True: print 'Press WASD-OL-I or q' next_char = _Getch() while True: k = next_char() command_lock.acquire() if k == 'q': chassis_command_output.send('KILL') return elif k == 'w': chassis_command_output.send( ('POSE', 0, 0, 0, 0, 0, -delta / 4, .25)) elif k == 'd': chassis_command_output.send( ('POSE', 0, 0, 0, 0, delta / 4, 0, .25)) elif k == 's': chassis_command_output.send( ('POSE', 0, 0, 0, 0, 0, delta / 4, .25)) elif k == 'a': chassis_command_output.send( ('POSE', 0, 0, 0, 0, -delta / 4, 0, .25)) elif k == 'o': chassis_command_output.send( ('POSE', 0, 0, delta, 0, 0, 0, .25)) elif k == 'l': chassis_command_output.send( ('POSE', 0, 0, -delta, 0, 0, 0, .25)) command_lock.release()
def move_keyboard(chassis_command_output, command_lock): delta = .5 x_vel, y_vel, r_vel = 0.0, 0.0, 0.0 getch = _Getch() while True: print 'Press WASD-OL-I or q' next_char = _Getch() while True: k = next_char() command_lock.acquire() if k == 'q': chassis_command_output.send('KILL') return elif k == 'w': y_vel += delta chassis_command_output.send(('MOVE', x_vel, y_vel, r_vel)) elif k == 'd': x_vel += delta chassis_command_output.send(('MOVE', x_vel, y_vel, r_vel)) elif k == 's': y_vel -= delta chassis_command_output.send(('MOVE', x_vel, y_vel, r_vel)) elif k == 'a': x_vel -= delta chassis_command_output.send(('MOVE', x_vel, y_vel, r_vel)) elif k == 'o': chassis_command_output.send( ('POSE', 0, 0, delta, 0, 0, 0, .25)) elif k == 'l': chassis_command_output.send( ('POSE', 0, 0, -delta, 0, 0, 0, .25)) command_lock.release()
def point_keyboard(chassis_command_output, command_lock): delta = .5 x, y, z = 0.0, 0.5, 0 bezier = True getch = _Getch() while True: print 'Press WASD-OL-I or q' next_char = _Getch() while True: k = next_char() command_lock.acquire() if k == 'q': chassis_command_output.send('KILL') return elif k == 'w': chassis_command_output.send(('POSE', 0, 0, 0, 0,0,-delta/4,.25)) elif k == 'd': chassis_command_output.send(('POSE', 0, 0, 0, 0,delta/4,0,.25)) elif k == 's': chassis_command_output.send(('POSE', 0, 0, 0, 0,0,delta/4,.25)) elif k == 'a': chassis_command_output.send(('POSE', 0, 0, 0, 0,-delta/4,0,.25)) elif k == 'o': chassis_command_output.send(('POSE', 0, 0, delta, 0,0,0,.25)) elif k == 'l': chassis_command_output.send(('POSE', 0, 0, -delta, 0,0,0,.25)) command_lock.release()
def move_keyboard(chassis_command_output, command_lock): delta = .5 x_vel, y_vel, r_vel = 0.0, 0.0, 0.0 getch = _Getch() while True: print 'Press WASD-OL-I or q' next_char = _Getch() while True: k = next_char() command_lock.acquire() if k == 'q': chassis_command_output.send('KILL') return elif k == 'w': y_vel += delta chassis_command_output.send(('MOVE', x_vel, y_vel, r_vel)) elif k == 'd': x_vel += delta chassis_command_output.send(('MOVE', x_vel, y_vel, r_vel)) elif k == 's': y_vel -= delta chassis_command_output.send(('MOVE', x_vel, y_vel, r_vel)) elif k == 'a': x_vel -= delta chassis_command_output.send(('MOVE', x_vel, y_vel, r_vel)) elif k == 'o': chassis_command_output.send(('POSE', 0, 0, delta, 0,0,0,.25)) elif k == 'l': chassis_command_output.send(('POSE', 0, 0, -delta, 0,0,0,.25)) command_lock.release()
def controller(control_queue): getch = _Getch() while True: print 'Press WASD or q' next_char = _Getch() while True: k = next_char() if k == 'q': control_queue.put(k) return elif k in 'wasdop': control_queue.put(k)
def _get_control_signal(self): print 'Press WASD or q' next_char = _Getch() while True: k = next_char() if k in 'qwasdop': return k