Open SeanCurtis-TRI opened 5 years ago
@SeanCurtis-TRI I'm curious to get your revised thoughts here, given recent designs of #13689.
@jwnimmer-tri Is there something specific you have in mind?
As I read this, what sticks out to me is that this is, ultimately, a comment on sdformat
's intermediate representation. We map sdf::Foo
to drake::Fooish
. The sdf::Foo
populates lots of fields without telling us whether it came from the .sdf file or from sdformat
itself. That remains true even in the face of #13689.
Eventually, things like <drake:perception_properties>
and <drake:illustration_properties>
may have named drake properties that would shadow sdf/urdf material properties (my current implementation in resolving #13689 has avoided making this decision). That choice would definitely be related to this issue, but, as my language might suggest, it's not clear to me that that feature would be a good thing. And even then, when we depend on the model-declared material, we're right back in the center of this issue.
So, I see these issues as largely orthogonal. However, I may simply be missing something that stood out to you.
You're right, they are mostly unrelated.
(NOTE: This discussion is in context of geometry used for the "illustration role" -- i.e. displayed in
drake_visualizer
ormesh_cat
. However, the principle can easily extend to other geometry roles.)Description
A geometry can have an arbitrary collection of properties in service of a particular role. The question is where do those property values come from and how do "default" values come into play?
Geometry passes through several stages before it's actually exercised in
SceneGraph
.SceneGraph
SDF Specificaiton and Parsing
The SDF specification (as an example) indicates while there is no default material for a visual element, if a material is defined it does have default values for diffuse, specular, ambient, and emissive. That suggest, that if the specification has a
<material>
tag but no<diffuse>
tag, the parser would be inclined to provide a diffuse value of (as currently specified) [0, 0, 0, 1].This has issues:
Consuming unspecified properties
In PR #10164, parsing the currently omits missing properties from the instantiated material property values deferring to the downstream consumers' individual policies for responding.
The concrete example of that is in
geometry_visualization.h
which is compatible with any geometry with an illustration role and provides a defaultdiffuse
value if one hasn't been specified. While the API doesn't currently support it, the API ingeometry_visualization.h
could support a user-defined default color in place of the hard-coded value.How to resolve?