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

Physics system: update link poses if the canonical link pose has been updated #876

Merged
merged 9 commits into from
Jul 12, 2021

Conversation

adlarkin
Copy link
Contributor

@adlarkin adlarkin commented Jun 23, 2021

Signed-off-by: Ashton Larkin [email protected]

🦟 Bug fix

Summary

As pointed out in gazebosim/gz-physics#264 (comment), if the pose of a model's canonical link changes, then the poses for all other links in this model must be updated (even if these links haven't moved) since these other link poses are given w.r.t. the model whose pose was just updated. I appeared to have removed this functionality in #669 (on accident, of course 🙂) when working on physics system performance updates, so I am adding it back in this PR. I've also added logic (and test coverage) to support pose updates for canonical links that are not the first link of a model (this has already been fixed in Edifice, but wasn't fixed for Dome yet).

A note about nested models: since nested model support is limited in Dome, I wasn't able to write tests that check for pose updates of nested models in this PR. I have left a TODO note for myself to add this test coverage when we forward port these changes to Edifice. Since we don't have test coverage for nested models yet, we should probably leave #871 open until this PR is forward ported to Edifice and nested model test coverage is included.

It's also worth noting that the physics system in Edifice/Dome has a few differences that were made for performance. This means that we may have some conflicts to resolve when porting this forward - I'm expecting that the implementation for this bug fix in Edifice/Fortress will differ somewhat from the Dome implementation (I can handle merging this bug fix forward once this PR is merged).

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (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

@github-actions github-actions bot added the 🔮 dome Ignition Dome label Jun 23, 2021
@azeey
Copy link
Contributor

azeey commented Jun 23, 2021

FYI, gazebosim/gz-physics#264 should be partially fixed by gazebosim/gz-physics#268

@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #876 (24c4217) into ign-gazebo4 (12f1237) will increase coverage by 0.02%.
The diff coverage is 93.61%.

Impacted file tree graph

@@               Coverage Diff               @@
##           ign-gazebo4     #876      +/-   ##
===============================================
+ Coverage        65.97%   66.00%   +0.02%     
===============================================
  Files              239      239              
  Lines            17657    17681      +24     
===============================================
+ Hits             11649    11670      +21     
- Misses            6008     6011       +3     
Impacted Files Coverage Δ
src/systems/physics/Physics.cc 72.08% <93.61%> (+0.39%) ⬆️

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 12f1237...24c4217. Read the comment docs.

Signed-off-by: Ashton Larkin <[email protected]>
@adlarkin adlarkin force-pushed the adlarkin/fix_pose_updates branch from 78a8297 to db748c0 Compare June 23, 2021 22:18
@adlarkin adlarkin changed the title Fix pose updates in the physics system for canonical link updates only and nested models Fix pose updates in the physics system for canonical link updates only Jun 24, 2021
@adlarkin adlarkin changed the title Fix pose updates in the physics system for canonical link updates only Physics system: update link poses if the canonical link pose has been updated Jun 24, 2021
@adlarkin adlarkin marked this pull request as ready for review June 24, 2021 17:44
@adlarkin adlarkin requested review from azeey and chapulina as code owners June 24, 2021 17:44
@adlarkin adlarkin requested a review from ahcorde June 24, 2021 17:44
@adlarkin
Copy link
Contributor Author

@azeey, this is ready for review now. I also left a note in the PR description about not being able to test nested models for this in Dome, as we discussed offline.

@adlarkin adlarkin requested a review from azeey June 30, 2021 02:49
Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

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

LGTM! I tested it using the attached shapes.sdf where I modified all the links to be in one model , set the canonical link, and changed the poses of the links.

shapes.sdf.txt

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

just a small comment

@adlarkin adlarkin merged commit e3fbbcd into ign-gazebo4 Jul 12, 2021
@adlarkin adlarkin deleted the adlarkin/fix_pose_updates branch July 12, 2021 21:43
@adlarkin adlarkin mentioned this pull request Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants