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

Added Root::Clone function #843

Closed
wants to merge 4 commits into from
Closed

Added Root::Clone function #843

wants to merge 4 commits into from

Conversation

nkoenig
Copy link
Contributor

@nkoenig nkoenig commented Feb 7, 2022

Signed-off-by: Nate Koenig [email protected]

🎉 New feature

Summary

Adds a Root::Clone function so that one sdf::Root can copy another sdf::Root

This is just a Fortress fix. Here is a fix for Garden: #844

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Nate Koenig <[email protected]>
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Feb 7, 2022
Signed-off-by: Nate Koenig <[email protected]>
src/Root.cc Outdated
Comment on lines 429 to 440

this->dataPtr->worldFrameAttachedToGraphs =
_root.dataPtr->worldFrameAttachedToGraphs ;

this->dataPtr->modelFrameAttachedToGraph =
_root.dataPtr->modelFrameAttachedToGraph ;

this->dataPtr->worldPoseRelativeToGraphs =
_root.dataPtr->worldPoseRelativeToGraphs;

this->dataPtr->modelPoseRelativeToGraph =
_root.dataPtr->modelPoseRelativeToGraph;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ScopedGraph holds a pointer to heap allocated data. Simply assigning the values here will have both Root objects pointing to the same data, which is probably not what we want, especially when we're adding mutation capabilities.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed these copies, and replaced with a Root::UpdateGraphs function in 9c16a72.

@nkoenig nkoenig requested a review from azeey February 10, 2022 22:25
@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2022

Codecov Report

Merging #843 (9c16a72) into sdf12 (8e832e7) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            sdf12     #843      +/-   ##
==========================================
+ Coverage   90.76%   90.78%   +0.01%     
==========================================
  Files          78       78              
  Lines       12535    12555      +20     
==========================================
+ Hits        11378    11398      +20     
  Misses       1157     1157              
Impacted Files Coverage Δ
src/Root.cc 94.01% <100.00%> (+0.81%) ⬆️

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 8e832e7...9c16a72. Read the comment docs.

@nkoenig
Copy link
Contributor Author

nkoenig commented Feb 10, 2022

I'm combining this PR with #841 due to testing overlap

@nkoenig nkoenig closed this Feb 10, 2022
@nkoenig nkoenig deleted the root_clone branch February 19, 2022 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants