00001 /* 00002 * StandardMassEstimator.hpp 00003 * 00004 * Created on: Oct 27, 2011 00005 * Author: mriedel 00006 */ 00007 00008 #ifndef STANDARDMASSESTIMATION_HPP_ 00009 #define STANDARDMASSESTIMATION_HPP_ 00010 00011 #include <telekyb_defines/telekyb_defines.hpp> 00012 #include <telekyb_base/Options.hpp> 00013 #include <telekyb_base/Filter/IIRFilter.hpp> 00014 00015 // Import Interface 00016 #include <tk_param_estimator/MassEstimator.hpp> 00017 00018 00019 namespace TELEKYB_NAMESPACE { 00020 00021 class StandardMassEstimOptions : public OptionContainer { 00022 public: 00023 Option<double>* tInitialMass; 00024 00025 Option<double>* tAFiltCoeff;/*a*/ 00026 Option<double>* tLambdaZeroGain; 00027 Option<double>* tKappaZeroGain; 00028 Option<double>* tSampleTime; 00029 00030 Option<double>* tMaxMass; 00031 Option<double>* tMinMass; 00032 00033 Option<double>* tGravity; 00034 00035 Option<bool>* tPublishMass; 00036 Option<std::string>* tMassTopic; 00037 00038 StandardMassEstimOptions(); 00039 }; 00040 00041 class StandardMassEstimator : public MassEstimator { 00042 private: 00043 StandardMassEstimOptions options; 00044 00045 ros::Publisher massPub; 00046 00047 double estInvMass; 00048 double estGain; 00049 00050 double integInitialInvMass; 00051 double integInitialGain; 00052 00053 // Filters 00054 IIRFilter* thrustFilter; 00055 IIRFilter* vertVelFilter; 00056 IIRFilter* gravityFilter; 00057 00058 // Integrators 00059 IIRFilter* estInvMassIntegrator; 00060 IIRFilter* estGainIntegrator; 00061 00062 ros::NodeHandle nodeHandle; 00063 00064 public: 00065 StandardMassEstimator(); 00066 virtual ~StandardMassEstimator(); 00067 00068 00069 void initialize(); 00070 void destroy(); 00071 std::string getName() const; 00072 00073 void run(const MassEstimInput& input,MassEstimOutput& output); 00074 00075 double getInitialMass() const; 00076 }; 00077 00078 } 00079 00080 #endif /* STANDARDMASSESTIMATION_HPP_ */