Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
fkie_message_filters::combiner_policies::ExactTime< IOs > Class Template Reference

Exact time policy. More...

#include <exact_time.h>

Inheritance diagram for fkie_message_filters::combiner_policies::ExactTime< IOs >:
Inheritance graph
[legend]

Public Member Functions

 ExactTime ()
 Constructor. More...
 
ExactTimeset_max_age (const ros::Duration &max_age) noexcept
 Set maximum age of any data in the queue. More...
 
ExactTimeset_max_queue_size (std::size_t queue_size, const boost::optional< ros::Duration > &max_age=boost::none) noexcept
 Set maximum queue size. More...
 
- Public Member Functions inherited from fkie_message_filters::combiner_policies::PolicyBase< IOs... >
virtual ~PolicyBase ()
 

Protected Member Functions

template<std::size_t N>
void add (std::unique_lock< std::mutex > &, const std::tuple_element_t< N, IncomingTuples > &)
 Input function. More...
 
void reset () noexcept override
 Reset internal state. More...
 
- Protected Member Functions inherited from fkie_message_filters::combiner_policies::PolicyBase< IOs... >
void emit (const OutgoingTuple &out)
 Emit data. More...
 
void set_emitter_callback (const EmitterCB &) noexcept
 Set output function. More...
 

Private Types

using IncomingQueues = std::tuple< std::map< ros::Time, helpers::io_tuple_t< IOs > >... >
 

Private Member Functions

MaybeOutgoingTuples try_assemble_output (const ros::Time &time, bool &complete) noexcept
 

Private Attributes

boost::optional< ros::Durationmax_age_
 
std::size_t max_queue_size_
 
IncomingQueues queues_
 

Friends

template<template< typename... > class, class... >
class fkie_message_filters::Combiner
 

Additional Inherited Members

- Public Types inherited from fkie_message_filters::combiner_policies::PolicyBase< IOs... >
using EmitterCB = std::function< void(const OutgoingTuple &)>
 Callback for assembled outputs. More...
 
using IncomingTuples = std::tuple< helpers::io_tuple_t< IOs >... >
 Tuple type of incoming data tuples. More...
 
using OutgoingTuple = helpers::io_tuple_t< helpers::io_concat_t< IOs... > >
 Combined tuple type for data output. More...
 
- Protected Types inherited from fkie_message_filters::combiner_policies::PolicyBase< IOs... >
using MaybeOutgoingTuples = std::tuple< boost::optional< helpers::io_tuple_t< IOs > >... >
 Tuple of outgoing tuple candidates. More...
 

Detailed Description

template<typename... IOs>
class fkie_message_filters::combiner_policies::ExactTime< IOs >

Exact time policy.

This is a policy for the Combiner class. It will associate data from the connected sources when their ROS header timestamp match exactly. If an input source is not unary, only the first argument of each input will be examined to determine the timestamp. It must have an accessible ROS header, which is determined using the ros::message_traits template.

The policy will discard unmatched data which exceeds configurable age limit or overflows the maximum queue size. The resulting timestamps will be strictly increasing if at least one of the inputs receives messages in correct temporal order. Whenever matched data is emitted, all queued inputs with older timestamps will be discarded.

The filter will not output any data at all if the time lag between two inputs is larger than the maximum permissible age, or if the time lag requires more messages to be buffered than the maximum queue size permits. By default, the filter will buffer arbitrary many messages for at most one second.

Definition at line 50 of file exact_time.h.

Member Typedef Documentation

◆ IncomingQueues

template<typename... IOs>
using fkie_message_filters::combiner_policies::ExactTime< IOs >::IncomingQueues = std::tuple<std::map<ros::Time, helpers::io_tuple_t<IOs> >...>
private

Definition at line 92 of file exact_time.h.

Constructor & Destructor Documentation

◆ ExactTime()

template<typename... IOs>
fkie_message_filters::combiner_policies::ExactTime< IOs >::ExactTime ( )

Constructor.

Definition at line 36 of file exact_time_impl.h.

Member Function Documentation

◆ add()

template<typename... IOs>
template<std::size_t N>
void fkie_message_filters::combiner_policies::ExactTime< IOs >::add ( std::unique_lock< std::mutex > &  lock,
const std::tuple_element_t< N, IncomingTuples > &  in 
)
protected

Input function.

This function will be called by the Combiner class for incoming data.

Definition at line 59 of file exact_time_impl.h.

◆ reset()

template<typename... IOs>
void fkie_message_filters::combiner_policies::ExactTime< IOs >::reset ( )
overrideprotectedvirtualnoexcept

Reset internal state.

This function is called by the Combiner if the filter is reset.

Implements fkie_message_filters::combiner_policies::PolicyBase< IOs... >.

Definition at line 125 of file exact_time_impl.h.

◆ set_max_age()

template<typename... IOs>
ExactTime< IOs... > & fkie_message_filters::combiner_policies::ExactTime< IOs >::set_max_age ( const ros::Duration max_age)
noexcept

Set maximum age of any data in the queue.

This is equivalent to

set_max_queue_size(0, max_age);
  • max_age maximum age

Definition at line 42 of file exact_time_impl.h.

◆ set_max_queue_size()

template<typename... IOs>
ExactTime< IOs... > & fkie_message_filters::combiner_policies::ExactTime< IOs >::set_max_queue_size ( std::size_t  queue_size,
const boost::optional< ros::Duration > &  max_age = boost::none 
)
noexcept

Set maximum queue size.

  • queue_size maximum queue size per slot (zero means unlimited)
  • max_age the maximum age of any data in the queue

Definition at line 50 of file exact_time_impl.h.

◆ try_assemble_output()

template<typename... IOs>
ExactTime< IOs... >::MaybeOutgoingTuples fkie_message_filters::combiner_policies::ExactTime< IOs >::try_assemble_output ( const ros::Time time,
bool &  complete 
)
privatenoexcept

Definition at line 99 of file exact_time_impl.h.

Friends And Related Function Documentation

◆ fkie_message_filters::Combiner

template<typename... IOs>
template<template< typename... > class, class... >
friend class fkie_message_filters::Combiner
friend

Definition at line 53 of file exact_time.h.

Member Data Documentation

◆ max_age_

template<typename... IOs>
boost::optional<ros::Duration> fkie_message_filters::combiner_policies::ExactTime< IOs >::max_age_
private

Definition at line 95 of file exact_time.h.

◆ max_queue_size_

template<typename... IOs>
std::size_t fkie_message_filters::combiner_policies::ExactTime< IOs >::max_queue_size_
private

Definition at line 96 of file exact_time.h.

◆ queues_

template<typename... IOs>
IncomingQueues fkie_message_filters::combiner_policies::ExactTime< IOs >::queues_
private

Definition at line 94 of file exact_time.h.


The documentation for this class was generated from the following files:


fkie_message_filters
Author(s): Timo Röhling
autogenerated on Mon Feb 28 2022 22:21:44