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 canonical links (#341) to master #352

Merged
merged 1 commit into from
Sep 3, 2020

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Sep 3, 2020

Cherry-pick #341 to master. 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 requested a review from azeey September 3, 2020 07:50
@codecov-commenter
Copy link

Codecov Report

Merging #352 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #352      +/-   ##
==========================================
+ Coverage   87.41%   87.44%   +0.02%     
==========================================
  Files          60       60              
  Lines        9315     9337      +22     
==========================================
+ Hits         8143     8165      +22     
  Misses       1172     1172              
Impacted Files Coverage Δ
src/FrameSemantics.cc 77.60% <100.00%> (+0.29%) ⬆️
src/Model.cc 85.93% <100.00%> (+0.58%) ⬆️

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 021eb8b...ecbe1c9. Read the comment docs.

@scpeters scpeters changed the title Cherry nested canonical links (#341) to master Cherry pick nested canonical links (#341) to master Sep 3, 2020
@scpeters scpeters merged commit d02105e into gazebosim:master Sep 3, 2020
@scpeters scpeters deleted the pick_nested_canonical branch September 3, 2020 08:10
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