MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / main

Function main

PythonAPI/examples/automatic_control.py:632–681  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

630
631
632def main():
633 argparser = argparse.ArgumentParser(
634 description='CARLA Manual Control Client')
635 argparser.add_argument(
636 '-v', '--verbose',
637 action='store_true',
638 dest='debug',
639 help='print debug information')
640 argparser.add_argument(
641 '--host',
642 metavar='H',
643 default='127.0.0.1',
644 help='IP of the host server (default: 127.0.0.1)')
645 argparser.add_argument(
646 '-p', '--port',
647 metavar='P',
648 default=2000,
649 type=int,
650 help='TCP port to listen to (default: 2000)')
651 argparser.add_argument(
652 '--res',
653 metavar='WIDTHxHEIGHT',
654 default='1280x720',
655 help='window resolution (default: 1280x720)')
656 argparser.add_argument(
657 '--filter',
658 metavar='PATTERN',
659 default='vehicle.*',
660 help='actor filter (default: "vehicle.*")')
661 argparser.add_argument("-a", "--agent", type=str,
662 choices=["Roaming", "Basic"],
663 help="select which agent to run",
664 default="Basic")
665 args = argparser.parse_args()
666
667 args.width, args.height = [int(x) for x in args.res.split('x')]
668
669 log_level = logging.DEBUG if args.debug else logging.INFO
670 logging.basicConfig(format='%(levelname)s: %(message)s', level=log_level)
671
672 logging.info('listening to server %s:%s', args.host, args.port)
673
674 print(__doc__)
675
676 try:
677
678 game_loop(args)
679
680 except KeyboardInterrupt:
681 print('\nCancelled by user. Bye!')
682
683
684if __name__ == '__main__':

Callers 1

Calls 1

game_loopFunction · 0.70

Tested by

no test coverage detected