Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR should fix an issue that arose after #8. I was doing some sim2sim test, and I just felt that something was odd - just a feeling. I inspected the generated
xml
and I figured out that the mass of the root link had vanished. I then compared the total mass of the robot loading theurdf
model withidyntree
and the total mass of the robot imported inmujoco
: it was different.In #8, I added an additional frame connecting the world to the root with a floating joint. In the conversion from
urdf
tomjcf
, it seems that the root link is lumped with this frame, losing the mass property.In this PR, I simplify this logic, exploiting the fact that the
idyntree model reducer
adds, before the root link, a fixed joint that is then converted to a floating one.I added an additional test that checks that the mass of the
idytree
model and of themujoco
model coincide. Just to be sure a test is added also with a different robot,anymal_c
fromrobots_description.py
.