mani_skill.utils.structs#

Submodules#

Attributes#

Classes#

Actor

Wrapper around sapien.Entity objects mixed in with useful properties from the RigidBodyDynamicComponent components

ArticulationJoint

Wrapper around physx.PhysxArticulationJoint objects

BaseStruct

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

DefaultMaterialsConfig

GPUMemoryConfig

A gpu memory configuration dataclass that neatly holds all parameters that configure physx GPU memory for simulation

Link

Wrapper around physx.PhysxArticulationLinkComponent objects

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

Pose

Wrapper around sapien.Pose that supports managing a batch of Poses and flexible creation of them from a variety of

RenderCamera

Wrapper around sapien.render.RenderCameraComponent

SceneConfig

SimConfig

Simulation configurations for ManiSkill environments

Package Contents#

class mani_skill.utils.structs.Actor[source]#

Bases: mani_skill.utils.structs.base.PhysxRigidDynamicComponentStruct[sapien.Entity]

Wrapper around sapien.Entity objects mixed in with useful properties from the RigidBodyDynamicComponent components

At the moment, on GPU and CPU one can query pose, linear velocity, and angular velocity easily

On CPU, more properties are available

__hash__()[source]#
__repr__()[source]#
__str__()[source]#
apply_force(force)[source]#

Apply an instantaneous external force to this actor in Newtons to the body’s center of mass. Once called no need to call any gpu_apply_x functions as this handles it for you.

Parameters:

force (mani_skill.utils.structs.types.Array)

classmethod create_from_entities(entities, scene, scene_idxs, shared_name=None)[source]#
Parameters:
get_collision_meshes(to_world_frame=True, first_only=False)[source]#

Returns the collision mesh of each managed actor object. Note results of this are not cached or optimized at the moment so this function can be slow if called too often. Some actors have no collision meshes, in which case this function returns an empty list.

Parameters:
  • to_world_frame (bool) – Whether to transform the collision mesh pose to the world frame

  • first_only (bool) – Whether to return the collision mesh of just the first actor managed by this object. If True, this also returns a single Trimesh.Mesh object instead of a list. This can be useful for efficiency reasons if you know ahead of time all of the managed actors have the same collision mesh

Return type:

Union[list[trimesh.Trimesh], trimesh.Trimesh]

get_first_collision_mesh(to_world_frame=True)[source]#

Returns the collision mesh of the first managed actor object. Note results of this are not cached or optimized at the moment so this function can be slow if called too often. Some actors have no collision meshes, in which case this function returns None

Parameters:

to_world_frame (bool) – Whether to transform the collision mesh pose to the world frame

Return type:

Union[trimesh.Trimesh, None]

get_state()[source]#
hide_visual()[source]#

Hides this actor from view. In CPU simulation the visual body is simply set to visibility 0

For GPU simulation, currently this is implemented by moving the actor very far away as visiblity cannot be changed on the fly. As a result we do not permit hiding and showing visuals of objects with collision shapes as this affects the actual simulation. Note that this operation can also be fairly slow as we need to run px.gpu_apply_rigid_dynamic_data and px.gpu_fetch_rigid_dynamic_data.

is_static(lin_thresh=0.01, ang_thresh=0.1)[source]#

Checks if this actor is static within the given linear velocity threshold lin_thresh and angular velocity threshold ang_thresh

classmethod merge(actors, name=None)[source]#

Merge actors together under one view so that they can all be managed by one python dataclass object. This can be useful for e.g. randomizing the asset loaded into a task and being able to do object.pose to fetch the pose of all randomized assets or object.set_pose to change the pose of each of the different assets, despite the assets not being uniform across all sub-scenes.

For example usage of this method, see mani_skill/envs/tasks/pick_single_ycb.py

Parameters:
  • actors (list[Actor]) – The actors to merge into one actor object to manage

  • name (str) – A new name to give the merged actors. If none, the name will default to the first actor’s name

remove_from_scene()[source]#
set_collision_group(group, value)[source]#
Parameters:

group (int)

set_collision_group_bit(group, bit_idx, bit)[source]#

Set’s a specific collision group bit for all collision shapes in all parallel actors

Parameters:
  • group (int)

  • bit_idx (int)

  • bit (Union[int, bool])

set_pose(arg1)[source]#
Parameters:

arg1 (Union[mani_skill.utils.structs.pose.Pose, sapien.Pose])

Return type:

None

set_state(state, env_idx=None)[source]#
Parameters:
  • state (mani_skill.utils.structs.types.Array)

  • env_idx (Optional[torch.Tensor])

show_visual()[source]#
property has_collision_shapes#
hidden: bool = False#
initial_pose: mani_skill.utils.structs.pose.Pose = None#

The initial pose of this Actor, as defined when creating the actor via the ActorBuilder. It is necessary to track this pose to ensure the actor is still at the correct pose once gpu system is initialized. It may also be useful to help reset a environment to an initial state without having to manage initial poses yourself

merged: bool = False#

Whether this object is a view of other actors as a result of Actor.merge

name: str = None#
property per_scene_id#

Returns a int32 torch tensor of the actor level segmentation ID for each managed actor object.

property pose: mani_skill.utils.structs.pose.Pose#
Return type:

mani_skill.utils.structs.pose.Pose

px_body_type: Literal['kinematic', 'static', 'dynamic'] = None#
class mani_skill.utils.structs.ArticulationJoint[source]#

Bases: mani_skill.utils.structs.base.BaseStruct[sapien.physx.PhysxArticulationJoint]

Wrapper around physx.PhysxArticulationJoint objects

At the moment, all of the same joints across all sub scenes are restricted to having the same properties as each other

__hash__()[source]#
__repr__()[source]#
__str__()[source]#
classmethod create(physx_joints, physx_articulations, scene, scene_idxs, joint_index, active_joint_index=None)[source]#

Creates an object for managing articulation joints in articulations

Note that the properties articulation, child_link, parent_link are by default None as they might not make sense in GPU sim and must be set by user

Parameters:
  • physx_joints (list[sapien.physx.PhysxArticulationJoint])

  • physx_articulations (list[sapien.physx.PhysxArticulation])

  • scene (mani_skill.envs.scene.ManiSkillScene)

  • scene_idxs (torch.Tensor)

  • joint_index (torch.Tensor)

  • active_joint_index (torch.Tensor)

get_damping()[source]#
Return type:

float

get_dof()[source]#
Return type:

int

get_drive_mode()[source]#
get_drive_target()[source]#
get_force_limit()[source]#
get_friction()[source]#
get_global_pose()[source]#
get_limits()[source]#
get_name()[source]#
get_pose_in_child()[source]#
get_pose_in_parent()[source]#
get_stiffness()[source]#
Return type:

float

get_type()[source]#
set_drive_properties(stiffness, damping, force_limit=3.4028234663852886e+38, mode='force')[source]#
Parameters:
  • stiffness (float)

  • damping (float)

  • force_limit (float)

  • mode (Literal['force', 'acceleration'])

set_drive_target(target)[source]#
Parameters:

target (mani_skill.utils.structs.types.Array)

Return type:

None

set_drive_velocity_target(velocity)[source]#
Parameters:

velocity (mani_skill.utils.structs.types.Array)

Return type:

None

set_friction(friction)[source]#
Parameters:

friction (float)

set_limits(limits)[source]#
Parameters:

limits (mani_skill.utils.structs.types.Array)

Return type:

None

property _data_index#
_physx_articulations: list[sapien.physx.PhysxArticulation] = None#
active_index: torch.Tensor#

index of this joint amongst the active joints

articulation: mani_skill.utils.structs.articulation.Articulation | None = None#
property damping: torch.Tensor#
Return type:

torch.Tensor

property dof: torch.Tensor#
Return type:

torch.Tensor

property drive_mode: list[Literal['force', 'acceleration']]#

typing.Literal[‘force’, ‘acceleration’]

Type:

type

Return type:

list[Literal[‘force’, ‘acceleration’]]

property drive_target: torch.Tensor#
Return type:

torch.Tensor

property drive_velocity_target: torch.Tensor#
Return type:

torch.Tensor

