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