robotology / whole-body-estimators

YARP devices that implement estimators for humanoid robots.
26 stars 12 forks source link

[iCubGazeboV3] Wholebody dynamics retuns high contact force on the hands while walking #119

Open GiulioRomualdi opened 3 years ago

GiulioRomualdi commented 3 years ago

I ran a walking experiment on iCubGazeboV3. I also ran whole-body dynamics to retrieve the measured contact wrenches on the hands.

YARP_CLOCK=/clock yarprobotinterface --config launch-wholebodydynamics.xml

Even if no external forces were acting on the system (excepts on the feet) and the robot walks fine, the forces retrieved by whole-body dynamics are pretty high.

right_hand left_hand

Any idea why this is happening?

cc @traversaro @S-Dafarra @prashanthr05

traversaro commented 3 years ago

Any idea why this is happening?

cc @traversaro @S-Dafarra @prashanthr05

At a first glance, I would say that the measures that we get from Gazebo do not fit the nominal model used for force estimation (for example due to numerical simulation errors) or perhaps the wbd filters are introducing errors w.r.t. to the measured quantities that result in a discrepancy that is reflected as an estimated external force. I will add to this issue a more in-depth description that should help anyone that wants to debug this.

traversaro commented 3 years ago

So, first of all let recap how the external 6D force/torque on the hand is computed (please install a extention that renders LaTeX to see this comment, such as green-pi ).

traversaro commented 3 years ago

The main reference text for the algorithm underlying wholebodydynamics is the Chapter 4 of https://traversaro.github.io/traversaro-phd-thesis/traversaro-phd-thesis.pdf . In particular, the equation that describes how external forces are computed in case there is only one unknown external force/torque for each submodel is Equation 4.21 :

$$ {}_{C} \mathrm{f}^x{C} = \sum{L \in \mathfrak{L}_{sm}} {}_C X^L {}_L \phiL - \sum{L \in \mathfrak{L}_{sm}} \sum{D \in \beth{sm}(L)} {}_C X^D {}_D \mathrm{f}_{D,L} . $$

where: ${}_C X^L {}_L \phi_L$ is the component of the force that depends on inertial parameters (due to inertial effects and gravity), defined by Equation 4.9 : $$ {}_B \phiB( {}^B \alpha^g{A,B}, {}^B \omega_{A,B}) := {}_B \mathbb{M}B \alpha^g_{A,B} + \begin{bmatrix} 0_{3\times1} \\ \omega_{A,B} \end{bmatrix} \bar{\times}^* {}_B \mathbb{M}_B \begin{bmatrix} 0_{3\times1} \\ {}^B \omega\{A,B} \end{bmatrix} $$

while the other term is the force measured by the F/T sensors connected to the submodels.

In the specific case of icub arm, this means that the external force on the l_hand link depends on:

In particular, the "force that depends on inertial parameters, acceleration and velocity" depends on the sensor proper acceleration ${}_B \phiB( {}^B \alpha^g{A,B}, {}^B \omega{A,B})$ and on the angular velocity ${}^B \omega\{A,B}$ and on the inertial parameters. The inertial parameters are assumed to be constant, so those are hardly the problem, even because the force estimation is correctly zero when the robot is not moving. On the other hand, ${}_B \phiB( {}^B \alpha^g{A,B}, {}^B \omega_{A,B})$ are computed using the measure of one IMU on the robot (either head or base, depending on the configuration), that is then propagated to all other links using the measured joint position, velocity and acceleration for all the joints between the link of interest and the link that has IMU (see section 4.4.3 of the thesis).

For this reason, it would be interesting to change a bit the estimation parameters to understand what is going wrong. Some easy checks are:

traversaro commented 3 years ago

fyi @prashanthr05 @isorrentino @HosameldinMohamed

traversaro commented 3 years ago

Another useful simpler test is to do this test in the fixed base case. If the problem is also there, it may be much easier to debug due to the presence of a single external force, and the fact that the base position, velocity and acceleration are fixed, so we can compute an appropriate ground truth by taking the position values, filter them and compute by numerical differences the velocity and acceleration, and then compute FT sensor measures and internal torques via inverse dynamics. This is a test that we can easily do on the real robot as well, both iCub 2.* or iCub 3.

traversaro commented 3 years ago

Another useful simpler test is to do this test in the fixed base case. If the problem is also there, it may be much easier to debug due to the presence of a single external force, and the fact that the base position, velocity and acceleration are fixed, so we can compute an appropriate ground truth by taking the position values, filter them and compute by numerical differences the velocity and acceleration, and then compute FT sensor measures and internal torques via inverse dynamics. This is a test that we can easily do on the real robot as well, both iCub 2.* or iCub 3.

By the way, this is a test that can be easily done also on the real robot. @HosameldinMohamed @isorrentino

HosameldinMohamed commented 2 years ago

@SanderRuijters