Exemplo n.º 1
0
def main():
    whill = ComWHILL(port='COM6')

    count = 0
    side = -50
    whill.hold_joy(front=int(0), side=side, timeout=30000)
    while True:
        count += 1
        print(count)
        if count >= 10:
            count = 0
            side *= -1
            print('Reverse turning direction')
            whill.hold_joy(front=int(0), side=side, timeout=30000)
        time.sleep(1)
Exemplo n.º 2
0
#!/usr/bin/env python3

# whill module example package
# Copyright (c) 2018 WHILL, Inc.
# This software is released under the MIT License.

import time
from whill import ComWHILL

whill = ComWHILL(port='COM5')
interval_msec = 1000
interval_sec = interval_msec / 1000

with open('data/2019-08-15-05-41-37.csv', 'r') as f:
    line = f.readline()
    while line:
        joy = list(map(int, line.strip().split(',')))
        print(joy)
        whill.hold_joy(int(joy[0]), int(joy[1]), interval_msec)
        time.sleep(interval_sec)
        line = f.readline()
Exemplo n.º 3
0
#!/usr/bin/env python3

# whill module example package
# Copyright (c) 2018 WHILL, Inc.
# This software is released under the MIT License.

import time
from whill import ComWHILL

whill = ComWHILL(port='COM5')
interval_msec = 1000
interval_sec = interval_msec / 1000

joys = []

with open('data/2019-08-15-04-31-45.csv', 'r') as f:
    line = f.readline()
    while line:
        joy = line.strip().split(',')
        joys.insert(0, joy)
        line = f.readline()

for joy in joys:
    print(joy)
    front = -1 * int(joy[0])
    side = -1 * int(joy[1])
    whill.hold_joy(front, side, interval_msec)
    time.sleep(interval_sec)
Exemplo n.º 4
0
#!/usr/bin/env python3

# whill module example package
# Copyright (c) 2018 WHILL, Inc.
# This software is released under the MIT License.

import time
from whill import ComWHILL

whill = ComWHILL(port='COM5')

whill.hold_joy(int(10), int(0))
# whill.unhold_joy()

# result = whill.send_power_on()
# result = whill.receive_data()
# print(result)

# while True:
#     whill.send_joystick(int(100), int(0))
#     time.sleep(1)

# whill.send_joystick(int(100), int(0))