diff --git a/script/RobotTCP.py b/script/RobotTCP.py index f2d54cf..ea24afe 100644 --- a/script/RobotTCP.py +++ b/script/RobotTCP.py @@ -74,6 +74,14 @@ class RobotTCP(TcpDevice, Stoppable): def get_arr(self, name, size): return self.execute('get_arr', name, size) + def get_trf(self, name): + return self.execute('get_trf', name) + + def get_jnt(self, name): + return self.execute('get_jnt', name) + + def get_pnt(self, name): + return self.execute('get_pnt', name) def get_int(self): return int(self.get_var("n")) @@ -115,17 +123,7 @@ class RobotTCP(TcpDevice, Stoppable): return self.get_bool(self) - def get_emergency_stop_sts(self): - st = self.eval_int("esStatus()") - if (st== 1): return "active" - if (st== 2): return "activated" - return "off" - - def get_safety_fault_signal(self): - fault = eval_bool("safetyFault(s)") - if (fault): - return get_str("") - + #Robot control def is_powered(self): self.powered = self.eval_bool("isPowered()") @@ -172,6 +170,18 @@ class RobotTCP(TcpDevice, Stoppable): self.working_mode = "invalid" return self.working_mode + def get_emergency_stop_sts(self): + st = self.eval_int("esStatus()") + if (st== 1): return "active" + if (st== 2): return "activated" + return "off" + + def get_safety_fault_signal(self): + fault = eval_bool("safetyFault(s)") + if (fault): + return get_str("") + + #Motion control def stop(self): self.evaluate("stopMove()") @@ -200,7 +210,14 @@ class RobotTCP(TcpDevice, Stoppable): robot_tcp.evaluate("getJointForce(arr)") return robot_tcp.get_float_arr(6) + #Tool + #This function can timeout since it synchronizes move. Better check state before + def open(self, tool): + return self.evaluate("open(" + tool + " )") + #This function can timeout since it synchronizes move. Better check state before + def close(self, tool): + return self.evaluate("close(" + tool + " )") #Updating def update_status(self):