diff 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
line wrap: on
line diff
--- a/scripts/safety-analysis.py	Thu Jul 11 00:17:25 2013 -0400
+++ b/scripts/safety-analysis.py	Thu Jul 11 02:17:12 2013 -0400
@@ -12,7 +12,7 @@
 
 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene')
 parser.add_argument('--cfg', dest = 'configFilename', help = 'name of the configuration file')
-parser.add_argument('--prediction-method', dest = 'predictionMethod', help = 'prediction method (constant velocity, normal adaptation, point set prediction)', choices = ['cv', 'na', 'ps'])
+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'])
 parser.add_argument('--display-cp', dest = 'displayCollisionPoints', help = 'display collision points')
 args = parser.parse_args()
 
@@ -25,7 +25,9 @@
 else:
     predictionMethod = params.predictionMethod
 
-if predictionMethod == 'cv':
+if predictionMethod == 'cvd':
+    predictionParameters = prediction.CVDirectPredictionParameters(params.maxPredictedSpeed)
+elif predictionMethod == 'cv':
     predictionParameters = prediction.ConstantPredictionParameters(params.maxPredictedSpeed)
 elif predictionMethod == 'na':
     predictionParameters = prediction.NormalAdaptationPredictionParameters(params.maxPredictedSpeed,