From 0912305ca29285abd04fc24eb44ea2538d9b4efa Mon Sep 17 00:00:00 2001 From: yunlongdong Date: Mon, 13 Aug 2018 17:21:24 +0800 Subject: [PATCH] adding rtmon joints velocity get function --- urx/urrtmon.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/urx/urrtmon.py b/urx/urrtmon.py index 3ff825b..9c08133 100644 --- a/urx/urrtmon.py +++ b/urx/urrtmon.py @@ -88,6 +88,16 @@ class URRTMonitor(threading.Thread): return self._qActual 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): """ Get the target joint position vector.""" if wait: @@ -164,6 +174,7 @@ class URRTMonitor(threading.Thread): self._ctrlTimestamp - self._last_ctrl_ts) self._last_ctrl_ts = self._ctrlTimestamp self._qActual = np.array(unp[31:37]) + self._qdActual = np.array(unp[37:43]) self._qTarget = np.array(unp[1:7]) self._tcp_force = np.array(unp[67:73]) self._tcp = np.array(unp[73:79])