Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/safety-analysis.py @ 1130:18e2c8cb9b09
Merged in etienne_beauchamp/trafficintelligence/Etienne-Beauchamp/added-d-optional-argument-1581358671588 (pull request #19)
Etienne Beauchamp/added d optional argument 1581358671588
Approved-by: Nicolas Saunier <[email protected]>
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Tue, 11 Feb 2020 03:47:05 +0000 |
| parents | e257643b1d0e |
| children | 8c0ec7e1eb8e |
comparison
equal
deleted
inserted
replaced
| 1127:94ac9c16420f | 1130:18e2c8cb9b09 |
|---|---|
| 11 # todo: very slow if too many predicted trajectories | 11 # todo: very slow if too many predicted trajectories |
| 12 # add computation of probality of unsucessful evasive action | 12 # add computation of probality of unsucessful evasive action |
| 13 | 13 |
| 14 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') | 14 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') |
| 15 parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file', required = True) | 15 parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file', required = True) |
| 16 parser.add_argument('-d', dest = 'databaseFilename', help = 'name of the Sqlite database file (overrides the configuration file)') | |
| 16 parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to analyse', type = int) | 17 parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to analyse', type = int) |
| 17 # TODO analyze only | 18 # TODO analyze only |
| 18 parser.add_argument('--prediction-method', dest = 'predictionMethod', help = 'prediction method (constant velocity (cvd: vector computation (approximate); cve: equation solving; cv: discrete time (approximate)), normal adaptation, point set prediction)', choices = ['cvd', 'cve', 'cv', 'na', 'ps', 'mp']) | 19 parser.add_argument('--prediction-method', dest = 'predictionMethod', help = 'prediction method (constant velocity (cvd: vector computation (approximate); cve: equation solving; cv: discrete time (approximate)), normal adaptation, point set prediction)', choices = ['cvd', 'cve', 'cv', 'na', 'ps', 'mp']) |
| 19 parser.add_argument('-p', dest = 'prototypeDatabaseFilename', help = 'name of the database containing the prototypes') | 20 parser.add_argument('-p', dest = 'prototypeDatabaseFilename', help = 'name of the database containing the prototypes') |
| 20 parser.add_argument('--no-motion-prediction', dest = 'noMotionPrediction', help = 'does not compute indicators like TTC depending on motion prediction', action = 'store_true') | 21 parser.add_argument('--no-motion-prediction', dest = 'noMotionPrediction', help = 'does not compute indicators like TTC depending on motion prediction', action = 'store_true') |
| 22 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points', action = 'store_true') | 23 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points', action = 'store_true') |
| 23 parser.add_argument('--nthreads', dest = 'nProcesses', help = 'number of processes to run in parallel', type = int, default = 1) | 24 parser.add_argument('--nthreads', dest = 'nProcesses', help = 'number of processes to run in parallel', type = int, default = 1) |
| 24 args = parser.parse_args() | 25 args = parser.parse_args() |
| 25 | 26 |
| 26 params = storage.ProcessParameters(args.configFilename) | 27 params = storage.ProcessParameters(args.configFilename) |
| 28 | |
| 29 # selected database to overide the configuration file | |
| 30 if args.databaseFilename is not None: | |
| 31 params.databaseFilename = args.databaseFilename | |
| 27 | 32 |
| 28 # parameters for prediction methods | 33 # parameters for prediction methods |
| 29 if args.predictionMethod is not None: | 34 if args.predictionMethod is not None: |
| 30 predictionMethod = args.predictionMethod | 35 predictionMethod = args.predictionMethod |
| 31 else: | 36 else: |
