comparison python/moving.py @ 256:dc1faa7287bd

added the normal adaptation class
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Tue, 24 Jul 2012 01:37:21 -0400
parents 13ec22bec5d4
children d90be3c02267
comparison
equal deleted inserted replaced
255:13ec22bec5d4 256:dc1faa7287bd
329 329
330 @staticmethod 330 @staticmethod
331 def load(line1, line2): 331 def load(line1, line2):
332 return Trajectory([[float(n) for n in line1.split(' ')], 332 return Trajectory([[float(n) for n in line1.split(' ')],
333 [float(n) for n in line2.split(' ')]]) 333 [float(n) for n in line2.split(' ')]])
334
335 @staticmethod
336 def fromPointList(points):
337 t = Trajectory()
338 for p in points:
339 t.addPosition(p)
340 return t
334 341
335 def __str__(self): 342 def __str__(self):
336 return ' '.join([self.__getitem__(i).__str__() for i in xrange(self.length())]) 343 return ' '.join([self.__getitem__(i).__str__() for i in xrange(self.length())])
337 344
338 def __repr__(self): 345 def __repr__(self):