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 support for nested canonical links to sdf10 #350

Merged
merged 1 commit into from
Sep 3, 2020

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Sep 2, 2020

Cherry-pick #341 to sdf10; use rebase and merge.

Support implicit nested canonical links (#341)

Allow models without links if they have nested models instead.
When building FrameAttachedToGraph, if model has no links
choose the first link of the first nested model as canonical
link instead.

A new private function Model::CanonicalLinkAndRelativeName
is added that provides a Link* pointer to the canonical link and its
nested name relative to the current model, which is needed
in the FrameAttachedToGraph. This private prevents
duplicate code in FrameSemantics.cc and Model::CanonicalLink.
The method is private to hide :: syntax from libsdformat9,
at least until there is a compelling reason to make the API
public.

A helper function is added to FrameSemantics.cc as a friend
of Model so that buildFrameAttachedToGraph can call the
private API. That function can't be added directly
as a friend since it uses a FrameAttachedToGraph&
as an argument, which isn't defined in Model.hh.

Signed-off-by: Steve Peters [email protected]

Allow models without links if they have nested models instead.
When building FrameAttachedToGraph, if model has no links
choose the first link of the first nested model as canonical
link instead.

A new private function `Model::CanonicalLinkAndRelativeName`
is added that provides a `Link*` pointer to the canonical link and its
nested name relative to the current model, which is needed
in the FrameAttachedToGraph. This private prevents
duplicate code in `FrameSemantics.cc` and `Model::CanonicalLink`.
The method is private to hide :: syntax from libsdformat9,
at least until there is a compelling reason to make the API
public.

A helper function is added to FrameSemantics.cc as a friend
of Model so that buildFrameAttachedToGraph can call the
private API. That function can't be added directly
as a friend since it uses a `FrameAttachedToGraph&`
as an argument, which isn't defined in Model.hh.

Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters added this to the SDFormat 1.8 / libsdformat11 milestone Sep 2, 2020
@scpeters scpeters requested a review from azeey September 2, 2020 17:43
@codecov-commenter
Copy link

Codecov Report

Merging #350 into sdf10 will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            sdf10     #350      +/-   ##
==========================================
+ Coverage   87.32%   87.35%   +0.03%     
==========================================
  Files          60       60              
  Lines        9185     9207      +22     
==========================================
+ Hits         8021     8043      +22     
  Misses       1164     1164              
Impacted Files Coverage Δ
src/FrameSemantics.cc 76.54% <100.00%> (+0.31%) ⬆️
src/Model.cc 85.86% <100.00%> (+0.66%) ⬆️

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 c1376c8...b34b39a. Read the comment docs.

@scpeters scpeters merged commit d506bf3 into gazebosim:sdf10 Sep 3, 2020
@scpeters scpeters deleted the pick_nested_canonical_10 branch September 3, 2020 07:41
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