ProcessorMotion KFcallback with recent TimeStamp
I think I found a bug in ProcessorMotion::process()
Consider this case:
A new key frame was created with a TimeStamp
such that is bigger than the TimeStamp
of the last integrated motion, within the time tolerances.
In ProcessorMotion::process()
we will enter to the switch case RUNNING_WITH_PACK_AFTER_ORIGIN
.
Then, before processing the incoming motion capture, the motion buffer in last_
will be split in two parts: the motion previous to the new KF and the motion executed afterwards.
Then, when splitBuffer()
is called, an assertion is not fulfilled returning:
...motion_buffer.cpp:111: void wolf::MotionBuffer::split(const wolf::TimeStamp&, wolf::MotionBuffer&): Assertion `(container_.back().ts_ >= _ts) && "Error: Query time stamp is greater than the buffer's last tick"' failed.
It seems that MotionBuffer::split()
assumes that we always split the buffer in two parts, which in this case is not true.
For sure, if we split the buffer after processing the incoming capture, it should not happen. Since the time tolerance should be lower than half of the time stamp between two captures. However, if the buffer is going to be split, the second part has to be reintegrated. So processing (integrating) the incoming capture would be useless.
It seems that the simplest solution would be ignoring the KF pack in this case. It will be processed in the next call to process()
and we will not have this problem.