33 lines
659 B
Python
33 lines
659 B
Python
def calibrate_tool():
|
|
"""
|
|
"""
|
|
print "calibrate_tool"
|
|
|
|
#Initial checks
|
|
robot.assert_no_task()
|
|
robot.reset_motion()
|
|
robot.wait_ready()
|
|
robot.assert_cleared()
|
|
#robot.assert_in_known_point()
|
|
|
|
#Enabling
|
|
enable_motion()
|
|
|
|
(detected, dm) = move_scanner()
|
|
|
|
if detected:
|
|
print "Pin detected, trashing..."
|
|
trash()
|
|
(detected, dm) = move_scanner()
|
|
if detected:
|
|
raise Exception("Cannot trash pin")
|
|
|
|
robot.open_tool()
|
|
robot.get_calibration_tool()
|
|
|
|
run("calibration/ToolCalibration3")
|
|
|
|
robot.put_calibration_tool()
|
|
|
|
robot.save_program()
|