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

Function main

PythonAPI/examples/manual_control_steeringwheel.py:810–859  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

808
809
810def main():
811 argparser = argparse.ArgumentParser(
812 description='CARLA Manual Control Client')
813 argparser.add_argument(
814 '-v', '--verbose',
815 action='store_true',
816 dest='debug',
817 help='print debug information')
818 argparser.add_argument(
819 '--host',
820 metavar='H',
821 default='127.0.0.1',
822 help='IP of the host server (default: 127.0.0.1)')
823 argparser.add_argument(
824 '-p', '--port',
825 metavar='P',
826 default=2000,
827 type=int,
828 help='TCP port to listen to (default: 2000)')
829 argparser.add_argument(
830 '-a', '--autopilot',
831 action='store_true',
832 help='enable autopilot')
833 argparser.add_argument(
834 '--res',
835 metavar='WIDTHxHEIGHT',
836 default='1280x720',
837 help='window resolution (default: 1280x720)')
838 argparser.add_argument(
839 '--filter',
840 metavar='PATTERN',
841 default='vehicle.*',
842 help='actor filter (default: "vehicle.*")')
843 args = argparser.parse_args()
844
845 args.width, args.height = [int(x) for x in args.res.split('x')]
846
847 log_level = logging.DEBUG if args.debug else logging.INFO
848 logging.basicConfig(format='%(levelname)s: %(message)s', level=log_level)
849
850 logging.info('listening to server %s:%s', args.host, args.port)
851
852 print(__doc__)
853
854 try:
855
856 game_loop(args)
857
858 except KeyboardInterrupt:
859 print('\nCancelled by user. Bye!')
860
861
862if __name__ == '__main__':

Callers 1

Calls 1

game_loopFunction · 0.70

Tested by

no test coverage detected