From f4e23b0b67237617a4214aab8cb9ab0b0a7f1420 Mon Sep 17 00:00:00 2001 From: Olivier R-D Date: Wed, 21 Aug 2013 14:28:44 +0200 Subject: [PATCH] debug changes --- urx/ursecmon.py | 5 +++-- urx/urx.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/urx/ursecmon.py b/urx/ursecmon.py index 592016a..41bd445 100644 --- a/urx/ursecmon.py +++ b/urx/ursecmon.py @@ -277,13 +277,14 @@ class SecondaryMonitor(Thread): returns something that looks like a packet, nothing is guaranted """ while True: - self.logger.debug("data queue size is: {}".format(len(self._dataqueue))) + #self.logger.debug("data queue size is: {}".format(len(self._dataqueue))) ans = self._parser.find_first_packet(self._dataqueue[:]) if ans: self._dataqueue = ans[1] + #self.logger.debug("found packet of size {}".format(len(ans[0]))) return ans[0] else: - self.logger.debug("Could not find packet in received data") + #self.logger.debug("Could not find packet in received data") tmp = self._s_secondary.recv(1024) self._dataqueue += tmp diff --git a/urx/urx.py b/urx/urx.py index f649fc9..b36f290 100644 --- a/urx/urx.py +++ b/urx/urx.py @@ -229,6 +229,7 @@ class URRobot(object): """ # it is important to sleep since robot may takes a while to get into running state, # for a physical move 0.5s is very short + self.logger.debug("Waiting for move completion") for i in range(3): self.secmon.wait() while True: @@ -239,10 +240,11 @@ class URRobot(object): for i in range(0, 6): #Rmq: q_target is an interpolated target we have no control over if abs(jts["q_actual%s"%i] - jts["q_target%s"%i]) > self.joinEpsilon: - #print("Waiting for end move, q_actual is {}, q_target is {}, diff is {}, epsilon is {}".format( jts["q_actual%s"%i], jts["q_target%s"%i] , jts["q_actual%s"%i] - jts["q_target%s"%i], self.radialEpsilon)) + print("Waiting for end move, q_actual is {}, q_target is {}, diff is {}, epsilon is {}".format( jts["q_actual%s"%i], jts["q_target%s"%i] , jts["q_actual%s"%i] - jts["q_target%s"%i], self.radialEpsilon)) finished = False break if finished and not self.secmon.is_program_running(): + self.logger.debug("move has ended") return def getj(self, wait=False):