gazebosim / gazebosim/sdformat
Material library and material instances.
- Dominant language
- C++
- Stars
- 216
- Forks
- 125
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 14
Description
**Original report ([archived issue](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/issues/196)) by Sean Curtis (Bitbucket: [SeanCurtisTRI](https://bitbucket.org/%7B9c62c800-3df6-43f2-a552-2739fb7f01c4%7D/)).**
----------------------------------------
Most tags have a *required* `name` tag. The `` tag is one conspicuous exception (the other being ``). The assumption is that they don't have names because they aren't referenced by any other tags.
However, if we named them, this would give us the ability to build a library of materials and then "instance" them, in some sense. This could be done formally (i.e., declare a material library tag and then define a bunch of materials that can be referenced by name) or in an ad hoc mechanism (I.e., one instance `...` can define a material and another reference could make use of it by sharing the name and defining no properties). This kind of library/instance paradigm would assist renderers in recognizing the same material being instanced (rather than having to infer it).
This is superficially related to #173 in that both would lead to a more compact representation of the robot in the SDF file. But the emphasis of this request is not on the *authoring* side, but on the consuming side -- it provides a meaningful basis for hashing materials (via name) at parse time rather than having to do it at implementation.
It obviously creates an increased burden on the parser (i.e., two definitions cannot exist for the same material name in the same scope), but that's a relatively trivial test and failing the test should indicate outright failure with an appropriate error message to the tune of "malformed SDF, try again".
Contributor guide
Research direction
Review the existing SDF parser and material handling before choosing between a formal material library and named material instances. Done should include named materials, a way to reference them, and an error when duplicate material names occur in the same scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, xml
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100