12#ifndef ZMPTRACKINGGAINESTIMATOR_HPP
13#define ZMPTRACKINGGAINESTIMATOR_HPP
15#include <state-observation/api.h>
30 constexpr static double defaultDt_ = 0.005;
31 constexpr static double defaultGain_ = 1;
35 constexpr static double defaultGainDriftSecond = 0.002;
38 constexpr static double defaultZmpProcessErrorStd = 0.005;
41 constexpr static double defaultZmpMeasurementErrorStd = 0.005;
45 constexpr static double defaultGainMinimum = .01;
48 constexpr static double defaultZmpUncertainty = 0.005;
51 constexpr static double defaultGainUncertainty = 20;
218 * previousOrientation_.transpose())
219 .selfadjointView<Eigen::Upper>();
272 return Vector2(v.array().square()).asDiagonal();
278 return Vector3(v.array().square()).asDiagonal();
283 R_ = Vec2ToSqDiag_(zmpMeasureErrorstd_);
289 Q_.topLeftCorner<2, 2>() = Vec2ToSqDiag_(zmpProcessErrorStd_);
290 Q_.bottomRightCorner<3, 3>() = Vec3ToSqDiag_(gainDriftPerSecondStd_);
void setMeasurementCovariance(const Rmatrix &R)
Definition kalman-filter-base.hpp:119
void setProcessCovariance(const Qmatrix &Q)
Definition kalman-filter-base.hpp:136
The class of a Linear Kalman filter.
Definition linear-kalman-filter.hpp:48
Definition zmp-tracking-gain-estimator.hpp:28
~ZmpTrackingGainEstimator()
Destroy the Lipm Dcm Bias Estimator object.
Definition zmp-tracking-gain-estimator.hpp:135
void updateR_()
Definition zmp-tracking-gain-estimator.hpp:281
double minimumGain_
Definition zmp-tracking-gain-estimator.hpp:248
Eigen::Matrix< double, 2, 5 > Matrix25
Definition zmp-tracking-gain-estimator.hpp:243
Vector2 zmpMeasureErrorstd_
Definition zmp-tracking-gain-estimator.hpp:250
void setGain(const Vector3 &gain, const Vector3 &uncertainty)
Set the Gain from a guess.
LinearKalmanFilter filter_
Definition zmp-tracking-gain-estimator.hpp:256
Matrix4 A_
Definition zmp-tracking-gain-estimator.hpp:257
void setInputs(const Vector2 &zmpErr, const Vector2 &zmp, const Matrix2 &R=Matrix2::Identity())
Set the Inputs of the estimator.
void setGainDriftPerSecond(const Vector3 &)
Set the Gain Drift Per Second.
Matrix2 previousOrientation_
Definition zmp-tracking-gain-estimator.hpp:267
void update()
Runs the estimation. Needs to be called every timestep.
Matrix2 yaw_
Definition zmp-tracking-gain-estimator.hpp:254
Vector3 gainDriftPerSecondStd_
Definition zmp-tracking-gain-estimator.hpp:251
Matrix2 R_
measurement noise
Definition zmp-tracking-gain-estimator.hpp:262
void resetWithMeasurements(const Vector2 &initZMP=Vector2::Zero(), const Vector3 &initGain=Vector3::Zero(), const Matrix2 &yaw=Matrix2::Identity(), const Vector2 &initZMPUncertainty=Vector2::Constant(defaultZmpUncertainty), const Vector3 &initGainUncertainty=Vector3::Constant(defaultGainUncertainty))
Resets the estimator.
Vector2 zmpProcessErrorStd_
Definition zmp-tracking-gain-estimator.hpp:252
void setGain(const Vector3 &gain)
Set the Gain from a guess.
Matrix2 getEstimatedGain() const
Get the Unbiased DCM filtered by the estimator.
Definition zmp-tracking-gain-estimator.hpp:214
void setZMPProcesError(const Vector2 &)
Set the covariance of the zmp process linear dynamics error.
void setMinimumGain(const double &minGain)
Set the Gain Limit.
Matrix25 C_
The B matrix is zero.
Definition zmp-tracking-gain-estimator.hpp:259
Matrix5 Q_
process noise
Definition zmp-tracking-gain-estimator.hpp:265
void resetWithMeasurements(const Vector2 &initZMP, const Vector3 &initGain, double yaw, const Vector2 &initZMPUncertainty=Vector2::Constant(defaultZmpUncertainty), const Vector3 &initGainUncertainty=Vector3::Constant(defaultGainUncertainty))
Resets the estimator.
Definition zmp-tracking-gain-estimator.hpp:103
void setSamplingTime(double dt)
Set the Sampling Time.
LinearKalmanFilter & getFilter()
Get the Kalman Filter object This can be used to run specific Advanced Kalman filter related funcions...
Definition zmp-tracking-gain-estimator.hpp:230
Matrix2 getEstimatedLocalGain() const
Get the estimated Bias expressed in the local frame of the robot.
ZmpTrackingGainEstimator(double dt=defaultDt_, const Vector2 &zmpMeasureErrorStd=Vector2::Constant(defaultZmpMeasurementErrorStd), const Vector3 &gainDriftPerSecond=Vector3::Constant(defaultGainDriftSecond), const Vector2 &zmpProcessErrorStd=Vector2::Constant(defaultZmpProcessErrorStd), double minimumGain=defaultGainMinimum, const Vector2 &initZMP=Vector2::Zero(), const Vector3 &initGain=Vector3::Zero(), const Vector2 &initZMPUncertainty=Vector2::Constant(defaultZmpUncertainty), const Vector3 &initGainUncertainty=Vector3::Constant(defaultGainUncertainty))
Construct a new ZMP Gain Estimator object.
void setInputs(const Vector2 &zmpErr, const Vector2 &zmp, const Matrix3 &orientation)
Set the Inputs of the estimator.
Definition zmp-tracking-gain-estimator.hpp:182
double dt_
Definition zmp-tracking-gain-estimator.hpp:246
Eigen::Matrix< double, 2, 3 > Matrix23
Definition zmp-tracking-gain-estimator.hpp:244
static Matrix3 Vec3ToSqDiag_(const Vector3 &v)
builds a diagonal out of the square valued of the Vec3
Definition zmp-tracking-gain-estimator.hpp:276
void resetWithMeasurements(const Vector2 &initZMP, const Vector3 &initGain, const Matrix3 &rotation, const Vector2 &initZMPUncertainty=Vector2::Constant(defaultZmpUncertainty), const Vector3 &initGainUncertainty=Vector3::Constant(defaultGainUncertainty))
Resets the estimator with first measurements.
Definition zmp-tracking-gain-estimator.hpp:124
void setZmpMeasureErrorStd(const Vector2 &)
Set the Zmp Measurement Error Stamdard deviation.
void setInputs(const Vector2 &zmpErr, const Vector2 &zmp, double yaw)
Set the Inputs of the estimator.
Definition zmp-tracking-gain-estimator.hpp:193
void updateQ_()
Definition zmp-tracking-gain-estimator.hpp:287
static Matrix2 Vec2ToSqDiag_(const Vector2 &v)
builds a diagonal out of the square valued of the Vec2
Definition zmp-tracking-gain-estimator.hpp:270
const LinearKalmanFilter & getFilter() const
Get the Kalman Filter object This can be used to run specific Advanced Kalman filter related funcions...
Definition zmp-tracking-gain-estimator.hpp:237
Defines the class of a Linear Kalman filter.
Gathers many kinds of algorithms.
double rotationMatrixToYawAxisAgnostic(const Matrix3 &rotation)
take 3x3 matrix represeting a rotation and gives a corresponding angle around upward vertical axis
Definition bidim-elastic-inv-pendulum-dyn-sys.hpp:21
Eigen::Matrix4d Matrix4
4x4 Scalar Matrix
Definition definitions.hpp:115
Eigen::Rotation2D< double > Rotation2D
2D rotations
Definition definitions.hpp:136
Eigen::Matrix2d Matrix2
2D scalar Matrix
Definition definitions.hpp:106
Eigen::Vector3d Vector3
3D vector
Definition definitions.hpp:85
Eigen::Matrix3d Matrix3
3x3 Scalar Matrix
Definition definitions.hpp:109
Eigen::MatrixXd Matrix
Dynamic sized Matrix.
Definition definitions.hpp:100
Eigen::Matrix< double, 5, 5 > Matrix5
5x5 Scalar Matrix
Definition definitions.hpp:118
Eigen::Matrix< double, 2, 1 > Vector2
2d Vector
Definition definitions.hpp:82
Implements integrators for the kinematics, in terms or rotations and translations.