icub-tech-iit / ergocub-software

Main collector of ergoCub specific SW
https://icub-tech-iit.github.io/ergocub-software/
BSD 3-Clause "New" or "Revised" License
13 stars 18 forks source link

ergoCubSN001 gravity compensation / compliant mode does not work as intended #221

Open traversaro opened 6 months ago

traversaro commented 6 months ago

Task description

While debugging torque control with @LoreMoretti and @danielePucci, we noticed that switching on compliant mode of the upper body of the ergoCubSN000 the gravity compensation was not working as intended, i.e. by decreasing the stiffness the arm or the torso the joint was not remaining still. Interestingly, running a gravity compensation "externally" (for example via https://github.com/vvv-school/tutorial_impedance-control/) seems to work fine, indicating that somehow the gravity compensation computed by wholebodynamics device was not working correctly. As both methods used the same model, perhaps the difference may be in the source of kinematic information used by WBD? If anyone is interested in investigating this, a first test could be to change this. From the configuration file in https://github.com/icub-tech-iit/ergocub-software/blob/10670acf8120bdaad19c6cb01388eff555f4f356/urdf/ergoCub/conf/estimators/wbd_ecub_sim.xml#L10C22-L10C34 it seems that wbd is using the head IMU, but according to @GiulioRomualdi this is not the case anymore, so the first thing to do would be to double check this.

Unfortunately I do not have detailed software version information of the software used in the tests, perhaps @LoreMoretti has more info.

Definition of Done

Commit in master branch a wbd configuration file for which compliant mode works "fine", i.e. by decreasing the stiffness the robot keep its position.

GiulioRomualdi commented 6 months ago

Here is the bug https://github.com/robotology/robots-configuration/blob/devel/ergoCubSN001%2Festimators%2Fwholebodydynamics.xml#L10

The imu used is the root link imu but the link is the head one

traversaro commented 6 months ago

Here is the bug https://github.com/robotology/robots-configuration/blob/devel/ergoCubSN001%2Festimators%2Fwholebodydynamics.xml#L10

The imu used is the root link imu but the link is the head one

Great, thanks!

traversaro commented 6 months ago

Fix proposed in https://github.com/robotology/robots-configuration/pull/614 . Note that probably this did not only affected the gravity compensation torques, but also the torque estimation @loremoretti @isorrentino . As the problem is there since https://github.com/robotology/robots-configuration/pull/584, probably all ergoCubSN001 tests were affected by this, good catch @GiulioRomualdi !

isorrentino commented 6 months ago

@traversaro I checked the configuration I was using for the paper to be sure that the results were correct and it is correct (luckily). Indeed I set the parameter assume_fixed and the frame was root_link.

See: https://github.com/ami-iit/robots-configuration/blob/4edd9f0993c9e1bf31e3652d67fc7b5d6c38b4ac/ergoCubSN000/estimators/wholebodydynamics.xml#L10

traversaro commented 6 months ago

@traversaro I checked the configuration I was using for the paper to be sure that the results were correct and it is correct (luckily). Indeed I set the parameter assume_fixed and the frame was root_link.

See: https://github.com/ami-iit/robots-configuration/blob/4edd9f0993c9e1bf31e3652d67fc7b5d6c38b4ac/ergoCubSN000/estimators/wholebodydynamics.xml#L10

Great!

Nicogene commented 6 months ago

@traversaro is this issue fixed by https://github.com/robotology/robots-configuration/pull/614 or we need to change also the urdf?

traversaro commented 6 months ago

In theory no change should be done in the URDF, in practice until this is tested is difficult to be 100% sure.

Nicogene commented 6 months ago

In theory no change should be done in the URDF, in practice until this is tested is difficult to be 100% sure.

This test has been done? Can we close it?

LoreMoretti commented 6 months ago

This test has been done? Can we close it?

We tested today as per this comment.

I think we can close this issue.

traversaro commented 6 months ago

Actually this issue was to track the switch to compliant mode via yarpmotorgui, I am not sure this was tested today. I expect it to work, but I think we can quickly check this on Monday.

Nicogene commented 5 months ago

Actually this issue was to track the switch to compliant mode via yarpmotorgui, I am not sure this was tested today. I expect it to work, but I think we can quickly check this on Monday.

@traversaro @LoreMoretti did you check it?

traversaro commented 5 months ago

I did not, today there are some demos, we can check after the demos.