wrapper#

Subpackages#

Submodules#

sapien.wrapper.actor_builder module#

class sapien.wrapper.actor_builder.ActorBuilder[source]#

Bases: object

add_box_collision(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), half_size: Tuple = (1, 1, 1), material: PhysxMaterial | None = None, density: float = 1000, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False)[source]#
add_box_visual(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), half_size: Tuple = (1, 1, 1), material: RenderMaterial | None | Tuple = None, name: str = '')[source]#
add_capsule_collision(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), radius: float = 1, half_length: float = 1, material: PhysxMaterial | None = None, density: float = 1000, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False)[source]#
add_capsule_visual(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), radius: float = 1, half_length: float = 1, material: RenderMaterial | None | Tuple = None, name: str = '')[source]#
add_convex_collision_from_file(filename, pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), scale: Tuple = (1, 1, 1), material: PhysxMaterial | None = None, density: float = 1000, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False)[source]#
add_cylinder_collision(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), radius: float = 1, half_length: float = 1, material: PhysxMaterial | None = None, density: float = 1000, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False)[source]#
add_cylinder_visual(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), radius: float = 1, half_length: float = 1, material: RenderMaterial | None | Tuple = None, name: str = '')[source]#
add_multiple_convex_collisions_from_file(filename, pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), scale: Tuple = (1, 1, 1), material: PhysxMaterial | None = None, density: float = 1000, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False, decomposition: Literal['none', 'coacd'] = 'none', decomposition_params={})[source]#
add_nonconvex_collision_from_file(filename: str, pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), scale: Tuple = (1, 1, 1), material: PhysxMaterial | None = None, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False)[source]#
add_plane_collision(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), material: PhysxMaterial | None = None, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False)[source]#
add_plane_visual(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), scale: Tuple = (1, 1, 1), material: RenderMaterial | None | Tuple = None, name: str = '')[source]#
add_sphere_collision(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), radius: float = 1, material: PhysxMaterial | None = None, density: float = 1000, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False)[source]#
add_sphere_visual(pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), radius: float = 1, material: RenderMaterial | None | Tuple = None, name: str = '')[source]#
add_visual_from_file(filename: str, pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0]), scale: Tuple = (1, 1, 1), material: RenderMaterial | None | Tuple = None, name: str = '')[source]#
build(name=None)[source]#
build_entity()[source]#
build_kinematic(name='')[source]#
build_physx_component(link_parent=None)[source]#
build_render_component()[source]#
build_static(name='')[source]#
set_initial_pose(pose)[source]#
set_mass_and_inertia(mass, cmass_local_pose, inertia)[source]#
set_name(name)[source]#
set_physx_body_type(type)[source]#
set_scene(scene: Scene)[source]#
class sapien.wrapper.actor_builder.CollisionShapeRecord(type: Literal['convex_mesh', 'multiple_convex_meshes', 'nonconvex_mesh', 'plane', 'box', 'capsule', 'sphere', 'cylinder'], filename: str = '', scale: Tuple = (1, 1, 1), radius: float = 1, length: float = 1, material: sapien.pysapien.physx.PhysxMaterial | None = None, pose: sapien.pysapien.Pose = Pose([0, 0, 0], [1, 0, 0, 0]), density: float = 1000, patch_radius: float = 0, min_patch_radius: float = 0, is_trigger: bool = False, decomposition: str = 'none', decomposition_params: Dict[str, Any] | None = None)[source]#

Bases: object

decomposition: str = 'none'#
decomposition_params: Dict[str, Any] | None = None#
density: float = 1000#
filename: str = ''#
is_trigger: bool = False#
length: float = 1#
material: PhysxMaterial | None = None#
min_patch_radius: float = 0#
patch_radius: float = 0#
pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0])#
radius: float = 1#
scale: Tuple = (1, 1, 1)#
type: Literal['convex_mesh', 'multiple_convex_meshes', 'nonconvex_mesh', 'plane', 'box', 'capsule', 'sphere', 'cylinder']#
class sapien.wrapper.actor_builder.VisualShapeRecord(type: Literal['file', 'plane', 'box', 'capsule', 'sphere', 'cylinder'], filename: str = '', scale: tuple = (1, 1, 1), radius: float = 1, length: float = 1, material: sapien.pysapien.render.RenderMaterial | None = None, pose: sapien.pysapien.Pose = Pose([0, 0, 0], [1, 0, 0, 0]), name: str = '')[source]#

Bases: object

filename: str = ''#
length: float = 1#
material: RenderMaterial | None = None#
name: str = ''#
pose: Pose = Pose([0, 0, 0], [1, 0, 0, 0])#
radius: float = 1#
scale: tuple = (1, 1, 1)#
type: Literal['file', 'plane', 'box', 'capsule', 'sphere', 'cylinder']#
sapien.wrapper.actor_builder.preprocess_mesh_file(filename: str)[source]#

Process input mesh file to a SAPIEN supported format Args:

filename: input mesh file

Returns:

filename for the generated file or original filename

sapien.wrapper.articulation_builder module#

class sapien.wrapper.articulation_builder.ArticulationBuilder[source]#

Bases: object

