comparison scripts/safety-analysis.py @ 939:a2f3f3ca241e

work in progress
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 17 Jul 2017 17:56:52 -0400
parents 063d1267585d
children b1e8453c207c
comparison
equal deleted inserted replaced
938:fbf12382f3f8 939:a2f3f3ca241e
12 12
13 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') 13 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene')
14 parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file', required = True) 14 parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file', required = True)
15 parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to analyse', type = int) 15 parser.add_argument('-n', dest = 'nObjects', help = 'number of objects to analyse', type = int)
16 # TODO analyze only 16 # TODO analyze only
17 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']) 17 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', 'proto'])
18 parser.add_argument('--cfg', dest = 'prototypeDatabaseFilename', help = 'name of the database containing the prototypes')
18 parser.add_argument('--pet', dest = 'computePET', help = 'computes PET', action = 'store_true') 19 parser.add_argument('--pet', dest = 'computePET', help = 'computes PET', action = 'store_true')
19 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points', action = 'store_true') 20 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points', action = 'store_true')
20 parser.add_argument('--nthreads', dest = 'nProcesses', help = 'number of processes to run in parallel', type = int, default = 1) 21 parser.add_argument('--nthreads', dest = 'nProcesses', help = 'number of processes to run in parallel', type = int, default = 1)
21 args = parser.parse_args() 22 args = parser.parse_args()
22 23
45 accelerationDistribution, 46 accelerationDistribution,
46 steeringDistribution, 47 steeringDistribution,
47 params.useFeaturesForPrediction) 48 params.useFeaturesForPrediction)
48 elif predictionMethod == 'ps': 49 elif predictionMethod == 'ps':
49 predictionParameters = prediction.PointSetPredictionParameters(params.maxPredictedSpeed) 50 predictionParameters = prediction.PointSetPredictionParameters(params.maxPredictedSpeed)
51 elif predictionMethod == 'proto':
52 prototypes = storage.loadPrototypesFromSqlite(args.prototypeDatabaseFilename)
53 for p in prototypes:
54 p.getMovingObject().getPositions().computeCumulativeDistances()
50 # no else required, since parameters is required as argument 55 # no else required, since parameters is required as argument
51 56
52 # evasiveActionPredictionParameters = prediction.EvasiveActionPredictionParameters(params.maxPredictedSpeed, 57 # evasiveActionPredictionParameters = prediction.EvasiveActionPredictionParameters(params.maxPredictedSpeed,
53 # params.nPredictedTrajectories, 58 # params.nPredictedTrajectories,
54 # params.minExtremeAcceleration, 59 # params.minExtremeAcceleration,