physx#

Module contents#

class sapien.pysapien.physx.PhysxArticulation#

Bases: pybind11_object

property active_joints#
compute_passive_force(self: sapien.pysapien.physx.PhysxArticulation, gravity: bool = True, coriolis_and_centrifugal: bool = True) numpy.ndarray[numpy.float32[m, 1]]#
create_fixed_tendon(self: sapien.pysapien.physx.PhysxArticulation, link_chain: list[sapien.pysapien.physx.PhysxArticulationLinkComponent], coefficients: list[float], recip_coefficients: list[float], rest_length: float = 0, offset: float = 0, stiffness: float = 0, damping: float = 0, low: float = -3.4028234663852886e+38, high: float = 3.4028234663852886e+38, limit_stiffness: float = 0) None#
create_pinocchio_model(gravity=[0, 0, -9.81]) PinocchioModel#
property dof#
find_joint_by_name(self: sapien.pysapien.physx.PhysxArticulation, name: str) sapien.pysapien.physx.PhysxArticulationJoint#
get_active_joints(self: sapien.pysapien.physx.PhysxArticulation) list[sapien.pysapien.physx.PhysxArticulationJoint]#
get_dof(self: sapien.pysapien.physx.PhysxArticulation) int#
get_gpu_index(self: sapien.pysapien.physx.PhysxArticulation) int#
get_joints(self: sapien.pysapien.physx.PhysxArticulation) list[sapien.pysapien.physx.PhysxArticulationJoint]#
get_name(self: sapien.pysapien.physx.PhysxArticulation) str#
get_pose(self: sapien.pysapien.physx.PhysxArticulation) sapien.pysapien.Pose#
get_qacc(self: sapien.pysapien.physx.PhysxArticulation) numpy.ndarray[numpy.float32[m, 1]]#
get_qf(self: sapien.pysapien.physx.PhysxArticulation) numpy.ndarray[numpy.float32[m, 1]]#
get_qlimit(self: sapien.pysapien.physx.PhysxArticulation) numpy.ndarray[numpy.float32[m, 2]]#

same as get_qlimit

get_qlimits(self: sapien.pysapien.physx.PhysxArticulation) numpy.ndarray[numpy.float32[m, 2]]#
get_qpos(self: sapien.pysapien.physx.PhysxArticulation) numpy.ndarray[numpy.float32[m, 1]]#
get_qvel(self: sapien.pysapien.physx.PhysxArticulation) numpy.ndarray[numpy.float32[m, 1]]#
get_root(self: sapien.pysapien.physx.PhysxArticulation) sapien.pysapien.physx.PhysxArticulationLinkComponent#
get_root_angular_velocity(self: sapien.pysapien.physx.PhysxArticulation) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_root_linear_velocity(self: sapien.pysapien.physx.PhysxArticulation) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_root_pose(self: sapien.pysapien.physx.PhysxArticulation) sapien.pysapien.Pose#
get_sleep_threshold(self: sapien.pysapien.physx.PhysxArticulation) float#
get_solver_position_iterations(self: sapien.pysapien.physx.PhysxArticulation) int#
get_solver_velocity_iterations(self: sapien.pysapien.physx.PhysxArticulation) int#
property gpu_index#
property joints#
property name#
property pose#
property qacc#
property qf#
property qlimit#
property qlimits#
property qpos#
property qvel#
property root#
property root_angular_velocity#
property root_linear_velocity#
property root_pose#
set_name(self: sapien.pysapien.physx.PhysxArticulation, name: str) None#
set_pose(self: sapien.pysapien.physx.PhysxArticulation, pose: sapien.pysapien.Pose) None#
set_qacc(self: sapien.pysapien.physx.PhysxArticulation, qacc: numpy.ndarray[numpy.float32[m, 1]]) None#
set_qf(self: sapien.pysapien.physx.PhysxArticulation, qf: numpy.ndarray[numpy.float32[m, 1]]) None#
set_qpos(self: sapien.pysapien.physx.PhysxArticulation, qpos: numpy.ndarray[numpy.float32[m, 1]]) None#
set_qvel(self: sapien.pysapien.physx.PhysxArticulation, qvel: numpy.ndarray[numpy.float32[m, 1]]) None#
set_root_angular_velocity(self: sapien.pysapien.physx.PhysxArticulation, velocity: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]) None#
set_root_linear_velocity(self: sapien.pysapien.physx.PhysxArticulation, velocity: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]) None#
set_root_pose(self: sapien.pysapien.physx.PhysxArticulation, pose: sapien.pysapien.Pose) None#
set_sleep_threshold(self: sapien.pysapien.physx.PhysxArticulation, threshold: float) None#
set_solver_position_iterations(self: sapien.pysapien.physx.PhysxArticulation, count: int) None#
set_solver_velocity_iterations(self: sapien.pysapien.physx.PhysxArticulation, count: int) None#
property sleep_threshold#
property solver_position_iterations#
property solver_velocity_iterations#
class sapien.pysapien.physx.PhysxArticulationJoint#

Bases: pybind11_object

