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

Cherry-pick nested model support to sdf10 #338

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

scpeters
Copy link
Member

This is a cherry-pick of #316 to sdf10. Use rebase and merge.

Nested model elements (`//model/model`) are currently supported in the
SDFormat 1.7 spec, but are not supported by the DOM API or frame
semantics operations in libsdformat 9.2.
Per Amendment 1 of the SDFormat 1.7 proposal
(sdformat.org/tutorials?tut=pose_frame_semantics_proposal#amendment-1-directly-nested-models),
this PR adds support for nested models in the DOM API and frame
semantics (fixing gazebosim#283) through three steps:

* adding `Model::Model*` methods for accessing nested models via
  the DOM API (047ec96)
* loading nested models in `Model::Load` (b57fea2, step 3 of model parsing
  stages (sdformat.org/tutorials?tut=pose_frame_semantics_proposal#1-model))
* supporting nested models (`//model/model`) in frame semantics as
  opaque frames to match how models in the world scope (`//world/model`)
  are treated (85e0b4f, steps 6-9 of model parsing stages
  (sdformat.org/tutorials?tut=pose_frame_semantics_proposal#1-model))

The first two steps are straightforward, while the 3rd step adds new behavior.
This behavior is added to `libsdformat9` because it is compatible with the
SDFormat 1.7 spec (which supports nested models) and makes the treatment
of models more consistent with regard to frame semantics.
In libsdformat 9.2.0, a `//world/model` supports frame semantics: they have
frames that can be referenced by name with `//pose/@relative_to` and
`//world/frame/@attached_to` values can resolve to a `//world/model`.
This extends that same behavior to nested `//model/model` elements;
they now have their own frames in the frame and pose graphs, and a
`//model/frame` is permitted to attach to a model.

This does not add support for referencing elements within a model via
the `::` syntax in the frame semantics or DOM APIs.
That will be added in SDFormat 1.8 (see gazebosim#293).

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters requested review from azeey and chapulina August 17, 2020 17:56
@codecov-commenter
Copy link

Codecov Report

Merging #338 into sdf10 will decrease coverage by 0.22%.
The diff coverage is 69.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##            sdf10     #338      +/-   ##
==========================================
- Coverage   87.51%   87.28%   -0.23%     
==========================================
  Files          60       60              
  Lines        9090     9189      +99     
==========================================
+ Hits         7955     8021      +66     
- Misses       1135     1168      +33     
Impacted Files Coverage Δ
src/parser.cc 78.50% <50.00%> (+0.02%) ⬆️
src/FrameSemantics.cc 76.23% <68.18%> (-0.99%) ⬇️
src/Model.cc 85.19% <69.81%> (-3.55%) ⬇️
src/SemanticPose.cc 100.00% <100.00%> (ø)
src/World.cc 93.12% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b53e44...1109e3a. Read the comment docs.

@scpeters
Copy link
Member Author

CI looks happy; I'm going to rebase and merge

@scpeters scpeters merged commit 6ea6ae6 into gazebosim:sdf10 Aug 17, 2020
@scpeters scpeters deleted the pick_nested_model_dom_10 branch August 17, 2020 20:21
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 this pull request may close these issues.

2 participants