diff python/moving.py @ 660:994dd644f6ab

corrected impact of warmUpLastInstant
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 15 May 2015 23:09:49 +0200
parents 784298512b60
children dc70d9e711f5
line wrap: on
line diff
--- a/python/moving.py	Thu May 14 23:18:44 2015 +0200
+++ b/python/moving.py	Fri May 15 23:09:49 2015 +0200
@@ -1081,6 +1081,8 @@
             from numpy import NaN
             if lane is None:
                 plot(list(self.getTimeInterval()), self.curvilinearPositions.positions[0], options, **kwargs)
+                if withOrigin:
+                    plot([self.getFirstInstant()], [self.curvilinearPositions.positions[0][0]], 'ro', **kwargs)
             else:
                 instants = []
                 coords = []
@@ -1092,8 +1094,8 @@
                         instants.append(NaN)
                         coords.append(NaN)
                 plot(instants, coords, options, **kwargs)
-            if withOrigin:
-                plot([self.getFirstInstant()], [self.curvilinearPositions.positions[0][0]], 'ro', **kwargs)
+                if withOrigin and len(instants)>0:
+                    plot([instants[0]], [coords[0]], 'ro', **kwargs)
         else:
             print('Object {} has no curvilinear positions'.format(self.getNum()))