property armature#
property damping#
property dof#
property drive_mode#
property drive_target#
property drive_velocity_target#
property force_limit#
property friction#
get_armature(self: sapien.pysapien.physx.PhysxArticulationJoint) numpy.ndarray[numpy.float32[m, 1]]#
get_damping(self: sapien.pysapien.physx.PhysxArticulationJoint) float#
get_dof(self: sapien.pysapien.physx.PhysxArticulationJoint) int#
get_drive_mode(self: sapien.pysapien.physx.PhysxArticulationJoint) Literal['force', 'acceleration']#
get_drive_target(self: sapien.pysapien.physx.PhysxArticulationJoint) numpy.ndarray[numpy.float32[m, 1]]#
get_drive_velocity_target(self: sapien.pysapien.physx.PhysxArticulationJoint) numpy.ndarray[numpy.float32[m, 1]]#
get_force_limit(self: sapien.pysapien.physx.PhysxArticulationJoint) float#
get_friction(self: sapien.pysapien.physx.PhysxArticulationJoint) float#
get_global_pose(self: sapien.pysapien.physx.PhysxArticulationJoint) sapien.pysapien.Pose#
get_limit(self: sapien.pysapien.physx.PhysxArticulationJoint) numpy.ndarray[numpy.float32[m, 2]]#

same as get_limits

get_limits(self: sapien.pysapien.physx.PhysxArticulationJoint) numpy.ndarray[numpy.float32[m, 2]]#
get_name(self: sapien.pysapien.physx.PhysxArticulationJoint) str#
get_pose_in_child(self: sapien.pysapien.physx.PhysxArticulationJoint) sapien.pysapien.Pose#
get_pose_in_parent(self: sapien.pysapien.physx.PhysxArticulationJoint) sapien.pysapien.Pose#
get_stiffness(self: sapien.pysapien.physx.PhysxArticulationJoint) float#
get_type(self: sapien.pysapien.physx.PhysxArticulationJoint) Literal['fixed', 'revolute', 'revolute_unwrapped', 'prismatic', 'free']#
property global_pose#
property limit#
property limits#
property name#
property pose_in_child#
property pose_in_parent#
set_armature(self: sapien.pysapien.physx.PhysxArticulationJoint, armature: numpy.ndarray[numpy.float32[m, 1]]) None#
set_drive_properties(self: sapien.pysapien.physx.PhysxArticulationJoint, stiffness: float, damping: float, force_limit: float = 3.4028234663852886e+38, mode: Literal['force', 'acceleration'] = 'force') None#
set_drive_property(self: sapien.pysapien.physx.PhysxArticulationJoint, stiffness: float, damping: float, force_limit: float = 3.4028234663852886e+38, mode: Literal['force', 'acceleration'] = 'force') None#

same as set_drive_properties

set_drive_target(*args, **kwargs)#

Overloaded function.

  1. set_drive_target(self: sapien.pysapien.physx.PhysxArticulationJoint, target: float) -> None

  2. set_drive_target(self: sapien.pysapien.physx.PhysxArticulationJoint, target: numpy.ndarray[numpy.float32[m, 1]]) -> None

set_drive_velocity_target(*args, **kwargs)#

Overloaded function.

  1. set_drive_velocity_target(self: sapien.pysapien.physx.PhysxArticulationJoint, velocity: float) -> None

  2. set_drive_velocity_target(self: sapien.pysapien.physx.PhysxArticulationJoint, velocity: numpy.ndarray[numpy.float32[m, 1]]) -> None

set_friction(self: sapien.pysapien.physx.PhysxArticulationJoint, friction: float) None#
set_limit(self: sapien.pysapien.physx.PhysxArticulationJoint, limit: numpy.ndarray[numpy.float32[m, 2]]) None#

same as set_limits

set_limits(self: sapien.pysapien.physx.PhysxArticulationJoint, limit: numpy.ndarray[numpy.float32[m, 2]]) None#
set_name(self: sapien.pysapien.physx.PhysxArticulationJoint, name: str) None#
set_pose_in_child(self: sapien.pysapien.physx.PhysxArticulationJoint, pose: sapien.pysapien.Pose) None#
set_pose_in_parent(self: sapien.pysapien.physx.PhysxArticulationJoint, pose: sapien.pysapien.Pose) None#
set_type(self: sapien.pysapien.physx.PhysxArticulationJoint, type: Literal['fixed', 'revolute', 'revolute_unwrapped', 'prismatic', 'free']) None#
property stiffness#
property type#
class sapien.pysapien.physx.PhysxArticulationLinkComponent#

Bases: PhysxRigidBodyComponent

property articulation#
property children#
get_articulation(self: sapien.pysapien.physx.PhysxArticulationLinkComponent) sapien.pysapien.physx.PhysxArticulation#
get_children(self: sapien.pysapien.physx.PhysxArticulationLinkComponent) list[sapien.pysapien.physx.PhysxArticulationLinkComponent]#
get_gpu_pose_index(self: sapien.pysapien.physx.PhysxArticulationLinkComponent) int#
get_index(self: sapien.pysapien.physx.PhysxArticulationLinkComponent) int#
get_joint(self: sapien.pysapien.physx.PhysxArticulationLinkComponent) sapien.pysapien.physx.PhysxArticulationJoint#
get_parent(self: sapien.pysapien.physx.PhysxArticulationLinkComponent) sapien.pysapien.physx.PhysxArticulationLinkComponent#
property gpu_pose_index#
property index#
property is_root#
property joint#
property parent#
put_to_sleep(self: sapien.pysapien.physx.PhysxArticulationLinkComponent) None#
set_parent(self: sapien.pysapien.physx.PhysxArticulationLinkComponent, parent: sapien.pysapien.physx.PhysxArticulationLinkComponent) None#
property sleeping#
wake_up(self: sapien.pysapien.physx.PhysxArticulationLinkComponent) None#
class sapien.pysapien.physx.PhysxBaseComponent#

