adding rtmon joints velocity get function

This commit is contained in:
yunlongdong 2018-08-13 17:21:24 +08:00 committed by oroulet
parent e1f78ce203
commit 0912305ca2

View File

@ -88,6 +88,16 @@ class URRTMonitor(threading.Thread):
return self._qActual return self._qActual
getActual = q_actual getActual = q_actual
def qd_actual(self, wait=False, timestamp=False):
""" Get the actual joint velocity vector."""
if wait:
self.wait()
with self._dataAccess:
if timestamp:
return self._timestamp, self._qdActual
else:
return self._qdActual
def q_target(self, wait=False, timestamp=False): def q_target(self, wait=False, timestamp=False):
""" Get the target joint position vector.""" """ Get the target joint position vector."""
if wait: if wait:
@ -164,6 +174,7 @@ class URRTMonitor(threading.Thread):
self._ctrlTimestamp - self._last_ctrl_ts) self._ctrlTimestamp - self._last_ctrl_ts)
self._last_ctrl_ts = self._ctrlTimestamp self._last_ctrl_ts = self._ctrlTimestamp
self._qActual = np.array(unp[31:37]) self._qActual = np.array(unp[31:37])
self._qdActual = np.array(unp[37:43])
self._qTarget = np.array(unp[1:7]) self._qTarget = np.array(unp[1:7])
self._tcp_force = np.array(unp[67:73]) self._tcp_force = np.array(unp[67:73])
self._tcp = np.array(unp[73:79]) self._tcp = np.array(unp[73:79])