`/test/sdf/model_nested_static_model.sdf` doesn't define a `@canonical_link`
#718 opened on Sep 28, 2021
Repository metrics
- Stars
- (216 stars)
- PR merge metrics
- (PR metrics pending)
Description
This could be related to me not having full knowledge of the @canonical_link resolution rules. The current order that I am aware of is:
- If
@canonical_linkis set, use that link - If
@canonical_linkis missing, but the model has at least one direct child//linkuse the first link - If
@canonical_linkis missing, direct//links are missing, and the model has a nested//modelor//includeuse the nested models's__model__frame (https://github.com/ignitionrobotics/sdformat/issues/705#issuecomment-926909748) - The canonical_link is undefined / the SDF is faulty
With this in mind, the following SDF (/test/sdfmodel_nested_static_model.sdf) would be invalid in v1.8:
<?xml version="1.0" ?>
<sdf version='1.8'>
<model name="model_nested_static_model">
<model name="child_model">
<model name="static_model">
<static>true</static>
</model>
</model>
</model>
</sdf>
static_model has neither child //links nor child //models, which makes the canonical link undetermined. The fact that it is //static will make its __model__ frame attach to world, and as such it would be possible to resolve all frame positions again, but - as far as I know - this behavior is currently not part of the spec.
On a tangent: It also strikes me as a bit odd that a __model__ frame can become a @canonical_link in this particular situation ... I believe it is not valid to directly/explicitly set it in this way? The frame is - technically - not a link, but rather a //link is a frame/frame-bearing.
My suggestion for resolving it would be to add a dummy link in static_model.