filter.cc
Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2011 Austin Robot Technology
00003  *  License: Modified BSD Software License Agreement
00004  * 
00005  *  $Id: accel.h 1539 2011-05-09 04:09:20Z jack.oquin $
00006  */
00007 
00016 #include <filters/realtime_circular_buffer.h>
00017 #include <art_observers/filter.h>
00018 
00019 MedianFilter::MedianFilter() 
00020 {
00021   number_of_observations_ = 5;
00022 }
00023 
00024 MedianFilter::~MedianFilter() 
00025 {
00026 }
00027 
00028 bool MedianFilter::configure() 
00029 {
00030   // Hack to overwrite configure for the median filter
00031   configured_=true; 
00032   data_storage_.reset( new filters::RealtimeCircularBuffer<float >(number_of_observations_, temp));
00033   temp_storage_.resize(number_of_observations_);
00034   return true;
00035 };
00036 
00037 bool MedianFilter::isFull() 
00038 {
00039   if (data_storage_->size() == number_of_observations_)
00040     return true;
00041   else
00042     return false;
00043 }
00044 
00045 // -------------------------
00046 
00047 MeanFilter::MeanFilter() 
00048 {
00049   number_of_observations_ = 5;
00050 }
00051 
00052 MeanFilter::~MeanFilter() 
00053 {
00054 }
00055 
00056 bool MeanFilter::configure() 
00057 {
00058   // Hack to overwrite configure for the mean filter
00059   configured_=true; 
00060   data_storage_.reset(new filters::RealtimeCircularBuffer<float>(number_of_observations_, temp_));
00061   return true;
00062 };
00063 
00064 bool MeanFilter::isFull() 
00065 {
00066   if (data_storage_->size() == number_of_observations_)
00067     return true;
00068   else
00069     return false;
00070 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


art_observers
Author(s): Michael Quinlan, Jack O'Quin, Corbyn Salisbury
autogenerated on Tue Sep 24 2013 10:43:43