property force_limit: torch.Tensor#
Return type:

torch.Tensor

property friction: torch.Tensor#
Return type:

torch.Tensor

property global_pose: mani_skill.utils.structs.pose.Pose#
Return type:

mani_skill.utils.structs.pose.Pose

index: torch.Tensor#

index of this joint among all joints

property limits: torch.Tensor#
Return type:

torch.Tensor

name: str = None#
property pose_in_child#
property pose_in_parent#
property qpos#

The qpos of this joint in the articulation

property qvel#

The qvel of this joint in the articulation

property stiffness: torch.Tensor#
Return type:

torch.Tensor

property type: list[Literal['fixed', 'revolute', 'revolute_unwrapped', 'prismatic', 'free']]#
Return type:

list[Literal[‘fixed’, ‘revolute’, ‘revolute_unwrapped’, ‘prismatic’, ‘free’]]

class mani_skill.utils.structs.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__#

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#
_objs: 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.

_scene_idxs: torch.Tensor#

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

property device#
property px#

The physx system objects managed by this dataclass are working on

scene: mani_skill.envs.scene.ManiSkillScene#

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

class mani_skill.utils.structs.DefaultMaterialsConfig[source]#
dict()[source]#
dynamic_friction: float = 0.3#
restitution: float = 0#
static_friction: float = 0.3#
class mani_skill.utils.structs.GPUMemoryConfig[source]#

A gpu memory configuration dataclass that neatly holds all parameters that configure physx GPU memory for simulation

dict()[source]#
collision_stack_size: int = 4194304#

Increase this if you get ‘Collision stack overflow detected’

found_lost_aggregate_pairs_capacity: int = 1024#
found_lost_pairs_capacity: int = 33554432#
heap_capacity: int = 67108864#
max_rigid_contact_count: int = 524288#

Increase this if you get ‘Contact buffer overflow detected’

max_rigid_patch_count: int = 262144#

Increase this if you get ‘Patch buffer overflow detected’

temp_buffer_capacity: int = 16777216#

overflowing initial allocation size, increase capacity to at least %.’

Type:

Increase this if you get ‘PxgPinnedHostLinearMemoryAllocator

total_aggregate_pairs_capacity: int = 1024#

Bases: mani_skill.utils.structs.base.PhysxRigidBodyComponentStruct[sapien.physx.PhysxArticulationLinkComponent]

Wrapper around physx.PhysxArticulationLinkComponent objects

__hash__()[source]#
__repr__()[source]#
__str__()[source]#
bbox(filter)[source]#
Parameters:

filter (Callable[[sapien.physx.PhysxArticulationLinkComponent, sapien.render.RenderShape], bool])

Return type:

list[trimesh.primitives.Box]

classmethod create(physx_links, scene, scene_idxs)[source]#
Parameters:
generate_mesh(filter, mesh_name)[source]#

Generates mesh objects (trimesh.Trimesh) for each managed physx link given a filter and saves them to self.meshes[mesh_name] in addition to returning them here.

Parameters:
  • filter (Callable[[sapien.physx.PhysxArticulationLinkComponent, sapien.render.RenderShape], bool])

  • mesh_name (str)

get_articulation()[source]#
get_index()[source]#
get_joint()[source]#
Return type:

mani_skill.utils.structs.articulation_joint.ArticulationJoint

get_name()[source]#
get_visual_meshes(to_world_frame=True, first_only=False)[source]#

Returns the visual mesh of each managed link object. Note results of this are not cached or optimized at the moment so this function can be slow if called too often

Parameters:
  • to_world_frame (bool)

  • first_only (bool)

Return type:

list[trimesh.Trimesh]

classmethod merge(links, name=None)[source]#
Parameters:
  • links (list[Link])

  • name (str)

set_collision_group(group, value)[source]#
Parameters:

group (int)

set_collision_group_bit(group, bit_idx, bit)[source]#

Set’s a specific collision group bit for all collision shapes in all parallel actors :param group: the collision group to set the bit for. Typically you only need to use group 2 to disable collision checks between links to enable faster simulation. :type group: int :param bit_idx: the bit index to set :type bit_idx: int :param bit: the bit value to set. Must be 1/0 or True/False. :type bit: int | bool

