[Issue-300] Handle prior on last stamp #323
Open
+165
−22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in Issue #300, there is a bug in the TimestampManager.
When a Transaction is sent to the TimestampManager, it is expected that the variables involved in that Transaction will be updated to the values predicted by the motion model. This was not happening in the case where the Transaction involved a single timestamp. The code to update the output Transaction with the motion model values was included in the loop that processes timestamp pairs. If there is only one timestamp, then there are zero timestamp pairs and that loop never executes.
This PR first creates a few new unit tests to capture this condition: 0ab7189
Then moves the code block out of the pair handling loop: 9729c83
The code block now exists in its own loop, after all of the involved timestamps have been located. This specific location allows us to reuse lookups into the motion model history.