Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/safety-analysis.py @ 359:619ae9a9a788
implemented prediction method at constant velocity with direct intersection computation
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Thu, 11 Jul 2013 02:17:12 -0400 |
| parents | e5fe0e6d48a1 |
| children | 91679eb2ff2c |
comparison
equal
deleted
inserted
replaced
| 358:c41ff9f3c263 | 359:619ae9a9a788 |
|---|---|
| 10 # todo: very slow if too many predicted trajectories | 10 # todo: very slow if too many predicted trajectories |
| 11 # add computation of probality of unsucessful evasive action | 11 # add computation of probality of unsucessful evasive action |
| 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') | 14 parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file') |
| 15 parser.add_argument('--prediction-method', dest = 'predictionMethod', help = 'prediction method (constant velocity, normal adaptation, point set prediction)', choices = ['cv', 'na', 'ps']) | 15 parser.add_argument('--prediction-method', dest = 'predictionMethod', help = 'prediction method (constant velocity (vector computation), constant velocity, normal adaptation, point set prediction)', choices = ['cvd', 'cv', 'na', 'ps']) |
| 16 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points') | 16 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points') |
| 17 args = parser.parse_args() | 17 args = parser.parse_args() |
| 18 | 18 |
| 19 params = utils.TrackingParameters() | 19 params = utils.TrackingParameters() |
| 20 params.loadConfigFile(args.configFilename) | 20 params.loadConfigFile(args.configFilename) |
| 23 if args.predictionMethod: | 23 if args.predictionMethod: |
| 24 predictionMethod = args.predictionMethod | 24 predictionMethod = args.predictionMethod |
| 25 else: | 25 else: |
| 26 predictionMethod = params.predictionMethod | 26 predictionMethod = params.predictionMethod |
| 27 | 27 |
| 28 if predictionMethod == 'cv': | 28 if predictionMethod == 'cvd': |
| 29 predictionParameters = prediction.CVDirectPredictionParameters(params.maxPredictedSpeed) | |
| 30 elif predictionMethod == 'cv': | |
| 29 predictionParameters = prediction.ConstantPredictionParameters(params.maxPredictedSpeed) | 31 predictionParameters = prediction.ConstantPredictionParameters(params.maxPredictedSpeed) |
| 30 elif predictionMethod == 'na': | 32 elif predictionMethod == 'na': |
| 31 predictionParameters = prediction.NormalAdaptationPredictionParameters(params.maxPredictedSpeed, | 33 predictionParameters = prediction.NormalAdaptationPredictionParameters(params.maxPredictedSpeed, |
| 32 params.nPredictedTrajectories, | 34 params.nPredictedTrajectories, |
| 33 params.maxAcceleration, | 35 params.maxAcceleration, |