Bases: Component

class sapien.pysapien.physx.PhysxBodyConfig#

Bases: pybind11_object

property sleep_threshold#
property solver_position_iterations#
property solver_velocity_iterations#
class sapien.pysapien.physx.PhysxCollisionShape#

Bases: pybind11_object

property collision_groups#
property contact_offset#
property density#
get_collision_groups(self: sapien.pysapien.physx.PhysxCollisionShape) Annotated[list[int], FixedSize(4)]#
get_contact_offset(*args, **kwargs)#

Overloaded function.

  1. get_contact_offset(self: sapien.pysapien.physx.PhysxCollisionShape) -> float

  2. get_contact_offset(self: sapien.pysapien.physx.PhysxCollisionShape) -> float

get_density(self: sapien.pysapien.physx.PhysxCollisionShape) float#
get_local_pose(self: sapien.pysapien.physx.PhysxCollisionShape) sapien.pysapien.Pose#
get_min_patch_radius(self: sapien.pysapien.physx.PhysxCollisionShape) float#
get_patch_radius(self: sapien.pysapien.physx.PhysxCollisionShape) float#
get_physical_material(self: sapien.pysapien.physx.PhysxCollisionShape) sapien.pysapien.physx.PhysxMaterial#
get_rest_offset(*args, **kwargs)#

Overloaded function.

  1. get_rest_offset(self: sapien.pysapien.physx.PhysxCollisionShape) -> float

  2. get_rest_offset(self: sapien.pysapien.physx.PhysxCollisionShape) -> float

property local_pose#
property min_patch_radius#
property patch_radius#
property physical_material#
property rest_offset#
set_collision_groups(self: sapien.pysapien.physx.PhysxCollisionShape, groups: Annotated[list[int], FixedSize(4)]) None#

collision groups determine the collision behavior of objects. Let A.gx denote the collision group x of collision shape A. Collision shape A and B will collide iff the following condition holds:

((A.g0 & B.g1) or (A.g1 & B.g0)) and (not ((A.g2 & B.g2) and ((A.g3 & 0xffff) == (B.g3 & 0xffff))))

Here is some explanation: g2 is the “ignore group” and g3 is the “id group”. Only the lower 16 bits of the id group is used since the upper 16 bits are reserved for other purposes in the future. When 2 collision shapes have the same ID (g3), then if any of their g2 bits match, their collisions are always ignored.

If after testing g2 and g3, the objects may collide, g0 and g1 come into play. g0 is the “contact type group” and g1 is the “contact affinity group”. Collision shapes collide only when a bit in the contact type of the first shape matches a bit in the contact affinity of the second shape.

set_contact_offset(*args, **kwargs)#

Overloaded function.

  1. set_contact_offset(self: sapien.pysapien.physx.PhysxCollisionShape, offset: float) -> None

  2. set_contact_offset(self: sapien.pysapien.physx.PhysxCollisionShape, offset: float) -> None

set_density(self: sapien.pysapien.physx.PhysxCollisionShape, density: float) None#
set_local_pose(self: sapien.pysapien.physx.PhysxCollisionShape, pose: sapien.pysapien.Pose) None#
set_min_patch_radius(self: sapien.pysapien.physx.PhysxCollisionShape, radius: float) None#
set_patch_radius(self: sapien.pysapien.physx.PhysxCollisionShape, radius: float) None#
set_physical_material(self: sapien.pysapien.physx.PhysxCollisionShape, material: sapien.pysapien.physx.PhysxMaterial) None#
set_rest_offset(*args, **kwargs)#

Overloaded function.

  1. set_rest_offset(self: sapien.pysapien.physx.PhysxCollisionShape, offset: float) -> None

  2. set_rest_offset(self: sapien.pysapien.physx.PhysxCollisionShape, offset: float) -> None

class sapien.pysapien.physx.PhysxCollisionShapeBox#

Bases: PhysxCollisionShape

get_half_size(self: sapien.pysapien.physx.PhysxCollisionShapeBox) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
property half_size#
class sapien.pysapien.physx.PhysxCollisionShapeCapsule#

Bases: PhysxCollisionShape

get_half_length(self: sapien.pysapien.physx.PhysxCollisionShapeCapsule) float#
get_radius(self: sapien.pysapien.physx.PhysxCollisionShapeCapsule) float#
property half_length#
property radius#
class sapien.pysapien.physx.PhysxCollisionShapeConvexMesh#

Bases: PhysxCollisionShape

