-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
executable file
·37 lines (29 loc) · 973 Bytes
/
run.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
#!/usr/bin/env python
import sys
import os
import subprocess
import time
from machinekit import launcher
from machinekit import config
launcher.register_exit_handler()
#launcher.set_debug_level(9)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
launcher.set_machinekit_ini(config.MACHINEKIT_INI)
try:
launcher.check_installation()
launcher.cleanup_session()
launcher.register_exit_handler() # needs to executed after HAL files
launcher.load_bbio_file('bebopr_cape.bbio')
nc_path = os.path.expanduser('~/nc_files')
if not os.path.exists(nc_path):
os.mkdir(nc_path)
launcher.ensure_mklauncher() # ensure mklauncher is started
launcher.start_process("configserver -n 'Arcus-3D-P1' ~/Machineface")
launcher.start_process('machinekit arcus-3d-p1.ini')
while True:
launcher.check_processes()
time.sleep(1)
except subprocess.CalledProcessError:
launcher.end_session()
sys.exit(1)
sys.exit(0)