Exemplo n.º 1
0
def reverse():
    PressKey(S)
    ReleaseKey(A)
    ReleaseKey(W)
    ReleaseKey(D)
    time.sleep(0.05)
    ReleaseKey(S)
Exemplo n.º 2
0
def forward_right_v2(time_sleep=0):
    PressKey(W)
    PressKey(D)
    ReleaseKey(A)
    ReleaseKey(S)
    time.sleep(time_sleep)
    ReleaseKey(D)
Exemplo n.º 3
0
def slowing_down():
    PressKey(S)
    ReleaseKey(A)
    ReleaseKey(W)
    ReleaseKey(D)
    time.sleep(0.6)
    ReleaseKey(S)
Exemplo n.º 4
0
def reverse_left():
    PressKey(S)
    PressKey(A)
    time.sleep(0.02)
    ReleaseKey(W)
    ReleaseKey(D)
    ReleaseKey(S)
    ReleaseKey(A)
Exemplo n.º 5
0
def reverse_right():
    PressKey(S)
    PressKey(D)
    time.sleep(0.02)
    ReleaseKey(W)
    ReleaseKey(A)
    ReleaseKey(S)
    ReleaseKey(D)
Exemplo n.º 6
0
def go_hard_left():
    # ReleaseKey(W)
    # ReleaseKey(A)
    # PressKey(D)
    # time.sleep(0.1)
    # ReleaseKey(D)
    ReleaseKey(W)
    ReleaseKey(D)
    PressKey(A)
    time.sleep(0.35)
    ReleaseKey(A)
Exemplo n.º 7
0
def go_hard_right():
    # ReleaseKey(W)
    # ReleaseKey(D)
    # PressKey(A)
    # time.sleep(0.1)
    # ReleaseKey(A)
    ReleaseKey(W)
    ReleaseKey(A)
    PressKey(D)
    time.sleep(0.35)
    ReleaseKey(D)
Exemplo n.º 8
0
def forward_right(steering_angle, car_speed):
    PressKey(D)
    PressKey(W)
    ReleaseKey(A)
    ReleaseKey(S)
    if car_speed > 30 and car_speed < 58:
        PressKey(S)
        ReleaseKey(S)
        if steering_angle < -0.12 or steering_angle > 0.12:
            ReleaseKey(W)
            ReleaseKey(D)
            print("Angle was less -0.12 or more 0.12")
    elif car_speed > 58:
        if steering_angle < -0.08 or steering_angle > 0.08:
            ReleaseKey(D)
            print("Angle was less -0.08 or more 0.08")
    elif steering_angle < -0.16 or steering_angle > 0.16:
        ReleaseKey(W)
        ReleaseKey(D)
        print("Angle was less -0.16 or more 0.16")
Exemplo n.º 9
0
def right_v2(steering_angle=None, car_speed=None):
    PressKey(D)
    ReleaseKey(A)
    ReleaseKey(W)
    ReleaseKey(S)
    if car_speed >= 20.0:
        PressKey(S)
        if steering_angle < -0.30 or steering_angle > 0.30:
            ReleaseKey(D)
        print("slowing down and right")
    elif car_speed > 5 and car_speed < 17:
        if steering_angle < -0.35 or steering_angle > 0.35:
            ReleaseKey(D)
            PressKey(W)
            # ReleaseKey(W)
            print("Angle was more 0.40 or less -0.40")
    elif steering_angle < -0.40 or steering_angle > 0.40:
        ReleaseKey(D)
        print("Angle was more 0.45 or less -0.45")
Exemplo n.º 10
0
def left_v2(steering_angle=None, car_speed=None):
    PressKey(A)
    ReleaseKey(D)
    ReleaseKey(W)
    ReleaseKey(S)
    if car_speed >= 20.0:
        PressKey(S)
        if steering_angle < -0.27 or steering_angle > 0.27:
            ReleaseKey(A)
        print("slowing down and left")
    elif car_speed > 5 and car_speed < 15:
        if steering_angle < -0.40 or steering_angle > 0.40:
            ReleaseKey(A)
            PressKey(W)
            # ReleaseKey(W)
            print("Angle was more 0.40 or less -0.40")
    elif steering_angle < -0.45 or steering_angle > 0.45:
        ReleaseKey(A)
        print("Angle was more 0.45 or less -0.45")
Exemplo n.º 11
0
def reverse():
    PressKey(S)
    ReleaseKey(S)
Exemplo n.º 12
0
def lil_gas():
    PressKey(W)
    time.sleep(0.06)
    ReleaseKey(W)
Exemplo n.º 13
0
def slow_down():
    ReleaseKey(W)
    time.sleep(0.09)
Exemplo n.º 14
0
def go_lil_right():
    ReleaseKey(A)
    PressKey(D)
    time.sleep(0.17)
    ReleaseKey(D)
Exemplo n.º 15
0
def slowing_down_left():
    PressKey(S)
    PressKey(A)
    ReleaseKey(W)
    ReleaseKey(D)
    time.sleep(0.4)
Exemplo n.º 16
0
def slowing_down_right():
    PressKey(S)
    PressKey(D)
    ReleaseKey(W)
    ReleaseKey(A)
    time.sleep(0.4)
Exemplo n.º 17
0
def straight():
    PressKey(W)
    ReleaseKey(A)
    ReleaseKey(D)
    ReleaseKey(S)
    time.sleep(0.13)
Exemplo n.º 18
0
def reverse_right_v2():
    PressKey(S)
    PressKey(D)
    ReleaseKey(W)
    ReleaseKey(A)
Exemplo n.º 19
0
def reverse_left_v2():
    PressKey(S)
    PressKey(A)
    ReleaseKey(W)
    ReleaseKey(D)
Exemplo n.º 20
0
def right():
    PressKey(D)
    ReleaseKey(W)
    ReleaseKey(A)
    ReleaseKey(S)
    time.sleep(0.06)
Exemplo n.º 21
0
def go_left():
    PressKey(A)
    ReleaseKey(W)
    ReleaseKey(D)
    time.sleep(0.24)
    ReleaseKey(A)
Exemplo n.º 22
0
def go_right():
    PressKey(D)
    ReleaseKey(W)
    ReleaseKey(A)
    time.sleep(0.24)
    ReleaseKey(D)
Exemplo n.º 23
0
def straight_v2():
    PressKey(W)
    ReleaseKey(A)
    ReleaseKey(D)
    ReleaseKey(S)
Exemplo n.º 24
0
def no_keys():
    ReleaseKey(A)
    ReleaseKey(S)
    ReleaseKey(D)
    ReleaseKey(W)
Exemplo n.º 25
0
def go_lil_left():
    ReleaseKey(D)
    PressKey(A)
    time.sleep(0.17)
    ReleaseKey(A)
Exemplo n.º 26
0
def go_straight():
    PressKey(W)
    ReleaseKey(A)
    ReleaseKey(D)
    time.sleep(0.2)
    ReleaseKey(W)