get_scale(self: sapien.pysapien.physx.PhysxCollisionShapeConvexMesh) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_triangles(self: sapien.pysapien.physx.PhysxCollisionShapeConvexMesh) numpy.ndarray[numpy.uint32[m, 3]]#
get_vertices(self: sapien.pysapien.physx.PhysxCollisionShapeConvexMesh) numpy.ndarray[numpy.float32[m, 3]]#
static load_multiple(filename: str, scale: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], material: sapien.pysapien.physx.PhysxMaterial) list[sapien.pysapien.physx.PhysxCollisionShapeConvexMesh]#
property scale#
property triangles#
property vertices#
class sapien.pysapien.physx.PhysxCollisionShapeCylinder#

Bases: PhysxCollisionShape

get_half_length(self: sapien.pysapien.physx.PhysxCollisionShapeCylinder) float#
get_radius(self: sapien.pysapien.physx.PhysxCollisionShapeCylinder) float#
property half_length#
property radius#
class sapien.pysapien.physx.PhysxCollisionShapePlane#

Bases: PhysxCollisionShape

class sapien.pysapien.physx.PhysxCollisionShapeSphere#

Bases: PhysxCollisionShape

get_radius(self: sapien.pysapien.physx.PhysxCollisionShapeSphere) float#
property radius#
class sapien.pysapien.physx.PhysxCollisionShapeTriangleMesh#

Bases: PhysxCollisionShape

get_scale(self: sapien.pysapien.physx.PhysxCollisionShapeTriangleMesh) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_triangles(self: sapien.pysapien.physx.PhysxCollisionShapeTriangleMesh) numpy.ndarray[numpy.uint32[m, 3]]#
get_vertices(self: sapien.pysapien.physx.PhysxCollisionShapeTriangleMesh) numpy.ndarray[numpy.float32[m, 3]]#
property scale#
property triangles#
property vertices#
class sapien.pysapien.physx.PhysxContact#

Bases: pybind11_object

property bodies#
property points#
property shapes#
class sapien.pysapien.physx.PhysxContactPoint#

Bases: pybind11_object

property impulse#
property normal#
property position#
property separation#
class sapien.pysapien.physx.PhysxCpuSystem#

Bases: PhysxSystem

get_contacts(self: sapien.pysapien.physx.PhysxCpuSystem) list[sapien.pysapien.physx.PhysxContact]#
pack(self: sapien.pysapien.physx.PhysxCpuSystem) bytes#
raycast(self: sapien.pysapien.physx.PhysxCpuSystem, position: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], direction: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], distance: float) sapien.pysapien.physx.PhysxRayHit#

Casts a ray and returns the closest hit. Returns None if no hit

unpack(self: sapien.pysapien.physx.PhysxCpuSystem, data: bytes) None#
class sapien.pysapien.physx.PhysxDistanceJointComponent#

Bases: PhysxJointComponent

property distance#
get_distance(self: sapien.pysapien.physx.PhysxDistanceJointComponent) float#
set_limit(self: sapien.pysapien.physx.PhysxDistanceJointComponent, low: float, high: float, stiffness: float = 0.0, damping: float = 0.0) None#
class sapien.pysapien.physx.PhysxDriveComponent#

Bases: PhysxJointComponent

property drive_target#
get_drive_property_slerp(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, Literal['force', 'acceleration']]#
get_drive_property_swing(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, Literal['force', 'acceleration']]#
get_drive_property_twist(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, Literal['force', 'acceleration']]#
get_drive_property_x(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, Literal['force', 'acceleration']]#
get_drive_property_y(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, Literal['force', 'acceleration']]#
get_drive_property_z(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, Literal['force', 'acceleration']]#
get_drive_target(self: sapien.pysapien.physx.PhysxDriveComponent) sapien.pysapien.Pose#
get_drive_velocity_target(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]]#
get_limit_cone(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, float]#
get_limit_pyramid(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, float, float, float]#
get_limit_twist(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, float]#
get_limit_x(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, float]#
get_limit_y(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, float]#
get_limit_z(self: sapien.pysapien.physx.PhysxDriveComponent) tuple[float, float, float, float]#
set_drive_property_slerp(self: sapien.pysapien.physx.PhysxDriveComponent, stiffness: float, damping: float, force_limit: float = 3.4028234663852886e+38, mode: Literal['force', 'acceleration'] = 'force') None#
set_drive_property_swing(self: sapien.pysapien.physx.PhysxDriveComponent, stiffness: float, damping: float, force_limit: float = 3.4028234663852886e+38, mode: Literal['force', 'acceleration'] = 'force') None#
set_drive_property_twist(self: sapien.pysapien.physx.PhysxDriveComponent, stiffness: float, damping: float, force_limit: float = 3.4028234663852886e+38, mode: Literal['force', 'acceleration'] = 'force') None#
set_drive_property_x(self: sapien.pysapien.physx.PhysxDriveComponent, stiffness: float, damping: float, force_limit: float = 3.4028234663852886e+38, mode: Literal['force', 'acceleration'] = 'force') None#
set_drive_property_y(self: sapien.pysapien.physx.PhysxDriveComponent, stiffness: float, damping: float, force_limit: float = 3.4028234663852886e+38, mode: Literal['force', 'acceleration'] = 'force') None#
set_drive_property_z(self: sapien.pysapien.physx.PhysxDriveComponent, stiffness: float, damping: float, force_limit: float = 3.4028234663852886e+38, mode: Literal['force', 'acceleration'] = 'force') None#
set_drive_target(self: sapien.pysapien.physx.PhysxDriveComponent, target: sapien.pysapien.Pose) None#
set_drive_velocity_target(self: sapien.pysapien.physx.PhysxDriveComponent, linear: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], angular: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]) None#
set_limit_cone(self: sapien.pysapien.physx.PhysxDriveComponent, angle_y: float, angle_z: float, stiffness: float = 0.0, damping: float = 0.0) None#
set_limit_pyramid(self: sapien.pysapien.physx.PhysxDriveComponent, low_y: float, high_y: float, low_z: float, high_z: float, stiffness: float = 0.0, damping: float = 0.0) None#
set_limit_twist(self: sapien.pysapien.physx.PhysxDriveComponent, low: float, high: float, stiffness: float = 0.0, damping: float = 0.0) None#
set_limit_x(self: sapien.pysapien.physx.PhysxDriveComponent, low: float, high: float, stiffness: float = 0.0, damping: float = 0.0) None#
set_limit_y(self: sapien.pysapien.physx.PhysxDriveComponent, low: float, high: float, stiffness: float = 0.0, damping: float = 0.0) None#
set_limit_z(self: sapien.pysapien.physx.PhysxDriveComponent, low: float, high: float, stiffness: float = 0.0, damping: float = 0.0) None#
class sapien.pysapien.physx.PhysxEngine#

Bases: pybind11_object

class sapien.pysapien.physx.PhysxGearComponent#

Bases: PhysxJointComponent

enable_hinges(self: sapien.pysapien.physx.PhysxGearComponent) None#
property gear_ratio#
get_gear_ratio(self: sapien.pysapien.physx.PhysxGearComponent) float#
property is_hinges_enabled#
set_gear_ratio(self: sapien.pysapien.physx.PhysxGearComponent, ratio: float) None#
class sapien.pysapien.physx.PhysxGpuContactBodyImpulseQuery#

Bases: pybind11_object

property cuda_impulses#
class sapien.pysapien.physx.PhysxGpuContactPairImpulseQuery#

Bases: pybind11_object

property cuda_impulses#
class sapien.pysapien.physx.PhysxGpuSystem#

Bases: PhysxSystem

property cuda_articulation_qacc#
property cuda_articulation_qf#
property cuda_articulation_qpos#
property cuda_articulation_qvel#
property cuda_articulation_target_qpos#
property cuda_articulation_target_qvel#
property cuda_rigid_body_data#
property cuda_rigid_dynamic_data#
property device#
get_scene_offset(self: sapien.pysapien.physx.PhysxGpuSystem, scene: sapien.pysapien.Scene) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
gpu_apply_articulation_qf(*args, **kwargs)#

Overloaded function.

  1. gpu_apply_articulation_qf(self: sapien.pysapien.physx.PhysxGpuSystem) -> None

  2. gpu_apply_articulation_qf(self: sapien.pysapien.physx.PhysxGpuSystem, index_buffer: sapien.pysapien.CudaArray) -> None

gpu_apply_articulation_qpos(*args, **kwargs)#

Overloaded function.

  1. gpu_apply_articulation_qpos(self: sapien.pysapien.physx.PhysxGpuSystem) -> None

  2. gpu_apply_articulation_qpos(self: sapien.pysapien.physx.PhysxGpuSystem, index_buffer: sapien.pysapien.CudaArray) -> None

gpu_apply_articulation_qvel(*args, **kwargs)#

Overloaded function.

  1. gpu_apply_articulation_qvel(self: sapien.pysapien.physx.PhysxGpuSystem) -> None

  2. gpu_apply_articulation_qvel(self: sapien.pysapien.physx.PhysxGpuSystem, index_buffer: sapien.pysapien.CudaArray) -> None

gpu_apply_articulation_root_pose(*args, **kwargs)#

Overloaded function.

  1. gpu_apply_articulation_root_pose(self: sapien.pysapien.physx.PhysxGpuSystem) -> None

  2. gpu_apply_articulation_root_pose(self: sapien.pysapien.physx.PhysxGpuSystem, index_buffer: sapien.pysapien.CudaArray) -> None

gpu_apply_articulation_root_velocity(*args, **kwargs)#

Overloaded function.

  1. gpu_apply_articulation_root_velocity(self: sapien.pysapien.physx.PhysxGpuSystem) -> None

  2. gpu_apply_articulation_root_velocity(self: sapien.pysapien.physx.PhysxGpuSystem, index_buffer: sapien.pysapien.CudaArray) -> None

gpu_apply_articulation_target_position(*args, **kwargs)#

Overloaded function.

  1. gpu_apply_articulation_target_position(self: sapien.pysapien.physx.PhysxGpuSystem) -> None

  2. gpu_apply_articulation_target_position(self: sapien.pysapien.physx.PhysxGpuSystem, index_buffer: sapien.pysapien.CudaArray) -> None

gpu_apply_articulation_target_velocity(*args, **kwargs)#

Overloaded function.

  1. gpu_apply_articulation_target_velocity(self: sapien.pysapien.physx.PhysxGpuSystem) -> None

  2. gpu_apply_articulation_target_velocity(self: sapien.pysapien.physx.PhysxGpuSystem, index_buffer: sapien.pysapien.CudaArray) -> None

gpu_apply_rigid_dynamic_data(*args, **kwargs)#

