# set up pins # shell out to halcmd to net our pins to where they need to go # h = hal.component("python-ui") h.ready() # # connect to LabvCNC # c = labvcnc.command() s = labvcnc.stat() e = labvcnc.error_channel() l = labvcnc_util.LabvCNC(command=c, status=s, error=e) c.state(labvcnc.STATE_ESTOP_RESET) c.state(labvcnc.STATE_ON) c.home(0) c.home(1) c.home(2) l.wait_for_home([1, 1, 1, 0, 0, 0, 0, 0, 0]) c.mode(labvcnc.MODE_MDI) c.mdi("O<obug> call [0]") c.wait_complete() s.poll() if s.position[0] != 0:
assert (joint['homed'] == 0) assert (joint['min_position_limit'] == -40.0) assert (joint['velocity'] == 0.0) def assert_axis_initialized(axis): assert (axis['min_position_limit'] == -40.0) assert (axis['velocity'] == 0.0) assert (axis['max_position_limit'] == 40.0) c = labvcnc.command() s = labvcnc.stat() e = labvcnc.error_channel() l = labvcnc_util.LabvCNC() # Wait for LabvCNC to initialize itself so the Status buffer stabilizes. l.wait_for_labvcnc_startup() print "status at boot up" s.poll() print_status(s) # FIXME: in 2.6.12, acceleration at startup is initialized to 1e99 for some reason #assert(s.acceleration == 0.0) assert (s.active_queue == 0) assert (s.actual_position == (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)) assert (s.adaptive_feed_enabled == False) assert (s.ain == (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,