mani_skill.utils.building#
Submodules#
- mani_skill.utils.building._mjcf_loader
- mani_skill.utils.building.actor_builder
- mani_skill.utils.building.actors
- mani_skill.utils.building.articulation_builder
- mani_skill.utils.building.articulations
- mani_skill.utils.building.ground
- mani_skill.utils.building.mjcf_loader
- mani_skill.utils.building.urdf_loader
Classes#
ActorBuilder class to flexibly build actors in both CPU and GPU simulations. |
|
Wrapper for the SAPIEN MJCF Loader to support easy parallelization |
|
Functions#
|
Builds an articulation or returns an articulation builder given an ID specifying which dataset/source and then the articulation ID |
Package Contents#
- class mani_skill.utils.building.ActorBuilder[source]#
Bases:
sapien.ActorBuilderActorBuilder class to flexibly build actors in both CPU and GPU simulations. This directly inherits the original flexible ActorBuilder from sapien and changes the build functions to support a batch of scenes and return a batch of Actors
- add_plane_repeated_visual(pose=sapien.Pose(), half_size=[5, 5], mat=None, texture_repeat=[1, 1])[source]#
Procedurally generateds a repeated 2D texture. Works similarly to https://mujoco.readthedocs.io/en/stable/XMLreference.html#asset-material-texrepeat
currently this always adds a back face
- Parameters:
texture_repeat (list[float]) – the number of times to repeat the texture in each direction.
pose (sapien.Pose) –
half_size (list[float]) –
mat (sapien.render.RenderMaterial) –
- build(name)[source]#
Build the actor with the given name.
Different to the original SAPIEN API, a unique name is required here.
- build_entity()[source]#
build the raw sapien entity. Modifies original SAPIEN function to accept new procedurally generated render components
- set_allow_overlapping_plane_collisions(v)[source]#
Set whether or not to permit allowing overlapping plane collisions. In general if you are creating an Actor with a plane collision that is parallelized across multiple sub-scenes, you only need one of those collision shapes. If you add multiple, it will cause the simulation to slow down significantly. By default this is set to False
- Parameters:
v (bool) –
- set_scene_idxs(scene_idxs=None)[source]#
Set a list of scene indices to build this object in. Cannot be used in conjunction with scene mask
- Parameters:
scene_idxs (Optional[Union[list[int], Sequence[int], torch.Tensor, numpy.ndarray]]) –
- _allow_overlapping_plane_collisions = False#
- _plane_collision_poses#
- _procedural_shapes = []#
procedurally generated shapes to attach
- initial_pose = None#
- scene_idxs = None#
- class mani_skill.utils.building.ArticulationBuilder[source]#
Bases:
sapien.wrapper.articulation_builder.ArticulationBuilder- build(name=None, fix_root_link=None, build_mimic_joints=True)[source]#
- Return type:
mani_skill.utils.structs.Articulation
- create_link_builder(parent=None)[source]#
- Parameters:
parent (sapien.wrapper.articulation_builder.LinkBuilder) –
- set_scene_idxs(scene_idxs=None)[source]#
Set a list of scene indices to build this object in. Cannot be used in conjunction with scene mask
- Parameters:
scene_idxs (Optional[Union[list[int], Sequence[int], torch.Tensor, numpy.ndarray]]) –
- disable_self_collisions: bool = False#
- initial_pose = None#
- name = None#
- scene_idxs = None#
- class mani_skill.utils.building.MJCFLoader(ignore_classes=['motor'], visual_groups=[0, 2])[source]#
Bases:
mani_skill.utils.building._mjcf_loader.MJCFLoaderWrapper for the SAPIEN MJCF Loader to support easy parallelization
- load(mjcf_file, package_dir=None, name=None, scene_idxs=None)[source]#
- Parameters:
urdf_file – filename for URDL file
srdf_file – SRDF for urdf_file. If srdf_file is None, it defaults to the “.srdf” file with the same as the urdf file
package_dir – base directory used to resolve asset files in the URDF file. If an asset path starts with “package://”, “package://” is simply removed from the file name
name (str) – name of the created articulation
scene_idxs (list[int]) – the ids of the scenes to build the objects in
mjcf_file (str) –
- Returns:
returns a single Articulation loaded from the URDF file. It throws an error if multiple objects exists
- Return type:
mani_skill.utils.structs.Articulation
- parse(mjcf_file, package_dir=None)[source]#
Parses a given MJCF file into articulation builders and actor builders and sensor configs
- Return type:
- disable_self_collisions: bool = False#
- name: str = None#
- class mani_skill.utils.building.URDFLoader[source]#
Bases:
sapien.wrapper.urdf_loader.URDFLoader- load(urdf_file, srdf_file=None, package_dir=None, name=None, scene_idxs=None)[source]#
- Parameters:
urdf_file (str) – filename for URDL file
srdf_file – SRDF for urdf_file. If srdf_file is None, it defaults to the “.srdf” file with the same as the urdf file
package_dir – base directory used to resolve asset files in the URDF file. If an asset path starts with “package://”, “package://” is simply removed from the file name
name (str) – name of the created articulation
scene_idxs (list[int]) – the ids of the scenes to build the objects in
- Returns:
returns a single Articulation loaded from the URDF file. It throws an error if multiple objects exists
- Return type:
- disable_self_collisions: bool = False#
- name: str = None#
- mani_skill.utils.building.get_articulation_builder(scene, id, fix_root_link=True, urdf_config=dict())[source]#
Builds an articulation or returns an articulation builder given an ID specifying which dataset/source and then the articulation ID
Currently these IDs are hardcoded for a few datasets. The new Shapedex platform for hosting and managing all assets will be integrated in the future
- Parameters:
scene (mani_skill.envs.scene.ManiSkillScene) –
id (str) –
fix_root_link (bool) –
urdf_config (dict) –
- Return type:
mani_skill.utils.building.articulation_builder.ArticulationBuilder