Skip to content

Instantly share code, notes, and snippets.

@machinekoder
Created April 30, 2015 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machinekoder/d71ec0d8d90f88abeb25 to your computer and use it in GitHub Desktop.
Save machinekoder/d71ec0d8d90f88abeb25 to your computer and use it in GitHub Desktop.
run.py for axis config
#!/usr/bin/python
import sys
import os
import subprocess
import importlib
from machinekit import launcher
from time import *
launcher.register_exit_handler()
launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))
try:
launcher.check_installation() # make sure the Machinekit installation is sane
launcher.cleanup_session() # cleanup a previous session
#launcher.load_bbio_file('myoverlay.bbio') # load a BBB universal overlay
#launcher.install_comp('led_dim.comp') # install a comp HAL component of not already installed
#launcher.install_comp('fake_ext.comp') # install a comp HAL component of not already installed
launcher.start_process("configserver -n Testmachine ~/projects/Cetus ~/projects/Machineface") # start the configserver
launcher.start_process('linuxcnc axis.ini') # start linuxcnc
except subprocess.CalledProcessError:
launcher.end_session()
sys.exit(1)
while True:
sleep(1)
launcher.check_processes()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment