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

Document design of DOM objects #292

Open
scpeters opened this issue May 19, 2020 · 6 comments · May be fixed by gazebosim/sdf_tutorials#64
Open

Document design of DOM objects #292

scpeters opened this issue May 19, 2020 · 6 comments · May be fixed by gazebosim/sdf_tutorials#64

Comments

@scpeters
Copy link
Member

Several questions about the design of libsdformat's DOM objects have come up in discussions with @EricCousineau-TRI over time, including the following:

  • Lifetime of DOM elements, lifetime or relationship
  • role of semantics, why not just use xsd to generate structs
  • How dynamic is the DOM? If you call SetPoseRelativeTo, does that modify the embedded ElementPtr? the PoseRelativeToGraph?
  • Is the DOM a read-only interface to a model parsed from XML? Or would you construct a model programmatically from DOM objects?
@EricCousineau-TRI
Copy link
Collaborator

Ideal target is SDFormat 1.8 release (Target: December 1, 2020)

@scpeters scpeters added this to the SDFormat 1.8 / libsdformat10 milestone May 22, 2020
@EricCousineau-TRI
Copy link
Collaborator

Relates #312 - on error behavior of XML parsing, should return Error.
But for public DOM API, not sure if mutators should either return Error, or throw exceptions.

@chapulina
Copy link
Contributor

Is the DOM a read-only interface to a model parsed from XML? Or would you construct a model programmatically from DOM objects?

We're close to December 1st 😄 Do we have an answer to this question?

I'm asking in the context of #388. We use SDF DOM classes to store data inside ign-gazebo, and convert that to and from protobuf messages. So I need a way to construct a sdf::Heightmap from an ignition::msgs::HeightmapGeom.

@scpeters
Copy link
Member Author

scpeters commented Dec 6, 2021

there have been a few recent changes (such as #772) that imply some answers to the questions about the DOM object design, though we haven't formally documented answers to these questions yet

@scpeters
Copy link
Member Author

scpeters commented Feb 8, 2022

  • Is the DOM a read-only interface to a model parsed from XML? Or would you construct a model programmatically from DOM objects?

Recent pull requests (such as #785, #838, #839, #840, #841) provide functionality to construct models, links, etc from DOM objects rather than editing XML strings, which would imply that the DOM is not simply a read-only interface.

@scpeters
Copy link
Member Author

scpeters commented Feb 8, 2022

  • How dynamic is the DOM? If you call SetPoseRelativeTo, does that modify the embedded ElementPtr? the PoseRelativeToGraph?

The Frame Semantics graphs are currently not updated by DOM API calls. It would be good to find a way to keep them in sync or decouple them in some way.

@azeey azeey linked a pull request Feb 11, 2022 that will close this issue
2 tasks
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.

3 participants