We discuss the overall structure of DoppelTest and describe what each of the main and test scripts does. For more detailed documentation for each of the internal modules, please refer to Internals.


  • apollo directory containes code that are related to controlling Apollo containers and communicating with Apollo’s cyberRT bridge.

  • data directory contains HD maps under data/maps and DoppelTest will save records to data/records. When violations are detected, you will also see a data/records/summary.csv describing violations discovered for each scenario.

  • docs directory contains all the documentation source code.

  • framework directory contains code that are related to genetic representation of the scenario, and actually using those representation to run a scenario.

  • hdmap directory contains code that are related to parsing HD map. HD map typically comes in binary form and you can parse and analyze it using protobuf.

  • modules directory contains Python files compiled from all *.proto files from Apollo. We use these to parse and construct binary messages because the communication between cyberBridge uses this binary format.

  • utils directory contains all the utility functions, such as logging, managing file storage, etc.

Main scripts

  • config.py


    Please refer to apollo/modules/common/data/vehicle_param.pb.txt for size of the vehicle, also remember to update APOLLO_ROOT and DT_ROOT!


    Root directory of Apollo 7.0

    config.APOLLO_VEHICLE_HEIGHT = 1.48

    Height of default Apollo vehicle

    config.APOLLO_VEHICLE_LENGTH = 4.933

    Length of default Apollo vehicle

    config.APOLLO_VEHICLE_WIDTH = 2.11

    Width of default Apollo vehicle

    config.APOLLO_VEHICLE_back_edge_to_center = 1.043

    Length between the back edge and the center of default Apollo vehicle


    Root directory of DoppelTest


    Whether you wish to force invalid traffic cnotrol (e.g., every signal being green)

    config.HD_MAP_PATH = 'DOPPELTEST_ROOT_DIR/data/maps/borregas_ave/base_map.bin'

    The HD map you are currently using


    you also need to update apollo/modules/common/data/global_flagfile.txt to match the HD map you are using

    config.INSTANCE_MAX_WAIT_TIME = 15

    The maximum time before the last ADS instance starts moving

    config.LOG_DIR = 'DOPPELTEST_ROOT_DIR/data/Logs'

    Desired directory to save log files

    config.MAX_ADC_COUNT = 5

    Number of ADS instances you wish to run simultaneously

    config.MAX_PD_COUNT = 5

    Number of pedestrians you wish to include in simulations


    Rate at which the Message Broker publishes perception messages

    config.RECORDS_DIR = 'DOPPELTEST_ROOT_DIR/data/records'

    Desired directory to save record files

    config.RUN_FOR_HOUR = 12

    Number of hours you wish to run

    config.SCENARIO_UPPER_LIMIT = 30

    The length of each scenario (in seconds)

    config.STREAM_LOGGING_LEVEL = 20

    Global logging level


    Whether you wish to use extracted SimControl when executing scenario

  • main_ga.py

    A version of DoppelTest with multiple ADS instances and genetic algorithm. Please refer to our main paper in Publication for details with regard to the genetic algorithm implemented.

  • main_baseline.py

    A baseline version used for comparison. This version relies on modeling road traffic participants as constant speed obstacles.

  • main_determinism.py

    A script that helps to determine whether a scenario generated from a chromosome always results in the same set of violations or not.

  • main_ga_performance.py

    A modified version of main_ga.py with timers added to compute its implementation efficiency.

  • main_random.py

    A version DoppelTest with multiple ADS instance and randomly generated chromosomes (i.e., no genetic algorithm).

Test scripts

  • test_analyzer.py

    A test script that runs oracles on the specified record file.

  • test_liability_checker.py

    A test script that tests the implementation of our liability checker.

  • test_main.py

    A test script used for verifying the installation of DoppelTest.