state-observation 1.7.0
General implementation of observers.
Loading...
Searching...
No Matches
kinetics-observer.hpp
Go to the documentation of this file.
1
11
12#ifndef KINETICSOBSERVER_HPP
13#define KINETICSOBSERVER_HPP
14
15#include <set>
16
17#include <boost/utility.hpp>
18
19#include <state-observation/api.h>
20#include <state-observation/dynamical-system/dynamical-system-functor-base.hpp>
22#include <state-observation/observer/extended-kalman-filter.hpp>
26#include <state-observation/tools/state-vector-arithmetics.hpp>
27
28namespace stateObservation
29{
30
33
39
41class STATE_OBSERVATION_DLLAPI KineticsObserver : protected DynamicalSystemFunctorBase, protected StateVectorArithmetics
42{
43public:
44 typedef kine::Kinematics Kinematics;
45 typedef kine::LocalKinematics LocalKinematics;
46 typedef kine::Orientation Orientation;
47
48 // ////////////////////////////////////////////////////////////
50 // ///////////////////////////////////////////////////////////
52
59 KineticsObserver(unsigned maxContacts = 4, unsigned maxNumberOfIMU = 1);
60
64
66
67 // ////////////////////////////////////////////////////////////
71 // ///////////////////////////////////////////////////////////
72
74
78 double getSamplingTime() const;
79
82 void setSamplingTime(double);
83
91 void setWithUnmodeledWrench(bool b = true);
92
99 void setWithAccelerationEstimation(bool b = true);
100
105
110 void setWithGyroBias(bool b = true);
111
115 void setMass(double);
116
120 double getMass() const;
121
125 const IndexedMatrix3 & getInertiaMatrix() const;
126
130 const IndexedMatrix3 & getInertiaMatrixDot() const;
131
135 const IndexedVector3 & getAngularMomentum() const;
136
140 const IndexedVector3 & getAngularMomentumDot() const;
141
145 const IndexedVector3 & getCenterOfMass() const;
146
150 const IndexedVector3 & getCenterOfMassDot() const;
151
155 const IndexedVector3 & getCenterOfMassDotDot() const;
156
161
163
164 // ///////////////////////////////////////////////////////////
169
171
188 Index setIMU(const Vector3 & accelero,
189 const Vector3 & gyrometer,
190 const Kinematics & userImuKinematics,
191 Index num = -1);
192
200 Index setIMU(const Vector3 & accelero,
201 const Vector3 & gyrometer,
202 const Matrix3 & acceleroCov,
203 const Matrix3 & gyroCov,
204 const Kinematics & userImuKinematics,
205 Index num = -1);
206
212 void setIMUDefaultCovarianceMatrix(const Matrix3 & acceleroCov, const Matrix3 & gyroCov);
213
220 void setAbsolutePoseSensor(const Kinematics & measurement);
221
227 void setAbsolutePoseSensor(const Kinematics & measurement, const Matrix6 & CovarianceMatrix);
228
232
237 void setAbsoluteOriSensor(const Orientation & measurement);
238
244 void setAbsoluteOriSensor(const Orientation & measurement, const Matrix3 & CovarianceMatrix);
245
249
251
252 // ///////////////////////////////////////////////////////////
257 // ///////////////////////////////////////////////////////////
259
283 Index addContact(const Kinematics & pose,
284 const Matrix12 & initialCovarianceMatrix,
285 const Matrix12 & processCovarianceMatrix,
286 Index contactNumber = -1,
287 const Matrix3 & linearStiffness = Matrix3::Constant(-1),
288 const Matrix3 & linearDamping = Matrix3::Constant(-1),
289 const Matrix3 & angularStiffness = Matrix3::Constant(-1),
290 const Matrix3 & angularDamping = Matrix3::Constant(-1));
291
307 Index addContact(const Kinematics & pose,
308 Index contactNumber = -1,
309 const Matrix3 & linearStiffness = Matrix3::Constant(-1),
310 const Matrix3 & linearDamping = Matrix3::Constant(-1),
311 const Matrix3 & angularStiffness = Matrix3::Constant(-1),
312 const Matrix3 & angularDamping = Matrix3::Constant(-1));
313
317 void removeContact(Index contactnbr);
318
321
326
330 std::vector<Index> getListOfContacts() const;
331
333
334 // ///////////////////////////////////////////////////////////
341 // //////////////////////////////////////////////////////////
343
349 void updateContactWithNoSensor(const Kinematics & localKine, unsigned contactNumber);
350
355 void updateContactWithWrenchSensor(const Vector6 & wrenchMeasurement,
356 const Kinematics & localKine,
357 unsigned contactNumber);
358
364 void updateContactWithWrenchSensor(const Vector6 & wrenchMeasurement,
365 const Matrix6 & wrenchCovMatrix,
366 const Kinematics & localKine,
367 unsigned contactNumber);
368
373
375
376 // /////////////////////////////////////////////
380
387 void setCenterOfMass(const Vector3 & com, const Vector3 & com_dot, const Vector3 & com_dot_dot);
388
394 void setCenterOfMass(const Vector3 & com, const Vector3 & com_dot);
395
400 void setCenterOfMass(const Vector3 & com);
401
406 void setCoMInertiaMatrix(const Matrix3 & I, const Matrix3 & I_dot);
407
414
420 void setCoMInertiaMatrix(const Vector6 & I, const Vector6 & I_dot);
421
428
433 void setCoMAngularMomentum(const Vector3 & sigma, const Vector3 & sigma_dot);
434
439 void setCoMAngularMomentum(const Vector3 & sigma);
440
447 void setAdditionalWrench(const Vector3 & force, const Vector3 & torque);
448
450
451 // ///////////////////////////////////////////////////////////
455
459
466 const Vector & update();
467
470
474 void convertWrenchFromUserToCentroid(const Vector3 & forceUserFrame,
475 const Vector3 & momentUserFrame,
476 Vector3 & forceCentroidFrame,
477 Vector3 & momentCentroidFrame);
478
486 LocalKinematics getLocalCentroidKinematics() const;
487
494 Kinematics getGlobalCentroidKinematics() const;
495
501 LocalKinematics estimateAccelerations();
502
507 LocalKinematics getLocalKinematicsOf(const Kinematics & userBodyKine);
508
514 Kinematics getGlobalKinematicsOf(const Kinematics & userBodyKin) const;
515
518
524 Vector6 getContactWrench(Index contactNbr) const;
525
534 Kinematics getContactPosition(Index contactNbr) const;
535
543
547 // /////////////////////////////////////////////////////////
548
556 void setWorldCentroidStateKinematics(const LocalKinematics & localKine,
557 bool resetContactWrenches = true,
558 bool resetCovariance = true);
559
566 void setWorldCentroidStateKinematics(const Kinematics & kine, bool resetCovariance = true);
567
575 void setStateContact(Index index,
576 Kinematics worldContactRestPose,
577 const Vector6 & wrench,
578 bool resetCovariance = true);
579
580 // TODO
581 // void setVelocityGuess(const Kinematics)
582
589 void setGyroBias(const Vector3 &, unsigned numberOfIMU = 1, bool resetCovariance = true);
590
597 void setStateUnmodeledWrench(const Vector6 &, bool resetCovariance = true);
598
600
601 // /////////////////////////////////////////////////////////////
604 // /////////////////////////////////////////////////////////////
606
610
614
615 // /////////////////////////////////////////////////////////////
617 // /////////////////////////////////////////////////////////////
619
624 const Matrix3 & P_ori,
625 const Matrix3 & P_linVel,
626 const Matrix3 & P_angVel);
627
630
635
639 void setContactInitCovMatDefault(const Matrix12 & contactCovMat);
640
643
648 void setGyroBiasStateCovariance(const Matrix3 & covMat, unsigned imuNumber);
649
653 void setUnmodeledWrenchStateCovMat(const Matrix6 & newCovMat);
654
659 void setContactStateCovMat(Index contactNbr, const Matrix12 & contactCovMat);
660
663
666 const Matrix3 & P_ori,
667 const Matrix3 & P_linVel,
668 const Matrix3 & P_angVel);
669
672
675
678
681
686 void setGyroBiasProcessCovariance(const Matrix3 & covMat, unsigned imuNumber);
687
691 void setUnmodeledWrenchProcessCovMat(const Matrix6 & processCovMat);
692
697 void setContactProcessCovMat(Index contactNbr, const Matrix12 & contactCovMat);
698
701 void resetStateKinematicsCovMat();
702 void resetStateGyroBiasCovMat(Index i);
703 void resetStateUnmodeledWrenchCovMat();
704 void resetStateContactsCovMat();
705 void resetStateContactCovMat(Index contactNbr);
706
707 void resetProcessCovarianceMat();
708 void resetProcessKinematicsCovMat();
709 void resetProcessGyroBiasCovMat(Index i);
710 void resetProcessUnmodeledWrenchCovMat();
711 void resetProcessContactsCovMat();
712 void resetProcessContactCovMat(Index contactNbr);
714
715 // /////////////////////////////////////////////////////////////
721 // /////////////////////////////////////////////////////////////
722
726
731 Index getStateSize() const;
732
737 Index getStateTangentSize() const;
738
742 Index getMeasurementSize() const;
743
748
754
759
763
768
773 TimeIndex getStateVectorTimeIndex() const;
774
777 void setInitWorldCentroidStateVector(const Vector & initStateVector);
778
784 void setStateVector(const Vector & newvalue, bool resetCovariance = true);
785
790
794
798 inline Index kineIndex() const;
799
803 inline Index posIndex() const;
804
808 inline Index oriIndex() const;
809
813 inline Index linVelIndex() const;
814
818 inline Index angVelIndex() const;
819
823 inline Index gyroBiasIndex(Index IMUNumber) const;
824
828 inline Index unmodeledWrenchIndex() const;
829
833 inline Index unmodeledForceIndex() const;
834
838 inline Index unmodeledTorqueIndex() const;
839
843 inline Index contactsIndex() const;
844
849 inline Index contactIndex(Index contactNbr) const;
850
855 inline Index contactKineIndex(Index contactNbr) const;
856
861 inline Index contactPosIndex(Index contactNbr) const;
862
867 inline Index contactOriIndex(Index contactNbr) const;
868
873 inline Index contactForceIndex(Index contactNbr) const;
874
879 inline Index contactTorqueIndex(Index contactNbr) const;
880
885 inline Index contactWrenchIndex(Index contactNbr) const;
886
887 // ///////////////////////////////////////////////////////////
890
894 inline Index kineIndexTangent() const;
895
899 inline Index posIndexTangent() const;
900
904 inline Index oriIndexTangent() const;
905
909 inline Index linVelIndexTangent() const;
910
914 inline Index angVelIndexTangent() const;
915
919 inline Index gyroBiasIndexTangent(Index IMUNumber) const;
920
924 inline Index unmodeledWrenchIndexTangent() const;
925
929 inline Index unmodeledForceIndexTangent() const;
930
934 inline Index unmodeledTorqueIndexTangent() const;
935
939 inline Index contactsIndexTangent() const;
940
945 inline Index contactIndexTangent(Index contactNbr) const;
946
951 inline Index contactKineIndexTangent(Index contactNbr) const;
952
957 inline Index contactPosIndexTangent(Index contactNbr) const;
958
963 inline Index contactOriIndexTangent(Index contactNbr) const;
964
969 inline Index contactForceIndexTangent(Index contactNbr) const;
970
975 inline Index contactTorqueIndexTangent(Index contactNbr) const;
976
981 inline Index contactWrenchIndexTangent(Index contactNbr) const;
982
984
985 // /////////////////////////////////////////////////////////////
987 // /////////////////////////////////////////////////////////////
989
992
997
998protected:
999 struct Sensor
1000 {
1001 Sensor(Index signalSize) : measIndex(-1), measIndexTangent(-1), size(signalSize), time(0) {}
1002 ~Sensor() {}
1003 Index measIndex;
1004 Index measIndexTangent;
1005 Index size;
1006 TimeIndex time;
1007
1008 inline Vector extractFromVector(const Vector & v)
1009 {
1010 return v.segment(size, measIndex);
1011 }
1012 };
1013
1014 struct IMU : public Sensor
1015 {
1016 ~IMU() {}
1017 IMU() : Sensor(sizeIMUSignal) {}
1018
1019 Kinematics userImuKinematics; // the kinematics of the IMU in the user's frame
1020 LocalKinematics centroidImuKinematics; // the kinematics of the IMU in the IMU's frame
1021 Vector6 acceleroGyro;
1022 Matrix3 covMatrixAccelero;
1023 Matrix3 covMatrixGyro;
1024
1025 Index stateIndex;
1026 Index stateIndexTangent;
1027
1028 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1029 };
1030
1031 typedef std::vector<IMU, Eigen::aligned_allocator<IMU>> VectorIMU;
1032 typedef VectorIMU::iterator VectorIMUIterator;
1033 typedef VectorIMU::const_iterator VectorIMUConstIterator;
1034
1035 struct Contact : public Sensor
1036 {
1037 Contact() : Sensor(sizeWrench), isSet(false), withRealSensor(false), stateIndex(-1), stateIndexTangent(-1)
1038 {
1039 worldRestPose.angVel = worldRestPose.linVel = Vector3::Zero();
1040 }
1041 ~Contact() {}
1042
1044 Kinematics worldRestPose; // the rest pose of the contact in the world frame
1045
1048
1050 Kinematics userContactKine;
1052 CheckedMatrix6 sensorCovMatrix;
1053
1058
1060
1061 bool isSet;
1062 bool withRealSensor;
1063 Index stateIndex;
1064 Index stateIndexTangent;
1065
1066 static const Kinematics::Flags::Byte contactKineFlags =
1067 Kinematics::Flags::position | Kinematics::Flags::orientation | Kinematics::Flags::linVel
1068 | Kinematics::Flags::angVel;
1069
1070 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1071 };
1072
1073 typedef std::vector<Contact, Eigen::aligned_allocator<Contact>> VectorContact;
1074 typedef VectorContact::iterator VectorContactIterator;
1075 typedef VectorContact::const_iterator VectorContactConstIterator;
1076
1077 struct AbsolutePoseSensor : public Sensor
1078 {
1079 AbsolutePoseSensor() : Sensor(sizePose) {}
1080
1081 Kinematics pose;
1082 static const Kinematics::Flags::Byte poseFlags = Kinematics::Flags::position | Kinematics::Flags::orientation;
1083 CheckedMatrix6 covMatrix;
1084 };
1085
1086 struct AbsoluteOriSensor : public Sensor
1087 {
1088 AbsoluteOriSensor() : Sensor(sizePose) {}
1089
1090 Orientation ori;
1091 CheckedMatrix3 covMatrix;
1092 };
1093
1094protected:
1102 virtual Vector stateDynamics(const Vector & x, const Vector & u, TimeIndex k);
1103
1110 virtual Vector measureDynamics(const Vector & x, const Vector & u, TimeIndex k);
1111
1116 void addUnmodeledAndContactWrench_(const Vector & centroidStateVector, Vector3 & force, Vector3 & torque);
1117
1122 void addUnmodeledWrench_(const Vector & centroidStateVector, Vector3 & force, Vector3 & torque);
1123
1132 void addContactWrench_(const Kinematics & centroidContactKine,
1133 const Vector3 & centroidContactForce,
1134 const Vector3 & centroidContactTorque,
1135 Vector3 & totalCentroidForce,
1136 Vector3 & totalCentroidTorque);
1137
1148
1149 void computeLocalAccelerations_(LocalKinematics & localStateKine,
1150 const Vector3 & totalForceLocal,
1151 const Vector3 & totalMomentLocal,
1152 Vector3 & linAcc,
1153 Vector3 & angAcc);
1154
1161 void computeContactForce_(VectorContactIterator i,
1162 LocalKinematics & worldCentroidStateKinematics,
1163 Kinematics & worldRestContactPose,
1164 Vector3 & contactForce,
1165 Vector3 & contactTorque);
1166
1173 void computeContactForces_(LocalKinematics & worldCentroidStateKinematics,
1174 Vector3 & contactForce,
1175 Vector3 & contactTorque);
1176
1179
1181 virtual void resetProcessNoise();
1183 virtual NoiseBase * getProcessNoise() const;
1184
1191
1193 virtual Index getInputSize() const;
1194
1195public:
1199 Vector6 getCentroidContactWrench(Index numContact) const;
1200
1204 Kinematics getCentroidContactInputPose(Index numContact) const;
1205
1209 Kinematics getWorldContactPoseFromCentroid(Index numContact) const;
1210
1213 Kinematics getContactStateRestKinematics(Index numContact) const;
1214
1217 Kinematics getUserContactInputPose(Index numContact) const;
1218
1223 Index getIMUMeasIndexByNum(Index num) const;
1224
1225 Index getContactMeasIndexByNum(Index num) const;
1226
1227 bool getContactIsSetByNum(Index num) const;
1228
1232
1234
1240 inline Vector stateSum(const Vector & stateVector, const Vector & tangentVector);
1241
1245 virtual void stateSum(const Vector & stateVector, const Vector & tangentVector, Vector & sum);
1246
1253 inline Vector stateDifference(const Vector & stateVector1, const Vector & stateVector2);
1254
1258 virtual void stateDifference(const Vector & stateVector1, const Vector & stateVector2, Vector & difference);
1259
1267 virtual void measurementDifference(const Vector & measureVector1, const Vector & measureVector2, Vector & difference);
1268
1272 virtual void useFiniteDifferencesJacobians(bool b = true);
1273
1277 virtual void setFiniteDifferenceStep(const Vector & dx);
1278
1279 virtual Matrix computeAMatrix();
1280
1281 virtual Matrix computeCMatrix();
1282
1284 void computeLocalAccelerations(const Vector & x, Vector & acceleration);
1285
1289 int errcode,
1290 double relativeErrorThreshold,
1291 double threshold); // declared out of namespace state-observation
1292
1297 int errcode,
1298 double relativeErrorThreshold,
1299 double threshold); // declared out of namespace state-observation
1300
1301 friend int testAnalyticalCJacobianVsFD(KineticsObserver & ko,
1302 int errcode,
1303 double relativeErrorThreshold,
1304 double threshold); // declared out of namespace state-observation
1305
1309 int errcode,
1310 double relativeErrorThreshold,
1311 double threshold); // declared out of namespace state-observation
1313
1314protected:
1315 void stateNaNCorrection_();
1316
1320
1323
1324protected:
1325 unsigned maxContacts_;
1326 unsigned maxImuNumber_;
1327
1328 AbsolutePoseSensor absPoseSensor_;
1329 AbsoluteOriSensor absOriSensor_;
1330 VectorContact contacts_;
1331 VectorIMU imuSensors_;
1332
1333 Index stateSize_;
1334 Index stateTangentSize_;
1335 Index measurementSize_;
1336 Index measurementTangentSize_;
1337
1338 Vector worldCentroidStateVector_;
1339 Vector worldCentroidStateVectorDx_;
1340 Vector oldWorldCentroidStateVector_;
1341
1342 LocalKinematics worldCentroidStateKinematics_;
1343 Kinematics worldCentroidKinematics_;
1344
1345 Vector3 additionalForce_;
1346 Vector3 additionalTorque_;
1347
1348 Vector3 initTotalCentroidForce_; // Initial total force used in the state prediction
1349 Vector3 initTotalCentroidTorque_; // Initial total torque used in the state prediction
1350
1351 Vector measurementVector_;
1352 Matrix measurementCovMatrix_;
1353
1355 bool finiteDifferencesJacobians_;
1356 bool withGyroBias_;
1357 bool withUnmodeledWrench_;
1358 bool withAccelerationEstimation_;
1359
1360 IndexedVector3 com_, comd_, comdd_;
1361 IndexedVector3 sigma_, sigmad_;
1362 IndexedMatrix3 I_, Id_;
1363
1364 TimeIndex k_est_; // time index of the last estimation
1365 TimeIndex k_data_; // time index of the current measurements
1366
1367 double mass_;
1368
1369 double dt_;
1370
1371 NoiseBase * processNoise_;
1372 NoiseBase * measurementNoise_;
1373
1374 Index numberOfContactRealSensors_;
1375 Index currentIMUSensorNumber_;
1376
1381
1388
1389 void convertUserToCentroidFrame_(const Kinematics & userKine, Kinematics & centroidKine, TimeIndex k_data);
1390
1395
1396 Kinematics convertUserToCentroidFrame_(const Kinematics & userKine, TimeIndex k_data);
1397
1399
1400 inline Index gyroBiasIndex(VectorIMUConstIterator i) const;
1401 inline Index gyroBiasIndexTangent(VectorIMUConstIterator i) const;
1402
1403 inline Index contactIndex(VectorContactConstIterator i) const;
1404 inline Index contactKineIndex(VectorContactConstIterator i) const;
1405 inline Index contactPosIndex(VectorContactConstIterator i) const;
1406 inline Index contactOriIndex(VectorContactConstIterator i) const;
1407 inline Index contactForceIndex(VectorContactConstIterator i) const;
1408 inline Index contactTorqueIndex(VectorContactConstIterator i) const;
1409 inline Index contactWrenchIndex(VectorContactConstIterator i) const;
1410
1412 inline Index contactIndexTangent(VectorContactConstIterator i) const;
1413 inline Index contactKineIndexTangent(VectorContactConstIterator i) const;
1414 inline Index contactPosIndexTangent(VectorContactConstIterator i) const;
1415 inline Index contactOriIndexTangent(VectorContactConstIterator i) const;
1416 inline Index contactForceIndexTangent(VectorContactConstIterator i) const;
1417 inline Index contactTorqueIndexTangent(VectorContactConstIterator i) const;
1418 inline Index contactWrenchIndexTangent(VectorContactConstIterator i) const;
1419
1420public:
1421 inline static constexpr Index sizeAcceleroSignal = 3;
1422 inline static constexpr Index sizeGyroSignal = 3;
1423 inline static constexpr Index sizeIMUSignal = sizeAcceleroSignal + sizeGyroSignal;
1424
1425 inline static constexpr Index sizePos = 3;
1426 inline static constexpr Index sizePosTangent = 3;
1427 inline static constexpr Index sizeOri = 4;
1428 inline static constexpr Index sizeOriTangent = 3;
1429 inline static constexpr Index sizeLinVel = sizePos;
1430 inline static constexpr Index sizeLinVelTangent = sizeLinVel;
1431 inline static constexpr Index sizeLinAccTangent = sizeLinVelTangent;
1432 inline static constexpr Index sizeAngVel = sizeOriTangent;
1433 inline static constexpr Index sizeAngVelTangent = sizeAngVel;
1434 inline static constexpr Index sizeGyroBias = sizeGyroSignal;
1435 inline static constexpr Index sizeGyroBiasTangent = sizeGyroBias;
1436
1437 inline static constexpr Index sizeForce = 3;
1438 inline static constexpr Index sizeForceTangent = sizeForce;
1439 inline static constexpr Index sizeTorque = 3;
1440 inline static constexpr Index sizeTorqueTangent = sizeTorque;
1441
1442 inline static constexpr Index sizeWrench = sizeForce + sizeTorque;
1443
1444 inline static constexpr Index sizeStateKine = sizePos + sizeOri + sizeLinVel + sizeAngVel;
1445 inline static constexpr Index sizeStateBase = sizeStateKine + sizeForce + sizeTorque;
1446 inline static constexpr Index sizeStateKineTangent = sizePos + sizeOriTangent + sizeLinVel + sizeAngVel;
1447 inline static constexpr Index sizeStateTangentBase = sizeStateKineTangent + sizeForce + sizeTorque;
1448
1449 inline static constexpr Index sizePose = sizePos + sizeOri;
1450 inline static constexpr Index sizePoseTangent = sizePos + sizeOriTangent;
1451
1452 inline static constexpr Index sizeContactKine = sizePose;
1453 inline static constexpr Index sizeContactKineTangent = sizePoseTangent;
1454
1455 inline static constexpr Index sizeContact = sizeContactKine + sizeWrench;
1456 inline static constexpr Index sizeContactTangent = sizeContactKineTangent + sizeWrench;
1457
1458 inline static constexpr Kinematics::Flags::Byte flagsStateKine =
1459 Kinematics::Flags::position | Kinematics::Flags::orientation | Kinematics::Flags::linVel
1460 | Kinematics::Flags::angVel;
1461
1462 inline static constexpr Kinematics::Flags::Byte flagsContactKine =
1463 Kinematics::Flags::position | Kinematics::Flags::orientation;
1464
1465 inline static constexpr Kinematics::Flags::Byte flagsPoseKine =
1466 Kinematics::Flags::position | Kinematics::Flags::orientation;
1467
1468 inline static constexpr Kinematics::Flags::Byte flagsPosKine = Kinematics::Flags::position;
1469
1470 inline static constexpr Kinematics::Flags::Byte flagsIMUKine =
1471 Kinematics::Flags::position | Kinematics::Flags::orientation | Kinematics::Flags::linVel
1472 | Kinematics::Flags::angVel | Kinematics::Flags::linAcc | Kinematics::Flags::angAcc;
1473
1475 static const double defaultMass;
1476
1477 static const double statePoseInitVarianceDefault;
1478 static const double stateOriInitVarianceDefault;
1479 static const double stateLinVelInitVarianceDefault;
1480 static const double stateAngVelInitVarianceDefault;
1481 static const double gyroBiasInitVarianceDefault;
1482 static const double unmodeledWrenchInitVarianceDefault;
1483 static const double contactForceInitVarianceDefault;
1484 static const double contactTorqueInitVarianceDefault;
1485
1486 static const double statePoseProcessVarianceDefault;
1487 static const double stateOriProcessVarianceDefault;
1488 static const double stateLinVelProcessVarianceDefault;
1489 static const double stateAngVelProcessVarianceDefault;
1490 static const double gyroBiasProcessVarianceDefault;
1491 static const double unmodeledWrenchProcessVarianceDefault;
1492 static const double contactPositionProcessVarianceDefault;
1493 static const double contactOrientationProcessVarianceDefault;
1494 static const double contactForceProcessVarianceDefault;
1495 static const double contactTorqueProcessVarianceDefault;
1496
1497 static const double acceleroVarianceDefault;
1498 static const double gyroVarianceDefault;
1499 static const double forceSensorVarianceDefault;
1500 static const double torqueSensorVarianceDefault;
1501 static const double positionSensorVarianceDefault;
1502 static const double orientationSensorVarianceDefault;
1503
1504 static const double linearStiffnessDefault;
1505 static const double angularStiffnessDefault;
1506 static const double linearDampingDefault;
1507 static const double angularDampingDefault;
1508
1510
1511 bool nanDetected_ = false;
1512 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1513
1514protected:
1517 Matrix3 angularStiffnessMatDefault_;
1518 Matrix3 linearDampingMatDefault_;
1519 Matrix3 angularDampingMatDefault_;
1520
1522 Matrix3 acceleroCovMatDefault_;
1523 Matrix3 gyroCovMatDefault_;
1524 Matrix6 contactWrenchSensorCovMatDefault_;
1525 Matrix6 absPoseSensorCovMatDefault_;
1526 Matrix3 absOriSensorCovMatDefault_;
1527
1528 Matrix3 statePosInitCovMat_;
1529 Matrix3 stateOriInitCovMat_;
1530 Matrix3 stateLinVelInitCovMat_;
1531 Matrix3 stateAngVelInitCovMat_;
1532 Matrix3 gyroBiasInitCovMat_;
1533 Matrix6 unmodeledWrenchInitCovMat_;
1534 Matrix12 contactInitCovMatDefault_;
1535
1536 Matrix3 statePosProcessCovMat_;
1537 Matrix3 stateOriProcessCovMat_;
1538 Matrix3 stateLinVelProcessCovMat_;
1539 Matrix3 stateAngVelProcessCovMat_;
1540 Matrix3 gyroBiasProcessCovMat_;
1541 Matrix6 unmodeledWrenchProcessCovMat_;
1542 Matrix3 contactPositionProcessCovMat_;
1543 Matrix3 contactOrientationProcessCovMat_;
1544 Matrix3 contactForceProcessCovMat_;
1545 Matrix3 contactTorqueProcessCovMat_;
1546 Matrix12 contactProcessCovMatDefault_;
1547
1548 Matrix12 stateKinematicsInitCovMat_;
1549 Matrix12 stateKinematicsProcessCovMat_;
1550
1552 static const double defaultdx;
1553
1555 struct Opt
1556 {
1557 Opt() : locKine(locKine1), ori(locKine.orientation), ori1(locKine1.orientation), ori2(locKine2.orientation) {}
1558
1559 LocalKinematics locKine1, locKine2;
1560 LocalKinematics & locKine;
1561 Orientation & ori;
1562 Orientation & ori1;
1563 Orientation & ori2;
1564 } opt_;
1565
1566private:
1567 Index setIMU(const Vector3 & accelero,
1568 const Vector3 & gyrometer,
1569 const Kinematics & userImuKinematics,
1570 Index num,
1571 const Matrix3 * acceleroCov,
1572 const Matrix3 * gyroCov);
1573};
1574
1575#include <state-observation/dynamics-estimators/kinetics-observer.hxx>
1576
1577} // namespace stateObservation
1578
1579#endif
Implements the accelerometer-gyrometer inertial measuremen.
virtual void measurementDifference(const Vector &measureVector1, const Vector &measureVector2, Vector &difference)
the difference operator for the measurement statevector1 ⊖ statevector2
Index getIMUMeasIndexByNum(Index num) const
Get the measurement index of the required IMU : allows to access its corresponding measurements in th...
LocalKinematics getLocalCentroidKinematics() const
Get the estimated local Kinematics of the centroid frame in the world frame (local,...
Vector6 getCentroidContactWrench(Index numContact) const
Returns the wrench exerted at the contact, expressed in the frame of the centroid.
Kinematics getContactPosition(Index contactNbr) const
Get the Contact 6D pose n in the global frame.
void setKinematicsProcessCovarianceDefault(const Matrix3 &P_pos, const Matrix3 &P_ori, const Matrix3 &P_linVel, const Matrix3 &P_angVel)
Set the default Kinematics Process Covariance.
friend int testAccelerationsJacobians(KineticsObserver &ko, int errcode, double relativeErrorThreshold, double threshold)
Comparison between the Jacobians of the linear and angular accelerations with respect to the state,...
Index getStateTangentSize() const
Get the State Vector Tangent Size.
Kinematics getGlobalKinematicsOf(const Kinematics &userBodyKin) const
Get the global kinematics of a given frame (in the user frame) in the centroid frame.
Index contactForceIndexTangent(Index contactNbr) const
Get the index of the linear force of a specific contact in the tangent sate vector.
void setStateVector(const Vector &newvalue, bool resetCovariance=true)
Set a value of the state x_k provided from another source.
Vector getMeasurementVector()
Get the Measurement Vector.
Index kineIndexTangent() const
Get the kinematics index of the tangent state vector.
Index linVelIndex() const
Get the linear velocity index of the state vector.
Index posIndex() const
Get the position index of the state vector.
void setUnmodeledWrenchInitCovMatDefault(const Matrix6 &initCovMat)
Set the default value for init Unmodeled Wrench covariance matrix.
void setAbsoluteOriSensorDefaultCovarianceMatrix(const Matrix3 &covMat)
Set the Absolute Orientation Sensor Default Covariance Matrix.
void setStateCovarianceMat(const Matrix &P)
Set the State Covariance Matrix This is useful in case of a setting a guess on a whole state vect9or.
void setCoMAngularMomentum(const Vector3 &sigma, const Vector3 &sigma_dot)
Set the Angular Momentum around the CoM and its derviative expressed in the user frame.
Index gyroBiasIndex(Index IMUNumber) const
Get the gyro bias index of the state vector.
virtual Vector measureDynamics(const Vector &x, const Vector &u, TimeIndex k)
Applies the measurement model to the given state vector using the given input to predict the sensor m...
Kinematics getUserContactInputPose(Index numContact) const
Returns the pose of the contact in the user frame, given as an input when updating the contact.
void computeLocalAccelerations(const Vector &x, Vector &acceleration)
computes the local acceleration from the given state vector
void updateMeasurements()
Updates the measurements.
double getMass() const
Returns the mass of the robot.
void resetSensorsDefaultCovMats()
Reset the default values for the sensors covariance matrices.
void setKinematicsInitCovarianceDefault(const Matrix3 &P_pos, const Matrix3 &P_ori, const Matrix3 &P_linVel, const Matrix3 &P_angVel)
Set the Default value for Kinematics Init Covariance.
Vector6 getContactWrench(Index contactNbr) const
Get the Estimated Contact Wrench This is useful in the case of uncertain wrench sensors or when conta...
void updateContactWithWrenchSensor(const Vector6 &wrenchMeasurement, const Kinematics &localKine, unsigned contactNumber)
Update the contact when it is equipped with wrench sensor.
Index contactIndexTangent(VectorContactConstIterator i) const
Getters for the indexes of the state Vector using private types.
Index contactPosIndexTangent(Index contactNbr) const
Get the index of the position of a specific contact in the tangent sate vector.
Index unmodeledTorqueIndex() const
Get the unmodeled external torque force index of the state vector.
Vector6 getUnmodeledWrench() const
Get the Unmodeled External Wrench (requires setWithUnmodeledWrench() to true before to update()).
void setCenterOfMass(const Vector3 &com)
Set the Center Of Mass kinematics expressed in the user frame.
void setGyroBiasProcessCovariance(const Matrix3 &covMat, unsigned imuNumber)
Set the Gyro Bias Process Covariance.
const IndexedMatrix3 & getInertiaMatrix() const
Returns the global inertia matrix of the robot at the center of mass.
const Vector & update()
Runs the estimation.
void setCenterOfMass(const Vector3 &com, const Vector3 &com_dot)
Set the Center Of Mass kinematics expressed in the user frame.
virtual void resetProcessNoise()
Removes the process noise.
Index contactsIndex() const
Get the index for the contact segment in the state vector.
void updateContactWithWrenchSensor(const Vector6 &wrenchMeasurement, const Matrix6 &wrenchCovMatrix, const Kinematics &localKine, unsigned contactNumber)
Update the contact when it is equipped with wrench sensor.
void setGyroBiasInitCovarianceDefault(const Matrix3 &covMat)
Set the Default value for Gyro Bias Init Covariance.
virtual void setMeasurementNoise(NoiseBase *)
Sets a noise which disturbs the measurements.
virtual void setFiniteDifferenceStep(const Vector &dx)
Set the Finite Difference time step.
virtual void useFiniteDifferencesJacobians(bool b=true)
Define if we use dinite differences Jacobian or analytic.
Kinematics getContactStateRestKinematics(Index numContact) const
Returns the estimated rest pose of the contact in the world frame.
Vector stateDifference(const Vector &stateVector1, const Vector &stateVector2)
the difference operator for the state statevector1 ⊖ statevector2
void setUnmodeledWrenchProcessCovarianceDefault(const Matrix6 &covMat)
Set the default Unmodeled Wrench Process Covariance.
void setContactStateCovMat(Index contactNbr, const Matrix12 &contactCovMat)
Set the Contact State Covariance Matrix.
void setKinematicsProcessCovarianceDefault(const Matrix12 &)
Set the default Kinematics Process Covariance.
void setAbsoluteOriSensor(const Orientation &measurement)
Set an Absolute Orientation Sensor measurement The measurement is the orientation of the observed fra...
Index contactOriIndexTangent(Index contactNbr) const
Get the index of the orientation of a specific contact in the tangent sate vector.
const IndexedMatrix3 & getInertiaMatrixDot() const
Returns the derivative of the global inertia matrix of the robot at the center of mass.
void addUnmodeledAndContactWrench_(const Vector &centroidStateVector, Vector3 &force, Vector3 &torque)
Adds the unmodeled and contact wrenches from the state to the given wrench.
void setKinematicsProcessCovariance(const Matrix12 &)
Set the Kinematics Process Covariance.
LocalKinematics estimateAccelerations()
gets the Kinematics that include the linear and angular accelerations.
Index angVelIndex() const
Get the angular velocity index of the state vector.
Index posIndexTangent() const
Get the position index of the tangent state vector.
bool getWithAccelerationEstimation() const
Returns if the estimation computes also the accelerations.
Vector stateSum(const Vector &stateVector, const Vector &tangentVector)
the sum operator for the state vector
void setInitWorldCentroidStateVector(const Vector &initStateVector)
Initializes the state vector.
void updateContactWithNoSensor(const Kinematics &localKine, unsigned contactNumber)
Update the contact when it is NOT equipped with wrench sensor.
Index getNumberOfSetContacts() const
Get the Current Number Of Contacts.
Index setIMU(const Vector3 &accelero, const Vector3 &gyrometer, const Matrix3 &acceleroCov, const Matrix3 &gyroCov, const Kinematics &userImuKinematics, Index num=-1)
Provides also the associated covariance matrices
Index oriIndex() const
Get the orientation index of the state vector.
Index angVelIndexTangent() const
Get the angular velocity index of the tangent state vector.
void setContactWrenchSensorDefaultCovarianceMatrix(const Matrix6 &wrenchSensorCovMat)
Set the Contact Wrench Sensor Default Covariance Matrix.
const IndexedVector3 & getCenterOfMassDot() const
Returns the linear velocity of the CoM of the robot in the user frame.
virtual void setProcessNoise(NoiseBase *)
Sets a noise which disturbs the state dynamics.
const ExtendedKalmanFilter & getEKF() const
Gets a const reference on the extended Kalman filter.
const IndexedVector3 & getAngularMomentumDot() const
Returns the derivative of the angular momentum of the robot at the center of mass.
void setKinematicsInitCovarianceDefault(const Matrix &)
Set the Default value for Kinematics Init Covariance.
Kinematics getCentroidContactInputPose(Index numContact) const
Returns the pose of the contact in the centroid frame, given as an input when updating the contact (o...
Index setIMU(const Vector3 &accelero, const Vector3 &gyrometer, const Kinematics &userImuKinematics, Index num=-1)
Set the measurements of an IMU and give the Kinematic of the IMU in the user frame.
void resetInputs()
reset all the sensor inputs and provided contact information but keeps the contacts themselves
Index kineIndex() const
Get the kinematics index of the state vector.
void updateLocalKineAndContacts_()
update of the state kinematics worldCentroidStateKinematics_ and of the contacts pose with the newly ...
void setAbsoluteOriSensor(const Orientation &measurement, const Matrix3 &CovarianceMatrix)
Set an Absolute Orientation Sensor measurement The measurement is the orientation of the observed fra...
void setWithGyroBias(bool b=true)
Set if the gyrometers bias is computed or not. This parameter is global for all the IMUs.
Index contactIndexTangent(Index contactNbr) const
Get the index of a specific contact in the tangent sate vector.
Index unmodeledWrenchIndex() const
Get the unmodeled external wrench index of the state vector.
void setStateUnmodeledWrench(const Vector6 &, bool resetCovariance=true)
Set the State Unmodeled Wrench.
void setWorldCentroidStateKinematics(const LocalKinematics &localKine, bool resetContactWrenches=true, bool resetCovariance=true)
Set the State Kinematics.
void convertWrenchFromUserToCentroid(const Vector3 &forceUserFrame, const Vector3 &momentUserFrame, Vector3 &forceCentroidFrame, Vector3 &momentCentroidFrame)
Returns the predicted Kinematics object of the centroid in the world frame at the time of the measure...
void setStateContact(Index index, Kinematics worldContactRestPose, const Vector6 &wrench, bool resetCovariance=true)
Set the state contact kinematics and wrench.
void setAbsolutePoseSensorDefaultCovarianceMatrix(const Matrix6 &covMat)
Set the Absolute Pose Sensor Default Covariance Matrix.
void setAbsolutePoseSensor(const Kinematics &measurement)
Set an Absolute Pose Sensor measurement The measurement is the kinematics namely position and orienta...
friend int testOrientationsJacobians(KineticsObserver &ko, int errcode, double relativeErrorThreshold, double threshold)
Comparison between the Jacobians of orientation integration with respect to an increment vector delta...
virtual Index getInputSize() const
Gets the input size.
void clearContacts()
remove all the contacts
Index getStateSize() const
Get the State Vector Size.
Matrix3 linearStiffnessMatDefault_
Default Stiffness and damping.
TimeIndex getStateVectorTimeIndex() const
Get the State Vector Internal Time Index This is for advanced use but may be used to check how many s...
Kinematics convertUserToCentroidFrame_(const Kinematics &userKine, TimeIndex k_data)
Converts a Kinematics object from the user's frame to the centroid's frame, which is used for most of...
void addUnmodeledWrench_(const Vector &centroidStateVector, Vector3 &force, Vector3 &torque)
Adds the unmodeled wrench from the state to the given wrench.
void computeContactForces_(LocalKinematics &worldCentroidStateKinematics, Vector3 &contactForce, Vector3 &contactTorque)
Computes the force exerted at a contact using the visco-elastic model on the given state vector....
void setGyroBiasProcessCovarianceDefault(const Matrix3 &covMat)
Set the default Gyro Bias Process Covariance.
virtual void stateDifference(const Vector &stateVector1, const Vector &stateVector2, Vector &difference)
the difference operator for the state statevector1 ⊖ statevector2 This version prevents a nwe vect...
void setWithAccelerationEstimation(bool b=true)
Sets if the estimation computes also the accelerations.
void computeLocalAccelerations_(LocalKinematics &localStateKine, const Vector3 &totalForceLocal, const Vector3 &totalMomentLocal, Vector3 &linAcc, Vector3 &angAcc)
Computes the local accelerations of the centroid frame in the world frame and adds them to its local ...
Index unmodeledForceIndexTangent() const
Get the unmodeled external linear force index of the tangent state vector.
void resetStateCovarianceMat()
Resets the covariance matrices to their original values.
void setGyroBiasStateCovariance(const Matrix3 &covMat, unsigned imuNumber)
Set the Gyro Bias State Covariance.
Vector6 getAdditionalWrench() const
Returns the input additional wrench, expressed in the centroid frame.
void setMass(double)
Set the total mass of the robot. This can be changed online.
void setCoMInertiaMatrix(const Matrix3 &I)
Set the 3x3 inertia matrix expressed in the user frame.
Kinematics getWorldContactPoseFromCentroid(Index numContact) const
Returns the pose of the contact in the world frame, obtained from the state pose of the centroid in t...
ExtendedKalmanFilter & getEKF()
Index unmodeledWrenchIndexTangent() const
Get the unmodeled external wrench index of the tangent state vector.
void setCoMInertiaMatrix(const Matrix3 &I, const Matrix3 &I_dot)
Set the 3x3 inertia matrix and its derivative expressed in the user frame.
void setProcessNoiseCovarianceMat(const Matrix &Q)
Set the covariance matrices for the process noises.
Index contactPosIndex(Index contactNbr) const
Get the index of the position of a specific contact in the sate vector.
Index getMeasurementSize() const
Get the Measurement vector Size.
Index addContact(const Kinematics &pose, Index contactNumber=-1, const Matrix3 &linearStiffness=Matrix3::Constant(-1), const Matrix3 &linearDamping=Matrix3::Constant(-1), const Matrix3 &angularStiffness=Matrix3::Constant(-1), const Matrix3 &angularDamping=Matrix3::Constant(-1))
Set a new contact with the environment (use default covariance matrices).
virtual void resetMeasurementNoise()
Removes the measurement noise.
void setGyroBias(const Vector3 &, unsigned numberOfIMU=1, bool resetCovariance=true)
Set the Gyro Bias Allows to initializa the value of the gyro bias of the IMU corresponding to the num...
void removeContact(Index contactnbr)
Remove a contact.
Index unmodeledForceIndex() const
Get the unmodeled external linear force index of the state vector.
void computeContactForce_(VectorContactIterator i, LocalKinematics &worldCentroidStateKinematics, Kinematics &worldRestContactPose, Vector3 &contactForce, Vector3 &contactTorque)
Computes the force exerted at a contact using the visco-elastic model on the given state vector.
void setUnmodeledWrenchStateCovMat(const Matrix6 &newCovMat)
Set the Unmodeled Wrench State Cov Mat.
void setContactProcessCovMat(Index contactNbr, const Matrix12 &contactCovMat)
Set the Contact Process Covariance Matrix.
virtual Vector stateDynamics(const Vector &x, const Vector &u, TimeIndex k)
Applies the state-transition model to the given state vector using the given input to predict the fut...
Matrix getStateCovarianceMat() const
Get the State Covariance matrix.
void setAbsolutePoseSensor(const Kinematics &measurement, const Matrix6 &CovarianceMatrix)
Set an Absolute Pose Sensor measurement The measurement is the kinematics namely position and orienta...
LocalKinematics getLocalKinematicsOf(const Kinematics &userBodyKine)
Get the local kinematics of a given frame (in the user frame) in the centroid frame.
Kinematics getGlobalCentroidKinematics() const
Get the estimated Kinematics of the centroid frame in the world frame.
void setContactProcessCovarianceDefault(const Matrix12 &covMat)
Set the default contact Process Covariance.
Index contactsIndexTangent() const
Get the index for the contact segment in the tangent state vector.
virtual ~KineticsObserver()
Destroy the Kinetics Observer.
Index contactIndex(Index contactNbr) const
Get the index of a specific contact in the sate vector.
Index gyroBiasIndexTangent(Index IMUNumber) const
Get the gyro bias index of the tangent state vector.
const IndexedVector3 & getAngularMomentum() const
Returns the angular momentum of the robot at the center of mass.
Index linVelIndexTangent() const
Get the linear velocity index of the tangent state vector.
void setCoMInertiaMatrix(const Vector6 &I, const Vector6 &I_dot)
Set the inertia matrix and its derivative as a Vector6 expressed in the user frame.
const IndexedVector3 & getCenterOfMassDotDot() const
Returns the linear acceleration of the CoM of the robot in the user frame.
void setCoMAngularMomentum(const Vector3 &sigma)
Set the Angular Momentum around the CoM expressed in the user frame.
void setSamplingTime(double)
Set the Sampling Time.
Index contactForceIndex(Index contactNbr) const
Get the index of the linear force of a specific contact in the sate vector.
virtual void stateSum(const Vector &stateVector, const Vector &tangentVector, Vector &sum)
the sum operator for the state vector This version does not allocate a new vector
void updateGlobalKine_()
updates the global kinematics of the centroid from the local ones, that can be more interpretable
void setWorldCentroidStateKinematics(const Kinematics &kine, bool resetCovariance=true)
Set the State Kinematics.
void convertUserToCentroidFrame_(const Kinematics &userKine, Kinematics &centroidKine, TimeIndex k_data)
Converts a LocalKinematics object from the user's frame to the centroid's frame, which is used for mo...
Index contactKineIndex(Index contactNbr) const
Get the index of the kinematics of a specific contact in the sate vector.
void setCoMInertiaMatrix(const Vector6 &I)
Set the inertia matrix as a Vector6 expressed in the user frame.
Index contactTorqueIndexTangent(Index contactNbr) const
Get the index of the toraue of a specific contact in the tangent sate vector.
virtual NoiseBase * getMeasurementNoise() const
Gets a pointer on the measurement noise.
void setContactInitCovMatDefault(const Matrix12 &contactCovMat)
Set the default valut for the Initial Covariance Matrix of the contact in the state.
Index contactTorqueIndex(Index contactNbr) const
Get the index of the toraue of a specific contact in the sate vector.
static const double defaultdx
default derivation steps
void setUnmodeledWrenchProcessCovMat(const Matrix6 &processCovMat)
Set the Unmodeled Wrench Process Covariance Mattix.
void setWithUnmodeledWrench(bool b=true)
Set if the unmodeled and unmeasured external wrench should be estimated.
friend int testAnalyticalAJacobianVsFD(KineticsObserver &ko, int errcode, double relativeErrorThreshold, double threshold)
Comparison between the analytical Jacobian matrix A and the one obtained by finite differences....
Index gyroBiasIndex(VectorIMUConstIterator i) const
Getters for the indexes of the state Vector using private types.
const IndexedVector3 & getCenterOfMass() const
Returns the position of the CoM of the robot in the user frame.
std::vector< Index > getListOfContacts() const
Get the List Of Contact ids.
Index unmodeledTorqueIndexTangent() const
Get the unmodeled external torque force index of the tangent state vector.
void setIMUDefaultCovarianceMatrix(const Matrix3 &acceleroCov, const Matrix3 &gyroCov)
set the default covariance matrix for IMU.
void setKinematicsStateCovariance(const Matrix &)
Set the Kinematics State Covariance.
void setAdditionalWrench(const Vector3 &force, const Vector3 &torque)
Set any Additional resultant known wrench (e.g. measured external forces and moments but no contact o...
KineticsObserver(unsigned maxContacts=4, unsigned maxNumberOfIMU=1)
Construct a new Kinetics Observer.
void addContactWrench_(const Kinematics &centroidContactKine, const Vector3 &centroidContactForce, const Vector3 &centroidContactTorque, Vector3 &totalCentroidForce, Vector3 &totalCentroidTorque)
adds the contribution of a contact wrench at the centroid to the total wrench
const Vector & getCurrentStateVector() const
Gets the current value of the state estimation in the form of a state vector .
Index contactWrenchIndex(Index contactNbr) const
Get the index of the wrench of a specific contact in the sate vector.
Index addContact(const Kinematics &pose, const Matrix12 &initialCovarianceMatrix, const Matrix12 &processCovarianceMatrix, Index contactNumber=-1, const Matrix3 &linearStiffness=Matrix3::Constant(-1), const Matrix3 &linearDamping=Matrix3::Constant(-1), const Matrix3 &angularStiffness=Matrix3::Constant(-1), const Matrix3 &angularDamping=Matrix3::Constant(-1))
Set a new contact with the environment.
Index contactKineIndexTangent(Index contactNbr) const
Get the index of the kinematics of a specific contact in the tangent sate vector.
Index contactWrenchIndexTangent(Index contactNbr) const
Get the index of the wrench of a specific contact in the sate tangent vector.
virtual NoiseBase * getProcessNoise() const
Gets the process noise.
void setCenterOfMass(const Vector3 &com, const Vector3 &com_dot, const Vector3 &com_dot_dot)
Set the Center Of Mass kinematics expressed in the user frame.
double getSamplingTime() const
Get the Sampling Time.
Index oriIndexTangent() const
Get the orientation index of the tangent state vector.
Index contactOriIndex(Index contactNbr) const
Get the index of the orientation of a specific contact in the sate vector.
This class is used to customize the way the difference between measurements, the state update functio...
Definitions of types and some structures.
Filtering of divergent component of motion (DCM) and estimation of a bias betweeen the DCM and the co...
Eigen::Vector3d Vector3
3D vector
Eigen::Matrix3d Matrix3
3x3 Scalar Matrix
Eigen::MatrixXd Matrix
Dynamic sized Matrix.
Eigen::Matrix< double, 6, 1 > Vector6
6D vector
Eigen::Matrix< double, 6, 6 > Matrix6
6x6 Scalar Matrix
Eigen::Matrix< double, 12, 12 > Matrix12
12x12 scalar Matrix
Eigen::VectorXd Vector
Dynamic sized scalar vector.
Implements integrators for the kinematics, in terms or rotations and translations.
Matrix3 angularStiffness
linear damping associated to the contact, used in the visco-elastic model
Matrix3 linearDamping
linear stiffness associated to the contact, used in the visco-elastic model
Matrix3 linearStiffness
measurement covariance matrix of the wrench sensor attached to the contact.
Matrix3 angularDamping
angular stiffness associated to the contact, used in the visco-elastic model
bool isSet
angular damping associated to the contact, used in the visco-elastic model
CheckedMatrix6 sensorCovMatrix
Describes the kinematics of the contact point in the centroid's frame.
Kinematics userContactKine
Describes the measured wrench (forces + torques) at the contact in the sensor's frame.
Kinematics centroidContactKine
Describes the kinematics of the contact point in the centroid's frame.
Class facilitating the manipulation of the kinematics of a frame within another and the associated op...
Class facilitating the manipulation of the local kinematics of a frame within another and the associa...