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

Function main

PythonAPI/examples/no_rendering_mode.py:1569–1636  ·  view source on GitHub ↗

Parses the arguments received from commandline and runs the game loop

()

Source from the content-addressed store, hash-verified

1567
1568
1569def main():
1570 """Parses the arguments received from commandline and runs the game loop"""
1571
1572 # Define arguments that will be received and parsed
1573 argparser = argparse.ArgumentParser(
1574 description='CARLA No Rendering Mode Visualizer')
1575 argparser.add_argument(
1576 '-v', '--verbose',
1577 action='store_true',
1578 dest='debug',
1579 help='print debug information')
1580 argparser.add_argument(
1581 '--host',
1582 metavar='H',
1583 default='127.0.0.1',
1584 help='IP of the host server (default: 127.0.0.1)')
1585 argparser.add_argument(
1586 '-p', '--port',
1587 metavar='P',
1588 default=2000,
1589 type=int,
1590 help='TCP port to listen to (default: 2000)')
1591 argparser.add_argument(
1592 '--res',
1593 metavar='WIDTHxHEIGHT',
1594 default='1280x720',
1595 help='window resolution (default: 1280x720)')
1596 argparser.add_argument(
1597 '--filter',
1598 metavar='PATTERN',
1599 default='vehicle.*',
1600 help='actor filter (default: "vehicle.*")')
1601 argparser.add_argument(
1602 '--map',
1603 metavar='TOWN',
1604 default=None,
1605 help='start a new episode at the given TOWN')
1606 argparser.add_argument(
1607 '--no-rendering',
1608 action='store_true',
1609 help='switch off server rendering')
1610 argparser.add_argument(
1611 '--show-triggers',
1612 action='store_true',
1613 help='show trigger boxes of traffic signs')
1614 argparser.add_argument(
1615 '--show-connections',
1616 action='store_true',
1617 help='show waypoint connections')
1618 argparser.add_argument(
1619 '--show-spawn-points',
1620 action='store_true',
1621 help='show recommended spawn points')
1622
1623 # Parse arguments
1624 args = argparser.parse_args()
1625 args.description = argparser.description
1626 args.width, args.height = [int(x) for x in args.res.split('x')]

Callers 1

Calls 1

game_loopFunction · 0.70

Tested by

no test coverage detected