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

Introducing model descriptions and instances #242

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open

Conversation

xiyuoh
Copy link
Member

@xiyuoh xiyuoh commented Nov 11, 2024

This is a continuation of Reuben's PR #230, opening a new one to accommodate push restrictions.

This PR:

  • Introduces the concept of model descriptions and instances, where a model description provides the information about a model (asset source, scale, etc.), and a model being spawned on site is an instance of a particular model description. This allows users to make changes to a group of model instances with the same model description at one go. This is helpful for sites with multiple identical models.
  • Allows users to create different scenarios with a scenario tree, where they can edit and switch between variants of the same environment with the ability to undo or redo changes without affecting the root scenario.
  • Provides a configurable property plugin that enables users to add new properties and configuration widgets, such as mobile robot tasks for instances and differential drive properties for descriptions.

Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
Signed-off-by: Reuben Thomas <[email protected]>
@xiyuoh
Copy link
Member Author

xiyuoh commented Nov 15, 2024

Changes from Reuben's PR:

Major changes

  • Model instance deletion: The logic for permanently deleting/temporarily removing a Model Instance in the original PR goes through the Delete Event twice - once to check whether the Model Instance should be temporarily removed only or permanently deleted (depends on the current scenario where this Model Instance is displayed), then a second time for actual deletion. The effort to streamline this process is in Filter entities sent for deletion #243, and is implemented here with filter_instance_deletion (057e186).
  • Refactor Tasks implementation - it started by wanting to implement the Display trait for Tasks so that we don't have to rely on a vector of Strings, but it led to quite a huge change in the way the Tasks enum is being written (acb39b9, 94b54a9)

Minor changes

  • Merge conflicts, a large portion of them in creation.rs (42f25c2)
  • Model instance creation - modified further after clearing merge conflicts. Needs to be reviewed again after workcell editor PR is merged (bb13ee0, e2b365c, d450cd7)
  • If a description is no longer selected or hovered over, remove the description entity (if any) from the relevant model instance support_selected/support_hovered instead of clearing all entities that the model instance supports (afddc82)
  • Simplify Model Instance creation - there are already a few ways to create a new Model Instance, limiting users to either spawn them from existing Model Descriptions under Groups or spawning one when loading a new Model Description (8ffcfe6)
  • Fixed bug where scenarios from a previously loaded site still remains visible in the Scenarios widget (5786bae)
  • Align delete button for scenarios so that it's visible within the widget (ad5ba6e)
  • Send a ChangeCurrentScenario event when adding new levels, despite the scenario not changing, to trigger visibility updates for all model instances. Otherwise when creating a new level, the model instances from before still remains visible in the editor unless the user toggles between scenarios (6ad0ea7)
  • Minor cleanup (4729bef, 1d8aa7d, af5a2d5, c6eebf4, f0fa12c, d331a79, 7b01c91, 83f3d85, de9b60e, 90a60ba, 8c19eed)

Notes:

  • Known bug: Right now with the demo map, when expanding the Added dropdown in the Scenarios widget, there will be constant error messages being printed as the editor is unable to locate assets for the TeleportIngestor and TeleportDispenser. The editor will also crash if we try to delete the Default scenario, since these entities are invalid. This is only specific to the demo map.

@xiyuoh xiyuoh marked this pull request as ready for review November 15, 2024 09:07
@xiyuoh
Copy link
Member Author

xiyuoh commented Dec 10, 2024

I've found that when calculating grid occupancy, the physical entities used for calculation are mostly meshes instead of model instance entities. This meant if a user wishes to ignore a set of model instances, their meshes would still cause the space to be occupied. 5aed94f and 3a6ad1d tackle that by ensuring that meshes that are children of an ignored entity would also be ignored.

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