Parameters:
  • group (int)

  • bit_idx (int)

  • bit (Union[int, bool])

set_pose(arg1)[source]#
Parameters:

arg1 (Union[mani_skill.utils.structs.pose.Pose, sapien.Pose])

Return type:

None

articulation: mani_skill.utils.structs.Articulation = None#

the articulation that this link is a part of. If this is None, most likely this link object is a view/merged link object in which case there is no one articulation that can be referenced easily

property index: torch.Tensor#

The indexes of the managed link objects in their respective articulations. NOTE that these do not correspond with position in the qpos and qvel of articulations. For that index use index_q

Return type:

torch.Tensor

property is_root: torch.Tensor#
Return type:

torch.Tensor

joint: mani_skill.utils.structs.articulation_joint.ArticulationJoint = None#

the joint of which this link is a child of. If this is a view/merged link then this joint is also a view/merged joint

merged: bool = False#

whether this link is result of Link.merge or not

meshes: dict[str, list[trimesh.Trimesh]]#

map from user-defined mesh groups (e.g. “handle” meshes for cabinets) to a list of trimesh.Trimesh objects corresponding to each physx link object managed here

name: str = None#
property per_scene_id: torch.Tensor#

Returns a int32 torch tensor of the link level segmentation ID for each managed link object.

Return type:

torch.Tensor

property pose: mani_skill.utils.structs.pose.Pose#
Return type:

mani_skill.utils.structs.pose.Pose

property render_shapes#

Returns each managed link objects render shape list (a list of lists)

class mani_skill.utils.structs.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#
pose_in_parent: mani_skill.utils.structs.pose.Pose#
class mani_skill.utils.structs.PhysxRigidBaseComponentStruct[source]#

Bases: BaseStruct[T], Generic[T]

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

_bodies: list[sapien.physx.PhysxRigidBaseComponent]#
class mani_skill.utils.structs.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]#
property _body_data: torch.Tensor#
Return type:

torch.Tensor

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

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

torch.Tensor

property angular_velocity: torch.Tensor#
Return type:

torch.Tensor

property auto_compute_mass: torch.Tensor#
Return type:

torch.Tensor

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

mani_skill.utils.structs.pose.Pose

property disable_gravity: torch.Tensor#
Return type:

torch.Tensor

property linear_damping: torch.Tensor#
Return type:

torch.Tensor

property linear_velocity: torch.Tensor#
Return type:

torch.Tensor

property mass: torch.Tensor#
Return type:

torch.Tensor

property px#

The physx system objects managed by this dataclass are working on

class mani_skill.utils.structs.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]#
property angular_velocity: torch.Tensor#
Return type:

torch.Tensor

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

torch.Tensor

property locked_motion_axes: mani_skill.utils.structs.types.Array#

list[bool]

Type:

type

Return type:

mani_skill.utils.structs.types.Array

class mani_skill.utils.structs.Pose[source]#

Wrapper around sapien.Pose that supports managing a batch of Poses and flexible creation of them from a variety of sources (list, numpy array, sapien.Pose). This pose object will also return information with a batch dimension, even if it is just holding a single position and quaternion.

As a result pose.p and pose.q will return shapes (N, 3) and (N, 4) respectively for N poses being stored. pose.raw_pose stores all the pose data as a single 2D array of shape (N, 7).

All sapien.Pose API are re-implemented in batch mode here to support GPU simulation. E.g. pose multiplication and inverse with pose_1.inv() * pose_2, or creating transformation matrices with pose_1.to_transformation_matrix() are suppported they same way they are in sapien.Pose.

Pose Creation#

To create a batched pose with a given position p and/or quaternion q, you run:

pose = Pose.create_from_pq(p=p, q=q)

p and q can be a torch tensor, numpy array, and/or list, or None.

If p or q have only 1 value/not batched, then we automatically repeat the value to the batch size of the other given value. For example, if p has a batch dimension of size > 1, and q has a batch dimension of size 1 or is a flat list, then the code automatically repeats the q value to the batch size of p. Likewise in the reverse direction the same repeating occurs.

