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

Update to Bevy 0.11 #180

Merged
merged 56 commits into from
Nov 10, 2023
Merged

Update to Bevy 0.11 #180

merged 56 commits into from
Nov 10, 2023

Conversation

luca-della-vedova
Copy link
Member

@luca-della-vedova luca-della-vedova commented Sep 5, 2023

New feature implementation

Implemented feature

This PR performs basic migration to Bevy 0.11. There are a lot of cleanups, refactors and additional features we could do in this upgrade that have been left out for the sake of simplicity, for example:

  • 16 size limit on SystemParam has been removed, we can remove all the manual splitting we had to do in widgets/mod.rs. Done in 2060bdf
  • A new crate for entity relations is available. We could potentially cleanup a lot of the <Entity> components, such as Point, Edge, MeshConstraint, etc.
  • States were simplified, we could potentially refactor them to reduce duplication that was introduced when WorkcellEditor was added. Done in 26c4a36, can be reverted if necessary.
  • The EntityCommand trait has been added, we could use it to unify our entity spawning logic and only spawning all the necessary components in one place.
  • Visibility component has now a new variant for "always visible". To preserve behavior I'm not using it but it seems it might help in a few places (i.e. drawing_editor has a todo mentioning it).
  • WebGPU support has been introduced, although it seems it's not supported in many browsers.

Other than the Visibility change that also introduced a lot of boilerplate, the other parts can imho be addressed in followup PRs to avoid the complexity of this exploding dramatically.

Implementation description

Other than what was necessary to make the code compile, a few other changes have been made:

  • Remove Label. It was previously mainly used for fiducials, however the use was removed in favor of Affiliation. It was still present for Measurements but not really used and set to None by default. The reason this had to be done is that now the bevy prelude includes a Label and we would have had to change all our imports statements to avoid name clashes.
  • Remove constraint.rs. They are not used anymore and were effectively dead code.
  • Remove urdf.rs. Same as above.
  • Remove bevy_mod_picking dependency. It was not really used since we do manual raycasting through bevy_mod_raycast and intersection checking. Removing it had barely any side effect.
  • Fix the assign_drawing_parent_to_new_measurements. During refactoring it pretty much became a no-op system and measurements were not saved to new projects.

The rest was just what was needed to make it run, the most complex change is rewriting the app for the new schedule, that might use an extra pair of eyes.

TODO:

  • Wasm build currently panics in bevy_render.
  • Fix panics when deleting entities.

Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova luca-della-vedova linked an issue Sep 7, 2023 that may be closed by this pull request
@luca-della-vedova luca-della-vedova changed the title WIP Update to Bevy 0.11 Update to Bevy 0.11 Sep 7, 2023
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova luca-della-vedova linked an issue Sep 7, 2023 that may be closed by this pull request
9 tasks
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova luca-della-vedova marked this pull request as ready for review September 8, 2023 02:58
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@mxgrey
Copy link
Collaborator

mxgrey commented Oct 6, 2023

Here's a before (left) : after (right) screenshot for this PR:
Screenshot from 2023-10-06 11-54-55
I notice that the coloring became a bit dull, and the specularity has softened. Is that due to some change in Bevy's rendering pipeline or default settings? I know it's subjective but I think I would prefer the previous look which feels more vibrant.

I'll check Bevy's changelog to see if I can find a likely cause. Then I'll try to fiddle with our rendering settings to see if we can get back to the original effect.

mxgrey and others added 6 commits October 6, 2023 12:55
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
@luca-della-vedova
Copy link
Member Author

Found / fixed a migration issue when removing add_children that caused wrong fiducial spawning in 4d66fb8.
Tested on web / Linux / Mac and it seems to help, good news is that 0.9 was panicking on Mac and updating to 0.11 fixes it. Merging.

@luca-della-vedova luca-della-vedova merged commit 856c2d8 into main Nov 10, 2023
5 checks passed
@luca-della-vedova luca-della-vedova deleted the luca/bevy_0.11 branch November 10, 2023 08:42
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.

Bevy 0.11 update state Support loading pgm files as Drawings
2 participants