21 #ifndef INCLUDE_FKIE_MESSAGE_FILTERS_COMBINER_POLICIES_APPROXIMATE_TIME_H_ 22 #define INCLUDE_FKIE_MESSAGE_FILTERS_COMBINER_POLICIES_APPROXIMATE_TIME_H_ 31 namespace combiner_policies
81 template<
typename... IOs>
139 template<std::
size_t N>
140 void add(std::unique_lock<std::mutex>&,
const std::tuple_element_t<N, IncomingTuples>&);
141 void reset() noexcept override;
147 template<
std::
size_t N>
150 template<
std::
size_t N>
152 template<
std::
size_t N>
173 #include "approximate_time_impl.h" void prune_queue_at(std::size_t queue_size) noexcept
static constexpr std::size_t NUM_SLOTS
std::size_t max_queue_size_
Base class for combiner policies.
void discard_expired_at(const ros::Time &cutoff) noexcept
bool can_still_improve_at() noexcept
std::tuple< helpers::io_tuple_t< IOs >... > IncomingTuples
Tuple type of incoming data tuples.
boost::optional< ros::Duration > max_age_
void drop_pivot() noexcept
ApproximateTime & set_min_distance(std::size_t i, const ros::Duration &min_dist) noexcept
Set the minimum distance between consecutive messages on a source.
std::function< void(const OutgoingTuple &)> EmitterCB
Callback for assembled outputs.
ApproximateTime & set_max_queue_size(std::size_t queue_size, const boost::optional< ros::Duration > &max_age=boost::none) noexcept
Set maximum queue size.
boost::optional< ros::Duration > max_delta_
void add(std::unique_lock< std::mutex > &, const std::tuple_element_t< N, IncomingTuples > &)
Input function.
ApproximateTime & set_max_age(const ros::Duration &max_age) noexcept
Set maximum age of any data in the queue.
static constexpr std::size_t UNSET
std::array< ros::Duration, NUM_SLOTS > min_dist_
ApproximateTime & set_max_timespan(const ros::Duration &max_delta) noexcept
Set maximum permissible timestamp difference of matched messages.
ros::Duration heads_timespan() noexcept
bool determine_pivot() noexcept
ApproximateTime()
Constructor.
std::tuple< boost::optional< helpers::io_tuple_t< IOs > >... > MaybeOutgoingTuples
Tuple of outgoing tuple candidates.
ros::Duration pivot_timedelta(const ros::Time &ts) noexcept
helpers::io_tuple_t< helpers::io_concat_t< IOs... > > OutgoingTuple
Combined tuple type for data output.
void reset() noexcept override
Reset internal state.
std::tuple< std::deque< helpers::io_tuple_t< IOs > >... > IncomingQueues
void discard_expired(const ros::Time &cutoff) noexcept
typename io_tuple< IO >::type io_tuple_t
MaybeOutgoingTuples heads_
Combine multiple sources into a single one.
bool can_still_improve() noexcept
void emit_heads(std::unique_lock< std::mutex > &)