Mercurial Hosting > traffic-intelligence
comparison trafficintelligence/moving.py @ 1117:bb58506c1bfd
minor
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Tue, 25 Jun 2019 00:38:56 -0400 |
parents | a3982d591a61 |
children | 58efbe18f102 b358bed29ab4 |
comparison
equal
deleted
inserted
replaced
1116:a3982d591a61 | 1117:bb58506c1bfd |
---|---|
1455 p1 = self.getCurvilinearPositionAtInstant(i) | 1455 p1 = self.getCurvilinearPositionAtInstant(i) |
1456 p2 = self.getCurvilinearPositionAtInstant(i+1) | 1456 p2 = self.getCurvilinearPositionAtInstant(i+1) |
1457 if p1[2] == p2[2]: | 1457 if p1[2] == p2[2]: |
1458 alpha = t-float(i) | 1458 alpha = t-float(i) |
1459 return [(1-alpha)*p1[0]+alpha*p2[0], (1-alpha)*p1[1]+alpha*p2[1], p1[2]] | 1459 return [(1-alpha)*p1[0]+alpha*p2[0], (1-alpha)*p1[1]+alpha*p2[1], p1[2]] |
1460 elif alignments is not None: | 1460 elif alignments is not None: # can be done only if assuming there is no missing alignmentn where the object has no coordinate |
1461 pass # TODO | 1461 pass # TODO |
1462 else: | 1462 else: |
1463 print('Object {} changes lane at {} and alignments are not provided'.format(self.getNum(), t)) | 1463 print('Object {} changes lane at {} and alignments are not provided'.format(self.getNum(), t)) |
1464 else: | 1464 else: |
1465 print('Object {} does not exist at {}'.format(self.getNum(), t)) | 1465 print('Object {} does not exist at {}'.format(self.getNum(), t)) |