-
Notifications
You must be signed in to change notification settings - Fork 943
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
Adds a rigid body collection class #1288
Conversation
...ions/omni.isaac.lab/omni/isaac/lab/assets/rigid_object_collection/rigid_object_collection.py
Outdated
Show resolved
Hide resolved
…bject_collection/rigid_object_collection.py Signed-off-by: David Hoeller <dhoeller@nvidia.com>
...ions/omni.isaac.lab/omni/isaac/lab/assets/rigid_object_collection/rigid_object_collection.py
Outdated
Show resolved
Hide resolved
…bject_collection/rigid_object_collection.py Signed-off-by: David Hoeller <dhoeller@nvidia.com>
…m/IsaacLab into feature/rigid_object_collection
.../omni.isaac.lab/omni/isaac/lab/assets/rigid_object_collection/rigid_object_collection_cfg.py
Outdated
Show resolved
Hide resolved
…bject_collection/rigid_object_collection_cfg.py Signed-off-by: David Hoeller <dhoeller@nvidia.com>
## | ||
|
||
@property | ||
def object_state_w(self): |
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.
Do we want to use the same convention as RigidObjects for these properties i.e. body_
? Or do we want to change RigidObjects to reflect this convention? What are your thoughts?
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.
This is a question I have been thinking a lot about when designing this.
The core difference between rigid objects, and object collections is that object collections can have rigid bodies that contain the same prim structure (for example when two rigid bodies come from the same USD). That is why something like body_names
would not work in general as there would be duplicates in that case. To mark that subtle but important difference, I have introduced the concept of object_names
which refer to the keys of the dict you create the config with (see code). This allows you to uniquely identify each rigid object in the collection and do proper indexing later on.
I thought to be consistent with that, I would rename all the occurrences of body
with object
.
But I am open for debate :)
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 OK I see what you mean. I think that is reasonable.
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.
Let's see what @Mayankm96 / @kellyguo11 say
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 the distinction makes sense, maybe we just need to make the use cases of these classes clear in the docs so users understand the differences between the classes.
Awesome, literally what we needed. Will test it, thank you! |
self._external_force_b[env_ids[:, None], object_ids] = 0.0 | ||
self._external_torque_b[env_ids[:, None], object_ids] = 0.0 |
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.
this code will break if we don't have the exact same number of rigid objects as the defined num_envs
of our interactive scene. Would recommend that we remove them
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.
Where should we put them though?
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 am not sure if we can. As env_ids assumes that we have num_envs instances but that may not be the case, we might have to leave that reset to the user?
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.
This argument also holds for Articulations and RigidObjects thought
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.
true that, but wasn't the idea that with the collection, we allow exactly an option that does not have to be repeated num_envs times?
Is there a reason why there is a change in the naming convention? For the regular |
This is explained in the comment above |
...ions/omni.isaac.lab/omni/isaac/lab/assets/rigid_object_collection/rigid_object_collection.py
Show resolved
Hide resolved
...ions/omni.isaac.lab/omni/isaac/lab/assets/rigid_object_collection/rigid_object_collection.py
Show resolved
Hide resolved
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.
This goes for both class and data files. Do we plan on implementing this before or after the root_link_state/root_com_state change? At some point it would be good to implement the velocity transformation here as well.
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.
Let's add it later on.
…m/IsaacLab into feature/rigid_object_collection
… in the collection
# Description Adds a rigid body collection class, which allows to spawn multiple objects in each environment and access/modify the quantities with a unified (env_ids, object_ids) API. ## Type of change - New feature (non-breaking change which adds functionality) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
Description
Adds a rigid body collection class, which allows to spawn multiple objects in each environment and access/modify the quantities with a unified (env_ids, object_ids) API.
Type of change
Checklist
pre-commit
checks with./isaaclab.sh --format
config/extension.toml
fileCONTRIBUTORS.md
or my name already exists there