diff python/prediction.py @ 692:9a258687af4c dev

corrected some errors for ttc
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 29 Jun 2015 23:09:58 -0400
parents 15e244d2a1b5
children ae137e3b1990
line wrap: on
line diff
--- a/python/prediction.py	Mon Jun 29 16:15:04 2015 -0400
+++ b/python/prediction.py	Mon Jun 29 23:09:58 2015 -0400
@@ -321,8 +321,8 @@
         if nProcesses == 1:
             if usePrototypes:
                 firstInstant= next( (x for x in xrange(commonTimeInterval.first,commonTimeInterval.last) if x-obj1.getFirstInstant() >= acceptPartialLength and x-obj2.getFirstInstant() >= acceptPartialLength), commonTimeInterval.last)
-                commonTimeIntervalList1= list(xrange(firstInstant,commonTimeInterval.last-1)) # do not look at the 1 last position/velocities, often with errors
-                commonTimeIntervalList2= list(xrange(firstInstant,commonTimeInterval.last-1,step)) # do not look at the 1 last position/velocities, often with errors
+                commonTimeIntervalList1= range(firstInstant,commonTimeInterval.last-1) # do not look at the 1 last position/velocities, often with errors
+                commonTimeIntervalList2= range(firstInstant,commonTimeInterval.last-1,step) # do not look at the 1 last position/velocities, often with errors
                 for i in commonTimeIntervalList2: 
                     i, cp, cz = self.computeCrossingsCollisionsAtInstant(i, obj1, obj2, collisionDistanceThreshold, timeHorizon, computeCZ, debug,usePrototypes,route1,route2,prototypes,secondStepPrototypes,nMatching,objects,noiseEntryNums,noiseExitNums,minSimilarity,mostMatched,useDestination,useSpeedPrototype)
                     if len(cp) != 0:
@@ -533,19 +533,6 @@
                             crossingZones = [SafetyPoint(intersection, 1., timeInterval1.distance(timeInterval2))]
                     else:
                         collisionPoints = [SafetyPoint(intersection, 1., collisionTimeInterval.center())]
-            # elif computeCZ and (dot1 > 0 or dot2 > 0):
-            #     if dot1 > 0:
-            #         firstUser = obj2 # first through crossingzone
-            #         secondUser = obj1 # second through crossingzone
-            #     elif dot2 > 0:
-            #         firstUser = obj1
-            #         secondUser = obj2
-            #     p2 = secondUser.getPositionAtInstant(currentInstant)
-            #     v2 = secondUser.getVelocityAtInstant(currentInstant)
-            #     indices, intersections = firstUser.getPositions().getLineIntersections(p2, p2+v2)
-            #     if indices is not None:
-            #         pass
-            #     else: # one has to predict !!!
     
         if debug and intersection is not None:
             from matplotlib.pyplot import plot, figure, axis, title