This commit is contained in:
gac-S_Changer
2018-04-30 17:31:42 +02:00
parent cdb602b7c7
commit 5114bfaf3d
14 changed files with 564 additions and 36 deletions

View File

@@ -30,21 +30,20 @@ def move_home():
wait_end_of_move()
def move_to_laser():
robot.reset_motion()
tool = robot.tool
d = robot.get_distance_to_pnt("pLaser")
if d<0:
raise Exception ("Error calculating distance to laser: " + str(d))
if d<POSITION_TOLERANCE:
print "FROM LASER"
robot.reset_motion()
robot.movel("pLaser", robot.tool, DESC_SCAN, sync = True)
return
d = robot.get_distance_to_pnt("pLaserAppro")
d = robot.get_distance_to_pnt("pLaserHome")
if d<0:
raise Exception ("Error calculating distance to laser appro: " + str(d))
if d<POSITION_TOLERANCE:
print "FROM APPRO"
robot.reset_motion()
robot.movel("pLaser", robot.tool, DESC_SCAN, sync = True)
return
d = robot.get_distance_to_pnt("pHome")
@@ -52,8 +51,7 @@ def move_to_laser():
raise Exception ("Error calculating distance to home: " + str(d))
if d<POSITION_TOLERANCE:
print "FROM HOME"
robot.reset_motion()
robot.movel("pLaserAppro", robot.tool, DESC_DEFAULT)
robot.movej("pLaserHome", robot.tool, DESC_DEFAULT)
robot.movel("pLaser", robot.tool, DESC_SCAN, sync = True)
return
raise Exception ("Must be in home position to start move to laser")