This commit is contained in:
16
script/motion/mount.py
Normal file
16
script/motion/mount.py
Normal file
@@ -0,0 +1,16 @@
|
||||
def mount(segment, puck, sample, unmount = False):
|
||||
"""
|
||||
"""
|
||||
cmd = "firstmount" if unmount else "mount"
|
||||
assertValidAddress(segment, puck, sample)
|
||||
|
||||
hexiposi.move(segment)
|
||||
|
||||
img_segment = get_img_cover_pos()
|
||||
if img_segment != segment:
|
||||
raise Excepton ("Image detection of cover does not match hexiposi: " + str(img_segment))
|
||||
|
||||
if type(segment) == str:
|
||||
segment = ord(segment.upper()) - ord('A') +1
|
||||
robot.start_task(cmd,segment, puck, sample)
|
||||
#robot.mount(segment, puck, sample)
|
||||
@@ -68,6 +68,15 @@ def update_tool(tool=None, x_offset=0.0, y_offset=0.0, z_offset=0.0):
|
||||
robot.set_tool_trsf(t, tool)
|
||||
print "Updated " + (str(robot.tool) if (tool is None) else tool) + ": " + str(t)
|
||||
robot.save_program()
|
||||
|
||||
|
||||
|
||||
def assertValidAddress(segment, puck, sample):
|
||||
if type(segment) == str:
|
||||
segment = ord(segment.upper()) - ord('A') +1
|
||||
if segment<=0 or segment >6:
|
||||
raise Excepton ("Invalid segment")
|
||||
if puck<=0 or puck >5:
|
||||
raise Excepton ("Invalid puck")
|
||||
if sample<=0 or sample >16:
|
||||
raise Excepton ("Invalid sample")
|
||||
|
||||
15
script/motion/unmount.py
Normal file
15
script/motion/unmount.py
Normal file
@@ -0,0 +1,15 @@
|
||||
def unmount(segment, puck, sample):
|
||||
"""
|
||||
"""
|
||||
assertValidAddress(segment, puck, sample)
|
||||
|
||||
hexiposi.move(segment)
|
||||
|
||||
img_segment = get_img_cover_pos()
|
||||
if img_segment != segment:
|
||||
raise Excepton ("Image detection of cover does not match hexiposi: " + str(img_segment))
|
||||
|
||||
if type(segment) == str:
|
||||
segment = ord(segment.upper()) - ord('A') +1
|
||||
|
||||
robot.unmount(segment, puck, sample)
|
||||
Reference in New Issue
Block a user