()
| 477 | |
| 478 | |
| 479 | def main(): |
| 480 | description = "CARLA AD Leaderboard Evaluation: evaluate your Agent in CARLA scenarios\n" |
| 481 | |
| 482 | # general parameters |
| 483 | parser = argparse.ArgumentParser(description=description, formatter_class=RawTextHelpFormatter) |
| 484 | parser.add_argument('--host', default='localhost', |
| 485 | help='IP of the host server (default: localhost)') |
| 486 | parser.add_argument('--port', default='2000', help='TCP port to listen to (default: 2000)') |
| 487 | parser.add_argument('--trafficManagerPort', default='8000', |
| 488 | help='Port to use for the TrafficManager (default: 8000)') |
| 489 | parser.add_argument('--trafficManagerSeed', default='2023', |
| 490 | help='Seed used by the TrafficManager (default: 0)') |
| 491 | parser.add_argument('--init_trafficManagerSeed', default=2023, type=int) |
| 492 | parser.add_argument('--debug', type=int, help='Run with debug output', default=0) |
| 493 | parser.add_argument('--record', type=str, default='', |
| 494 | help='Use CARLA recording feature to create a recording of the scenario') |
| 495 | parser.add_argument('--timeout', default="6000.0", |
| 496 | help='Set the CARLA client timeout value in seconds') |
| 497 | |
| 498 | # simulation setup |
| 499 | parser.add_argument('--routes', |
| 500 | help='Name of the route to be executed. Point to the route_xml_file to be executed.', |
| 501 | required=True) |
| 502 | parser.add_argument('--weather', |
| 503 | type=str, default='none', |
| 504 | help='Name of the weahter to be executed', |
| 505 | ) |
| 506 | parser.add_argument('--scenarios', |
| 507 | help='Name of the scenario annotation file to be mixed with the route.', |
| 508 | required=True) |
| 509 | parser.add_argument('--repetitions', |
| 510 | type=int, |
| 511 | default=1, |
| 512 | help='Number of repetitions per route.') |
| 513 | |
| 514 | # agent-related options |
| 515 | parser.add_argument("-a", "--agent", type=str, help="Path to Agent's py file to evaluate", required=True) |
| 516 | parser.add_argument("--agent-config", type=str, help="Path to Agent's configuration file", default="") |
| 517 | |
| 518 | parser.add_argument("--track", type=str, default='SENSORS', help="Participation track: SENSORS, MAP") |
| 519 | parser.add_argument('--resume', type=str2bool, default=False, help='Resume execution from last checkpoint?') |
| 520 | parser.add_argument('--is_local', type=str2bool, default=False, help='whether in local machine') |
| 521 | parser.add_argument('--is_eval', type=str2bool, default=False, help='whether in eval mode otherwise data collection mode') |
| 522 | |
| 523 | parser.add_argument("--checkpoint", type=str, |
| 524 | default='./simulation_results.json', |
| 525 | help="Path to checkpoint used for saving statistics and resuming") |
| 526 | |
| 527 | arguments = parser.parse_args() |
| 528 | print("init statistics_manager") |
| 529 | statistics_manager = StatisticsManager() |
| 530 | if arguments.is_eval: |
| 531 | os.environ['IS_EVAL'] = "True" |
| 532 | else: |
| 533 | os.environ['IS_EVAL'] = "False" |
| 534 | |
| 535 | if arguments.is_local: |
| 536 | os.environ['IS_LOCAL'] = "True" |
no test coverage detected