state-observation 1.7.0
Loading...
Searching...
No Matches
model-base-ekf-flex-estimator-imu.hpp
Go to the documentation of this file.
1
13#ifndef FLEXBILITYESTMATOR_MODELBASEEKFFLEXIBILITYESTIMATOR_IMU_H
14#define FLEXBILITYESTMATOR_MODELBASEEKFFLEXIBILITYESTIMATOR_IMU_H
15
16#include <state-observation/api.h>
18// #include <state-observation/flexibility-estimation/stable-imu-fixed-contact-dynamical-system.hpp>
20// #include <state-observation/flexibility-estimation/imu-fixed-contact-dynamical-system.hpp>
21
22namespace stateObservation
23{
24namespace flexibilityEstimation
25{
26
39 private boost::noncopyable
40{
41public:
43 {
45 static const unsigned elasticContact = IMUElasticLocalFrameDynamicalSystem::contactModel::elasticContact;
46 static const unsigned pendulum = IMUElasticLocalFrameDynamicalSystem::contactModel::pendulum;
47 };
48
50 explicit ModelBaseEKFFlexEstimatorIMU(double dt = 0.005);
51
54
56 void setContactsNumber(unsigned i);
57
59 {
60 return functor_.getContactsNumber();
61 }
62
64 {
65 return functor_;
66 }
67
69 {
70 return functor_.computeAccelerations(getFlexibilityVector(), getInput());
71 }
72
73 void setContactModel(unsigned nb);
74
76 virtual void setMeasurement(const Vector & y);
77
79 virtual void setProcessNoiseCovariance(const Matrix & Q);
80
82 virtual void setMeasurementNoiseCovariance(const Matrix & R);
83
86
89
93
94 // get state covariance
96 {
97 stateObservation::Matrix P(ekf_.getStateCovariance());
98 stateObservation::Vector Pvec(ekf_.getStateSize());
99 for(Index i = 0; i < ekf_.getStateSize(); ++i) Pvec(i) = P(i, i);
100 return Pvec;
101 }
102
104
107 virtual void setFlexibilityGuess(const Matrix & x);
108
111
113 virtual const Vector & getFlexibilityVector();
114
117 {
118 return ekf_.getA();
119 }
120
122 {
123 return ekf_.getC();
124 }
125
126 virtual Index getMeasurementSize() const;
127
128 virtual Index getStateSize() const;
129
130 virtual Index getInputSize() const;
131
133 virtual void setWithForcesMeasurements(bool);
134
136
137 virtual void setWithAbsolutePos(bool);
138
140
142 {
143 return withUnmodeledForces_;
144 }
145
147 {
148 return withAbsolutePos_;
149 }
150
151 virtual void setWithComBias(bool b);
152
153 virtual bool getWithComBias()
154 {
155 return withComBias_;
156 }
157
158 virtual void setUnmodeledForceVariance(double d);
160
163 virtual void setForceVariance(double d);
164 virtual void setForceVariance(const Matrix3 & C);
165
166 virtual void setAbsolutePosVariance(double d);
167
169 virtual void setSamplingPeriod(double);
170
172 void setOn(bool & b);
173
174 virtual void setKfe(const Matrix3 & m);
175 virtual void setKfv(const Matrix3 & m);
176 virtual void setKte(const Matrix3 & m);
177 virtual void setKtv(const Matrix3 & m);
178
179 virtual void setKfeRopes(const Matrix3 & m);
180 virtual void setKfvRopes(const Matrix3 & m);
181 virtual void setKteRopes(const Matrix3 & m);
182 virtual void setKtvRopes(const Matrix3 & m);
183
184 virtual void setPe(const stateObservation::Vector3 & Pe)
185 {
186 functor_.setPe(Pe);
187 }
188
189 virtual Matrix getKfe() const;
190 virtual Matrix getKfv() const;
191 virtual Matrix getKte() const;
192 virtual Matrix getKtv() const;
193
197
198 virtual void setRobotMass(double m);
199 virtual double getRobotMass() const
200 {
201 return functor_.getRobotMass();
202 }
203
204 void setTorquesLimit(const Vector3 & v)
205 {
206 limitTorques_ = v;
207 }
208
209 void setForcesLimit(const Vector3 & v)
210 {
211 limitForces_ = v;
212 }
213
215 {
216 return limitForces_;
217 }
218
220 {
221 return limitTorques_;
222 }
223
224 void setLimitOn(const bool & b)
225 {
226 limitOn_ = b;
227 }
228
229 virtual bool getLimitOn() const
230 {
231 return limitOn_;
232 }
233
235
237
239
240protected:
242
244
246
247 Matrix R_, Q_, P_;
248
250
251 static const Index measurementSizeBase_ = 12;
252
253 static const Index inputSizeBase_ = IMUElasticLocalFrameDynamicalSystem::input::sizeBase;
255
256 double dt_; // sampling period
257 bool on_;
258
260 Matrix forceVariance_; // force sensor variance
262
264
268
272
278
279private:
280};
281
282} // namespace flexibilityEstimation
283} // namespace stateObservation
284#endif // FLEXBILITYESTMATOR_MODELBASEEKFFLEXIBILITYESTIMATOR_IMU_H
This class is the base class of the flexibility estimators that use an extended Kalman Filter....
Definition ekf-flexibility-estimator-base.hpp:36
This class describes the dynamics of a robot's flexibility this dynamics with elastic forces to bring...
Definition imu-elastic-local-frame-dynamical-system.hpp:35
This class implements the flexibility estimation of a robot with the hypothesis that the contact posi...
Definition model-base-ekf-flex-estimator-imu.hpp:40
virtual stateObservation::Vector computeAccelerations()
Definition model-base-ekf-flex-estimator-imu.hpp:68
virtual void resetCovarianceMatrices()
Resets the covariance matrices to their original values.
Vector3 limitTorques_
Definition model-base-ekf-flex-estimator-imu.hpp:269
virtual stateObservation::Matrix getAMatrix()
Definition model-base-ekf-flex-estimator-imu.hpp:116
virtual void setPe(const stateObservation::Vector3 &Pe)
Definition model-base-ekf-flex-estimator-imu.hpp:184
double absPosVariance_
Definition model-base-ekf-flex-estimator-imu.hpp:261
void setForcesLimit(const Vector3 &v)
Definition model-base-ekf-flex-estimator-imu.hpp:209
virtual Matrix4 getFlexibility()
Gets an estimation of the flexibility in the form of a homogeneous matrix.
const Index stateSize_
Definition model-base-ekf-flex-estimator-imu.hpp:249
IMUElasticLocalFrameDynamicalSystem getFunctor()
Definition model-base-ekf-flex-estimator-imu.hpp:63
void setOn(bool &b)
Enable or disable the estimation.
bool on_
Definition model-base-ekf-flex-estimator-imu.hpp:257
virtual stateObservation::Vector3 getTorquesLimit() const
Definition model-base-ekf-flex-estimator-imu.hpp:219
bool withAbsolutePos_
Definition model-base-ekf-flex-estimator-imu.hpp:265
double dt_
Definition model-base-ekf-flex-estimator-imu.hpp:256
bool getWithUnmodeledForces()
Definition model-base-ekf-flex-estimator-imu.hpp:141
virtual void setMeasurementNoiseCovariance(const Matrix &R)
Sets the measurements covariance matrice.
virtual Matrix getProcessNoiseCovariance() const
gets the covariance matrices for the process noises
virtual stateObservation::Vector3 getForcesLimit() const
Definition model-base-ekf-flex-estimator-imu.hpp:214
virtual void setProcessNoiseCovariance(const Matrix &Q)
Sets the process covariance matrice.
void setLimitOn(const bool &b)
Definition model-base-ekf-flex-estimator-imu.hpp:224
virtual Matrix getMeasurementNoiseCovariance() const
gets the covariance matrices for the sensor noises
virtual bool getLimitOn() const
Definition model-base-ekf-flex-estimator-imu.hpp:229
bool withUnmodeledForces_
Definition model-base-ekf-flex-estimator-imu.hpp:267
virtual bool getWithComBias()
Definition model-base-ekf-flex-estimator-imu.hpp:153
virtual void setComBiasGuess(const stateObservation::Vector &x)
void setContactsNumber(unsigned i)
Sets the number of contacts can be changed online.
stateObservation::Vector getStateCovariance() const
Definition model-base-ekf-flex-estimator-imu.hpp:95
void setTorquesLimit(const Vector3 &v)
Definition model-base-ekf-flex-estimator-imu.hpp:204
unsigned getContactsNumber()
Definition model-base-ekf-flex-estimator-imu.hpp:58
virtual void setWithForcesMeasurements(bool)
sets to whether or not the force mesurements are taken into account
Vector3 limitForces_
Definition model-base-ekf-flex-estimator-imu.hpp:270
Matrix P_
Definition model-base-ekf-flex-estimator-imu.hpp:247
Index inputSize_
Definition model-base-ekf-flex-estimator-imu.hpp:254
double unmodeledForceVariance_
Definition model-base-ekf-flex-estimator-imu.hpp:259
virtual const Vector & getFlexibilityVector()
Gets an estimation of the flexibility in the form of a state vector \hat{x_{k+1}}.
bool limitOn_
Definition model-base-ekf-flex-estimator-imu.hpp:271
virtual void setMeasurement(const Vector &y)
Sets the value of the next sensor measurement y_{k+1}.
IMUElasticLocalFrameDynamicalSystem functor_
Definition model-base-ekf-flex-estimator-imu.hpp:243
Vector x_
Definition model-base-ekf-flex-estimator-imu.hpp:245
bool getWithAbsolutePos()
Definition model-base-ekf-flex-estimator-imu.hpp:146
virtual double getRobotMass() const
Definition model-base-ekf-flex-estimator-imu.hpp:199
Matrix forceVariance_
Definition model-base-ekf-flex-estimator-imu.hpp:260
bool withComBias_
Definition model-base-ekf-flex-estimator-imu.hpp:266
virtual void setSamplingPeriod(double)
sets the sampling period
virtual stateObservation::Matrix getCMatrix()
Definition model-base-ekf-flex-estimator-imu.hpp:121
bool useFTSensors_
Definition model-base-ekf-flex-estimator-imu.hpp:263
ModelBaseEKFFlexEstimatorIMU(double dt=0.005)
The constructor, it requires the value of the time discretization period.
Declare the class of the flexibility estimation using the extended Kalman Filter.
Definition bidim-elastic-inv-pendulum-dyn-sys.hpp:21
Eigen::Matrix4d Matrix4
4x4 Scalar Matrix
Definition definitions.hpp:115
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, 6, 6 > Matrix6
6x6 Scalar Matrix
Definition definitions.hpp:121
Eigen::Index Index
Definition definitions.hpp:138
Eigen::VectorXd Vector
Dynamic sized scalar vector.
Definition definitions.hpp:76
stateObservation::Matrix CA
Definition model-base-ekf-flex-estimator-imu.hpp:276
stateObservation::Matrix O
Definition model-base-ekf-flex-estimator-imu.hpp:275