-
Notifications
You must be signed in to change notification settings - Fork 269
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
Fixes buoyancy flakiness when spawning entities #1808
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For reference see osrf/lrauv#272 (comment) Essentially, if we spawn an entity using the `UserCommand` system, it will create the entity during the `PreUpdate` phase. However, the `Buoyancy` system only checks for new entities during the `PreUpdate` phase (It does this to precompute volume so it does not need to be computed on every run). This means the buoyancy system may or may not catch the newly created entities. Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Codecov Report
@@ Coverage Diff @@
## gz-sim7 #1808 +/- ##
===========================================
+ Coverage 64.37% 64.42% +0.04%
===========================================
Files 341 341
Lines 27132 27151 +19
===========================================
+ Hits 17467 17492 +25
+ Misses 9665 9659 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Test Failures Unrelated. |
hidmic
approved these changes
Nov 23, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Arjo Chakravarty <arjo@openrobotics.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🦟 Bug fix
Fixes #
Summary
For reference see osrf/lrauv#272 (comment)
Essentially, if we spawn an entity using the
UserCommand
system, it will create the entity during thePreUpdate
phase. However, theBuoyancy
system only checks for new entities during thePreUpdate
phase (It does this to precompute volume so it does not need to be computed on every run). This means the buoyancy system may or may not catch the newly created entities. This PR fixes this by checking for new entities both in thePreUpdate
(for static entities) and thePostUpdate
. One caveet is that we may end up running the volume calculations twice if the entities are found during thePreUpdate
. However, if we don't check during thePreUpdate
entities spawned when the world starts will experience a gravitational pull for one time step leading to a slow sinking behaviour.I probably should back-port this.
Signed-off-by: Arjo Chakravarty arjo@openrobotics.org
Checklist
codecheck
passed (See contributing)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.