[RST-1625] stamped variable synchronizer #39
Merged
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.
Created a helper class that finds the latest common timestamp for a set of stamped variable types.
A bit of background:
In
fuse
, there is a category of plugins called "Publishers". These publishers are provided with (a) a Transaction object consisting of the variable additions and deletions that occurred since the last update, and (b) the full SLAM graph containing all variables. The publisher then uses that information however it wants to generate ROS messages. A publisher could publish just the latest pose, or the full robot path, or even build an occupancy grid.The variable types in
fuse
represent "pieces" of what one might think of as the full state. We have a Position2D variable, an Orientation2D variable, a LinearVelocity2D variable...you get the idea. Because the state is split across multiple variables, it is often necessary to "reassemble" the full state. The StampedVariableSynchronizer is designed for this "reassembly" task. You provide the object with a set of variable types that should all have the same timestamp, and it processes the Transaction and Graph objects to find the latest common timestamp shared by the requested variable types.Because we must reason about an arbitrary number of types, this uses all sorts of annoying and incomprehensible variadic template magic. You're welcome.