POSITION_TOLERANCE = 50 def wait_end_of_move(): robot.update() while (not robot.settled) or (not robot.empty) or (not robot.isReady()) : time.sleep(0.01) def move_home(): #robot.reset_motion("jHome") robot.movej("pHome", robot.tool , DESC_SCAN) wait_end_of_move() def move_to_laser(): tool = robot.tool d = robot.get_distance_to_pnt("pLaser") if d<0: raise Exception ("Error calculating distance to laser: " + str(d)) if d