gazebosim / gazebosim/sdformat
`/test/sdf/model_nested_static_model.sdf` doesn't define a `@canonical_link`
- Dominant language
- C++
- Stars
- 216
- Forks
- 125
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 14
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:
1. If `@canonical_link` is set, use that link
2. If `@canonical_link` is missing, but the model has at least one direct child `//link` use the first link
3. If `@canonical_link` is missing, direct `//link`s are missing, and the model has a nested `//model` or `//include` use the nested models's `__model__` frame (https://github.com/ignitionrobotics/sdformat/issues/705#issuecomment-926909748)
4. 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
true
```
`static_model` has neither child `//link`s nor child `//model`s, 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`.
Contributor guide
Assessment
This issue has not been assessed yet.