mani_skill.utils.structs.base#

Attributes#

T

Classes#

BaseStruct

Base class of all structs that manage sapien objects on CPU/GPU

PhysxJointComponentStruct

Base class of all structs that manage sapien objects on CPU/GPU

PhysxRigidBaseComponentStruct

Base class of all structs that manage sapien objects on CPU/GPU

PhysxRigidBodyComponentStruct

Base class of all structs that manage sapien objects on CPU/GPU

PhysxRigidDynamicComponentStruct

Base class of all structs that manage sapien objects on CPU/GPU

Module Contents#

class mani_skill.utils.structs.base.BaseStruct[source]#

Bases: Generic[T]

Base class of all structs that manage sapien objects on CPU/GPU

__hash__()[source]#
__post_init__()[source]#
__repr__()[source]#
__str__()[source]#
property __maniskill_hash__[source]#

A better hash to use compared to the default frozen dataclass hash. It is tied directly to the only immutable field (the _objs list).

property _num_objs[source]#
_objs: list[T][source]#

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.

_scene_idxs: torch.Tensor[source]#

a list of indexes parallel to self._objs indicating which sub-scene each of those objects are actually in by index

property device[source]#
property px[source]#

The physx system objects managed by this dataclass are working on

scene: mani_skill.envs.scene.ManiSkillScene[source]#

The ManiSkillScene object that manages the sub-scenes this dataclasses’s objects are in

class mani_skill.utils.structs.base.PhysxJointComponentStruct[source]#

Bases: BaseStruct[T], Generic[T]

Base class of all structs that manage sapien objects on CPU/GPU

pose_in_child: mani_skill.utils.structs.pose.Pose[source]#
pose_in_parent: mani_skill.utils.structs.pose.Pose[source]#
class mani_skill.utils.structs.base.PhysxRigidBaseComponentStruct[source]#

Bases: BaseStruct[T], Generic[T]

Base class of all structs that manage sapien objects on CPU/GPU

_bodies: list[sapien.physx.PhysxRigidBaseComponent][source]#
class mani_skill.utils.structs.base.PhysxRigidBodyComponentStruct[source]#

Bases: PhysxRigidBaseComponentStruct[T], Generic[T]

Base class of all structs that manage sapien objects on CPU/GPU

get_angular_damping()[source]#
Return type:

float

get_angular_velocity()[source]#
Return type:

torch.Tensor

get_auto_compute_mass()[source]#
Return type:

bool

get_cmass_local_pose()[source]#
Return type:

mani_skill.utils.structs.pose.Pose

get_disable_gravity()[source]#
Return type:

bool

get_linear_damping()[source]#
Return type:

float

get_linear_velocity()[source]#
Return type:

torch.Tensor

get_mass()[source]#
Return type:

float

get_net_contact_forces()[source]#

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.

get_net_contact_impulses()[source]#

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.

set_angular_damping(damping)[source]#
Parameters:

damping (float) –

Return type:

None

set_disable_gravity(arg0)[source]#
Parameters:

arg0 (bool) –

Return type:

None

set_linear_damping(damping)[source]#
Parameters:

damping (float) –

Return type:

None

set_mass(arg0)[source]#
Parameters:

arg0 (float) –

Return type:

None

_bodies: list[sapien.physx.PhysxRigidBodyComponent][source]#
property _body_data: torch.Tensor[source]#
Return type:

torch.Tensor

property _body_data_index[source]#

a list of indexes of each GPU rigid body in the px.cuda_rigid_body_data buffer, one for each element in self._objs

_body_data_index_internal: slice = None[source]#
_body_data_name: str[source]#
property _body_force_query[source]#
property angular_damping: torch.Tensor[source]#
Return type:

torch.Tensor

property angular_velocity: torch.Tensor[source]#
Return type:

torch.Tensor

property auto_compute_mass: torch.Tensor[source]#
Return type:

torch.Tensor

property cmass_local_pose: mani_skill.utils.structs.pose.Pose[source]#
Return type:

mani_skill.utils.structs.pose.Pose

property disable_gravity: torch.Tensor[source]#
Return type:

torch.Tensor

property linear_damping: torch.Tensor[source]#
Return type:

torch.Tensor

property linear_velocity: torch.Tensor[source]#
Return type:

torch.Tensor

property mass: torch.Tensor[source]#
Return type:

torch.Tensor

property px[source]#

The physx system objects managed by this dataclass are working on

class mani_skill.utils.structs.base.PhysxRigidDynamicComponentStruct[source]#

Bases: PhysxRigidBodyComponentStruct[T], Generic[T]

Base class of all structs that manage sapien objects on CPU/GPU

get_angular_velocity()[source]#
Return type:

torch.Tensor

get_gpu_index()[source]#
Return type:

int

get_gpu_pose_index()[source]#
Return type:

int

get_linear_velocity()[source]#
Return type:

torch.Tensor

get_locked_motion_axes()[source]#
Return type:

mani_skill.utils.structs.types.Array

set_angular_velocity(arg0)[source]#

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.

Parameters:

arg0 (mani_skill.utils.structs.types.Array) –

set_linear_velocity(arg0)[source]#

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.

Parameters:

arg0 (mani_skill.utils.structs.types.Array) –

set_locked_motion_axes(axes)[source]#

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.

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

Parameters:

axes (mani_skill.utils.structs.types.Array) –

Return type:

None

_bodies: list[sapien.physx.PhysxRigidDynamicComponent][source]#
property angular_velocity: torch.Tensor[source]#
Return type:

torch.Tensor

property gpu_index[source]#
property gpu_pose_index[source]#
property is_sleeping[source]#
property linear_velocity: torch.Tensor[source]#
Return type:

torch.Tensor

property locked_motion_axes: mani_skill.utils.structs.types.Array[source]#

list[bool]

Type:

type

Return type:

mani_skill.utils.structs.types.Array

mani_skill.utils.structs.base.T[source]#