def replay(fspec): pkts = load_engine_pkts(fspec) pycozmo.setup_basic_logging(log_level="DEBUG", protocol_log_level="DEBUG") cli = pycozmo.Client() cli.start() cli.connect() cli.wait_for_robot() for i, pkt in enumerate(pkts): input() print("{}".format(i)) cli.send(pkt) cli.disconnect() time.sleep(1)
def replay(self, fspec): self.load_engine_pkts(fspec) pycozmo.setup_basic_logging(log_level="DEBUG", protocol_log_level="DEBUG") cli = pycozmo.Client(protocol_log_messages=self.log_messages) cli.start() cli.connect() cli.wait_for_robot() try: for i, v in enumerate(self.pkts): # if i < 1113: # continue ts, pkt = v if self.packet_id_filter.filter(pkt.id): continue input() print("{}, time={:.06f}".format(i, ts - self.first_ts)) cli.conn.send(pkt) except KeyboardInterrupt: pass cli.disconnect() time.sleep(1)
def setUpClass(cls): pycozmo.setup_basic_logging(log_level="DEBUG", protocol_log_level="DEBUG")
import time import pycozmo pycozmo.setup_basic_logging(log_level="DEBUG", protocol_log_level="DEBUG") conn = pycozmo.conn.Connection(server=True) conn.start() while True: try: time.sleep(0.1) except KeyboardInterrupt: break conn.stop()