If p and q have the same batch size, they are stored as so.

If p and q have no batch dimensions, one is automatically added (e.g. p having shape (3,) now becomes (1, 3))

If p is None, it is auto filled with zeros.

If q is None, it is auto filled with the [1, 0, 0, 0] quaternion.

If you have a sapien.Pose, another Pose object, or a raw pose tensor of shape (N, 7) or (7,) called x, you can create this Pose object with:

pose = Pose.create(x)

If you want a sapien.Pose object instead of this batched Pose, you can do pose.sp to get the sapien.Pose version (which is not batched). Note that this is only permitted if this Pose has a batch size of 1.

Pose Indexing#

You can index into a Pose object like numpy/torch arrays to get a new Pose object with the indexed data.

For example if pose has a batch size of 4, then pose[0] will be a Pose object with batch size of 1, and pose[1:3] will be a Pose object with batch size of 2.

__getitem__(i)[source]#
__len__()[source]#
__mul__(arg0)[source]#

Multiply two poses. Supports multiplying singular poses like sapien.Pose or Pose object with batch size of 1 with Pose objects with batch size > 1.

Parameters:

arg0 (Union[Pose, sapien.Pose])

Return type:

Pose

classmethod create(pose, device=None)[source]#

Creates a Pose object from a given pose, which can be a torch tensor, sapien.Pose, list of sapien.Pose, or Pose

Parameters:
  • pose (Union[mani_skill.utils.structs.types.Array, sapien.Pose, list[sapien.Pose], Pose])

  • device (Optional[mani_skill.utils.structs.types.Device])

Return type:

Pose

classmethod create_from_pq(p=None, q=None, device=None)[source]#

Creates a Pose object from a given position p and/or quaternion q

Parameters:
  • p (Optional[mani_skill.utils.structs.types.Array])

  • q (Optional[mani_skill.utils.structs.types.Array])

  • device (Optional[mani_skill.utils.structs.types.Device])

get_p()[source]#

Returns self.p, the position

get_q()[source]#

Returns self.q, the quaternion

inv()[source]#

Returns the inverse of this pose

set_p(p)[source]#

Sets the position of this pose

Parameters:

p (torch.Tensor)

Return type:

None

set_q(q)[source]#

Sets the quaternion of this pose

Parameters:

q (torch.Tensor)

Return type:

None

to(device)[source]#

Move the Pose object to a different device

Parameters:

device (mani_skill.utils.structs.types.Device)

to_transformation_matrix()[source]#

Returns the (N, 4, 4) shaped transformation matrix equivalent to this pose

property device: mani_skill.utils.structs.types.Device#

Torch Device the Pose object is on

Return type:

mani_skill.utils.structs.types.Device

property p#

The position of this pose

property q#

The quaternion of this pose

raw_pose: torch.Tensor#
property shape: torch.Size#

Shape of the Pose object

Return type:

torch.Size

property sp#

Returns the equivalent sapien pose. Note that this is only permitted if this Pose has a batch size of 1.

class mani_skill.utils.structs.RenderCamera[source]#

Wrapper around sapien.render.RenderCameraComponent

__hash__()[source]#
classmethod create(render_cameras, scene, mount=None)[source]#
Parameters:
get_extrinsic_matrix()[source]#
get_far()[source]#
Return type:

float

get_global_pose()[source]#
Return type:

mani_skill.utils.structs.pose.Pose

get_height()[source]#
Return type:

int

get_intrinsic_matrix()[source]#
get_local_pose()[source]#
Return type:

mani_skill.utils.structs.pose.Pose

get_model_matrix()[source]#
get_name()[source]#
Return type:

str

get_near()[source]#
Return type:

float

get_picture(names)[source]#
Parameters:

names (Union[str, list[str]])

Return type:

list[torch.Tensor]

get_projection_matrix()[source]#
get_skew()[source]#
Return type:

float

get_width()[source]#
Return type:

int

set_far(far)[source]#
Parameters:

far (float)

Return type:

None

set_focal_lengths(fx, fy)[source]#
Parameters:
  • fx (float)

  • fy (float)

