00001 00002 00008 #ifndef LMC_FILTER_NODE_H 00009 #define LMC_FILTER_NODE_H 00010 class lpf 00011 { 00012 public: 00013 lpf(); 00014 lpf(double); 00015 void setCutoff(double); 00016 void setInitialPos(double initial_msrmt, int b_idx, int dim); 00017 double filter(const double& new_msrmt, int f_idx, int dim); 00018 double getFilteredMsrmt(int f_idx, int dim); 00019 double c_; // Related to the cutoff frequency of the filter. 00020 // c = 1 results in a cutoff at 1/4 of the sampling rate. 00021 // See bitbucket.org/AndyZe/pid if you want to get more sophisticated. 00022 // Larger c --> trust the filtered data more, trust the measurements less. 00023 private: 00024 double prev_msrmts_ [6][3][3]; 00025 double prev_filtered_msrmts_ [6][3][2]; 00026 }; 00027 #endif /* LMC_FILTER_NODE_H */