This commit is contained in:
gac-S_Changer
2019-01-21 14:36:44 +01:00
parent 8836a36512
commit 0871ae0dec
16 changed files with 47 additions and 36 deletions
+2 -6
View File
@@ -90,11 +90,6 @@ class RobotSC(RobotTCP):
self.wait_task_finished(TASK_WAIT_ROBOT_POLLING)
self.assert_scanner()
def move_scanner(self):
self.start_task('moveScanner')
self.wait_task_finished(TASK_WAIT_ROBOT_POLLING)
self.assert_scanner()
#def do_scan(self):
# self.start_task('doScan')
# self.wait_task_finished(TASK_WAIT_ROBOT_POLLING)
@@ -271,11 +266,12 @@ else:
add_device(RobotSC("robot", "TellRobot6S:1000"), force = True)
#robot.latency = 0.005
robot.set_default_desc(DESC_DEFAULT)
robot.default_speed = 20
robot.set_frame(FRAME_DEFAULT)
robot.set_tool(TOOL_DEFAULT)
robot.setPolling(DEFAULT_ROBOT_POLLING)
robot.setPolling(DEFAULT_ROBOT_POLLING)
robot.get_current_point() #TODO: REMOVE WHEN CURRENT POINT REPORTED BY POLLING MESSAGE
+19 -4
View File
@@ -47,7 +47,9 @@ class RobotTCP(TcpDevice, Stoppable):
self.polling_interval = 0.01
self.reset = True
self.default_tolerance = 5
self.default_speed = 100
self.default_speed = 100
self.latency = 0
self.last_msg_timestamp = 0
self.task_start_retries = 3
self.exception_on_task_start_failure = True #Tasks may start and be finished when checked
@@ -135,6 +137,10 @@ class RobotTCP(TcpDevice, Stoppable):
raise Exception ("Robot not in known point")
def _sendReceive(self, msg_id, msg = "", timeout = None):
if self.latency >0:
timespan = time.time() - self.last_msg_timestamp
if timespan<self.latency:
time.sleep(self.latency-timespan)
tx = self.header if (self.header != None) else ""
tx = tx + msg_id + " " + msg
if (len(tx)>150):
@@ -144,6 +150,7 @@ class RobotTCP(TcpDevice, Stoppable):
if self.isSimulated():
return ""
rx = self.sendReceive(tx, msg_id, self.trailer , 0, self.timeout if timeout is None else timeout, self.retries)
self.last_msg_timestamp = time.time()
rx=rx[:-1] #Remove 0A
self.getLogger().finer("RX = '" + str(rx) + "'")
if rx[:3] != msg_id:
@@ -547,8 +554,10 @@ class RobotTCP(TcpDevice, Stoppable):
if self.get_task_status(name)[0] != -1:
raise Exception("Task already exists: " + name)
#taskCreate "t1", 10, read(sMessage)
cmd = 'taskCreate "' + name + '", ' + str(priority) + ', ' + program + '('
if priority<1 or priority > 100:
raise Exception("Invalid priority: " + str(priority))
cmd = program + '('
for i in range(len(args)):
val = args[i]
if type(val) == bool:
@@ -556,7 +565,13 @@ class RobotTCP(TcpDevice, Stoppable):
elif val == False: val = "false"
cmd += str(val) + (',' if (i<(len(args)-1)) else '')
cmd+=')'
self.evaluate(cmd)
#TODO: in new robot exec taskCreate is freezing controller
#REMOVE if bug is fixed
self.execute('task_create',name, str(priority), program, *args)
#self.evaluate('taskCreate "' + name + '", ' + str(priority) + ', ' + cmd)
def task_suspend(self, name):
self.evaluate('taskSuspend("' + str(name)+ '")')
+1 -1
View File
@@ -93,7 +93,7 @@ def release_psys():
###################################################################################################
# Drier
###################################################################################################
MAX_HEATER_TIME = 60000
MAX_HEATER_TIME = 70000
def set_air_stream(state):
"""
+1 -1
View File
@@ -1,6 +1,6 @@
def dry(heat_time=30.0, speed=0.5, wait_cold = 30.0):
def dry(heat_time=40.0, speed=0.4, wait_cold = 30.0):
"""
heat_time (float): in seconds
speed (float): % of nominal speed
+3 -3
View File
@@ -5,10 +5,10 @@ import org.apache.commons.math3.geometry.euclidean.threed.Line as Line3D
RECOVER_DESC = "mRecovery"
RECOVER_TOOL = TOOL_DEFAULT
known_segments = [ ("pHome", "pPark", 100), \
("pScan", "pGonioA", 80), \
known_segments = [ ("pHome", "pPark", 60), \
("pScan", "pGonioA", 100), \
("pPark", "pScan", 25), \
("pScan", "pHeater", 75), \
("pScan", "pHeater", 50), \
("pHome", "pDewar", 10), \
("pGonioA", "pGonioG", 10), \
("pHeater", "pHeatB", 10), \