build(fix_root_link=None, build_mimic_joints=True) PhysxArticulation[source]#
build_entities(fix_root_link=None)[source]#
set_initial_pose(pose)[source]#
set_scene(scene: Scene)[source]#
class sapien.wrapper.articulation_builder.JointRecord(joint_type: str = 'undefined', limits: Tuple[float] = (-inf, inf), pose_in_parent: sapien.pysapien.Pose = Pose([0, 0, 0], [1, 0, 0, 0]), pose_in_child: sapien.pysapien.Pose = Pose([0, 0, 0], [1, 0, 0, 0]), friction: float = 0, damping: float = 0, name: str = '')[source]#

Bases: object

damping: float = 0#
friction: float = 0#
joint_type: str = 'undefined'#
limits: Tuple[float] = (-inf, inf)#
name: str = ''#
pose_in_child: Pose = Pose([0, 0, 0], [1, 0, 0, 0])#
pose_in_parent: Pose = Pose([0, 0, 0], [1, 0, 0, 0])#
class sapien.wrapper.articulation_builder.LinkBuilder(index: int, parent)[source]#

Bases: ActorBuilder

set_joint_name(name)[source]#
set_joint_properties(type, limits, pose_in_parent, pose_in_child, friction=0, damping=0)[source]#
class sapien.wrapper.articulation_builder.MimicJointRecord(joint: str, mimic: str, multiplier: float, offset: float)[source]#

Bases: object

joint: str#
mimic: str#
multiplier: float#
offset: float#

sapien.wrapper.coacd module#

sapien.wrapper.coacd.do_coacd(filename, threshold=0.05, max_convex_hull=-1, preprocess_mode='auto', preprocess_resolution=30, resolution=2000, mcts_nodes=20, mcts_iterations=150, mcts_max_depth=3, pca=False, merge=True, seed=0, verbose=False)[source]#
sapien.wrapper.coacd.get_file_md5(filename)[source]#

sapien.wrapper.engine module#

class sapien.wrapper.engine.Engine(**args)[source]#

Bases: object

create_physical_material(static_friction, dynamic_friction, restitution)[source]#
create_scene(config=PhysxSceneConfig())[source]#
set_renderer(renderer)[source]#

sapien.wrapper.pinocchio_model module#

sapien.wrapper.renderer module#

class sapien.wrapper.renderer.SapienRenderer(**args)[source]#

Bases: SapienRenderer

create_material()[source]#
sapien.wrapper.renderer.get_diffuse_texture(self)[source]#
sapien.wrapper.renderer.set_diffuse_texture(self, texture)[source]#

sapien.wrapper.scene module#

class sapien.wrapper.scene.Scene(systems=None)[source]#

Bases: Scene

add_area_light_for_ray_tracing(pose: Pose, color, half_width: float, half_height: float)[source]#
add_camera(name, width: int, height: int, fovy: float, near: float, far: float) RenderCameraComponent[source]#
add_directional_light(direction, color, shadow=False, position=[0, 0, 0], shadow_scale=10.0, shadow_near=-10.0, shadow_far=10.0, shadow_map_size=2048)[source]#
add_ground(altitude, render=True, material=None, render_material=None, render_half_size=[10, 10])[source]#
add_mounted_camera(name, mount, pose, width, height, fovy, near, far) RenderCameraComponent[source]#
add_point_light(position, color, shadow=False, shadow_near=0.1, shadow_far=10.0, shadow_map_size=2048)[source]#
add_spot_light(position, direction, inner_fov: float, outer_fov: float, color, shadow=False, shadow_near=0.1, shadow_far=10.0, shadow_map_size=2048)[source]#
property ambient_light#
create_actor_builder()[source]#
create_articulation_builder()[source]#
create_connection(body0: Entity | PhysxRigidBaseComponent | None, pose0: Pose, body1: Entity | PhysxRigidBaseComponent, pose1: Pose)[source]#
create_drive(body0: Entity | PhysxRigidBaseComponent | None, pose0: Pose, body1: Entity | PhysxRigidBaseComponent, pose1: Pose)[source]#
create_gear(body0: Entity | PhysxRigidBaseComponent | None, pose0: Pose, body1: Entity | PhysxRigidBaseComponent, pose1: Pose)[source]#
create_physical_material(static_friction: float, dynamic_friction: float, restitution: float)[source]#
create_urdf_loader()[source]#
create_viewer()[source]#
get_all_actors()[source]#
get_all_articulations()[source]#
get_cameras()[source]#
get_contacts()[source]#
get_mounted_cameras()[source]#
get_timestep()[source]#
remove_actor(actor)[source]#
remove_articulation(articulation)[source]#
remove_camera(camera)[source]#
remove_light(light)[source]#
property render_id_to_visual_name#
set_ambient_light(color)[source]#
set_environment_map(cubemap: str | RenderCubemap)[source]#
set_environment_map_from_files(px: str, nx: str, py: str, ny: str, pz: str, nz: str)[source]#
set_timestep(timestep)[source]#
step()[source]#
property timestep#
update_render()[source]#
class sapien.wrapper.scene.Widget[source]#

Bases: object

sapien.wrapper.urdf_exporter module#

sapien.wrapper.urdf_exporter.export_joint(joint: PhysxArticulationJoint)[source]#
sapien.wrapper.urdf_exporter.export_kinematic_chain_urdf(articulation, force_fix_root=False)[source]#
sapien.wrapper.urdf_exporter.export_kinematic_chain_xml(articulation)[source]#

sapien.wrapper.urdf_loader module#

Module contents#