-
Notifications
You must be signed in to change notification settings - Fork 12
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
[iCubGenova09] estimated right leg wrench is different from zero when the leg is in a configuration different from the one used to calibrate #140
Comments
TL;DR: I think (but I may be wrong) we are seeing the difference in behaviour of FT sensors for which over the years we developed algorithms and methods to calibrate in-situ secondary calibration matrices, see https://github.com/robotology/whole-body-estimators/tree/master/devices/wholeBodyDynamics#secondary-calibration-matrix for the related parameters (that we are currently missing). This has been sometimes called "phantom forces". If we assess that this is really the problem, it may be worth to check with francisco where the last software to compute this secondary calibration matrix is. I think this is much easier to debug that some other strange "spiky" behaviour that you recenty also saw on the same robot. In this case, if we focus on the static case (as you are doing) the math of the problem of 3D force estimation (warning, you should have some LaTeX plugin to see the following) is just (some signs could be wrong, but I think you can get the logic): Where If the forces measured by the feet FTs are indeed correctly small (i.e. they are quite similar to their offset) then the equation can be simplified to: |
Hi @GiulioRomualdi thanks a lot for opening and documenting the issue. I have just two clarifications:
An additional comment is that I repeated the experiment on the right arm and also in this case the cartesian wrenches depend on the joint configuration. So to recap the problems are two:
|
Not sure if we can consider that an indipendent problem, that is just how the estimation algorithm work. That, coupled with how we are computing FT offset, means that in the configuration in which we have run |
I guess the software was this one: https://github.com/fjandrad/sensors-calib-inertial/commits/feature/integrateFTSensors, but we may need to double check with him. |
@traversaro I wanted to kindly ask you to check one thing before going ahead with what you suggested. Since I'm not a super expert on WBD, could you check if I correctly added the new contact frame and sensor in https://github.com/ami-iit/robots-configuration/blob/devel_iCubGenova09/iCubGenova09/estimators/wholebodydynamics.xml, please? Just to be sure that is not the cause. |
Happy memories from @DanielePucci robotology-legacy/codyco-modules#160 |
Francisco's repository on insitu-ft-analysis https://github.com/robotology-playground/insitu-ft-analysis |
I believe that this issue is of interests also for the current work @HosameldinMohamed is doing in https://github.com/ami-iit/element_ft-nonlinear-modeling |
Here, the same on the arms. I just run the test. |
Stupid question, Are we sure the ft is correctly mounted in the model? yesterday @S-Dafarra mentioned that the problem could be related to a wrong weight in the robot, however since the force is not only on the z-axis I would say that the issue is not only related to that (on the leg the wrench components are written in the root link frame so the z is pointing upward) Is the problem also happening in simulation? |
Mhh, I am afraid we can't exclude this problem. The problem is that a wrong weight induces a wrong offset on the z direction. Once you move the robot, the wrong offset in the z direction will influence a wrong force in all the directions. |
Ah, but in that case the wrong offset will be an all axis in the frame of the FT sensor frame, but will be again just on Z once you project back the force in the
As the simulation is using the same model also for the simulation, I do not think you will be able to see any difference between reality and the model (be it the weight of the model, or the wrong sensor frame) by just doing a simulation. |
But I think it will give us some direction, such as:
But actually, I feel that the results we're getting could make sense. I am not sure if you discussed this already, but: Considering a linear FT sensor model: Where
The way to find What we do in Update: which means the |
Talking with @DanielePucci and @isorrentino, it may make sense to try to explore the in-situ calibration, because hopefully, we then overcome the need to do Regarding the in-situ calibration. I never tested the code of Francisco in https://github.com/robotology-playground/insitu-ft-analysis. But looking at the wiki, it seems well documented. However, it seems to have a lot of steps. From collecting the data offline, then running many (MATLAB) scripts to compute the new calibration matrices. Then, I am not yet sure how to download these parameters to FT sensors or apply them to the measured forces. We may think of automating the in-situ calibration process with C++ code. Where we apply the reference trajectories to the robot, then collect the data, then perform online calibration maybe? |
For reference here's Francisco's knowledge transfer video https://www.youtube.com/watch?v=Mh0a2JoXmnU |
This is in theory a good idea, but in general we experience that in a lot of cases it is important to be able to inspect the data if something went wrong or simply different from expected, hence the focus on collecting data, but then run the calibration/processing in high level languages such as Python or MATLAB. |
In our experience (see the papers mentioned in #140 (comment), if you want to start from something you can start from the first one, i.e. https://ieeexplore.ieee.org/abstract/document/7139477) a good model that is describing the behaviour is the following: The ft \boldsymbol{f} is well described by an affice model that relates it to the raw measurements However, for never well understood reason the matrix This means that when we start WBD or call calib, if we assume that the reference force value Where the solution is: while the offset Then, if the force transmitted through the FT sensor changes (for example due to a change of configuration of the robot) and so the raw measurents change as well, the FT sensor measure used by WBD would be: while the correct measure would be: for So, you see that even if the error is caused a configuration-invariant calibration matrix, you still get a configuration-dependent error. How we got rid of this problems in the past?
Note: this is just what in the past explained well the data that we saw, nothing prevents that the situation is different now and the data can be explained better by other models. A good way to check if this is still the case, is to perform the plots described in #140 (comment) . If the measured force lay on an elipsoid, probably the problem is given by a wrong linear calibration matrix, as if you transform a sphere with a linear transformation you obtained an elipsoid. Feel free to schedule a meeting if you want to discuss about this with a whiteboard that I guess is much more productive that discussing in issues. |
I guess the relevant change is ami-iit/robots-configuration@723ff7e, right? From what I see, you added a default contact on the origin of
The related logic is:
|
Hi @pattacini, yesterday I did the same test run in the past on the other fts, this time on the sensor mounted on the left upper leg. If I'm not mistaken, the sensor is the one calibrated in https://github.com/icub-tech-iit/task-force-miscellanea/issues/114, and if this is the case, something is causing miscalibration (cables touching the sensor? miscalibration due to mechanical stresses mounting it?) Here is the norm of the forces measured by the sensor: I'm also showing the joints of the left leg to understand when the leg was moving. Unfortunately, I do not have the cartesian wrenches logged for this FT, but I expect they are not zero when the norm of the forces changes. |
Hi @isorrentino I can see that the final configuration of the leg It's true that the FT readouts should be independent of Also, the FT SN can be retrieved using the FirmwareUpdater for a double check. cc @maggia80 |
Just to make sure that we are all aligned, I tried to plot the norms of forces of another sensor tested in a similar issue, that was considered "acceptable" without anyone contractinding this assesment: done with:
In this case, the max-min error is ~30 N, similar in the order of magnitude of max-min ~40 N observed in this issue. So, for the future it may be useful to agree before hand in a quantitative index to consider a sensor "acceptable", to avoid misunderstandings. |
If I have to tell the truth in my opinion this is not acceptable. I raised this point during a meeting but unfortunately given the current calibration this is the best we are able to reach (we may think to figure out how to improve it. (cc to some people interested in the topic) @DanielePucci @isorrentino @HosameldinMohamed ). Given the plot in #140 (comment) and assuming that the "real" norm is 145N. We can say that the sensor returns a force with an error of In other words, the sensor has an accuracy of about 10% (that in my opinion is pretty high since we try to use this information to estimate the joint torques and the external wrenches) This is just to say that it would be really nice if we try to solve (as a team) the problem all together, since I think we will all benefit if the FTs becomes more trustable 😃 |
I agree! |
I agree with @GiulioRomualdi on
Improving the FT sensor calibration may in turn enable better performances of the torque-control that is now suffering of zero or low torque gains during @lrapetti and @HosameldinMohamed physical HRI tasks https://github.com/ami-iit/element_ergonomy-control/issues/165#issuecomment-1190449021. It is also important for the finals of the ANA Avatar XPRIZE where we most likely need to identify precisely the weight of grasped objects up to three chilos. We discussed briefly about possible action plans today with @GiulioRomualdi and @S-Dafarra, and a possibility could be that to make a cross research axis team that for a really short amount of time (one week or ten days) attempts preliminary actions for improving the model possibly with the support of @robotology/icub-tech-support-team One action that we may take independently of the cross-team is to re-run the in-situ calibration and check validation results on both iCub 3 and iRonCub https://github.com/ami-iit/element_ft-nonlinear-modeling/issues/29 |
Probably you meant @mebbaid |
We know that in iCub Tech we calibrate the FT sensors with a simple linear model, which by the way enables us to achieve errors smaller than 3÷4% on validation sets. We also know that the calibration/validation sets might be not good representatives of the real range of data that are generally experienced on the robot since the KUKA can lift limited weights, although we tried to put to test the calibration outcome with the old procedure where we could use heavier input weights and the results weren't that bad. Further, it may also be that when mounting the sensor on the robot some other snags can have an impact. That's why we launched in the recent past the initiative of the FTWG tracked in https://github.com/icub-tech-iit/task-force-miscellanea/issues/108. From our side, we're definitely open to integrating more sophisticated calibration models within the FW, but it would be nice to see first some decisive improvements from, for example, the in-situ calibration and/or nonlinear identification methods. It would also help to have an estimate of the upper bound on the relative error of the FT quantities that the whole-body framework can tolerate. |
We understand this @pattacini, and we are happy to help: preliminary results that answer the point above are performed in https://github.com/ami-iit/element_ft-nonlinear-modeling/issues/36. On the other hand, it would be important to see the performance of the FT sensors on test datasets after installation and deployment are complete so as we may consider the installation successful if performance indexes to be discussed are met - e.g. errors within certain thresholds. I do not know if you already have these tests in place: if you do not, they would give us a direct metric of what happens when installing FTs on the robot - the test suit presented by @gsisinna in the last Product Increment may help.
Giving the current priorities, we would struggle with giving you stability margins of the controller versus FT accuracies. So, I do not think this is happening soon. What we may say is that we are struggling with force estimates of external payloads - a task of the ANA Avatar XPRIZE final - as well as with increasing torque gains in torque-controlled demos - e.g. collaborative lifting of the ergoCub project https://github.com/ami-iit/element_ergonomy-control/issues/165#issuecomment-1190449021 CC @lrapetti. On the same line, @affafjunaidMOMIN and @gabrielenava of the iRonCub team are correcting FT readings along the z component for better estimates of the thrust force using a manual off-situ calibration, see, e.g., https://github.com/ami-iit/element_jet-cat-turbines/issues/354#issuecomment-1172337742. |
There's no such a thing in place so far. We just work with the KUKA, but I agree that this check would help make installation more robust and give us insights into what weirdnesses are going on. We can certainly adopt the test suite but, first, we should agree on what types of movements the robot needs to be performing for validation purposes together with what ground truth we're required to use alongside (probably iDynTree). I can add up this task to the list1; however, I also deem that this won't happen any time soon because we have our main developers busy with the 4K Cameras2.
That's great and I can also see big potential here, although in my view we still need to validate the approach for external wrenches (and extend the procedure to include them) as nonlinear estimators tend to suffer from overfitting and clamping. New algorithms are welcome as now we have a powerful tool (Simulink + Embedded Coder) to port them into FW, though we ought to check whether there are enough resources onboard.
Got it 👍🏻
Given @lrapetti's answer3, investigations are underway; keep us posted.
This is kind of expected as looking at the study it seems that you're trying to correct an error in the range of 4%, which is something our linear fitter cannot compensate for. Footnotes |
Hi @pattacini
Concerning this I was wondering a silly thing: are we sure that the Kuka based calibration explores all positive and negative values of forces and wrenches? I mean, this seems an important feature of the calibration since it would be important that the training dataset contains experiments that pull and push both forces and torques in all directions, namely, we excite all axes of both forces and torques in positive and negative directions. I do not know if we know this.
Got it thanks
This is also interesting, I am sure there is a lot of potential there. I agree on the validation, although let's say that at least the NN seems to improve the original calibration and the in-situ, which leaves space to the nonlinear models @HosameldinMohamed is developing along different directions https://github.com/ami-iit/element_ft-nonlinear-modeling/issues/4 |
It's a legit doubt 👍🏻 I agree that there are a number of quirks, although we still don't know exactly where they are. At any rate, putting in place with your help an automated test with iDynTree when mounting the sensor onboard the robot, which we can run by ourselves, would be a good starting point for the investigation. |
Today @isorrentino noticed that the wrench on the right leg estimated by wbd depends on the joint values.
She did the following experiment:
Some additional info (@isorrentino correct them if you spot an error):
Here is the video of the dataset representing the experiment
measured_extenal_forces.mp4
robot_logger_device_2022_03_01_16_25_19.zip
cc @traversaro @prashanthr05 @HosameldinMohamed @S-Dafarra
The text was updated successfully, but these errors were encountered: