This observer estimates the kinematics, the external forces, the bias on the gyrometers measurements, and the contacts forces and pose. More...
#include <state-observation/dynamics-estimators/kinetics-observer.hpp>
Classes | |
struct | AbsoluteOriSensor |
struct | AbsolutePoseSensor |
struct | Contact |
struct | IMU |
struct | Opt |
a structure to optimize computations More... | |
struct | Sensor |
Public Types | |
typedef kine::Kinematics | Kinematics |
typedef kine::LocalKinematics | LocalKinematics |
typedef kine::Orientation | Orientation |
Public Member Functions | |
Constructors and destructors | |
KineticsObserver (unsigned maxContacts=4, unsigned maxNumberOfIMU=1) | |
Construct a new Kinetics Observer. More... | |
virtual | ~KineticsObserver () |
Destroy the Kinetics Observer. More... | |
Setting and getting parameters | |
For initialization and update of parameters that should not evolve over time on a sample basis. | |
double | getSamplingTime () const |
Get the Sampling Time. More... | |
void | setSamplingTime (double) |
Set the Sampling Time. More... | |
void | setWithUnmodeledWrench (bool b=true) |
Set if the unmodeled and unmeasured external wrench should be estimated. More... | |
void | setWithAccelerationEstimation (bool b=true) |
Sets if the estimation computes also the accelerations. More... | |
bool | getWithAccelerationEstimation () const |
Returns if the estimation computes also the accelerations. More... | |
void | setWithGyroBias (bool b=true) |
Set if the gyrometers bias is computed or not. This parameter is global for all the IMUs. More... | |
void | setMass (double) |
Set the total mass of the robot. This can be changed online. More... | |
double | getMass () const |
Returns the mass of the robot. More... | |
const IndexedMatrix3 & | getInertiaMatrix () const |
Returns the global inertia matrix of the robot at the center of mass. More... | |
const IndexedMatrix3 & | getInertiaMatrixDot () const |
Returns the derivative of the global inertia matrix of the robot at the center of mass. More... | |
const IndexedVector3 & | getAngularMomentum () const |
Returns the angular momentum of the robot at the center of mass. More... | |
const IndexedVector3 & | getAngularMomentumDot () const |
Returns the derivative of the angular momentum of the robot at the center of mass. More... | |
const IndexedVector3 & | getCenterOfMass () const |
Returns the position of the CoM of the robot in the user frame. More... | |
const IndexedVector3 & | getCenterOfMassDot () const |
Returns the linear velocity of the CoM of the robot in the user frame. More... | |
const IndexedVector3 & | getCenterOfMassDotDot () const |
Returns the linear acceleration of the CoM of the robot in the user frame. More... | |
Vector6 | getAdditionalWrench () const |
Returns the input additional wrench, expressed in the centroid frame. More... | |
Setting kinematic sensors | |
These are the methods to be called at each iteration to give the control inputs and the sensor measurement for IMUs and absolute pose sensors. ////////////////////////////////////////////////////////// | |
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. More... | |
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 More... | |
void | setIMUDefaultCovarianceMatrix (const Matrix3 &acceleroCov, const Matrix3 &gyroCov) |
set the default covariance matrix for IMU. More... | |
void | setAbsolutePoseSensor (const Kinematics &measurement) |
Set an Absolute Pose Sensor measurement The measurement is the kinematics namely position and orientation of the observed frame in the global frame. More... | |
void | setAbsolutePoseSensor (const Kinematics &measurement, const Matrix6 &CovarianceMatrix) |
Set an Absolute Pose Sensor measurement The measurement is the kinematics namely position and orientation of the observed frame in the global frame. More... | |
void | setAbsolutePoseSensorDefaultCovarianceMatrix (const Matrix6 &covMat) |
Set the Absolute Pose Sensor Default Covariance Matrix. More... | |
void | setAbsoluteOriSensor (const Orientation &measurement) |
Set an Absolute Orientation Sensor measurement The measurement is the orientation of the observed frame in the global frame. More... | |
void | setAbsoluteOriSensor (const Orientation &measurement, const Matrix3 &CovarianceMatrix) |
Set an Absolute Orientation Sensor measurement The measurement is the orientation of the observed frame in the global frame. More... | |
void | setAbsoluteOriSensorDefaultCovarianceMatrix (const Matrix3 &covMat) |
Set the Absolute Orientation Sensor Default Covariance Matrix. More... | |
Adding, managing and deleting contacts | |
This class does NOT detect new contacts with the environment. Use these classes instead. Call these only when a new contact is created or removed from the environment, otherwise the contacts will remain the same at each new iteration. | |
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. More... | |
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) More... | |
void | removeContact (Index contactnbr) |
Remove a contact. More... | |
void | clearContacts () |
remove all the contacts More... | |
Index | getNumberOfSetContacts () const |
Get the Current Number Of Contacts. More... | |
std::vector< Index > | getListOfContacts () const |
Get the List Of Contact ids. More... | |
Updating contact information | |
Calling one of the two following methods (updateContactWithWrenchSensor() and updateContactWithNoSensor()) is MANDATORY for every contact and at every iteration.
| |
void | updateContactWithNoSensor (const Kinematics &localKine, unsigned contactNumber) |
Update the contact when it is NOT equipped with wrench sensor. More... | |
void | updateContactWithWrenchSensor (const Vector6 &wrenchMeasurement, const Kinematics &localKine, unsigned contactNumber) |
Update the contact when it is equipped with wrench sensor. More... | |
void | updateContactWithWrenchSensor (const Vector6 &wrenchMeasurement, const Matrix6 &wrenchCovMatrix, const Kinematics &localKine, unsigned contactNumber) |
Update the contact when it is equipped with wrench sensor. More... | |
void | setContactWrenchSensorDefaultCovarianceMatrix (const Matrix6 &wrenchSensorCovMat) |
Set the Contact Wrench Sensor Default Covariance Matrix. More... | |
Setting additional inputs to the dynamical system | |
It is highly recommended to set these inputs at each iteration //////////////////////////////////////////////// | |
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. More... | |
void | setCenterOfMass (const Vector3 &com, const Vector3 &com_dot) |
Set the Center Of Mass kinematics expressed in the user frame. More... | |
void | setCenterOfMass (const Vector3 &com) |
Set the Center Of Mass kinematics expressed in the user frame. More... | |
void | setCoMInertiaMatrix (const Matrix3 &I, const Matrix3 &I_dot) |
Set the 3x3 inertia matrix and its derivative expressed in the user frame. More... | |
void | setCoMInertiaMatrix (const Matrix3 &I) |
Set the 3x3 inertia matrix expressed in the user frame. More... | |
void | setCoMInertiaMatrix (const Vector6 &I, const Vector6 &I_dot) |
Set the inertia matrix and its derivative as a Vector6 expressed in the user frame. More... | |
void | setCoMInertiaMatrix (const Vector6 &I) |
Set the inertia matrix as a Vector6 expressed in the user frame. More... | |
void | setCoMAngularMomentum (const Vector3 &sigma, const Vector3 &sigma_dot) |
Set the Angular Momentum around the CoM and its derviative expressed in the user frame. More... | |
void | setCoMAngularMomentum (const Vector3 &sigma) |
Set the Angular Momentum around the CoM expressed in the user frame. More... | |
void | setAdditionalWrench (const Vector3 &force, const Vector3 &torque) |
Set any Additional resultant known wrench (e.g. measured external forces and moments but no contact ones) expressed in the local estimated frame. More... | |
Running and getting the estimations | |
///////////////////////////////////////////////////////// | |
void | updateMeasurements () |
Updates the measurements. More... | |
const Vector & | update () |
Runs the estimation. More... | |
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 measurement predictions. More... | |
LocalKinematics | getLocalCentroidKinematics () const |
Get the estimated local Kinematics of the centroid frame in the world frame (local, which means expressed in the centroid frame). More... | |
Kinematics | getGlobalCentroidKinematics () const |
Get the estimated Kinematics of the centroid frame in the world frame. More... | |
LocalKinematics | estimateAccelerations () |
gets the Kinematics that include the linear and angular accelerations. More... | |
LocalKinematics | getLocalKinematicsOf (const Kinematics &userBodyKine) |
Get the local kinematics of a given frame (in the user frame) in the centroid frame. More... | |
Kinematics | getGlobalKinematicsOf (const Kinematics &userBodyKin) const |
Get the global kinematics of a given frame (in the user frame) in the centroid frame. More... | |
Vector6 | getContactWrench (Index contactNbr) const |
Get the Estimated Contact Wrench This is useful in the case of uncertain wrench sensors or when contact force measurement is not available. More... | |
Kinematics | getContactPosition (Index contactNbr) const |
Get the Contact 6D pose n in the global frame. More... | |
Vector6 | getUnmodeledWrench () const |
Get the Unmodeled External Wrench (requires setWithUnmodeledWrench() to true before to update()) More... | |
Set values for state components | |
/////////////////////////////////////////////////////////// These methods allow to update some parts of the state of the system based on guesses obtained independently | |
void | setWorldCentroidStateKinematics (const LocalKinematics &localKine, bool resetContactWrenches=true, bool resetCovariance=true) |
Set the State Kinematics. More... | |
void | setWorldCentroidStateKinematics (const Kinematics &kine, bool resetCovariance=true) |
Set the State Kinematics. More... | |
void | setStateContact (Index index, Kinematics worldContactRestPose, const Vector6 &wrench, bool resetCovariance=true) |
Set the state contact kinematics and wrench. More... | |
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 numberOfIMU. More... | |
void | setStateUnmodeledWrench (const Vector6 &, bool resetCovariance=true) |
Set the State Unmodeled Wrench. More... | |
Estimator resets | |
This allows to reset default values for specific parameters of the estimator | |
void | resetSensorsDefaultCovMats () |
Reset the default values for the sensors covariance matrices. More... | |
void | resetInputs () |
reset all the sensor inputs and provided contact information but keeps the contacts themselves More... | |
Covariance matrices operations | |
void | setKinematicsInitCovarianceDefault (const Matrix &) |
Set the Default value for Kinematics Init Covariance. More... | |
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. More... | |
void | setGyroBiasInitCovarianceDefault (const Matrix3 &covMat) |
Set the Default value for Gyro Bias Init Covariance. More... | |
void | setUnmodeledWrenchInitCovMatDefault (const Matrix6 &initCovMat) |
Set the default value for init Unmodeled Wrench covariance matrix. More... | |
void | setContactInitCovMatDefault (const Matrix12 &contactCovMat) |
Set the default valut for the Initial Covariance Matrix of the contact in the state. More... | |
void | setKinematicsStateCovariance (const Matrix &) |
Set the Kinematics State Covariance. More... | |
void | setGyroBiasStateCovariance (const Matrix3 &covMat, unsigned imuNumber) |
Set the Gyro Bias State Covariance. More... | |
void | setUnmodeledWrenchStateCovMat (const Matrix6 &newCovMat) |
Set the Unmodeled Wrench State Cov Mat. More... | |
void | setContactStateCovMat (Index contactNbr, const Matrix12 &contactCovMat) |
Set the Contact State Covariance Matrix. More... | |
void | setKinematicsProcessCovarianceDefault (const Matrix12 &) |
Set the default Kinematics Process Covariance. More... | |
void | setKinematicsProcessCovarianceDefault (const Matrix3 &P_pos, const Matrix3 &P_ori, const Matrix3 &P_linVel, const Matrix3 &P_angVel) |
Set the default Kinematics Process Covariance. More... | |
void | setGyroBiasProcessCovarianceDefault (const Matrix3 &covMat) |
Set the default Gyro Bias Process Covariance. More... | |
void | setUnmodeledWrenchProcessCovarianceDefault (const Matrix6 &covMat) |
Set the default Unmodeled Wrench Process Covariance. More... | |
void | setContactProcessCovarianceDefault (const Matrix12 &covMat) |
Set the default contact Process Covariance. More... | |
void | setKinematicsProcessCovariance (const Matrix12 &) |
Set the Kinematics Process Covariance. More... | |
void | setGyroBiasProcessCovariance (const Matrix3 &covMat, unsigned imuNumber) |
Set the Gyro Bias Process Covariance. More... | |
void | setUnmodeledWrenchProcessCovMat (const Matrix6 &processCovMat) |
Set the Unmodeled Wrench Process Covariance Mattix. More... | |
void | setContactProcessCovMat (Index contactNbr, const Matrix12 &contactCovMat) |
Set the Contact Process Covariance Matrix. More... | |
void | resetStateCovarianceMat () |
Resets the covariance matrices to their original values. More... | |
void | resetStateKinematicsCovMat () |
void | resetStateGyroBiasCovMat (Index i) |
void | resetStateUnmodeledWrenchCovMat () |
void | resetStateContactsCovMat () |
void | resetStateContactCovMat (Index contactNbr) |
void | resetProcessCovarianceMat () |
void | resetProcessKinematicsCovMat () |
void | resetProcessGyroBiasCovMat (Index i) |
void | resetProcessUnmodeledWrenchCovMat () |
void | resetProcessContactsCovMat () |
void | resetProcessContactCovMat (Index contactNbr) |
State vector representation operations (advanced use) | |
@ this is constituted with
| |
Index | getStateSize () const |
Get the State Vector Size. More... | |
Index | getStateTangentSize () const |
Get the State Vector Tangent Size. More... | |
Index | getMeasurementSize () const |
Get the Measurement vector Size. More... | |
Matrix | getStateCovarianceMat () const |
Get the State Covariance matrix. More... | |
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. More... | |
void | setProcessNoiseCovarianceMat (const Matrix &Q) |
Set the covariance matrices for the process noises. More... | |
const Vector & | getCurrentStateVector () const |
Gets the current value of the state estimation in the form of a state vector \(\hat{x_{k}}\). More... | |
TimeIndex | getStateVectorTimeIndex () const |
Get the State Vector Internal Time Index This is for advanced use but may be used to check how many states have been estimated up to now. More... | |
void | setInitWorldCentroidStateVector (const Vector &initStateVector) |
Initializes the state vector. More... | |
void | setStateVector (const Vector &newvalue, bool resetCovariance=true) |
Set a value of the state x_k provided from another source. More... | |
Vector | getMeasurementVector () |
Get the Measurement Vector. More... | |
Index | kineIndex () const |
Get the kinematics index of the state vector. More... | |
Index | posIndex () const |
Get the position index of the state vector. More... | |
Index | oriIndex () const |
Get the orientation index of the state vector. More... | |
Index | linVelIndex () const |
Get the linear velocity index of the state vector. More... | |
Index | angVelIndex () const |
Get the angular velocity index of the state vector. More... | |
Index | gyroBiasIndex (Index IMUNumber) const |
Get the gyro bias index of the state vector. More... | |
Index | unmodeledWrenchIndex () const |
Get the unmodeled external wrench index of the state vector. More... | |
Index | unmodeledForceIndex () const |
Get the unmodeled external linear force index of the state vector. More... | |
Index | unmodeledTorqueIndex () const |
Get the unmodeled external torque force index of the state vector. More... | |
Index | contactsIndex () const |
Get the index for the contact segment in the state vector. More... | |
Index | contactIndex (Index contactNbr) const |
Get the index of a specific contact in the sate vector. More... | |
Index | contactKineIndex (Index contactNbr) const |
Get the index of the kinematics of a specific contact in the sate vector. More... | |
Index | contactPosIndex (Index contactNbr) const |
Get the index of the position of a specific contact in the sate vector. More... | |
Index | contactOriIndex (Index contactNbr) const |
Get the index of the orientation of a specific contact in the sate vector. More... | |
Index | contactForceIndex (Index contactNbr) const |
Get the index of the linear force of a specific contact in the sate vector. More... | |
Index | contactTorqueIndex (Index contactNbr) const |
Get the index of the toraue of a specific contact in the sate vector. More... | |
Index | contactWrenchIndex (Index contactNbr) const |
Get the index of the wrench of a specific contact in the sate vector. More... | |
Index | kineIndexTangent () const |
Get the kinematics index of the tangent state vector. More... | |
Index | posIndexTangent () const |
Get the position index of the tangent state vector. More... | |
Index | oriIndexTangent () const |
Get the orientation index of the tangent state vector. More... | |
Index | linVelIndexTangent () const |
Get the linear velocity index of the tangent state vector. More... | |
Index | angVelIndexTangent () const |
Get the angular velocity index of the tangent state vector. More... | |
Index | gyroBiasIndexTangent (Index IMUNumber) const |
Get the gyro bias index of the tangent state vector. More... | |
Index | unmodeledWrenchIndexTangent () const |
Get the unmodeled external wrench index of the tangent state vector. More... | |
Index | unmodeledForceIndexTangent () const |
Get the unmodeled external linear force index of the tangent state vector. More... | |
Index | unmodeledTorqueIndexTangent () const |
Get the unmodeled external torque force index of the tangent state vector. More... | |
Index | contactsIndexTangent () const |
Get the index for the contact segment in the tangent state vector. More... | |
Index | contactIndexTangent (Index contactNbr) const |
Get the index of a specific contact in the tangent sate vector. More... | |
Index | contactKineIndexTangent (Index contactNbr) const |
Get the index of the kinematics of a specific contact in the tangent sate vector. More... | |
Index | contactPosIndexTangent (Index contactNbr) const |
Get the index of the position of a specific contact in the tangent sate vector. More... | |
Index | contactOriIndexTangent (Index contactNbr) const |
Get the index of the orientation of a specific contact in the tangent sate vector. More... | |
Index | contactForceIndexTangent (Index contactNbr) const |
Get the index of the linear force of a specific contact in the tangent sate vector. More... | |
Index | contactTorqueIndexTangent (Index contactNbr) const |
Get the index of the toraue of a specific contact in the tangent sate vector. More... | |
Index | contactWrenchIndexTangent (Index contactNbr) const |
Get the index of the wrench of a specific contact in the sate tangent vector. More... | |
Getters for the extended Kalman filter (advanced use) | |
const ExtendedKalmanFilter & | getEKF () const |
Gets a const reference on the extended Kalman filter. More... | |
ExtendedKalmanFilter & | getEKF () |
Vector6 | getCentroidContactWrench (Index numContact) const |
Returns the wrench exerted at the contact, expressed in the frame of the centroid. More... | |
Kinematics | getCentroidContactInputPose (Index numContact) const |
Returns the pose of the contact in the centroid frame, given as an input when updating the contact (obtained from its pose in the user frame). More... | |
Kinematics | getWorldContactPoseFromCentroid (Index numContact) const |
Returns the pose of the contact in the world frame, obtained from the state pose of the centroid in the world frame. More... | |
Kinematics | getContactStateRestKinematics (Index numContact) const |
Returns the estimated rest pose of the contact in the world frame. More... | |
Kinematics | getUserContactInputPose (Index numContact) const |
Returns the pose of the contact in the user frame, given as an input when updating the contact. More... | |
Index | getIMUMeasIndexByNum (Index num) const |
Get the measurement index of the required IMU : allows to access its corresponding measurements in the measurement vector for example. More... | |
Index | getContactMeasIndexByNum (Index num) const |
bool | getContactIsSetByNum (Index num) const |
Public Attributes | |
bool | nanDetected_ = false |
Protected Types | |
typedef std::vector< IMU, Eigen::aligned_allocator< IMU > > | VectorIMU |
typedef VectorIMU::iterator | VectorIMUIterator |
typedef VectorIMU::const_iterator | VectorIMUConstIterator |
typedef std::vector< Contact, Eigen::aligned_allocator< Contact > > | VectorContact |
typedef VectorContact::iterator | VectorContactIterator |
typedef VectorContact::const_iterator | VectorContactConstIterator |
Protected Member Functions | |
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 future state. More... | |
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 measurements. More... | |
void | addUnmodeledAndContactWrench_ (const Vector ¢roidStateVector, Vector3 &force, Vector3 &torque) |
Adds the unmodeled and contact wrenches from the state to the given wrench. More... | |
void | addUnmodeledWrench_ (const Vector ¢roidStateVector, Vector3 &force, Vector3 &torque) |
Adds the unmodeled wrench from the state to the given wrench. More... | |
void | addContactWrench_ (const Kinematics ¢roidContactKine, const Vector3 ¢roidContactForce, const Vector3 ¢roidContactTorque, Vector3 &totalCentroidForce, Vector3 &totalCentroidTorque) |
adds the contribution of a contact wrench at the centroid to the total wrench More... | |
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 kinematics. More... | |
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. More... | |
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. Compute the resulting wrench for all currently set contacts. More... | |
virtual void | setProcessNoise (NoiseBase *) |
Sets a noise which disturbs the state dynamics. More... | |
virtual void | resetProcessNoise () |
Removes the process noise. More... | |
virtual NoiseBase * | getProcessNoise () const |
Gets the process noise. More... | |
virtual void | setMeasurementNoise (NoiseBase *) |
Sets a noise which disturbs the measurements. More... | |
virtual void | resetMeasurementNoise () |
Removes the measurement noise. More... | |
virtual NoiseBase * | getMeasurementNoise () const |
Gets a pointer on the measurement noise. More... | |
virtual Index | getInputSize () const |
Gets the input size. More... | |
void | stateNaNCorrection_ () |
void | updateLocalKineAndContacts_ () |
update of the state kinematics worldCentroidStateKinematics_ and of the contacts pose with the newly estimated state More... | |
void | updateGlobalKine_ () |
updates the global kinematics of the centroid from the local ones, that can be more interpretable More... | |
void | startNewIteration_ () |
void | convertUserToCentroidFrame_ (const Kinematics &userKine, Kinematics ¢roidKine, TimeIndex k_data) |
Converts a LocalKinematics object from the user's frame to the centroid's frame, which is used for most of the computations. More... | |
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 the computations. More... | |
Index | gyroBiasIndex (VectorIMUConstIterator i) const |
Getters for the indexes of the state Vector using private types. More... | |
Index | gyroBiasIndexTangent (VectorIMUConstIterator i) const |
Index | contactIndex (VectorContactConstIterator i) const |
Index | contactKineIndex (VectorContactConstIterator i) const |
Index | contactPosIndex (VectorContactConstIterator i) const |
Index | contactOriIndex (VectorContactConstIterator i) const |
Index | contactForceIndex (VectorContactConstIterator i) const |
Index | contactTorqueIndex (VectorContactConstIterator i) const |
Index | contactWrenchIndex (VectorContactConstIterator i) const |
Index | contactIndexTangent (VectorContactConstIterator i) const |
Getters for the indexes of the state Vector using private types. More... | |
Index | contactKineIndexTangent (VectorContactConstIterator i) const |
Index | contactPosIndexTangent (VectorContactConstIterator i) const |
Index | contactOriIndexTangent (VectorContactConstIterator i) const |
Index | contactForceIndexTangent (VectorContactConstIterator i) const |
Index | contactTorqueIndexTangent (VectorContactConstIterator i) const |
Index | contactWrenchIndexTangent (VectorContactConstIterator i) const |
![]() | |
void | assertStateVector_ (const Vector &v) |
void | assertInputVector_ (const Vector &v) |
DynamicalSystemFunctorBase () | |
virtual | ~DynamicalSystemFunctorBase () |
virtual void | reset () |
virtual bool | checkStateVector (const Vector &) |
Gives a boolean answer on whether or not the vector is correctly sized to be a state vector. More... | |
virtual bool | checkInputvector (const Vector &) |
Gives a boolean answer on whether or not the vector is correctly sized to be an input vector. More... | |
Static Protected Attributes | |
static const double | defaultdx |
default derivation steps More... | |
State vector representation arithmetics and derivation (advanced use) | |
Vector | stateSum (const Vector &stateVector, const Vector &tangentVector) |
the sum operator for the state vector More... | |
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 More... | |
Vector | stateDifference (const Vector &stateVector1, const Vector &stateVector2) |
the difference operator for the state statevector1 ⊖ statevector2 More... | |
virtual void | stateDifference (const Vector &stateVector1, const Vector &stateVector2, Vector &difference) |
the difference operator for the state statevector1 ⊖ statevector2 This version prevents a nwe vector allocation More... | |
virtual void | measurementDifference (const Vector &measureVector1, const Vector &measureVector2, Vector &difference) |
the difference operator for the measurement statevector1 ⊖ statevector2 More... | |
virtual void | useFiniteDifferencesJacobians (bool b=true) |
Define if we use dinite differences Jacobian or analytic. More... | |
virtual void | setFiniteDifferenceStep (const Vector &dx) |
Set the Finite Difference time step. More... | |
virtual Matrix | computeAMatrix () |
virtual Matrix | computeCMatrix () |
void | computeLocalAccelerations (const Vector &x, Vector &acceleration) |
computes the local acceleration from the given state vector More... | |
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, obtained with finite differences and analyticially. More... | |
int | testAnalyticalAJacobianVsFD (KineticsObserver &ko, int errcode, double relativeErrorThreshold, double threshold) |
Comparison between the analytical Jacobian matrix A and the one obtained by finite differences. Used to test the analytical method. More... | |
int | testAnalyticalCJacobianVsFD (KineticsObserver &ko, int errcode, double relativeErrorThreshold, double threshold) |
int | testOrientationsJacobians (KineticsObserver &ko, int errcode, double relativeErrorThreshold, double threshold) |
Comparison between the Jacobians of orientation integration with respect to an increment vector delta, obtained with finite differences and analyticially. More... | |
This observer estimates the kinematics, the external forces, the bias on the gyrometers measurements, and the contacts forces and pose.
Our observer estimates the localkinematics of the centroid's frame within the world frame. The reason to choose the centroid's frame is that it simplifies many expressions, for example the expressions of the accelerations. This estimation is based on the assumption of viscoelastic contacts and using three kinds of measurements: IMUs, Force/Torque measurements (contact and other ones) and any absolute position measurements. Inputs are given in a frame whose choice is at the user's discretion, we therefore call it the user frame.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
stateObservation::KineticsObserver::KineticsObserver | ( | unsigned | maxContacts = 4 , |
unsigned | maxNumberOfIMU = 1 |
||
) |
Construct a new Kinetics Observer.
maxContacts | maximum number of contacts between the robot and the environment. These do not include the additional forces nor the estimated unmodeled forces |
maxNumberOfIMU | the maximum number of IMUs. They don't have to give measurements at each iterations and they don't have to be synchronized |
|
virtual |
Destroy the Kinetics Observer.
Index stateObservation::KineticsObserver::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.
pose | is the initial guess on the position of the contact in the WORLD frame. Only position and orientation are enough. If the contact is compliant, you need to set the "rest" pose of the contact (i.e. the pose that gives zero reaction force) |
initialCovarianceMatrix | is the covariance matrix expressing the uncertainty in the pose of the initial guess in the 6x6 upper left corner ( if no good initial guess is available give a rough position with a high initial covariance matrix, if the position is certain, set it to zero.) and the initial wrench in the 6x6 lower right corner. |
processCovarianceMatrix | is the covariance matrix expressing the rate at which the contact slides or drifts in the 6x6 upper left corner (set to zero for no sliding) and the certainty in the reaction force model (viscoelastic) in the prediction of the contact force |
contactNumber | the number id of the contact to add. If no predefined id, use -1 (default) in order to set the number automatically |
linearStiffness | the linear stiffness of the contact viscoelastic model, if unknown, set to Matrix3::Constant(-1) (default) to use the default one |
linearDamping | the linear damping of the contact viscoelastic model, if unknown, set to Matrix3::Constant(-1) (default) to use the default one |
angularStiffness | the angular stiffness of the contact viscoelastic model, if unknown, set to Matrix3::Constant(-1) (default) to use the default one |
angularDamping | the angular damping of the contact viscoelastic model, if unknown, set to Matrix3::Constant(-1) (default) to use the default one |
Index stateObservation::KineticsObserver::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)
pose | is the initial guess on the position of the contact in the WORLD frame. Only position and orientation are enough |
contactNumber | the number id of the contact to add. If no predefined id, use -1 (default) in order to set the number automatically |
linearStiffness | the linear stiffness of the contact viscoelastic model, if unknown, set to Matrix3::Constant(-1) (default) to use the default one |
linearDamping | the linear damping of the contact viscoelastic model, if unknown, set to Matrix3::Constant(-1) (default) to use the default one |
angularStiffness | the angular stiffness of the contact viscoelastic model, if unknown, set to Matrix3::Constant(-1) (default) to use the default one |
angularDamping | the angular damping of the contact viscoelastic model, if unknown, set to Matrix3:::Constant(-1) (default) to use the default one |
|
protected |
adds the contribution of a contact wrench at the centroid to the total wrench
centroidContactKine | The Kinematics of the current contact at the centroid |
centroidContactForce | The contact force at the centroid to add to the total force |
centroidContactTorque | The contact torque at the centroid to add to the total torque |
totalCentroidForce | The total force exerced at the centroid, that will be completed with the contact's force |
totalCentroidTorque | The total torque exerced at the centroid, that will be completed with the contact's torque |
|
protected |
Adds the unmodeled and contact wrenches from the state to the given wrench.
centroidStateVector | The current state vector |
force | The force we want to add the forces to. Must be expressed in the centroid frame. |
torque | The torque we want to add the torques to. Must be expressed in the centroid frame. |
|
protected |
Adds the unmodeled wrench from the state to the given wrench.
centroidStateVector | The current state vector |
force | The force we want to add the unmodeled force to. Must be expressed in the centroid frame. |
torque | The torque we want to add the unmodeled torque to. Must be expressed in the centroid frame. |
|
inline |
Get the angular velocity index of the state vector.
|
inline |
Get the angular velocity index of the tangent state vector.
void stateObservation::KineticsObserver::clearContacts | ( | ) |
remove all the contacts
|
virtual |
|
virtual |
|
protected |
Computes the force exerted at a contact using the visco-elastic model on the given state vector.
i | Contact to estimate |
worldCentroidStateKinematics | State vector used in the visco-elastic model |
worldRestContactPose | Rest pose of the contact |
contactForce | Empty vector of the contact force to estimate |
contactTorque | Empty vector of the contact force to estimate |
|
protected |
Computes the force exerted at a contact using the visco-elastic model on the given state vector. Compute the resulting wrench for all currently set contacts.
worldCentroidStateKinematics | State vector used in the visco-elastic model |
contactForce | Empty vector of the contact force to estimate |
contactTorque | Empty vector of the contact force to estimate |
void stateObservation::KineticsObserver::computeLocalAccelerations | ( | const Vector & | x, |
Vector & | acceleration | ||
) |
computes the local acceleration from the given state vector
|
protected |
Computes the local accelerations of the centroid frame in the world frame and adds them to its local kinematics.
localStateKine | The local kinematics of the centroid frame in the world frame that still don't contain the accelerations. |
centroidContactForce | The contact force at the centroid to add to the total force |
totalForceLocal | Total force exerted on the centroid. |
totalMomentLocal | Total torque exerted on the centroid. |
linAcc | The empty vector of the linear acceleration we want to compute. |
angAcc | The empty vector of the angular acceleration we want to compute. |
Get the index of the linear force of a specific contact in the sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of the linear force of a specific contact in the tangent sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of a specific contact in the sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of a specific contact in the tangent sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Getters for the indexes of the state Vector using private types.
Get the index of the kinematics of a specific contact in the sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of the kinematics of a specific contact in the tangent sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of the orientation of a specific contact in the sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of the orientation of a specific contact in the tangent sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of the position of a specific contact in the sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of the position of a specific contact in the tangent sate vector.
contactNbr | The contact number id |
|
inlineprotected |
|
inline |
Get the index for the contact segment in the state vector.
|
inline |
Get the index for the contact segment in the tangent state vector.
Get the index of the toraue of a specific contact in the sate vector.
contactNbr | The contact number id |
|
inlineprotected |
|
inline |
Get the index of the toraue of a specific contact in the tangent sate vector.
contactNbr | The contact number id |
|
inlineprotected |
Get the index of the wrench of a specific contact in the sate vector.
contactNbr | The contact number id |
|
inlineprotected |
|
inline |
Get the index of the wrench of a specific contact in the sate tangent vector.
contactNbr | The contact number id |
|
inlineprotected |
|
protected |
Converts a LocalKinematics object from the user's frame to the centroid's frame, which is used for most of the computations.
userKine | the LocalKinematics object expressed in the user's frame. It is likely to correspond to the IMU's LocalKinematics, defined by the user in its frame. |
centroidKine | the LocalKinematics object corresponding to the converted LocalKinematics in the centroid's frame. |
|
protected |
Converts a Kinematics object from the user's frame to the centroid's frame, which is used for most of the computations.
userKine | the Kinematics object expressed in the user's frame. It is likely to correspond to the contact's Kinematics, defined by the user in its frame. |
void stateObservation::KineticsObserver::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 measurement predictions.
Converts a given wrench from the user to the centroid frame
Performs the conversion of a wrench {force, torque} from the user frame to the centroid frame.
LocalKinematics stateObservation::KineticsObserver::estimateAccelerations | ( | ) |
gets the Kinematics that include the linear and angular accelerations.
This method computes the estimated accelerations from the observed state of the robot. It means this acceleration is filtered by the model
Vector6 stateObservation::KineticsObserver::getAdditionalWrench | ( | ) | const |
Returns the input additional wrench, expressed in the centroid frame.
const IndexedVector3& stateObservation::KineticsObserver::getAngularMomentum | ( | ) | const |
Returns the angular momentum of the robot at the center of mass.
const IndexedVector3& stateObservation::KineticsObserver::getAngularMomentumDot | ( | ) | const |
Returns the derivative of the angular momentum of the robot at the center of mass.
const IndexedVector3& stateObservation::KineticsObserver::getCenterOfMass | ( | ) | const |
Returns the position of the CoM of the robot in the user frame.
const IndexedVector3& stateObservation::KineticsObserver::getCenterOfMassDot | ( | ) | const |
Returns the linear velocity of the CoM of the robot in the user frame.
const IndexedVector3& stateObservation::KineticsObserver::getCenterOfMassDotDot | ( | ) | const |
Returns the linear acceleration of the CoM of the robot in the user frame.
Kinematics stateObservation::KineticsObserver::getCentroidContactInputPose | ( | Index | numContact | ) | const |
Returns the pose of the contact in the centroid frame, given as an input when updating the contact (obtained from its pose in the user frame).
Returns the wrench exerted at the contact, expressed in the frame of the centroid.
bool stateObservation::KineticsObserver::getContactIsSetByNum | ( | Index | num | ) | const |
Kinematics stateObservation::KineticsObserver::getContactPosition | ( | Index | contactNbr | ) | const |
Get the Contact 6D pose n in the global frame.
The contact position may be uncertain, this estimator uses the input data, the kinematic and the dynamic models to estimate the position of the contact in the environment This position is the "rest position" of the contact and therefore is different from what is obtained using forward kinematics because it does not include the contact deformation due to the contact forces
contactNbr | The contact number id |
Kinematics stateObservation::KineticsObserver::getContactStateRestKinematics | ( | Index | numContact | ) | const |
Returns the estimated rest pose of the contact in the world frame.
Get the Estimated Contact Wrench This is useful in the case of uncertain wrench sensors or when contact force measurement is not available.
get the contact force provided by the estimator which is different from a contact sensor measurement
contactNbr |
const Vector& stateObservation::KineticsObserver::getCurrentStateVector | ( | ) | const |
Gets the current value of the state estimation in the form of a state vector \(\hat{x_{k}}\).
//////////////////////////////// Getters and setters for the state vectors ////////////////////////////////
ExtendedKalmanFilter& stateObservation::KineticsObserver::getEKF | ( | ) |
Gets a reference on the extended Kalman filter modifying this object may lead to instabilities
const ExtendedKalmanFilter& stateObservation::KineticsObserver::getEKF | ( | ) | const |
Gets a const reference on the extended Kalman filter.
Kinematics stateObservation::KineticsObserver::getGlobalCentroidKinematics | ( | ) | const |
Get the estimated Kinematics of the centroid frame in the world frame.
It includes the linear and angular position and velocity but not the accelerations by default. To get the acceleration call estimateAccelerations(). This method does NOT update the estimation, for this use update().
Kinematics stateObservation::KineticsObserver::getGlobalKinematicsOf | ( | const Kinematics & | userBodyKin | ) | const |
Get the global kinematics of a given frame (in the user frame) in the centroid frame.
The kinematics are linear and angular positions, velocities and optionally accelerations.
kine |
Get the measurement index of the required IMU : allows to access its corresponding measurements in the measurement vector for example.
const IndexedMatrix3& stateObservation::KineticsObserver::getInertiaMatrix | ( | ) | const |
Returns the global inertia matrix of the robot at the center of mass.
const IndexedMatrix3& stateObservation::KineticsObserver::getInertiaMatrixDot | ( | ) | const |
Returns the derivative of the global inertia matrix of the robot at the center of mass.
|
protectedvirtual |
Gets the input size.
Implements stateObservation::DynamicalSystemFunctorBase.
std::vector<Index> stateObservation::KineticsObserver::getListOfContacts | ( | ) | const |
Get the List Of Contact ids.
LocalKinematics stateObservation::KineticsObserver::getLocalCentroidKinematics | ( | ) | const |
Get the estimated local Kinematics of the centroid frame in the world frame (local, which means expressed in the centroid frame).
the kinematics are the main output of this observer. It includes the linear and angular position and velocity but not the accelerations by default. To get the acceleration call estimateAccelerations(). This method does NOT update the estimation, for this use update().
LocalKinematics stateObservation::KineticsObserver::getLocalKinematicsOf | ( | const Kinematics & | userBodyKine | ) |
Get the local kinematics of a given frame (in the user frame) in the centroid frame.
The kinematics are linear and angular positions, velocities and optionally accelerations.
userBodyKine |
double stateObservation::KineticsObserver::getMass | ( | ) | const |
Returns the mass of the robot.
|
protectedvirtual |
Gets a pointer on the measurement noise.
|
virtual |
Get the Measurement vector Size.
Implements stateObservation::DynamicalSystemFunctorBase.
Vector stateObservation::KineticsObserver::getMeasurementVector | ( | ) |
Get the Measurement Vector.
Index stateObservation::KineticsObserver::getNumberOfSetContacts | ( | ) | const |
Get the Current Number Of Contacts.
|
protectedvirtual |
Gets the process noise.
double stateObservation::KineticsObserver::getSamplingTime | ( | ) | const |
Get the Sampling Time.
Matrix stateObservation::KineticsObserver::getStateCovarianceMat | ( | ) | const |
Get the State Covariance matrix.
|
virtual |
Get the State Vector Size.
//////////////////////////////// Getters and setters for the state vector and full covariance matrices ////////////////////////////////
Implements stateObservation::DynamicalSystemFunctorBase.
Index stateObservation::KineticsObserver::getStateTangentSize | ( | ) | const |
Get the State Vector Tangent Size.
TimeIndex stateObservation::KineticsObserver::getStateVectorTimeIndex | ( | ) | const |
Get the State Vector Internal Time Index This is for advanced use but may be used to check how many states have been estimated up to now.
Vector6 stateObservation::KineticsObserver::getUnmodeledWrench | ( | ) | const |
Get the Unmodeled External Wrench (requires setWithUnmodeledWrench() to true before to update())
In the presence of unmodeled and unmeasured external forces and moments, the dynamics of the robot behaves differently, this difference can be exploited to estimate the resultant of these forces and moments.
Kinematics stateObservation::KineticsObserver::getUserContactInputPose | ( | Index | numContact | ) | const |
Returns the pose of the contact in the user frame, given as an input when updating the contact.
bool stateObservation::KineticsObserver::getWithAccelerationEstimation | ( | ) | const |
Returns if the estimation computes also the accelerations.
Kinematics stateObservation::KineticsObserver::getWorldContactPoseFromCentroid | ( | Index | numContact | ) | const |
Returns the pose of the contact in the world frame, obtained from the state pose of the centroid in the world frame.
Get the gyro bias index of the state vector.
|
inlineprotected |
Getters for the indexes of the state Vector using private types.
Get the gyro bias index of the tangent state vector.
|
inlineprotected |
|
inline |
Get the kinematics index of the state vector.
/////////////////////////////////////////////////////////// Getters for the indexes of the state Vector //////////////////////////////////////////////////////////
|
inline |
Get the kinematics index of the tangent state vector.
Getters for the indexes of the tangent state Vector //////////////////////////////////////////////////////////
|
inline |
Get the linear velocity index of the state vector.
|
inline |
Get the linear velocity index of the tangent state vector.
|
protectedvirtual |
Applies the measurement model to the given state vector using the given input to predict the sensor measurements.
x | The current state vector |
u | The current input vector |
k | The current time index |
Implements stateObservation::DynamicalSystemFunctorBase.
|
virtual |
the difference operator for the measurement statevector1 ⊖ statevector2
it amounts at a time derivation betweeen state vectors with a time step of one second. Therefore the result is a tangent vector
measureVector1 | Operator 1 |
measureVector2 | Operator 2 |
difference | The result |
Reimplemented from stateObservation::StateVectorArithmetics.
|
inline |
Get the orientation index of the state vector.
|
inline |
Get the orientation index of the tangent state vector.
|
inline |
Get the position index of the state vector.
|
inline |
Get the position index of the tangent state vector.
void stateObservation::KineticsObserver::removeContact | ( | Index | contactnbr | ) |
Remove a contact.
contactnbr | the number of the contact to remove |
void stateObservation::KineticsObserver::resetInputs | ( | ) |
reset all the sensor inputs and provided contact information but keeps the contacts themselves
|
protectedvirtual |
Removes the measurement noise.
void stateObservation::KineticsObserver::resetProcessContactCovMat | ( | Index | contactNbr | ) |
void stateObservation::KineticsObserver::resetProcessContactsCovMat | ( | ) |
void stateObservation::KineticsObserver::resetProcessCovarianceMat | ( | ) |
void stateObservation::KineticsObserver::resetProcessGyroBiasCovMat | ( | Index | i | ) |
void stateObservation::KineticsObserver::resetProcessKinematicsCovMat | ( | ) |
|
protectedvirtual |
Removes the process noise.
void stateObservation::KineticsObserver::resetProcessUnmodeledWrenchCovMat | ( | ) |
void stateObservation::KineticsObserver::resetSensorsDefaultCovMats | ( | ) |
Reset the default values for the sensors covariance matrices.
this is useful in case of misbehavior of the estimator or the sensors
void stateObservation::KineticsObserver::resetStateContactCovMat | ( | Index | contactNbr | ) |
void stateObservation::KineticsObserver::resetStateContactsCovMat | ( | ) |
void stateObservation::KineticsObserver::resetStateCovarianceMat | ( | ) |
Resets the covariance matrices to their original values.
void stateObservation::KineticsObserver::resetStateGyroBiasCovMat | ( | Index | i | ) |
void stateObservation::KineticsObserver::resetStateKinematicsCovMat | ( | ) |
void stateObservation::KineticsObserver::resetStateUnmodeledWrenchCovMat | ( | ) |
void stateObservation::KineticsObserver::setAbsoluteOriSensor | ( | const Orientation & | measurement | ) |
Set an Absolute Orientation Sensor measurement The measurement is the orientation of the observed frame in the global frame.
The overload with the measurement only uses default covariance matrix.
measurement | The measurement in the form of an Orientation object |
void stateObservation::KineticsObserver::setAbsoluteOriSensor | ( | const Orientation & | measurement, |
const Matrix3 & | CovarianceMatrix | ||
) |
Set an Absolute Orientation Sensor measurement The measurement is the orientation of the observed frame in the global frame.
This version sets the Covariance matrix explicitely. The overload with the measurement only uses default covariance matrix.
measurement | The measurement in the form of an Orientation object |
CovarianceMatrix | the covariance matrix |
void stateObservation::KineticsObserver::setAbsoluteOriSensorDefaultCovarianceMatrix | ( | const Matrix3 & | covMat | ) |
Set the Absolute Orientation Sensor Default Covariance Matrix.
covMat |
void stateObservation::KineticsObserver::setAbsolutePoseSensor | ( | const Kinematics & | measurement | ) |
Set an Absolute Pose Sensor measurement The measurement is the kinematics namely position and orientation of the observed frame in the global frame.
The overload with the measurement only uses default covariance matrix.
measurement | The measurement in the form of a Kinematics object |
void stateObservation::KineticsObserver::setAbsolutePoseSensor | ( | const Kinematics & | measurement, |
const Matrix6 & | CovarianceMatrix | ||
) |
Set an Absolute Pose Sensor measurement The measurement is the kinematics namely position and orientation of the observed frame in the global frame.
This version sets the Covariance matrix explicitely. The overload with the measurement only uses default covariance matrix.
measurement | The measurement in the form of a Kinematics object |
CovarianceMatrix | the covariance matrix |
void stateObservation::KineticsObserver::setAbsolutePoseSensorDefaultCovarianceMatrix | ( | const Matrix6 & | covMat | ) |
Set the Absolute Pose Sensor Default Covariance Matrix.
covMat |
void stateObservation::KineticsObserver::setAdditionalWrench | ( | const Vector3 & | force, |
const Vector3 & | torque | ||
) |
Set any Additional resultant known wrench (e.g. measured external forces and moments but no contact ones) expressed in the local estimated frame.
Set to zero if no forces or unknown
force | |
torque |
void stateObservation::KineticsObserver::setCenterOfMass | ( | const Vector3 & | com | ) |
Set the Center Of Mass kinematics expressed in the user frame.
The velocity and acceleration will be computed through finite differences
com | position |
void stateObservation::KineticsObserver::setCenterOfMass | ( | const Vector3 & | com, |
const Vector3 & | com_dot | ||
) |
Set the Center Of Mass kinematics expressed in the user frame.
The acceleration will be computed through finite differences
com | position |
com_dot | velocity |
void stateObservation::KineticsObserver::setCenterOfMass | ( | const Vector3 & | com, |
const Vector3 & | com_dot, | ||
const Vector3 & | com_dot_dot | ||
) |
Set the Center Of Mass kinematics expressed in the user frame.
com | position |
com_dot | velocity |
com_dot_dot | acceleration |
void stateObservation::KineticsObserver::setCoMAngularMomentum | ( | const Vector3 & | sigma | ) |
Set the Angular Momentum around the CoM expressed in the user frame.
The derivative will be computed using finite differences
sigma | The angular momentum |
void stateObservation::KineticsObserver::setCoMAngularMomentum | ( | const Vector3 & | sigma, |
const Vector3 & | sigma_dot | ||
) |
Set the Angular Momentum around the CoM and its derviative expressed in the user frame.
sigma | The angular momentum |
sigma_dot | The angular momentum derivative |
void stateObservation::KineticsObserver::setCoMInertiaMatrix | ( | const Matrix3 & | I | ) |
Set the 3x3 inertia matrix expressed in the user frame.
The derivative will be computed using finite differences
I | Inertia matrix |
I_dot | Derivative of inertia matrix |
void stateObservation::KineticsObserver::setCoMInertiaMatrix | ( | const Matrix3 & | I, |
const Matrix3 & | I_dot | ||
) |
Set the 3x3 inertia matrix and its derivative expressed in the user frame.
I | Set the inertia matrix at the CoM |
I_dot | Derivative of inertia matrix |
void stateObservation::KineticsObserver::setCoMInertiaMatrix | ( | const Vector6 & | I | ) |
Set the inertia matrix as a Vector6 expressed in the user frame.
The derivative will be computed using finite differences
I | Inertia matrix as a vector containing the diagonal and the three non diagonal values concatenated |
void stateObservation::KineticsObserver::setCoMInertiaMatrix | ( | const Vector6 & | I, |
const Vector6 & | I_dot | ||
) |
Set the inertia matrix and its derivative as a Vector6 expressed in the user frame.
I | Inertia matrix as a vector containing the diagonal and the three non diagonal values concatenated |
I_dot | Derivative of inertia matrix expressed in the same way |
void stateObservation::KineticsObserver::setContactInitCovMatDefault | ( | const Matrix12 & | contactCovMat | ) |
Set the default valut for the Initial Covariance Matrix of the contact in the state.
contactCovMat |
void stateObservation::KineticsObserver::setContactProcessCovarianceDefault | ( | const Matrix12 & | covMat | ) |
Set the default contact Process Covariance.
void stateObservation::KineticsObserver::setContactProcessCovMat | ( | Index | contactNbr, |
const Matrix12 & | contactCovMat | ||
) |
Set the Contact Process Covariance Matrix.
contactNbr | |
contactCovMat | the contact number id |
void stateObservation::KineticsObserver::setContactStateCovMat | ( | Index | contactNbr, |
const Matrix12 & | contactCovMat | ||
) |
Set the Contact State Covariance Matrix.
contactNbr | |
contactCovMat | the contact number id |
void stateObservation::KineticsObserver::setContactWrenchSensorDefaultCovarianceMatrix | ( | const Matrix6 & | wrenchSensorCovMat | ) |
|
virtual |
Set the Finite Difference time step.
dx | the timestep |
void stateObservation::KineticsObserver::setGyroBias | ( | const Vector3 & | , |
unsigned | numberOfIMU = 1 , |
||
bool | resetCovariance = true |
||
) |
void stateObservation::KineticsObserver::setGyroBiasInitCovarianceDefault | ( | const Matrix3 & | covMat | ) |
Set the Default value for Gyro Bias Init Covariance.
void stateObservation::KineticsObserver::setGyroBiasProcessCovariance | ( | const Matrix3 & | covMat, |
unsigned | imuNumber | ||
) |
Set the Gyro Bias Process Covariance.
covMat | the new process covariance matrix |
imuNumber | the number id of the IMU |
void stateObservation::KineticsObserver::setGyroBiasProcessCovarianceDefault | ( | const Matrix3 & | covMat | ) |
Set the default Gyro Bias Process Covariance.
void stateObservation::KineticsObserver::setGyroBiasStateCovariance | ( | const Matrix3 & | covMat, |
unsigned | imuNumber | ||
) |
Set the Gyro Bias State Covariance.
covMat | the nwe covariance matrix |
imuNumber | the number id of the IMU |
Index stateObservation::KineticsObserver::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.
The overload that does not have the covariance matrices as an inputs uses default ones.
The IMU is located in a sensor frame. We suppose we know the kinematics of this sensor frame in the centroid's frame
accelero | measured value |
gyrometer | measured gyro value |
userImuKinematics | sets the kinematics of the IMU in the user frame. The best is to provide the position, the orientation, the angular and linear velocities and the linear acceleration Nevertheless if velocities or accelerations are not available they will be automatically computed through finite differences |
num | the number of the IMU (useful in case there are several ones). If not set it will be generated automatically. |
Index stateObservation::KineticsObserver::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
This version specifies the covariance matrices of these measurements.
acceleroCov | The covariance matrix of the accelerometer |
gyroCov | The covariance matrix of the gyrometer |
void stateObservation::KineticsObserver::setIMUDefaultCovarianceMatrix | ( | const Matrix3 & | acceleroCov, |
const Matrix3 & | gyroCov | ||
) |
set the default covariance matrix for IMU.
this is used to set the covariances wgen not given explicitely (see setIMU(const Vector3&,const Vector3&,const Kinematics &,int)).
acceleroCov | The covariance matrix of the accelerometer |
gyroCov | The covariance matrix of the gyrometer |
void stateObservation::KineticsObserver::setInitWorldCentroidStateVector | ( | const Vector & | initStateVector | ) |
Initializes the state vector.
initStateVector | the initial state vector. |
void stateObservation::KineticsObserver::setKinematicsInitCovarianceDefault | ( | const Matrix & | ) |
Set the Default value for Kinematics Init Covariance.
void stateObservation::KineticsObserver::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.
void stateObservation::KineticsObserver::setKinematicsProcessCovariance | ( | const Matrix12 & | ) |
Set the Kinematics Process Covariance.
void stateObservation::KineticsObserver::setKinematicsProcessCovarianceDefault | ( | const Matrix12 & | ) |
Set the default Kinematics Process Covariance.
void stateObservation::KineticsObserver::setKinematicsProcessCovarianceDefault | ( | const Matrix3 & | P_pos, |
const Matrix3 & | P_ori, | ||
const Matrix3 & | P_linVel, | ||
const Matrix3 & | P_angVel | ||
) |
Set the default Kinematics Process Covariance.
void stateObservation::KineticsObserver::setKinematicsStateCovariance | ( | const Matrix & | ) |
Set the Kinematics State Covariance.
void stateObservation::KineticsObserver::setMass | ( | double | ) |
Set the total mass of the robot. This can be changed online.
|
protectedvirtual |
Sets a noise which disturbs the measurements.
|
protectedvirtual |
Sets a noise which disturbs the state dynamics.
void stateObservation::KineticsObserver::setProcessNoiseCovarianceMat | ( | const Matrix & | Q | ) |
Set the covariance matrices for the process noises.
Q | process noise |
void stateObservation::KineticsObserver::setSamplingTime | ( | double | ) |
Set the Sampling Time.
void stateObservation::KineticsObserver::setStateContact | ( | Index | index, |
Kinematics | worldContactRestPose, | ||
const Vector6 & | wrench, | ||
bool | resetCovariance = true |
||
) |
Set the state contact kinematics and wrench.
Sets a value for the contact part of the state. Might be useful to reset this state for instance.
index | index of the contact |
worldContactRestPose | new state rest pose of the contact |
wrench | new state wrench of the contact |
resetCovariance | set if the associated part of the state covariance matrix should be reset |
void stateObservation::KineticsObserver::setStateCovarianceMat | ( | const Matrix & | P | ) |
Set the State Covariance Matrix This is useful in case of a setting a guess on a whole state vect9or.
P | The covariance matrix |
void stateObservation::KineticsObserver::setStateUnmodeledWrench | ( | const Vector6 & | , |
bool | resetCovariance = true |
||
) |
Set the State Unmodeled Wrench.
this modifies the current guess for external unmodeled Wrench. This is different from setAdditionalWrench() since it modifies a state component. This function is likely useful when initializing the estimation and reduce the convergence time
resetCovariance | set if the covariance should be reset |
void stateObservation::KineticsObserver::setStateVector | ( | const Vector & | newvalue, |
bool | resetCovariance = true |
||
) |
Set a value of the state x_k provided from another source.
can be used for initialization of the estimator
newvalue | The new value for the state vector |
resetCovariance | set if the state covariance should be reset |
void stateObservation::KineticsObserver::setUnmodeledWrenchInitCovMatDefault | ( | const Matrix6 & | initCovMat | ) |
Set the default value for init Unmodeled Wrench covariance matrix.
initCovMat |
void stateObservation::KineticsObserver::setUnmodeledWrenchProcessCovarianceDefault | ( | const Matrix6 & | covMat | ) |
Set the default Unmodeled Wrench Process Covariance.
void stateObservation::KineticsObserver::setUnmodeledWrenchProcessCovMat | ( | const Matrix6 & | processCovMat | ) |
Set the Unmodeled Wrench Process Covariance Mattix.
processCovMat |
void stateObservation::KineticsObserver::setUnmodeledWrenchStateCovMat | ( | const Matrix6 & | newCovMat | ) |
Set the Unmodeled Wrench State Cov Mat.
newCovMat |
void stateObservation::KineticsObserver::setWithAccelerationEstimation | ( | bool | b = true | ) |
Sets if the estimation computes also the accelerations.
This will not modify the estimated value, but just compute the modeled acceleration, which gives a model-based filtered acceleration
b |
void stateObservation::KineticsObserver::setWithGyroBias | ( | bool | b = true | ) |
Set if the gyrometers bias is computed or not. This parameter is global for all the IMUs.
b |
void stateObservation::KineticsObserver::setWithUnmodeledWrench | ( | bool | b = true | ) |
Set if the unmodeled and unmeasured external wrench should be estimated.
Activating this estimation will assume that the contact exists therefore, it is likely to modify the value of the estimated state. The estimation will also be slower.
b |
void stateObservation::KineticsObserver::setWorldCentroidStateKinematics | ( | const Kinematics & | kine, |
bool | resetCovariance = true |
||
) |
Set the State Kinematics.
Sets a value for the kinematics part of the state
localKine | are the new kinematics of the state |
resetContactWrenches | set if the contact wrenches should be reset |
resetCovariance | set if the covariance of the state should be reset |
void stateObservation::KineticsObserver::setWorldCentroidStateKinematics | ( | const LocalKinematics & | localKine, |
bool | resetContactWrenches = true , |
||
bool | resetCovariance = true |
||
) |
Set the State Kinematics.
Sets a value for the kinematics part of the state
localKine | are the new local kinematics of the state |
resetContactWrenches | set if the contact wrenches should be reset |
resetCovariance | set if the covariance of the state should be reset |
|
protected |
function to call before adding any measurement detects if there is a new estimation beginning and then calls the reset of the iteration
|
inline |
the difference operator for the state statevector1 ⊖ statevector2
it amounts at a time derivation betweeen state vectors with a time step of one second. Therefore the result is a tangent vector
stateVector1 | Operator 1 |
stateVector2 | Operator 2 |
|
virtual |
the difference operator for the state statevector1 ⊖ statevector2 This version prevents a nwe vector allocation
it amounts at a time derivation betweeen state vectors with a time step of one second. Therefore the result is a tangent vector
stateVector1 | Operator 1 |
stateVector2 | Operator 2 |
difference | The result |
Reimplemented from stateObservation::StateVectorArithmetics.
|
protectedvirtual |
Applies the state-transition model to the given state vector using the given input to predict the future state.
DYNAMICAL SYSTEM IMPLEMENTATION
x | The current state vector |
u | The current input vector |
k | The current time index |
Implements stateObservation::DynamicalSystemFunctorBase.
|
protected |
|
inline |
the sum operator for the state vector
it amounts at a time-integration of the state vector using a tangent vector (constant for 1 second)
stateVector | The state vector |
tangentVector | The tangent Vector |
|
virtual |
the sum operator for the state vector This version does not allocate a new vector
it amounts at a time-integration of the state vector using a tangent vector (constant for 1 second)
stateVector | The state vector |
tangentVector | The tangent Vector |
sum | The result of the operation |
Reimplemented from stateObservation::StateVectorArithmetics.
|
inline |
Get the unmodeled external linear force index of the state vector.
|
inline |
Get the unmodeled external linear force index of the tangent state vector.
|
inline |
Get the unmodeled external torque force index of the state vector.
|
inline |
Get the unmodeled external torque force index of the tangent state vector.
|
inline |
Get the unmodeled external wrench index of the state vector.
|
inline |
Get the unmodeled external wrench index of the tangent state vector.
const Vector& stateObservation::KineticsObserver::update | ( | ) |
Runs the estimation.
This is the function that allows to 1- compute the estimation 2- move to the next iteration (increments time, resets the measurements, etc)
void stateObservation::KineticsObserver::updateContactWithNoSensor | ( | const Kinematics & | localKine, |
unsigned | contactNumber | ||
) |
Update the contact when it is NOT equipped with wrench sensor.
localKine | the new kinematics of the contact expressed in the centroid's frame frame the best is to provide the position, the orientation, the angular and the linear velocities. Otherwise they will be computed automatically |
contactNumber | The number id of the contact |
void stateObservation::KineticsObserver::updateContactWithWrenchSensor | ( | const Vector6 & | wrenchMeasurement, |
const Kinematics & | localKine, | ||
unsigned | contactNumber | ||
) |
Update the contact when it is equipped with wrench sensor.
wrenchMeasurement | wrenchMeasurement is the measurment vector composed with 3D forces and 3D torques |
localKine | the new kinematics of the contact expressed in the centroid's frame frame the best is to provide the position, the orientation, the angular and the linear velocities. Otherwise they will be computed automatically |
contactNumber | The number id of the contact |
void stateObservation::KineticsObserver::updateContactWithWrenchSensor | ( | const Vector6 & | wrenchMeasurement, |
const Matrix6 & | wrenchCovMatrix, | ||
const Kinematics & | localKine, | ||
unsigned | contactNumber | ||
) |
Update the contact when it is equipped with wrench sensor.
This version sets the Covariance matrix explicitely.
wrenchCovMatrix | The covariance matrix of the wrench measurement |
wrenchMeasurement | wrenchMeasurement is the measurment vector composed with 3D forces and 3D torques |
localKine | the new kinematics of the contact expressed in the centroid's frame frame the best is to provide the position, the orientation, the angular and the linear velocities. Otherwise they will be computed automatically |
contactNumber | The number id of the contact |
|
protected |
updates the global kinematics of the centroid from the local ones, that can be more interpretable
|
protected |
update of the state kinematics worldCentroidStateKinematics_ and of the contacts pose with the newly estimated state
void stateObservation::KineticsObserver::updateMeasurements | ( | ) |
Updates the measurements.
Updates the measurement sensors and the associated vectors and covariance matrices
|
virtual |
Define if we use dinite differences Jacobian or analytic.
b | true means we use finite differences |
|
friend |
Comparison between the Jacobians of the linear and angular accelerations with respect to the state, obtained with finite differences and analyticially.
|
friend |
Comparison between the analytical Jacobian matrix A and the one obtained by finite differences. Used to test the analytical method.
threshold | Threshold on the relative error between both Jacobians (in percentage) |
|
friend |
|
friend |
Comparison between the Jacobians of orientation integration with respect to an increment vector delta, obtained with finite differences and analyticially.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
protected |
|
staticprotected |
default derivation steps
|
static |
|
protected |
|
protected |
|
protected |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
static |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
Default Stiffness and damping.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool stateObservation::KineticsObserver::nanDetected_ = false |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |