debug changes
This commit is contained in:
		| @@ -277,13 +277,14 @@ class SecondaryMonitor(Thread): | |||||||
|         returns something that looks like a packet, nothing is guaranted |         returns something that looks like a packet, nothing is guaranted | ||||||
|         """ |         """ | ||||||
|         while True: |         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[:]) |             ans = self._parser.find_first_packet(self._dataqueue[:]) | ||||||
|             if ans: |             if ans: | ||||||
|                 self._dataqueue = ans[1] |                 self._dataqueue = ans[1] | ||||||
|  |                 #self.logger.debug("found packet of size {}".format(len(ans[0]))) | ||||||
|                 return ans[0] |                 return ans[0] | ||||||
|             else: |             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) |                 tmp = self._s_secondary.recv(1024) | ||||||
|                 self._dataqueue += tmp |                 self._dataqueue += tmp | ||||||
|  |  | ||||||
|   | |||||||
| @@ -229,6 +229,7 @@ class URRobot(object): | |||||||
|         """ |         """ | ||||||
|         # it is important to sleep since robot may takes a while to get into running state,  |         # 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 |         # for a physical move 0.5s is very short | ||||||
|  |         self.logger.debug("Waiting for move completion") | ||||||
|         for i in range(3): |         for i in range(3): | ||||||
|             self.secmon.wait() |             self.secmon.wait() | ||||||
|         while True: |         while True: | ||||||
| @@ -239,10 +240,11 @@ class URRobot(object): | |||||||
|             for i in range(0, 6): |             for i in range(0, 6): | ||||||
|                 #Rmq: q_target is an interpolated target we have no control over |                 #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: |                 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 |                     finished = False | ||||||
|                     break |                     break | ||||||
|             if finished and not self.secmon.is_program_running(): |             if finished and not self.secmon.is_program_running(): | ||||||
|  |                 self.logger.debug("move has ended") | ||||||
|                 return |                 return | ||||||
|  |  | ||||||
|     def getj(self, wait=False): |     def getj(self, wait=False): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user