This commit is contained in:
@@ -23,7 +23,7 @@ class RobotSC(RobotTCP):
|
||||
def __init__(self, name, server, timeout = 1000, retries = 1):
|
||||
RobotTCP.__init__(self, name, server, timeout, retries)
|
||||
self.set_tasks(["getDewar", "putDewar", "putGonio", "getGonio", "robotRecover", "moveDewar", "movePark", "moveGonio","moveHeater", "moveScanner","moveHome"])
|
||||
self.set_known_points(["pPark", "pHome","pDewarHome", "pGonioHome", "pDewarWait", "pGonioGet", "pScanHome", "pHeaterHome", "pHeater", "pHeaterBottom", "pScanStop","pHelium"])
|
||||
self.set_known_points(["pPark", "pGonioHome", "pDewarWait", "pGonioGet", "pScanHome", "pHeaterHome", "pHeater", "pHeaterBottom", "pScanStop","pHelium", "pHome"])
|
||||
self.setPolling(DEFAULT_ROBOT_POLLING)
|
||||
|
||||
def move_dewar(self):
|
||||
@@ -97,7 +97,7 @@ class RobotSC(RobotTCP):
|
||||
def robot_recover(self):
|
||||
self.start_task('robotRecover')
|
||||
self.wait_task_finished(TASK_WAIT_ROBOT_POLLING)
|
||||
self.assert_dewar_home()
|
||||
self.assert_home()
|
||||
|
||||
def toSegmentNumber(self, segment):
|
||||
if is_string(segment):
|
||||
@@ -143,7 +143,7 @@ class RobotSC(RobotTCP):
|
||||
return self.is_in_point("pPark")
|
||||
|
||||
def is_home(self):
|
||||
return self.is_in_point("pDewarHome")
|
||||
return self.is_in_point("pHome")
|
||||
|
||||
def is_dewar(self):
|
||||
return self.is_in_point("pDewarWait")
|
||||
@@ -186,7 +186,7 @@ class RobotSC(RobotTCP):
|
||||
self.assert_in_point("pPark")
|
||||
|
||||
def assert_home(self):
|
||||
self.assert_in_point("pDewarHome")
|
||||
self.assert_in_point("pHome")
|
||||
|
||||
def assert_dewar(self):
|
||||
self.assert_in_point("pDewarWait")
|
||||
|
||||
@@ -138,13 +138,16 @@ def set_air_stream(state):
|
||||
set_heater_chrono = None
|
||||
|
||||
def monitor_heater_time():
|
||||
while get_heater():
|
||||
if set_heater_chrono.isTimeout(MAX_HEATER_TIME):
|
||||
set_heater(False)
|
||||
log("Heater timeout expired: turned off", False)
|
||||
return
|
||||
time.sleep(0.1)
|
||||
|
||||
time.sleep(0.5)
|
||||
try:
|
||||
while get_heater():
|
||||
if set_heater_chrono.isTimeout(MAX_HEATER_TIME):
|
||||
set_heater(False)
|
||||
log("Heater timeout expired: turned off", False)
|
||||
return
|
||||
time.sleep(0.1)
|
||||
except:
|
||||
print sys.exc_info()
|
||||
|
||||
def set_heater(state):
|
||||
"""
|
||||
|
||||
@@ -6,14 +6,14 @@ RECOVER_DESC = "mRecovery"
|
||||
RECOVER_TOOL = TOOL_DEFAULT
|
||||
|
||||
known_segments = [ ("pHome", "pPark", 50), \
|
||||
("pHome", "pDewarHome", 30), \
|
||||
("pHome", "pGonioHome", 30), \
|
||||
("pHome", "pScanHome", 25), \
|
||||
("pHome", "pHeaterHome", 25), \
|
||||
("pDewarHome", "pDewarWait", 10), \
|
||||
("pHome", "pHeaterHome", 75), \
|
||||
("pHome", "pDewarWait", 10), \
|
||||
("pHome", "pHelium", 230), \
|
||||
("pGonioHome", "pGonioGet", 10), \
|
||||
("pHeaterHome", "pHeater", 10), \
|
||||
("pHeater", "pHeaterBottom", 10), \
|
||||
("pPark", "pHeater", 40), \
|
||||
("pHeaterHome", "pHeaterBottom", 10), \
|
||||
]
|
||||
|
||||
def get_dist_to_line(segment):
|
||||
@@ -85,6 +85,7 @@ def get_current_distance():
|
||||
|
||||
|
||||
def move_to_segment(segment):
|
||||
tolerance = segment[2]
|
||||
p = robot.get_cartesian_pos()
|
||||
v = Vector3D(p[0], p[1], p[2])
|
||||
lv = get_pojection_at_line(segment)
|
||||
@@ -103,7 +104,8 @@ def move_to_segment(segment):
|
||||
#Moves to first point of the segment ehich is safer, unless in the vicinity of the second
|
||||
def move_to_safest_point(segment, vicinity_tolerance = 100):
|
||||
d1, d2 = robot.get_distance_to_pnt(segment[0]), robot.get_distance_to_pnt(segment[1])
|
||||
if (d2<=d1) and (d2 <= vicinity_tolerance):
|
||||
#Always moving to primary point
|
||||
if False : #(d2<=d1) and (d2 <= vicinity_tolerance):
|
||||
print "Moving to secondary point " + str(segment[1] + " - d1=" + str(d1) + " d2=" + str(d2) )
|
||||
robot.movel(segment[1], tool=RECOVER_TOOL, desc=RECOVER_DESC, sync=True)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user