# HG changeset patch # User Nicolas Saunier # Date 1394645814 14400 # Node ID a8f95bbd79bcf80c1a80f7dfa3d93e68440efb40 # Parent a84b9ba9631fbe0d99f9c0ae4a1229be2ff92df6# Parent 7d2310f6451126715bb60a6e9cd3d745f6218914 merge done diff -r 7d2310f64511 -r a8f95bbd79bc python/prediction.py --- a/python/prediction.py Thu Mar 06 15:01:33 2014 -0500 +++ b/python/prediction.py Wed Mar 12 13:36:54 2014 -0400 @@ -66,6 +66,15 @@ self.predictedPositions = {0: initialPosition} self.predictedSpeedOrientations = {0: moving.NormAngle.fromPoint(initialVelocity)} + def predictPosition(self, nTimeSteps): + if nTimeSteps > 0 and not nTimeSteps in self.predictedPositions.keys(): + if constantSpeed: + # calculate cumulative distance + pass + else: # see c++ code, calculate ratio + pass + return self.predictedPositions[nTimeSteps] + class PredictedTrajectoryRandomControl(PredictedTrajectory): '''Random vehicle control: suitable for normal adaptation''' def __init__(self, initialPosition, initialVelocity, accelerationDistribution, steeringDistribution, probability = 1., maxSpeed = None):