Fix controller crashes with $exec

This commit is contained in:
gac-S_Changer
2018-12-13 16:15:29 +01:00
parent d4813692c5
commit da3bf82cfe
8 changed files with 55 additions and 98 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ def restore_samples_info():
set_samples_info(info)
def get_samples_info(as_json=True):
global samples_info
global samples_info
return json.dumps(to_list(samples_info)) if as_json else samples_info
def has_puck_datamatrix(datamatrix):
+1 -4
View File
@@ -268,10 +268,7 @@ class RobotSC(RobotTCP):
if simulation:
add_device(RobotSC("robot","localhost:1000"),force = True)
else:
#add_device(RobotSC("robot", "129.129.243.120:1000"), force = True)
#add_device(RobotSC("robot", "pcp068129.psi.ch:1000"), force = True)
#add_device(RobotSC("robot", "saresb-cons-06.psi.ch:1000"), force = True)
add_device(RobotSC("robot", "129.129.243.90:1000"), force = True)
add_device(RobotSC("robot", "TellRobot6S:1000"), force = True)
robot.set_default_desc(DESC_DEFAULT)
+23 -2
View File
@@ -382,8 +382,13 @@ class RobotTCP(TcpDevice, Stoppable):
def resume(self):
self.evaluate("restartMove()")
def reset_motion(self, joint=None):
self.evaluate("resetMotion()" if (joint is None) else ("resetMotion(" + joint + ")"))
def reset_motion(self, joint=None, timeout=None):
#TODO: in new robot robot.resetMotion() is freezing controller
#self.evaluate("resetMotion()" if (joint is None) else ("resetMotion(" + joint + ")"))
if joint is None:
self.execute('reset', timeout=timeout)
else:
self.execute('reset', str(joint), timeout=timeout)
def is_empty(self):
self.empty = self.eval_bool("isEmpty()")
@@ -652,6 +657,7 @@ class RobotTCP(TcpDevice, Stoppable):
self.setState(State.Offline)
#Cartesian space
"""
def get_flange_pos(self):
return self.eval_pnt("jointToPoint(" +FLANGE + ", " + self.frame + ", herej())")
@@ -660,6 +666,21 @@ class RobotTCP(TcpDevice, Stoppable):
return self.eval_pnt("jointToPoint(" + self.tool + ", " + self.frame + ", herej())")
#self.set_jnt(self.herej())
#return self.joint_to_point(tool, frame)
"""
#TODO: in new robot robot.evaluate("tcp_p=jointToPoint(tSuna, world, herej())") is freezing controller (cannot cal herej directly)
#We can consider atomic because tcp_j is only accessed in comTcp
def get_flange_pos(self):
self.evaluate("tcp_j=herej(); tcp_p=jointToPoint(" +FLANGE + ", " + self.frame + ", tcp_j)")
return self.get_pnt()
def get_cartesian_pos(self):
self.assert_tool()
self.evaluate("tcp_j=herej(); tcp_p=jointToPoint(" + self.tool + ", " + self.frame + ", tcp_j)")
return self.get_pnt()
#self.set_jnt(self.herej())
#return self.joint_to_point(tool, frame)
def get_cartesian_destination(self):
self.assert_tool()
-31
View File
@@ -2,37 +2,6 @@ LED_LEVEL_ROOM_TEMPERATURE = 0.4
LED_LEVEL_LN2 = 1.0
"""
wago=ch.psi.pshell.modbus.ModbusTCP|wago-mxsc-1:502|||
relays=ch.psi.pshell.modbus.DigitalOutputArray|wago 0 16||1000|
release_local_safety=ch.psi.pshell.modbus.DigitalOutput|wago 0|||
release_psys_safety=ch.psi.pshell.modbus.DigitalOutput|wago 1|||
ln2_main_power=ch.psi.pshell.modbus.DigitalOutput|wago 2|||
rim_heater=ch.psi.pshell.modbus.DigitalOutput|wago 3|||
phase_separator_ln2=ch.psi.pshell.modbus.DigitalOutput|wago 4|||
dewar_ln2=ch.psi.pshell.modbus.DigitalOutput|wago 5|||false
valve_he_chamber=ch.psi.pshell.modbus.DigitalOutput|wago 6|||
gripper_dryer=ch.psi.pshell.modbus.DigitalOutput|wago 7|||
valve_1=ch.psi.pshell.modbus.DigitalOutput|wago 8|||
valve_2=ch.psi.pshell.modbus.DigitalOutput|wago 9|||
valve_3=ch.psi.pshell.modbus.DigitalOutput|wago 10|||
valve_4=ch.psi.pshell.modbus.DigitalOutput|wago 11|||
#spare_do_1=ch.psi.pshell.modbus.DigitalOutput|wago 12|||
#spare_do_2=ch.psi.pshell.modbus.DigitalOutput|wago 13|||
#spare_do_3=ch.psi.pshell.modbus.DigitalOutput|wago 14|||
#spare_do_4=ch.psi.pshell.modbus.DigitalOutput|wago 15|||
phase_separator_level=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 0||1000|
dewar_level=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 1||1000|
rim_heater_temp=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 2||1000|
air_pressure=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 3||1000|
n2_pressure=ch.psi.pshell.modbus.ReadonlyProcessVariable|wago 4||1000|
#spare_ai_1=ch.psi.pshell.modbus.AnalogInput|wago 5|||
#spare_ai_2=ch.psi.pshell.modbus.AnalogInput|wago 6|||
#spare_ai_3=ch.psi.pshell.modbus.AnalogInput|wago 7|||
led_ctrl_1=ch.psi.pshell.modbus.ProcessVariable|wago 0|||
led_ctrl_2=ch.psi.pshell.modbus.ProcessVariable|wago 1|||
led_ctrl_3=ch.psi.pshell.modbus.ProcessVariable|wago 2|||
"""
###################################################################################################
# Leds
###################################################################################################