"exceed distance_upper_bound" error

Hello,
while playing movements with MovePlayer, when calling method move_player.start(), I got this error:

Exception in thread Thread-144:
Traceback (most recent call last):
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py”, line 810, in __bootstrap_inner
self.run()
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py”, line 763, in run
self.__target(*self.__args, **self.__kwargs)
File “/Library/Python/2.7/site-packages/pypot/utils/stoppablethread.py”, line 119, in _wrapped_target
self._target()
File “/Library/Python/2.7/site-packages/pypot/primitive/primitive.py”, line 75, in _prim_run
self.run()
File “/Library/Python/2.7/site-packages/pypot/primitive/primitive.py”, line 163, in run
make_update_loop(self, self._wrapped_update)
File “/Library/Python/2.7/site-packages/pypot/utils/stoppablethread.py”, line 152, in make_update_loop
update_func()
File “/Library/Python/2.7/site-packages/pypot/primitive/primitive.py”, line 168, in _wrapped_update
self.update()
File “/Library/Python/2.7/site-packages/pypot/primitive/move.py”, line 163, in update
position = self.positions[self.elapsed_time * self.play_speed]
File “/Library/Python/2.7/site-packages/pypot/utils/interpolation.py”, line 31, in getitem
return super(KDTreeDict, self).getitem(key)
File “/Library/Python/2.7/site-packages/pypot/utils/interpolation.py”, line 107, in missing
return self.interpolate_motor_positions(key, self.nearest_keys(key))
File “/Library/Python/2.7/site-packages/pypot/utils/interpolation.py”, line 77, in interpolate_motor_positions
input_key, self.distance_upper_bound))
KeyError: ‘key -182.517166138 exceed distance_upper_bound 0.2’

Would you have an idea what this error comes from?

The MovePlayer is a dict which take a timestamp as a key and return the targeted positions for each motors. As the OS is not realtime, the timestamp may vary a lot from the 50Hz sampling ; the dict operate a linear interpolation (on the position) between the two nearest recorded points.

If the key (timestamp) is 0.2s after the last recorded point, it consider that it is not normal and rase this KeyError.
The key -182.517166138 is negative … something very odd my have occurs somewhere between the record of your file. You can edit it by hand to fix that key.

thanks for the explanation!