-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
46 lines (36 loc) · 1.11 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import glob
import os
import subprocess
from setuptools import setup, find_packages, Extension
def make_rule():
path = '/etc/udev/rules.d/99-jetbot-rover.rules'
rule = 'KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE="0666", SYMLINK+="ttyUSB_Rover"'
isRule = False
if os.path.isfile(path):
with open(path) as lines:
for line in lines:
if line==rule:
isRule = True
if isRule==False:
f = open(path, 'w')
f.write(rule)
f.close()
subprocess.call(['systemctl', 'restart', 'systemd-udevd'])
subprocess.call(['usb_modeswitch', '-v', '0x0403', '-p', '0x6015', '--reset-usb'])
def build_libs():
subprocess.call(['cmake', '.'])
subprocess.call(['make'])
make_rule()
build_libs()
setup(
name='jetbot',
version='0.4.0',
description='An open-source robot based on NVIDIA Jetson Nano',
packages=find_packages(),
install_requires=[
'Adafruit_MotorHat',
'Adafruit-SSD1306',
'pyserial',
],
package_data={'jetbot': ['ssd_tensorrt/*.so']},
)