Overloaded function.

  1. gpu_apply_rigid_dynamic_data(self: sapien.pysapien.physx.PhysxGpuSystem) -> None

  2. gpu_apply_rigid_dynamic_data(self: sapien.pysapien.physx.PhysxGpuSystem, index_buffer: sapien.pysapien.CudaArray) -> None

gpu_create_contact_body_impulse_query(self: sapien.pysapien.physx.PhysxGpuSystem, bodies: list[sapien.pysapien.physx.PhysxRigidBaseComponent]) sapien.pysapien.physx.PhysxGpuContactBodyImpulseQuery#
gpu_create_contact_pair_impulse_query(self: sapien.pysapien.physx.PhysxGpuSystem, body_pairs: list[tuple[sapien.pysapien.physx.PhysxRigidBaseComponent, sapien.pysapien.physx.PhysxRigidBaseComponent]]) sapien.pysapien.physx.PhysxGpuContactPairImpulseQuery#
gpu_fetch_articulation_qacc(self: sapien.pysapien.physx.PhysxGpuSystem) None#
gpu_fetch_articulation_qpos(self: sapien.pysapien.physx.PhysxGpuSystem) None#
gpu_fetch_articulation_qvel(self: sapien.pysapien.physx.PhysxGpuSystem) None#
gpu_fetch_articulation_target_qpos(self: sapien.pysapien.physx.PhysxGpuSystem) None#
gpu_fetch_articulation_target_qvel(self: sapien.pysapien.physx.PhysxGpuSystem) None#
gpu_fetch_rigid_dynamic_data(self: sapien.pysapien.physx.PhysxGpuSystem) None#
gpu_init(self: sapien.pysapien.physx.PhysxGpuSystem) None#

“Warm start” the GPU simulation by stepping the system once. This function must be called each time when actors are added or removed from the scene. One may call gpu_apply_* functions to initialize the system after calling this function.

gpu_query_contact_body_impulses(self: sapien.pysapien.physx.PhysxGpuSystem, query: sapien.pysapien.physx.PhysxGpuContactBodyImpulseQuery) None#

Query net contact forces for specific bodies of the last simulation step. Usage:

query = system.gpu_create_contact_body_force_query(bodies) # create force query in advance

# after simulation step system.gpu_query_contact_body_forces(query) # query.cuda_buffer is now filled with net contact forces for each body

gpu_query_contact_pair_impulses(self: sapien.pysapien.physx.PhysxGpuSystem, query: sapien.pysapien.physx.PhysxGpuContactPairImpulseQuery) None#
gpu_set_cuda_stream(self: sapien.pysapien.physx.PhysxGpuSystem, stream: int) None#

PhysX GPU APIs will be synchronized with the provided stream and SAPIEN’s CUDA kernels will be launched to the provided stream.

Args:

stream: integer representation of a cuda stream pointer

gpu_update_articulation_kinematics(self: sapien.pysapien.physx.PhysxGpuSystem) None#
set_scene_offset(self: sapien.pysapien.physx.PhysxGpuSystem, scene: sapien.pysapien.Scene, offset: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]) None#

In GPU mode, all SAPIEN scenes share the same PhysX scene. One should call this function to apply an offset to avoid bodies in different scenes interfere with each other. This function must be called before any PhysX body is added to scene.

Example: After calling set_scene_offset([2, 1, 0]), an SAPIEN object with position [1, 1, 1] will be at position [1, 1, 1] + [2, 1, 0] = [3, 2, 1] in PhysX scene.

step_finish(self: sapien.pysapien.physx.PhysxGpuSystem) None#
step_start(self: sapien.pysapien.physx.PhysxGpuSystem) None#
sync_poses_gpu_to_cpu(self: sapien.pysapien.physx.PhysxGpuSystem) None#

Warning: this function is super slow and for debug only. Download all poses from the GPU and copy to SAPIEN entities.

class sapien.pysapien.physx.PhysxJointComponent#

Bases: PhysxBaseComponent

get_parent(self: sapien.pysapien.physx.PhysxJointComponent) sapien.pysapien.physx.PhysxRigidBaseComponent#
get_pose_in_child(self: sapien.pysapien.physx.PhysxJointComponent) sapien.pysapien.Pose#
get_pose_in_parent(self: sapien.pysapien.physx.PhysxJointComponent) sapien.pysapien.Pose#
get_relative_pose(self: sapien.pysapien.physx.PhysxJointComponent) sapien.pysapien.Pose#
property parent#
property pose_in_child#
property pose_in_parent#
property relative_pose#
set_inv_inertia_scales(self: sapien.pysapien.physx.PhysxJointComponent, scale0: float, scale1: float) None#
set_inv_mass_scales(self: sapien.pysapien.physx.PhysxJointComponent, scale0: float, scale1: float) None#
set_parent(self: sapien.pysapien.physx.PhysxJointComponent, parent: sapien.pysapien.physx.PhysxRigidBaseComponent) None#
set_pose_in_child(self: sapien.pysapien.physx.PhysxJointComponent, pose: sapien.pysapien.Pose) None#
set_pose_in_parent(self: sapien.pysapien.physx.PhysxJointComponent, pose: sapien.pysapien.Pose) None#
class sapien.pysapien.physx.PhysxMaterial#

