-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: main
Are you sure you want to change the base?
Conversation
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]>
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: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Changes from Reuben's PR: Major changes
Minor changes
Notes:
|
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
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. |
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Latest changes:
TODO fix CI, though I foresee some refactoring through the review process |
rmf_site_format/src/model.rs
Outdated
pub enum OptionalModelProperty { | ||
DifferentialDrive(DifferentialDrive), | ||
MobileRobotMarker(MobileRobotMarker), | ||
Tasks(Tasks<Entity>), |
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.
I think this is making CI fail, the moment we compile rmf_site_format
without the bevy
feature Entity
will not be defined, you can try this locally by just running cargo build
in the rmf_site_format
folder.
I don't know the details of the Tasks
implementation but usually if we need to reference an entity in a "non bevy specific way" in rmf_site_format
we just use RefTrait
:
rmf_site/rmf_site_format/src/site.rs
Line 224 in 7d21b48
pub trait RefTrait: Ord + Eq + Copy + Send + Sync + Hash + 'static {} |
Which is a trait for references and is implemented for Entity
(for usage in site editor) and u32
(for usage in serialization / deserialization, as well as not having a bevy dependency).
Now the problem with this approach is that it will make OptionalModelProperty
generic and that will propagate all the way up to the ModelDescriptionBundle
, which might not be what you want
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.
But again, maybe having to do ModelDescriptionBundle<u32>
instead of ModelDescriptionBundle
wouldn't be too bad
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.
Ah thank you for pointing this out! I couldn't figure out the underlying issue behind using Entity
. I can see another (and maybe better) way to store location information in tasks without using Entity
, especially since the current method to save tasks involve exporting the entity ID that could change between runs. Let me make that change.
Edit: the change will still involve adding RefTrait
to all the relevant structs
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.
Yap that's the classic use for RefTrait
, to use both Entity
and u32
, usually the u32
that is saved / loaded is the value that is contained in the SiteID
component
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.
Fixed in 347d546
Also the elephant in the room while I was giving this a spin, where are the robots? My expectationWhat I would have expected from this PR is, when a world is loaded, models are converted into instances (and I see that) and robots are also correctly imported and converted into instances and that doesn't seem to be the case. My expectation (not sure that is the intention of this PR) would have been to see that either:
OR
The first implementation followed the second approach, but only for historical reasons and I don't have strong feelings on what is right (it seems the current implementation would do the first instead). What I actually seeWhat I see happening instead is that the location tag still exists and contains information about what robot is spawned in that location. The information is however ignored and the demo map by default contains no robot. Robots that are imported will use purely the model instance components creating a bit of a double source of truth conflict with the location tag |
…rate_site_entities Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Xiyu Oh <[email protected]>
@luca-della-vedova Thanks for highlighting the issues! I've taken your suggestions and removed the redundant Regarding setting up the option to tag robots to location entities (such that when we move location anchors around, the robot models would follow) - I'm still experimenting to figure out what's the best way to preserve non-location pose updates while also supporting robot-to-location affiliation, though I understand from our chat this is not too high up on the priority list and can potentially be tackled in another (and smaller) follow-up PR. |
( | ||
With<ModelMarker>, | ||
With<Group>, | ||
Or<(Changed<Hovered>, Changed<Selected>)>, |
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.
In the current setup, we iterate over &mut model_instances
which does not have this filter, meaning it will include all model instances in the world every update cycle. Moreover, this query will only include model descriptions whose Hovered
or Selected
status has changed during the latest cycle, so this line will not fetch anything if neither of these components changed for the model description.
I have a feeling this filter was meant to go on model_instances
, not on model_descriptions
.
This is a continuation of Reuben's PR #230, opening a new one to accommodate push restrictions.
This PR: