30 #ifndef FILTERS_MEAN_H 31 #define FILTERS_MEAN_H 37 #include <boost/scoped_ptr.hpp> 67 virtual bool update(
const T & data_in, T& data_out);
90 ROS_ERROR(
"MeanFilter did not find param number_of_observations");
105 template <
typename T>
120 for (uint32_t row = 0; row < length; row ++)
133 template <
typename T>
150 virtual bool update(
const std::vector<T> & data_in, std::vector<T>& data_out);
166 template <
typename T>
172 template <
typename T>
178 ROS_ERROR(
"MultiChannelMeanFilter did not find param number_of_observations");
188 template <
typename T>
194 template <
typename T>
220 for (uint32_t row = 0; row < length; row ++)
224 data_out[i] /= length;
231 #endif// FILTERS_MEAN_H uint32_t last_updated_row_
The last row to have been updated by the filter.
A Base filter class to provide a standard interface for all filters.
~MeanFilter()
Destructor to clean up.
boost::scoped_ptr< RealtimeCircularBuffer< std::vector< T > > > data_storage_
Storage for data between updates.
A realtime safe circular (ring) buffer.
virtual bool update(const T &data_in, T &data_out)
Update the filter and return the data seperately.
virtual bool update(const std::vector< T > &data_in, std::vector< T > &data_out)
Update the filter and return the data seperately.
unsigned int number_of_channels_
How many parallel inputs for which the filter is to be configured.
boost::scoped_ptr< RealtimeCircularBuffer< T > > data_storage_
Storage for data between updates.
A mean filter which works on double arrays.
virtual bool configure()
Pure virtual function for the sub class to configure the filter This function must be implemented in ...
~MultiChannelMeanFilter()
Destructor to clean up.
uint32_t last_updated_row_
The last row to have been updated by the filter.
MeanFilter()
Construct the filter with the expected width and height.
uint32_t number_of_observations_
Temporary storage.
MultiChannelMeanFilter()
Construct the filter with the expected width and height.
virtual bool configure()
Pure virtual function for the sub class to configure the filter This function must be implemented in ...
A mean filter which works on doubles.
uint32_t number_of_observations_
Number of observations over which to filter.