34 from handlers
import MessageHandler
37 from cStringIO
import StringIO
38 from threading
import Lock
48 for msg_id
in msgs.keys():
49 handlers[msg_id] = MessageHandler(*msgs[msg_id])
50 pkt_counters[msg_id] = 0
56 while not self.finish.is_set():
58 header, pkt_str = self.recv()
59 if header
is not None:
60 handlers[header.id].handle(StringIO(pkt_str), header)
62 except ValueError
as e:
68 if header.id
not in handlers
and header.id
not in pkt_counters:
69 rospy.logwarn(
"No handler for message id %d" % header.id)
72 if header.id
not in bad_pkts:
73 rospy.logwarn(
"Error parsing %s.%d" % header.id)
76 if header.id
not in pkt_counters:
77 pkt_counters[header.id] = 0
79 pkt_counters[header.id] += 1
80 pkt_times[header.id] = header.gps_week_seconds