Return type:

None

set_fovx(fov, compute_y=True)[source]#
Parameters:
  • fov (float)

  • compute_y (bool)

Return type:

None

set_fovy(fov, compute_x=True)[source]#
Parameters:
  • fov (float)

  • compute_x (bool)

Return type:

None

set_gpu_pose_batch_index(arg0)[source]#
Parameters:

arg0 (int)

Return type:

None

set_local_pose(arg0)[source]#
Parameters:

arg0 (sapien.Pose)

Return type:

None

set_near(near)[source]#
Parameters:

near (float)

Return type:

None

set_perspective_parameters(near, far, fx, fy, cx, cy, skew)[source]#
Parameters:
  • near (float)

  • far (float)

  • fx (float)

  • fy (float)

  • cx (float)

  • cy (float)

  • skew (float)

Return type:

None

set_principal_point(cx, cy)[source]#
Parameters:
  • cx (float)

  • cy (float)

Return type:

None

set_property(name, value)[source]#

change properties of the camera. This is not well documented at the moment and is a heavily overloaded function.

At the moment you can do this:

  • set_property(“toneMapper”, value) where value is 0 (gamma), 1 (sRGB), 2 (filmic) change the color management used. Default is 0 (gamma)

  • set_property(“exposure”, value) where value is the exposure. Default is 1.0

Parameters:
  • name (str)

  • value (Any)

Return type:

None

set_skew(skew)[source]#
Parameters:

skew (float)

Return type:

None

take_picture()[source]#
Return type:

None

_cached_extrinsic_matrix: torch.Tensor = None#
_cached_intrinsic_matrix: torch.Tensor = None#
_cached_local_pose: mani_skill.utils.structs.pose.Pose = None#
_cached_model_matrix: torch.Tensor = None#
property _cuda_buffer#
_render_cameras: list[sapien.render.RenderCameraComponent]#
camera_group: sapien.render.RenderCameraGroup = None#
property cx: float#
Return type:

float

property cy: float#
Return type:

float

property far: float#
Return type:

float

property fovx: float#
Return type:

float

property fovy: float#
Return type:

float

property fx: float#
Return type:

float

property fy: float#
Return type:

float

property global_pose: mani_skill.utils.structs.pose.Pose#
Return type:

mani_skill.utils.structs.pose.Pose

property height: int#
Return type:

int

property local_pose: sapien.Pose#
Return type:

sapien.Pose

mount: mani_skill.utils.structs.actor.Actor | mani_skill.utils.structs.link.Link = None#
name: str#
property near: float#
Return type:

float

scene: Any#
property skew: float#
Return type:

float

property width: int#
Return type:

int

class mani_skill.utils.structs.SceneConfig[source]#
dict()[source]#
bounce_threshold: float = 2.0#
contact_offset: float = 0.02#
cpu_workers: int = 0#
enable_ccd: bool = False#
enable_enhanced_determinism: bool = False#
enable_friction_every_iteration: bool = True#
enable_pcm: bool = True#
enable_tgs: bool = True#
gravity: numpy.ndarray | list[float]#
rest_offset: float = 0#
sleep_threshold: float = 0.005#
solver_position_iterations: int = 15#
solver_velocity_iterations: int = 1#
class mani_skill.utils.structs.SimConfig[source]#

Simulation configurations for ManiSkill environments

dict()[source]#
control_freq: int = 20#

control frequency (Hz). Every control step (e.g. env.step) contains sim_freq / control_freq physx simulation steps

default_materials_config: DefaultMaterialsConfig#
gpu_memory_config: GPUMemoryConfig#
scene_config: SceneConfig#
sim_freq: int = 100#

simulation frequency (Hz)

spacing: float = 5#

Controls the spacing between parallel environments when simulating on GPU in meters. Increase this value if you expect objects in one parallel environment to impact objects within this spacing distance

type mani_skill.utils.structs.Array = torch.Tensor | np.ndarray[Any] | Sequence[source]#
type mani_skill.utils.structs.Device = str | torch.device[source]#
mani_skill.utils.structs.DriveMode[source]#