robotology / icub-models-generator

Resources and programs to generated models (URDF, SDF) of the iCub robot
14 stars 23 forks source link

Enable tests for consistency of FT sensor and "fake link" frames also to iCub v2 models #276

Closed traversaro closed 3 months ago

traversaro commented 3 months ago

To prevent in the future bugs like https://github.com/robotology/icub-models-generator/issues/275 .

traversaro commented 3 months ago

Given https://github.com/robotology/icub-models-generator/issues/275, I was quite surprised that the test pass fine, as there is no l_arm_ft frame in iCub v2 model, so how it is possible that the test compares its value w.r.t. to the pose of the sensor and gets a consistent value? It turns out that indeed the tests is bugged due to a bug in model parsing propagation ad the iDynTree level: https://github.com/robotology/idyntree/pull/1191, so the code in https://github.com/robotology/icub-models-generator/blob/5f1654a6f4de436d13284ab48786ba8eaa6e9aa8/tests/icub-model-test.cpp#L628-L633 was not working as intended, and so it does not fail if the l_arm_ft frame is missing, as the iDynTree URDF parser is automatically creating it out of the sensor pose (and in that case clearly the test will pass, as the frame and sensor pose for sure they will match).

However, this PR already adds a few improvements in testing that I think we can merge as they are, we can open a new PR to update the idyntree version and so see what failures we have once the checkAllFTMeasurementFrameGivenBySensorTagsIsCoherentWithMeasurementFrameGivenByFrame function actually test something.