Bases: pybind11_object

property dynamic_friction#
get_dynamic_friction(self: sapien.pysapien.physx.PhysxMaterial) float#
get_restitution(self: sapien.pysapien.physx.PhysxMaterial) float#
get_static_friction(self: sapien.pysapien.physx.PhysxMaterial) float#
property restitution#
set_dynamic_friction(self: sapien.pysapien.physx.PhysxMaterial, friction: float) None#
set_restitution(self: sapien.pysapien.physx.PhysxMaterial, restitution: float) None#
set_static_friction(self: sapien.pysapien.physx.PhysxMaterial, friction: float) None#
property static_friction#
class sapien.pysapien.physx.PhysxRayHit#

Bases: pybind11_object

property component#
property distance#
property normal#
property position#
property shape#
class sapien.pysapien.physx.PhysxRigidBaseComponent#

Bases: PhysxBaseComponent

attach(self: sapien.pysapien.physx.PhysxRigidBaseComponent, collision_shape: sapien.pysapien.physx.PhysxCollisionShape) sapien.pysapien.physx.PhysxRigidBaseComponent#
property collision_shapes#
compute_global_aabb_tight(self: sapien.pysapien.physx.PhysxRigidBaseComponent) numpy.ndarray[tuple[Literal[2], Literal[3]], numpy.dtype[numpy.float32]]#
get_collision_shapes(self: sapien.pysapien.physx.PhysxRigidBaseComponent) list[sapien.pysapien.physx.PhysxCollisionShape]#
get_global_aabb_fast(self: sapien.pysapien.physx.PhysxRigidBaseComponent) numpy.ndarray[tuple[Literal[2], Literal[3]], numpy.dtype[numpy.float32]]#
class sapien.pysapien.physx.PhysxRigidBodyComponent#

Bases: PhysxRigidBaseComponent

add_force_at_point(self: sapien.pysapien.physx.PhysxRigidBodyComponent, force: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], point: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], mode: Literal['force', 'acceleration', 'velocity_change', 'impulse'] = 'force') None#
add_force_torque(self: sapien.pysapien.physx.PhysxRigidBodyComponent, force: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], torque: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]], mode: Literal['force', 'acceleration', 'velocity_change', 'impulse'] = 'force') None#
property angular_damping#
property angular_velocity#
property auto_compute_mass#
property cmass_local_pose#
property disable_gravity#
get_angular_damping(self: sapien.pysapien.physx.PhysxRigidBodyComponent) float#
get_angular_velocity(self: sapien.pysapien.physx.PhysxRigidBodyComponent) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_auto_compute_mass(self: sapien.pysapien.physx.PhysxRigidBodyComponent) bool#
get_cmass_local_pose(self: sapien.pysapien.physx.PhysxRigidBodyComponent) sapien.pysapien.Pose#
get_disable_gravity(self: sapien.pysapien.physx.PhysxRigidBodyComponent) bool#
get_inertia(self: sapien.pysapien.physx.PhysxRigidBodyComponent) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_linear_damping(self: sapien.pysapien.physx.PhysxRigidBodyComponent) float#
get_linear_velocity(self: sapien.pysapien.physx.PhysxRigidBodyComponent) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_mass(self: sapien.pysapien.physx.PhysxRigidBodyComponent) float#
get_max_contact_impulse(self: sapien.pysapien.physx.PhysxRigidBodyComponent) float#
get_max_depenetration_velocity(self: sapien.pysapien.physx.PhysxRigidBodyComponent) float#
property inertia#
property linear_damping#
property linear_velocity#
property mass#
property max_contact_impulse#
property max_depenetration_velocity#
set_angular_damping(self: sapien.pysapien.physx.PhysxRigidBodyComponent, damping: float) None#
set_cmass_local_pose(self: sapien.pysapien.physx.PhysxRigidBodyComponent, pose: sapien.pysapien.Pose) None#
set_disable_gravity(self: sapien.pysapien.physx.PhysxRigidBodyComponent, disable: bool) None#
set_inertia(self: sapien.pysapien.physx.PhysxRigidBodyComponent, inertia: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]) None#
set_linear_damping(self: sapien.pysapien.physx.PhysxRigidBodyComponent, damping: float) None#
set_mass(self: sapien.pysapien.physx.PhysxRigidBodyComponent, mass: float) None#
set_max_contact_impulse(self: sapien.pysapien.physx.PhysxRigidBodyComponent, impulse: float) None#
set_max_depenetration_velocity(self: sapien.pysapien.physx.PhysxRigidBodyComponent, velocity: float) None#
class sapien.pysapien.physx.PhysxRigidDynamicComponent#

Bases: PhysxRigidBodyComponent

