def callback(topic, data): msg = lcmutil.decode(lcm_type, data) loop.create_task(self.websocket.send(json.dumps({ 'type': 'lcm_message', 'topic': topic, 'message': lcmutil.lcm_to_dict(msg) })))
def recv_message(type, channel, data): msg = lcmutil.decode(type, data) now = datetime.datetime.now() print('----- {}'.format(now.strftime('%Y-%m-%d %H:%M:%S.%f'))) pprint.pprint(lcmutil.lcm_to_dict(msg)) print()
def callback(topic, data): msg = lcmutil.decode(lcm_type, data) loop.create_task(self._send_subscription(topic, msg, websocket))