Hi there,
I am creating a robot, and when I call the following code, the last line yields an error.
class AMR_2W_SS(Robot):
def __init__(
self,
prim_path: str,
cfg: dict,
name: Optional[str] = "AMR_2W_SS",
usd_path: Optional[str] = None,
translation: Optional[np.ndarray] = None,
orientation: Optional[np.ndarray] = None,
scale: Optional[np.array] = None,
) -> None:
"""[summary]"""
self._usd_path = usd_path
self._name = name
AMR = CreateAMR2WheelsSkidSteer(prim_path, cfg)
AMR.build()
super().__init__(
prim_path=prim_path,
name=name,
translation=translation,
orientation=orientation,
scale=scale,
)
self.set_enabled_self_collisions(False) # THIS LINE YIELDS AN ERROR
The error:
File "/home/antoine/Documents/RANS/omniisaacgymenvs/robots/articulations/AMR_2WheelsSkidSteer.py", line 218, in __init__
self.set_enabled_self_collisions(False)
File "/home/antoine/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/articulations/articulation.py", line 1050, in set_enabled_self_collisions
self._articulation_view.set_enabled_self_collisions(flag)
File "/home/antoine/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/articulations/articulation_view.py", line 3388, in set_enabled_self_collisions
set_prim_property(self.prim_paths[i], "physxArticulation:enabledSelfCollisions", flags[read_idx])
File "/home/antoine/.local/share/ov/pkg/isaac_sim-2023.1.1/exts/omni.isaac.core/omni/isaac/core/utils/prims.py", line 802, in set_prim_property
prim.GetAttribute(property_name).Set(property_value)
pxr.Tf.ErrorException:
Error in 'pxrInternal_v0_22__pxrReserved__::UsdStage::_SetValueImpl' at line 6174 in file /buildAgent/work/ac88d7d902b57417/USD/pxr/usd/usd/stage.cpp : 'Empty typeName for </Turtlebot2.physxArticulation:enabledSelfCollisions>'
I don’t know if this is the intended outcome, maybe some things need to be initialized?
Anyhow, I’m pretty sure I am not using this method properly. Could someone tell me how it should be done?
There is a work around though, replacing the last line by the following solves the problem.
stage = omni.usd.get_context().get_stage()
art = PhysxSchema.PhysxArticulationAPI.Apply(stage.GetPrimAtPath(prim_path))
art.CreateEnabledSelfCollisionsAttr().Set(False)
Cheers,
Antoine