Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions embodichain/lab/sim/sim_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ def asset_uids(self) -> List[str]:
uid_list.extend(list(self._robots.keys()))
uid_list.extend(list(self._rigid_objects.keys()))
uid_list.extend(list(self._rigid_object_groups.keys()))
uid_list.extend(list(self._soft_objects.keys()))
uid_list.extend(list(self._articulations.keys()))
return uid_list

Expand Down Expand Up @@ -795,6 +796,20 @@ def get_rigid_object(self, uid: str) -> RigidObject | None:
return None
return self._rigid_objects[uid]

def get_soft_object(self, uid: str) -> SoftObject | None:
"""Get a soft object by its unique ID.

Args:
uid (str): The unique ID of the soft object.

Returns:
SoftObject | None: The soft object instance if found, otherwise None.
"""
if uid not in self._soft_objects:
logger.log_warning(f"Soft object {uid} not found.")
return None
return self._soft_objects[uid]

def get_rigid_object_uid_list(self) -> List[str]:
"""Get current rigid body uid list

Expand All @@ -803,6 +818,14 @@ def get_rigid_object_uid_list(self) -> List[str]:
"""
return list(self._rigid_objects.keys())

def get_soft_object_uid_list(self) -> List[str]:
"""Get current soft body uid list

Returns:
List[str]: list of soft body uid.
"""
return list(self._soft_objects.keys())

def add_rigid_object_group(self, cfg: RigidObjectGroupCfg) -> RigidObjectGroup:
"""Add a rigid object group to the scene.

Expand Down
1 change: 0 additions & 1 deletion tests/sim/objects/test_soft_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def teardown_method(self):
self.sim.destroy()


@pytest.mark.skip(reason="Skipping SoftObject test now")
class TestSoftObjectCUDA(BaseSoftObjectTest):
def setup_method(self):
self.setup_simulation()
Expand Down