Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should store an included model's source file name #401

Closed
azeey opened this issue Oct 30, 2020 · 3 comments · Fixed by #509
Closed

Should store an included model's source file name #401

azeey opened this issue Oct 30, 2020 · 3 comments · Fixed by #509

Comments

@azeey
Copy link
Collaborator

azeey commented Oct 30, 2020

This can be useful when a world is saved. Relates to a TODO in https://github.com/osrf/sdformat/blob/144f82cf8b994abd2a566a7bbe6ae873a9d92403/src/parser.cc#L1075-L1082

@azeey azeey added this to the SDFormat 1.8 / libsdformat11 milestone Oct 30, 2020
@EricCousineau-TRI
Copy link
Collaborator

Can you illustrate this workflow, or point to a Gazebo tutorial / unittest that illustrates the nested model filenames being kept?

@azeey
Copy link
Collaborator Author

azeey commented Mar 11, 2021

I don't think there is currently an example of this, but when saving worlds in ign-gazebo, there is an option to preserve the <include> tag as opposed to expanding it to a <model>. This worked by making use of sdf::Element::FilePath of the included model (https://github.com/ignitionrobotics/ign-gazebo/blob/5348afa4b5ae4349f72aca51af01db856ae65b90/src/SdfGenerator.cc#L101-L124). This was somewhat of a workaround for the lack of information regarding what file the model was loaded from. It is also unable to retrieve any other information included in the original <include> element, such as <plugin> or any custom elements.

#509 addresses this by storing the original content of the <include> element so it can be retrieved at a later time for such purposes.

@EricCousineau-TRI
Copy link
Collaborator

Sweet! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants