Quickstart
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.
Directories
apollodirectory containes code that are related to controlling Apollo containers and communicating with Apollo’s cyberRT bridge.datadirectory contains HD maps underdata/mapsand DoppelTest will save records todata/records. When violations are detected, you will also see adata/records/summary.csvdescribing violations discovered for each scenario.docsdirectory contains all the documentation source code.frameworkdirectory contains code that are related to genetic representation of the scenario, and actually using those representation to run a scenario.hdmapdirectory 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.modulesdirectory contains Python files compiled from all*.protofiles from Apollo. We use these to parse and construct binary messages because the communication between cyberBridge uses this binary format.utilsdirectory contains all the utility functions, such as logging, managing file storage, etc.
Main scripts
config.pyNote
Please refer to
apollo/modules/common/data/vehicle_param.pb.txtfor size of the vehicle, also remember to updateAPOLLO_ROOTandDT_ROOT!- config.APOLLO_ROOT = 'APOLLO_ROOT_DIR'
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
- config.DT_ROOT = 'DOPPELTEST_ROOT_DIR'
Root directory of DoppelTest
- config.FORCE_INVALID_TRAFFIC_CONTROL = False
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
- Note
you also need to update
apollo/modules/common/data/global_flagfile.txtto 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
- config.PERCEPTION_FREQUENCY = 25
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
- config.USE_SIM_CONTROL_STANDALONE = True
Whether you wish to use extracted SimControl when executing scenario
main_ga.pyA 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.pyA baseline version used for comparison. This version relies on modeling road traffic participants as constant speed obstacles.
main_determinism.pyA 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.pyA modified version of
main_ga.pywith timers added to compute its implementation efficiency.main_random.pyA version DoppelTest with multiple ADS instance and randomly generated chromosomes (i.e., no genetic algorithm).
Test scripts
test_analyzer.pyA test script that runs oracles on the specified record file.
test_liability_checker.pyA test script that tests the implementation of our liability checker.
test_main.pyA test script used for verifying the installation of DoppelTest.