Closedown

This commit is contained in:
gac-S_Changer
2017-03-01 15:30:04 +01:00
parent 0ba95fd137
commit 5aa71d13fe
4 changed files with 56 additions and 10 deletions

View File

@@ -18,6 +18,7 @@ class RobotTCP(TcpDevice, Stoppable):
self.working_mode = None
self.status = None
self.lock = threading.Lock()
self.joint_forces = None
def _sendReceive(self, msg_id, msg = "", timeout = None):
tx = self.header if (self.header != None) else ""
@@ -244,9 +245,14 @@ class RobotTCP(TcpDevice, Stoppable):
def set_move_id(self, id):
return self.evaluate("setMoveId(" + str(id) + " )")
def get_joint_forces(self):
self.evaluate("getJointForce(arr)")
return self.get_float_arr(6)
def get_joint_forces(self):
try:
self.evaluate("getJointForce(arr)")
self.joint_forces = self.get_float_arr(6)
return self.joint_forces
excepr:
return self.joint_forces = None
raise
def movej(self, joint_or_point, tool, desc):
return self.eval_int("movej(" + joint_or_point + ", " + tool + ", " + desc +")")