property angular_velocity#
get_angular_velocity(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_gpu_index(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) int#
get_gpu_pose_index(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) int#
get_kinematic(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) bool#
get_kinematic_target(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) sapien.pysapien.Pose#
get_linear_velocity(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]#
get_locked_motion_axes(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) Annotated[list[bool], FixedSize(6)]#
get_sleep_threshold(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) float#
get_solver_position_iterations(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) int#
get_solver_velocity_iterations(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) int#
property gpu_index#
property gpu_pose_index#
property is_sleeping#
property kinematic#
property kinematic_target#
property linear_velocity#
property locked_motion_axes#
put_to_sleep(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) None#
set_angular_velocity(self: sapien.pysapien.physx.PhysxRigidDynamicComponent, velocity: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]) None#
set_kinematic(self: sapien.pysapien.physx.PhysxRigidDynamicComponent, kinematic: bool) None#
set_kinematic_target(self: sapien.pysapien.physx.PhysxRigidDynamicComponent, target: sapien.pysapien.Pose) None#
set_linear_velocity(self: sapien.pysapien.physx.PhysxRigidDynamicComponent, velocity: numpy.ndarray[Literal[3], numpy.dtype[numpy.float32]]) None#
set_locked_motion_axes(self: sapien.pysapien.physx.PhysxRigidDynamicComponent, axes: Annotated[list[bool], FixedSize(6)]) None#

set some motion axes of the dynamic rigid body to be locked Args:

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.

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

set_sleep_threshold(self: sapien.pysapien.physx.PhysxRigidDynamicComponent, threshold: float) None#
set_solver_position_iterations(self: sapien.pysapien.physx.PhysxRigidDynamicComponent, count: int) None#
set_solver_velocity_iterations(self: sapien.pysapien.physx.PhysxRigidDynamicComponent, count: int) None#
property sleep_threshold#
property solver_position_iterations#
property solver_velocity_iterations#
wake_up(self: sapien.pysapien.physx.PhysxRigidDynamicComponent) None#
class sapien.pysapien.physx.PhysxRigidStaticComponent#

Bases: PhysxRigidBaseComponent

class sapien.pysapien.physx.PhysxSceneConfig#

Bases: pybind11_object

property bounce_threshold#
property enable_ccd#
property enable_enhanced_determinism#
property enable_friction_every_iteration#
property enable_pcm#
property enable_tgs#
property gravity#
class sapien.pysapien.physx.PhysxShapeConfig#

Bases: pybind11_object

property contact_offset#
property rest_offset#
class sapien.pysapien.physx.PhysxSystem#

Bases: System

property config#
get_config(self: sapien.pysapien.physx.PhysxSystem) sapien.pysapien.physx.PhysxSceneConfig#
get_rigid_dynamic_components(self: sapien.pysapien.physx.PhysxSystem) list[sapien.pysapien.physx.PhysxRigidDynamicComponent]#
get_rigid_static_components(self: sapien.pysapien.physx.PhysxSystem) list[sapien.pysapien.physx.PhysxRigidStaticComponent]#
get_scene_collision_id(self: sapien.pysapien.physx.PhysxSystem) int#
get_timestep(self: sapien.pysapien.physx.PhysxSystem) float#
property rigid_dynamic_components#
property rigid_static_components#
property scene_collision_id#
set_scene_collision_id(self: sapien.pysapien.physx.PhysxSystem, id: int) None#
set_timestep(self: sapien.pysapien.physx.PhysxSystem, timestep: float) None#
property timestep#
sapien.pysapien.physx.get_body_config() sapien.pysapien.physx.PhysxBodyConfig#
sapien.pysapien.physx.get_default_material() sapien.pysapien.physx.PhysxMaterial#
sapien.pysapien.physx.get_scene_config() sapien.pysapien.physx.PhysxSceneConfig#
sapien.pysapien.physx.get_shape_config() sapien.pysapien.physx.PhysxShapeConfig#
sapien.pysapien.physx.is_gpu_enabled() bool#
sapien.pysapien.physx.set_body_config(*args, **kwargs)#

Overloaded function.

  1. set_body_config(solver_position_iterations: int = 10, solver_velocity_iterations: int = 1, sleep_threshold: float = 0.004999999888241291) -> None

  2. set_body_config(config: sapien.pysapien.physx.PhysxBodyConfig) -> None

sapien.pysapien.physx.set_default_material(static_friction: float, dynamic_friction: float, restitution: float) None#
sapien.pysapien.physx.set_gpu_memory_config(temp_buffer_capacity: int = 16777216, max_rigid_contact_count: int = 524288, max_rigid_patch_count: int = 81920, heap_capacity: int = 67108864, found_lost_pairs_capacity: int = 262144, found_lost_aggregate_pairs_capacity: int = 1024, total_aggregate_pairs_capacity: int = 1024) None#
sapien.pysapien.physx.set_scene_config(*args, **kwargs)#

Overloaded function.

  1. set_scene_config(gravity: numpy.ndarray[typing.Literal[3], numpy.dtype[numpy.float32]] = array([ 0. , 0. , -9.81], dtype=float32), bounce_threshold: float = 2.0, enable_pcm: bool = True, enable_tgs: bool = True, enable_ccd: bool = False, enable_enhanced_determinism: bool = False, enable_friction_every_iteration: bool = True, cpu_workers: int = 0) -> None

  2. set_scene_config(config: sapien.pysapien.physx.PhysxSceneConfig) -> None

sapien.pysapien.physx.set_shape_config(*args, **kwargs)#

Overloaded function.

  1. set_shape_config(contact_offset: float = 0.009999999776482582, rest_offset: float = 0.0) -> None

  2. set_shape_config(config: sapien.pysapien.physx.PhysxShapeConfig) -> None

sapien.pysapien.physx.version() str#