From c9ff017d8bd1de2e109b3ebc11c8d53219613175 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Wed, 1 Mar 2017 16:36:24 +0100 Subject: [PATCH] Closedown --- .../usrapp/ForceDetection/ForceDetection.dtx | 16 +++---- .../usr/usrapp/ForceDetection/comTcp.pgx | 44 +++++++++---------- script/RobotTCP.py | 40 ++++++++--------- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/robot/MXLAB/Controller1/usr/usrapp/ForceDetection/ForceDetection.dtx b/robot/MXLAB/Controller1/usr/usrapp/ForceDetection/ForceDetection.dtx index 42bd1f6..cac673a 100644 --- a/robot/MXLAB/Controller1/usr/usrapp/ForceDetection/ForceDetection.dtx +++ b/robot/MXLAB/Controller1/usr/usrapp/ForceDetection/ForceDetection.dtx @@ -83,10 +83,10 @@ - - - - + + + + @@ -119,12 +119,12 @@ - - + + - - + + diff --git a/robot/MXLAB/Controller1/usr/usrapp/ForceDetection/comTcp.pgx b/robot/MXLAB/Controller1/usr/usrapp/ForceDetection/comTcp.pgx index 74477df..22bcbbd 100644 --- a/robot/MXLAB/Controller1/usr/usrapp/ForceDetection/comTcp.pgx +++ b/robot/MXLAB/Controller1/usr/usrapp/ForceDetection/comTcp.pgx @@ -163,38 +163,38 @@ break //case "get_str" - // //$exec("s = " + args[0]) TODO: MAKES THE CONTROLLER TO CRASH! + // //$exec("tcp_s = " + args[0]) TODO: MAKES THE CONTROLLER TO CRASH! // //tx = s //break case "get_pnt" - $exec("p = " + args[0]) - tx = tx + toString(".4", p.trsf.x) + "|" - tx = tx + toString(".4", p.trsf.y) + "|" - tx = tx + toString(".4", p.trsf.z) + "|" - tx = tx + toString(".4", p.trsf.rx) + "|" - tx = tx + toString(".4", p.trsf.ry) + "|" - tx = tx + toString(".4", p.trsf.rz) + "|" + $exec("tcp_p = " + args[0]) + tx = tx + toString(".4", tcp_p.trsf.x) + "|" + tx = tx + toString(".4", tcp_p.trsf.y) + "|" + tx = tx + toString(".4", tcp_p.trsf.z) + "|" + tx = tx + toString(".4", tcp_p.trsf.rx) + "|" + tx = tx + toString(".4", tcp_p.trsf.ry) + "|" + tx = tx + toString(".4", tcp_p.trsf.rz) + "|" break case "get_jnt" - $exec("j = " + args[0]) - tx = tx + toString(".4", j.j1) + "|" - tx = tx + toString(".4", j.j2) + "|" - tx = tx + toString(".4", j.j3) + "|" - tx = tx + toString(".4", j.j4) + "|" - tx = tx + toString(".4", j.j5) + "|" - tx = tx + toString(".4", j.j6) + "|" + $exec("tcp_j = " + args[0]) + tx = tx + toString(".4", tcp_j.j1) + "|" + tx = tx + toString(".4", tcp_j.j2) + "|" + tx = tx + toString(".4", tcp_j.j3) + "|" + tx = tx + toString(".4", tcp_j.j4) + "|" + tx = tx + toString(".4", tcp_j.j5) + "|" + tx = tx + toString(".4", tcp_j.j6) + "|" break case "get_trf" - $exec("t = " + args[0]) - tx = tx + toString(".4", t.x) + "|" - tx = tx + toString(".4", t.y) + "|" - tx = tx + toString(".4", t.z) + "|" - tx = tx + toString(".4", t.rx) + "|" - tx = tx + toString(".4", t.ry) + "|" - tx = tx + toString(".4", t.rz) + "|" + $exec("tcp_t = " + args[0]) + tx = tx + toString(".4", tcp_t.x) + "|" + tx = tx + toString(".4", tcp_t.y) + "|" + tx = tx + toString(".4", tcp_t.z) + "|" + tx = tx + toString(".4", tcp_t.rx) + "|" + tx = tx + toString(".4", tcp_t.ry) + "|" + tx = tx + toString(".4", tcp_t.rz) + "|" break case "get_help" diff --git a/script/RobotTCP.py b/script/RobotTCP.py index 3bff3a9..3d07388 100644 --- a/script/RobotTCP.py +++ b/script/RobotTCP.py @@ -75,65 +75,65 @@ class RobotTCP(TcpDevice, Stoppable): def get_arr(self, name, size): return self.execute('get_arr', name, size) - def get_bool(self, name = "b"): + def get_bool(self, name = "tcp_b"): return True if (self.execute('get_bool', name).strip() == '1') else False - def get_int(self, name ="n"): + def get_int(self, name ="tcp_n"): return int(self.get_var(name)) - def get_float(self, name ="n"): + def get_float(self, name ="tcp_n"): return float(self.get_var(name)) - def get_int_arr(self, size, name="arr"): + def get_int_arr(self, size, name="tcp_a"): # not working. A Jython bug in PyUnicaode? - #return [int(x) for x in self.get_arr("arr", size)] + #return [int(x) for x in self.get_arr("tcp_arr", size)] ret = [] a=self.get_arr(name, size) for i in range(size): ret.append(int(a[i])) return ret - def get_float_arr(self, size, name="arr"): - #return [float(x) for x in self.get_arr("arr", size)] + def get_float_arr(self, size, name="tcp_a"): + #return [float(x) for x in self.get_arr("tcp_arr", size)] a=self.get_arr(name, size) ret = []; for i in range(size): ret.append(float(a[i])); return ret - def get_trf(self, name="t"): + def get_trf(self, name="tcp_t"): a = self.execute('get_trf', name) ret = [] for i in range(6): ret.append(float(a[i])) return ret - def set_tr(self, l, name="t"): + def set_tr(self, l, name="tcp_t"): self.evaluate(name + "={" + str(l[0]) + ","+ str(l[1]) + ","+ str(l[2]) + ","+ str(l[3]) + ","+ str(l[4]) + ","+ str(l[5]) + "}") - def get_jnt(self, name="j"): + def get_jnt(self, name="tcp_j"): a = self.execute('get_jnt', name) ret = [] for i in range(6): ret.append(float(a[i])) return ret - def set_jnt(self, l, name="j"): + def set_jnt(self, l, name="tcp_j"): self.evaluate(name + "={" + str(l[0]) + ","+ str(l[1]) + ","+ str(l[2]) + ","+ str(l[3]) + ","+ str(l[4]) + ","+ str(l[5]) + "}") - def get_pnt(self, name="p"): + def get_pnt(self, name="tcp_p"): a = self.execute('get_pnt', name) ret = [] for i in range(6): ret.append(float(a[i])) return ret def eval_int(self, cmd): - self.evaluate("n=" + cmd) + self.evaluate("tcp_n=" + cmd) return self.get_int() def eval_float(self, cmd): - self.evaluate("n=" + cmd) + self.evaluate("tcp_n=" + cmd) return self.get_float() def eval_bool(self, cmd): - self.evaluate("b=" + cmd) + self.evaluate("tcp_b=" + cmd) return self.get_bool() #def eval_str(self, cmd): @@ -141,15 +141,15 @@ class RobotTCP(TcpDevice, Stoppable): # return self.get_str() def eval_jnt(self, cmd): - self.evaluate("j=" + cmd) + self.evaluate("tcp_j=" + cmd) return self.get_jnt() def eval_trf(self, cmd): - self.evaluate("t=" + cmd) + self.evaluate("tcp_t=" + cmd) return self.get_trf() def eval_pnt(self, cmd): - self.evaluate("p=" + cmd) + self.evaluate("tcp_p=" + cmd) return self.get_pnt() @@ -198,8 +198,8 @@ class RobotTCP(TcpDevice, Stoppable): def read_working_mode(self): try: - mode = self.eval_int("workingMode(arr)") - status = int(self.get_var("arr[0]")) + mode = self.eval_int("workingMode(tcp_a)") + status = int(self.get_var("tcp_a[0]")) self._update_working_mode(mode, status) self._update_state() except: