Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RST-1625] stamped variable synchronizer #39

Merged
merged 3 commits into from Feb 28, 2019

Conversation

svwilliams
Copy link
Contributor

@svwilliams svwilliams commented Feb 28, 2019

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.

Copy link
Contributor

@ayrton04 ayrton04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it was fun.

#include <fuse_core/async_publisher.h>
#include <fuse_core/graph.h>
#include <fuse_core/macros.h>
#include <fuse_core/transaction.h>
#include <fuse_core/uuid.h>
#include <fuse_variables/position_2d_stamped.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New ones aren't alphabetical, if you care.

/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2018, Locus Robotics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2019

@svwilliams svwilliams merged commit a0164e0 into devel Feb 28, 2019
@svwilliams svwilliams deleted the RST-1625-stamped-variable-synchronizer branch February 28, 2019 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants