def jog(x, y, z): driveboard.intensity(0) driveboard.feedrate(conf['seekrate']) driveboard.relative() driveboard.move(x, y, z) driveboard.absolute() return '{}'
def control_move(path): print(path) seekrate_ = 6000 feedrate_ = 2000 intensity_ = 100.0 driveboard.absolute() for polyline in path: if len(polyline) > 0: driveboard.feedrate(seekrate_) driveboard.intensity(0.0) driveboard.move(polyline[0][0], polyline[0][1]) if len(polyline) > 1: driveboard.feedrate(feedrate_) driveboard.intensity(intensity_) for i in range(1, len(polyline)): driveboard.move(polyline[i][0], polyline[i][1]) time.sleep(0.08) driveboard.air_off() driveboard.feedrate(seekrate_) driveboard.intensity(0.0) time.sleep(0.1) driveboard.move(0, 0, 0) time.sleep(0.1)
def control(decision): seekrate_ = 6000 driveboard.feedrate(seekrate_) driveboard.intensity(0.0) if decision == "left": driveboard.move(-10.0, 0) time.sleep(0.1) elif decision == "right": driveboard.move(10.0, 0) time.sleep(0.1) elif decision == "top": driveboard.move(0, -10.0) time.sleep(0.1) elif decision == "bot": driveboard.move(0, 10.0) time.sleep(0.1) elif decision == "quit": driveboard.absolute() driveboard.air_off() driveboard.feedrate(seekrate_) driveboard.intensity(0.0) time.sleep(0.1) driveboard.move(0, 0, 0) time.sleep(0.1) elif decision == "run": driveboard.absolute() path = [[[0, 0], [0, 0]], [[30.0, 30.0], [30.0, 60.0], [60.0, 60.0], [60.0, 30.0], [30.0, 30.0]]] driveboard.intensity(0.0) driveboard.air_on() seekrate_ = 6000 feedrate_ = 2000 intensity_ = 100.0 for polyline in path: if len(polyline) > 0: driveboard.feedrate(seekrate_) driveboard.intensity(0.0) driveboard.move(polyline[0][0], polyline[0][1]) if len(polyline) > 1: driveboard.feedrate(feedrate_) driveboard.intensity(intensity_) for i in range(1, len(polyline)): driveboard.move(polyline[i][0], polyline[i][1]) time.sleep(0.08) driveboard.air_off() driveboard.feedrate(seekrate_) driveboard.intensity(0.0) time.sleep(0.1) driveboard.move(0, 0, 0) time.sleep(0.1)
def absolute(): driveboard.absolute() return '{}'
[19.749, 50.426], [21.045, 49.426], [22.389, 48.595], [25.913, 46.995], [29.97, 45.671], [33.861, 44.858], [35.526, 44.716]]] count = 0 # if driveboard.status()['ready']: driveboard.intensity(0.0) driveboard.air_on() seekrate_ = 6000 feedrate_ = 2000 intensity_ = 100.0 driveboard.absolute() for polyline in path: if len(polyline) > 0: driveboard.feedrate(seekrate_) driveboard.intensity(0.0) driveboard.move(polyline[0][0], polyline[0][1]) if len(polyline) > 1: driveboard.feedrate(feedrate_) driveboard.intensity(intensity_) for i in range(1, len(polyline)): driveboard.move(polyline[i][0], polyline[i][1]) count += 1 time.sleep(0.08) driveboard.air_off() driveboard.feedrate(seekrate_)