Open Mokosha opened 3 years ago
The DOM classes sdf::Root
, sdf::World
, sdf::Model
, etc add more semantic structure to the parsed SDFormat file than what is available through the sdf::Element
API. An example of this structure is pose frame semantics, which was added in SDFormat 1.7 (http://sdformat.org/tutorials?tut=pose_frame_semantics&cat=specification&). This feature adds extra constraints, such as valid relative_to
references and the requirement that non-static models have at least one link. However, the conversion that happens via sdf::convertString
is more geared toward converting syntax changes between versions of the SDFormat spec.
It would be nice for the converter to know that the model is semantically invalid in SDFormat 1.8 and report that it can't be converted properly as you suggested, but I don't think that functionality should go in sdf::convertString
. Perhaps we can update ign sdf -p
to validate the converted string and report any errors. By the way, ign sdf -k
does that already, but it doesn't print out the converted SDFormat.
Environment
Description
libsdformat
version 6.2).Note: using
::sdf::readString
directly seems to work fine, but using the available API, this doesn't give access to an::sdf::Root
object.Steps to reproduce
Run the following program:
Output