mani_skill.utils.structs.base ============================= .. py:module:: mani_skill.utils.structs.base Attributes ---------- .. autoapisummary:: mani_skill.utils.structs.base.T Classes ------- .. autoapisummary:: mani_skill.utils.structs.base.BaseStruct mani_skill.utils.structs.base.PhysxJointComponentStruct mani_skill.utils.structs.base.PhysxRigidBaseComponentStruct mani_skill.utils.structs.base.PhysxRigidBodyComponentStruct mani_skill.utils.structs.base.PhysxRigidDynamicComponentStruct Module Contents --------------- .. py:class:: BaseStruct Bases: :py:obj:`Generic`\ [\ :py:obj:`T`\ ] Base class of all structs that manage sapien objects on CPU/GPU .. py:method:: __hash__() .. py:method:: __post_init__() .. py:method:: __repr__() .. py:method:: __str__() .. py:property:: __maniskill_hash__ A better hash to use compared to the default frozen dataclass hash. It is tied directly to the only immutable field (the _objs list). .. py:property:: _num_objs .. py:attribute:: _objs :type: list[T] list of objects of type T managed by this dataclass. This should not be modified after initialization. The struct hash is dependent on the hash of this list. .. py:attribute:: _scene_idxs :type: torch.Tensor a list of indexes parallel to `self._objs` indicating which sub-scene each of those objects are actually in by index .. py:property:: device .. py:property:: px The physx system objects managed by this dataclass are working on .. py:attribute:: scene :type: mani_skill.envs.scene.ManiSkillScene The ManiSkillScene object that manages the sub-scenes this dataclasses's objects are in .. py:class:: PhysxJointComponentStruct Bases: :py:obj:`BaseStruct`\ [\ :py:obj:`T`\ ], :py:obj:`Generic`\ [\ :py:obj:`T`\ ] Base class of all structs that manage sapien objects on CPU/GPU .. py:attribute:: pose_in_child :type: mani_skill.utils.structs.pose.Pose .. py:attribute:: pose_in_parent :type: mani_skill.utils.structs.pose.Pose .. py:class:: PhysxRigidBaseComponentStruct Bases: :py:obj:`BaseStruct`\ [\ :py:obj:`T`\ ], :py:obj:`Generic`\ [\ :py:obj:`T`\ ] Base class of all structs that manage sapien objects on CPU/GPU .. py:attribute:: _bodies :type: list[sapien.physx.PhysxRigidBaseComponent] .. py:class:: PhysxRigidBodyComponentStruct Bases: :py:obj:`PhysxRigidBaseComponentStruct`\ [\ :py:obj:`T`\ ], :py:obj:`Generic`\ [\ :py:obj:`T`\ ] Base class of all structs that manage sapien objects on CPU/GPU .. py:method:: get_angular_damping() .. py:method:: get_angular_velocity() .. py:method:: get_auto_compute_mass() .. py:method:: get_cmass_local_pose() .. py:method:: get_disable_gravity() .. py:method:: get_linear_damping() .. py:method:: get_linear_velocity() .. py:method:: get_mass() .. py:method:: get_net_contact_forces() Get the net contact forces on this body. Returns force vector of shape (N, 3) where N is the number of environments, and 3 is the dimension of the force vector itself, representing x, y, and z direction of force. .. py:method:: get_net_contact_impulses() Get the net contact impulses on this body. Returns impulse vector of shape (N, 3) where N is the number of environments, and 3 is the dimension of the impulse vector itself, representing x, y, and z direction of impulse. .. py:method:: set_angular_damping(damping) .. py:method:: set_disable_gravity(arg0) .. py:method:: set_linear_damping(damping) .. py:method:: set_mass(arg0) .. py:attribute:: _bodies :type: list[sapien.physx.PhysxRigidBodyComponent] .. py:property:: _body_data :type: torch.Tensor .. py:property:: _body_data_index a list of indexes of each GPU rigid body in the `px.cuda_rigid_body_data` buffer, one for each element in `self._objs` .. py:attribute:: _body_data_index_internal :type: slice :value: None .. py:attribute:: _body_data_name :type: str .. py:property:: _body_force_query .. py:property:: angular_damping :type: torch.Tensor .. py:property:: angular_velocity :type: torch.Tensor .. py:property:: auto_compute_mass :type: torch.Tensor .. py:property:: cmass_local_pose :type: mani_skill.utils.structs.pose.Pose .. py:property:: disable_gravity :type: torch.Tensor .. py:property:: linear_damping :type: torch.Tensor .. py:property:: linear_velocity :type: torch.Tensor .. py:property:: mass :type: torch.Tensor .. py:property:: px The physx system objects managed by this dataclass are working on .. py:class:: PhysxRigidDynamicComponentStruct Bases: :py:obj:`PhysxRigidBodyComponentStruct`\ [\ :py:obj:`T`\ ], :py:obj:`Generic`\ [\ :py:obj:`T`\ ] Base class of all structs that manage sapien objects on CPU/GPU .. py:method:: get_angular_velocity() .. py:method:: get_gpu_index() .. py:method:: get_gpu_pose_index() .. py:method:: get_linear_velocity() .. py:method:: get_locked_motion_axes() .. py:method:: set_angular_velocity(arg0) Set the angular velocity of the dynamic rigid body. :param arg0: The angular velocity to set. Can be of shape (N, 3) where N is the number of managed bodies or (3, ) to apply the same angular velocity to all managed bodies. .. py:method:: set_linear_velocity(arg0) Set the linear velocity of the dynamic rigid body. :param arg0: The linear velocity to set. Can be of shape (N, 3) where N is the number of managed bodies or (3, ) to apply the same linear velocity to all managed bodies. .. py:method:: set_locked_motion_axes(axes) Set some motion axes of the dynamic rigid body to be locked :param axes: list of 6 true/false values indicating whether which of the 6 DOFs of the body is locked. The order is linear X, Y, Z followed by angular X, Y, Z. If given a single list of length 6, it will be applied to all managed bodies. If given a a batch of shape (N, 6), you can modify the N managed bodies each in batch. .. rubric:: Example set_locked_motion_axes([True, False, False, False, True, False]) allows the object to move along the X axis and rotate about the Y axis .. py:attribute:: _bodies :type: list[sapien.physx.PhysxRigidDynamicComponent] .. py:property:: angular_velocity :type: torch.Tensor .. py:property:: gpu_index .. py:property:: gpu_pose_index .. py:property:: is_sleeping .. py:property:: linear_velocity :type: torch.Tensor .. py:property:: locked_motion_axes :type: mani_skill.utils.structs.types.Array list[bool] :type: type .. py:data:: T