diff --git a/embodichain/lab/sim/sim_manager.py b/embodichain/lab/sim/sim_manager.py index a11626d..d31e2c6 100644 --- a/embodichain/lab/sim/sim_manager.py +++ b/embodichain/lab/sim/sim_manager.py @@ -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 @@ -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 @@ -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. diff --git a/tests/sim/objects/test_soft_object.py b/tests/sim/objects/test_soft_object.py index 88ea2d2..3099c2d 100644 --- a/tests/sim/objects/test_soft_object.py +++ b/tests/sim/objects/test_soft_object.py @@ -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()