30 #ifndef CORELIB_SRC_IMUFILTER_COMPLEMENTARYFILTER_H_ 31 #define CORELIB_SRC_IMUFILTER_COMPLEMENTARYFILTER_H_ 65 virtual void getOrientation(
double & qx,
double & qy,
double & qz,
double & qw)
const;
66 virtual void reset(
double qx = 0.0,
double qy = 0.0,
double qz = 0.0,
double qw = 1.0);
73 double gx,
double gy,
double gz,
74 double ax,
double ay,
double az,
111 double wx,
double wy,
double wz);
113 bool checkState(
double ax,
double ay,
double az,
114 double wx,
double wy,
double wz)
const;
117 double wx,
double wy,
double wz,
double dt,
118 double& q0_pred,
double& q1_pred,
double& q2_pred,
double& q3_pred)
const;
121 double ax,
double ay,
double az,
122 double& q0_meas,
double& q1_meas,
double& q2_meas,
double& q3_meas);
125 double ax,
double ay,
double az,
126 double mx,
double my,
double mz,
127 double& q0_meas,
double& q1_meas,
double& q2_meas,
double& q3_meas);
130 double ax,
double ay,
double az,
131 double p0,
double p1,
double p2,
double p3,
132 double& dq0,
double& dq1,
double& dq2,
double& dq3);
144 double& dq0,
double& dq1,
double& dq2,
double& dq3);
147 double q0,
double q1,
double q2,
double q3,
148 double& q0_inv,
double& q1_inv,
double& q2_inv,
double& q3_inv);
151 double q0,
double q1,
double q2,
double q3,
152 double& r0,
double& r1,
double& r2,
double& r3);
155 double q0,
double q1,
double q2,
double q3,
156 double& vx,
double& vy,
double& vz);
void updateBiases(double ax, double ay, double az, double wx, double wy, double wz)
virtual void reset(double qx=0.0, double qy=0.0, double qz=0.0, double qw=1.0)
void invertQuaternion(double q0, double q1, double q2, double q3, double &q0_inv, double &q1_inv, double &q2_inv, double &q3_inv)
static const double kAccelerationThreshold
virtual IMUFilter::Type type() const
double getAngularVelocityBiasY() const
std::map< std::string, std::string > ParametersMap
double getAngularVelocityBiasZ() const
void normalizeQuaternion(double &q0, double &q1, double &q2, double &q3)
virtual void getOrientation(double &qx, double &qy, double &qz, double &qw) const
void getMeasurement(double ax, double ay, double az, double &q0_meas, double &q1_meas, double &q2_meas, double &q3_meas)
virtual ~ComplementaryFilter()
static const double gamma_
virtual void parseParameters(const ParametersMap ¶meters)
static const double kDeltaAngularVelocityThreshold
void quaternionMultiplication(double p0, double p1, double p2, double p3, double q0, double q1, double q2, double q3, double &r0, double &r1, double &r2, double &r3)
bool getDoAdaptiveGain() const
double getBiasAlpha() const
void setDoAdaptiveGain(bool do_adaptive_gain)
bool checkState(double ax, double ay, double az, double wx, double wy, double wz) const
bool getSteadyState() const
bool setBiasAlpha(double bias_alpha)
void scaleQuaternion(double gain, double &dq0, double &dq1, double &dq2, double &dq3)
void normalizeVector(double &x, double &y, double &z)
bool setGainAcc(double gain)
virtual void updateImpl(double gx, double gy, double gz, double ax, double ay, double az, double dt)
ComplementaryFilter(const ParametersMap ¶meters=ParametersMap())
double getGainAcc() const
bool getDoBiasEstimation() const
void rotateVectorByQuaternion(double x, double y, double z, double q0, double q1, double q2, double q3, double &vx, double &vy, double &vz)
double getAdaptiveGain(double alpha, double ax, double ay, double az)
double getAngularVelocityBiasX() const
void setDoBiasEstimation(bool do_bias_estimation)
void getPrediction(double wx, double wy, double wz, double dt, double &q0_pred, double &q1_pred, double &q2_pred, double &q3_pred) const
void getAccCorrection(double ax, double ay, double az, double p0, double p1, double p2, double p3, double &dq0, double &dq1, double &dq2, double &dq3)
static const double kGravity
static const double kAngularVelocityThreshold