Closed traversaro closed 7 months ago
In the model generated by this repo, this affects:
root_link_imu_acc
just for _plus models root_link_ems_acc_eb5
and root_link_ems_gyro_eb5
(see https://github.com/robotology/icub-models/blob/472db4555ea72832db571b49197849e1fc6192f1/iCub/robots/iCubGazeboV2_5_plus/model.urdf#L2968 and https://github.com/robotology/icub-models/blob/472db4555ea72832db571b49197849e1fc6192f1/iCub/robots/iCubGazeboV2_5_plus/model.urdf#L2187) for all iCub >= 2.5.5 modelsGetting a fix in sdformat properly deployed will take time. For a faster fix, the best option to be seems to just to avoid to have the peculiar structure for which the base_link
is a parent link of the real link root_link
, but rather have the base_link
being a child of root_link
, as all other fake massless links are child of the actual links.
The only reason we ever used the fake base_link
as a parent was because it is a choice widespread in many humanoid robots, and because the kdl_parser
used in ROS does not support the inertia for the root link, see:
However, iDynTree has migrated away from using anything related to KDL since 2015, and KDL dynamics does not support floating base dynamics, so getting on the model generation side to basically workaround a decade old bug (https://github.com/ros/kdl_parser/issues/27) is not a great tradeoff.
We worked around the issue in https://github.com/robotology/icub-models-generator/pull/142, and the underlying issue (https://github.com/gazebosim/sdformat/issues/378) was fixed in sdformat in https://github.com/gazebosim/sdformat/pull/1114 . While the fix is not available in Gazebo 11 apt binary packages in Ubuntu 20.04/22.04 that many user use, I think that given that we worked around this issue in our models and that upstream is fixed, we can just close this issue.
The SDFormat URDF to SDF converter if fixed joints are present in the URDF, fuses the child link with its parent, transferring all the information from the lumped link to the remaining link. However, it seems that due to a bug the sensor pose are not correctly propagated.
The issue is clear with this example (done with Gazebo 11.1). Let's say that we have two URDF files:
model_sensor_on_root_link.urdf
:model_sensor_on_base_link.urdf
:The only difference between the two files is the line
<gazebo reference="root_link">
and<gazebo reference="base_link">
in another. The URDF files can be converted to SDF with the following command:that results in the following output:
model_sensor_on_root_link.urdf
:model_sensor_on_base_link.sdf
:The difference between this two files:
So it is possible to see that in the
model_sensor_on_base_link.sdf
case works fine, while in the case ofmodel_sensor_on_root_link.sdf
the pose of the sensor is silently set to the identity.