You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may not be a bug, looking at Migration.md under SDFormat specification 1.6 to 1.7 > Modifications#2 it says regarding unique names:
Some existing SDFormat models may not comply with this requirement. The ign sdf --check command can be used to identify models that violate this requirement.
Looking into the API for the recursiveSiblingUniqueNames method it is unclear to me that we want to introduce SDF specs if the method is designed just to provide the check and it's on its clients to use it to implement whatever logic they want:
/// \brief Check that all sibling elements of the any type have unique names.
/// This checks recursively and should check the files exhaustively
/// rather than terminating early when the first duplicate name is found.
I used this approach in gazebo11 . The downside is that all the clients should implement a logic defined in the standard, which seems inefficient to me for multiple reasons.
libsdformat has the limitation that all files are converted to the latest Spec version known by the library before parsing. This means that if you parse a 1.6 file in libsdformat9, it will be converted to 1.7, and if you parse the same file in libsdformat11, it will be converted to 1.8. To work around this limitation, we have sdf::Element::OriginalVersion and there are places in the code that issue warnings based on that. However, name uniqueness for sibling elements is required to provide Frame Semantics features that were introduced in SDFormat 1.7. And there is no way for libsdformat9 to function with that feature disabled, so as a work around and not to break a lot of existing SDF files, if a name collision is found, we print a warning and rename the element as you can see in: https://github.com/osrf/sdformat/blob/9876a6089c88ac39408e658b6b4b2928abab8377/src/Model.cc#L294-L297 and https://github.com/osrf/sdformat/blob/9876a6089c88ac39408e658b6b4b2928abab8377/src/Model.cc#L331-L334)
However, we did not put in these workarounds for the validation checks because we want to encourage users to update their models.
Environment
Description
With the following example:
libsdformat6
the check says the example is valid. When usinglibsdformat9
the check says the example is not valid.Steps to reproduce
Output
Looking into the specification: naming rules for 1.4-1.6, it says:
So I believe that the issue could be a bug in sdformat9 (probably above) when forcing to use the 1.6 spec.
The text was updated successfully, but these errors were encountered: