-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add method to help calibrating multiple FT sensors attached to the same submodel #1091
Conversation
1415e63
to
c6e26e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @traversaro thanks a lot for this implementation. I went through the code and I more or less understood it, but I have some curiosities:
- Since the matrix
$A$ and the vector$b$ are computed to obtain the expected FT wrenches, why provide$A$ and$b$ instead of computing$w_{sm}$ by the pseudo-inverse? In this way, the function will be compatible with the methodcomputeExpectedFTSensorsMeasurements()
, especially since you checked in the unit test that the expected computed with the latter provides a correct solution for theA
andb
pair computed by the new method.
* A w = b | ||
* \f] | ||
* Where: | ||
* * \f$w\f$ is the vector of dimension 6*nrOfFTSensors obtained by stacking the FT sensors measures: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it's better to highlight here that this represents the expected measures from the FTs, not the actual measures we get from the sensor,,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any idea how to formulate the sentence better/more understandable? Assuming that the multibody model is correct (that is kind of the assumption of the whole class) that sentence is correct. Unless we introduce somewhere the concept of "expected measures" (that we need to define somewhere) and "actual measures", I am not sure if I am able to make this sentence more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I think it's clear enough to me once I read through the whole explanation.
I was just expecting a similar structure to the computeExpectedFTSensorsMeasurements()
method in my mind. But now I see they are serving different goals.
std::cerr << "Testing submodel with base " << estimatorIMU.model().getLinkName(baseLinkIndeces[l]) << std::endl; | ||
|
||
iDynTree::VectorDynSize bCheck(b[l].size()); | ||
toEigen(bCheck) = toEigen(A[l])*w; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious to see if pinv(A[l])*b[l] = w
with the A matrices contain many zeros that correspond to not being attached to FTs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that depending on the rank and shape of of pinv(A[l])*b[l] = w
, but just that pinv(A[l])*b[l] = pinv(A[l])*A[l]*w
.
The main reason is that in this way we can plug this information in any learning/identification/calibration algorithm. Let's say that you are in the case in which you have a model in which they are two FT sensors, connected in a chain: (code: ExampleFTs.zip ) For this model, let's say that you have a dataset composed by
And you want to learn the parameters for the following generic non-linear calibration models for the FT sensors (this models could be linear models, polynomial models, feedforward Neural networks): Using the method introduced in this PR, you can write the following cost function to minimize: Where:
The identification problem could then be solved by: If the method gave in input directly the Note that in specific cases (for example if both |
I am not excited about the naming, but let's merge this, we can always change names later. |
Can we generate MATLAB bindings for this method? Maybe you could give me pointers on how to do it? |
Good idea, so we see if they work! MATLAB bindings generation is done by an action, let me trigger it. |
Greate! Thanks a lot! |
This PR adds the
ExtWrenchesAndJointTorquesEstimator::computeSubModelMatrixRelatingFTSensorsMeasuresAndKinematics
method, that can be used to compute for each submodel without any external wrench, the equation that relates the FT sensor measures with the kinematics-related known terms. This function can be useful to perform calibration of multiple FT connected to the same submodel without any external force, even if multiple links (that belong to different submodels) have external forces on it.For more theorical details, check the
ExtWrenchesAndJointTorquesEstimator::computeSubModelMatrixRelatingFTSensorsMeasuresAndKinematics
documentation, and for details on how to use the class check the added tests.