Skip to main content

['SAPIEN: A SimulAted Parted based Interactive ENvironment']

Project description

SAPIEN

SAPIEN is a realistic and physics-rich simulated environment that hosts a large-scale set for articulated objects. It enables various robotic vision and interaction tasks that require detailed part-level understanding. SAPIEN is a collaborative effort between researchers at UCSD, Stanford and SFU. The dataset is a continuation of ShapeNet and PartNet.

Getting Started

SAPIEN is distributed via PyPI. Installation is just

pip install sapien

It requires Linux with NVIDIA, AMD, or Intel GPU to run. Verify installation with

python -m sapien.exapmle.hello_world

Next, follow our tutorial at: https://sapien-sim.github.io/docs/.

Offscreen rendering on a server

To use SAPIEN on a GPU server without display, the only system dependencies required are libegl1 and libxext6. If using NVIDIA docker environment, enable graphics, utility, and compute by setting the environment variable in the Dockerfile.

ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute

Virtual desktop on a server

To use SAPIEN on a GPU server with virtual display, additionally install xvfb, x11vnc, and any window manager such as fluxbox or xfce. Add display capabilities for NVIDIA docker.

ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute,display

Assuming fluxbox, start a VNC server by

x11vnc -create -env FD_PROG=/usr/bin/fluxbox  -env X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 -env X11VNC_CREATE_GEOM=${99:-1920x1080x16} -gone 'pkill Xvfb' -nopw
# Note: you should use a strong password and/or only allow local access

Now you can connect to the server at port 5900. SAPIEN should be fully functional, test with

python -m sapien.exapmle.hello_world

Change Log

3.0
  • Major API & infrastructure overhaul
    • Refactor SAPIEN core to use entity-component system
      • Actor from SAPIEN 2 now becomes Entity in SAPIEN 3
      • Functionalities of an Actor now becomes components attached to an entity.
      • See updated documentation for usage.
      • Actor builder and articulation builder APIs are mostly unchanged, except the color and material parameters for visual shapes are unified to material.
    • Support for PhysX 5 GPU simulation. See ManiSkill for how it is used to build robot learning environments.
2.2
  • Rename VulkanRenderer to SapienRenderer (VulkanRenderer is still an alias)
  • Support ray tracing in SapienRenderer
  • Deprecate KuafuRenderer, use the rt shader in SapienRenderer instead
  • GPU-accelerated stereo depth sensor simulation
  • Render server
  • Python 3.11
  • bug fixes
    • Fix inverse kinematics default active joint mask (now defaults to all 1s)
    • Fix incorrectly exported memory in Vulkan-Cuda interop
    • Fix joint get_global_pose
2.1
  • Python 3.10
  • Bug fixes
    • crash when not using renderer
    • joint force limit (was impulse limit)
    • incorrect inertia computation in scaled URDF
    • incorrect point-light shadow
    • incorrect collision when loaded from dae
  • Utility improvements
    • set_material
    • active light
    • flat shading
    • dynamic point rendering
    • envmap generation
    • multi-thread envs
2.1
  • Refactor light system
    • Remove light functions on scene.renderer_scene
  • Refactor camera system
    • Cameras no longer require mounts
    • Camera can change its mount and mounted pose by camera.set_parent and camera.set_local_pose.
    • When camera is not mounted, setting local pose is setting its global pose.
    • Add functions scene.add_camera and scene.remove_camera
    • add_mounted_camera can be replaced with add_camera followed by camera.set_parent and camera.set_local_pose. add_mounted_camera is still provided but fovx should not longer be provided.
    • Remove functions related to mount, including find_camera_by_mount.
    • Cameras now support full camera parameters through camera.near, camera.far, camera.set_fovx, camera.set_fovy, camera.set_focal_lengths, camera.set_principal_point, camera.skew, and the all-in-one method camera.set_perspective_parameters.
  • Refactor render shape system
    • Originally, after actor.get_visual_bodies() and visual_body.get_render_shapes(), users typically do shape.scale and shape.pose. These are no longer valid. It is required to check visual_body.type. When type is mesh, shape.scale is replaced with visual_body.scale and shape.pose is replaced by visual_body.local_pose. These changes are made to match add_visual_shape functions when building the actor.
pre2.0
  • Shader change: 4th component in default camera shader now gives the 0-1 depth value.
  • Add "critical" and "off" log levels.
  • Add support for pointcloud and line rendering (for visualizing camera and point cloud)
  • Performance: the same shader only compile once per process
  • Bug fix
    • Articulation setDriveTarget was now correctly reversed for prismatic joint (joint setDriveTarget is not affected)
    • Fix kinematic articulation loader
1 to 2 migration
  • replace scene.renderer_scene.add_xxx_light with scene.add_xxx_light
  • replace scene.remove_mounted_camera with scene.remove_camera
  • optionally, remove fovx from scene.add_mounted_camera.
1.1
  • Support nonconvex static/kinematic collision shape
  • Add warning for small mass/inertia
  • Introduce Entity as the base class of Actors
  • Add Light classes inherited from entity, allowing manipulate light objects in sapien scene
  • Updates to the viewer
    • rename actor to entity when appropriate
  • Partial support the material tag in URDF loader (primitive shape, single color)
  • Bug fixes for the renderer
  • Support inner and outer FOV for spotlight
1.0
  • Replace the old Vulkan based renderer completely
    • See sapien.core.renderer for details
  • Expose GUI functionalities to Python
  • Reimplement Vulkan viewer in Python
  • Expose PhysX shape wrapper to Python. For example,
    • Collision shapes can be retrieved through actor.get_collision_shapes
    • Collision groups on a shape can be set by CollisionShape.set_collision_groups
    • Shapes are now also available in Contact.
  • API changes
    • Render material creation is now renderer.create_material()
    • in actor builder: add_xxx_shape is replaced with add_xxx_collision.
    • move light functions from scene to scene.renderer_scene
  • Add centrifugal and Coriolis force.
  • Change default physical parameters for better stability.

Website and Documentation

SAPIEN Website: https://sapien.ucsd.edu/. SAPIEN Documentation: https://sapien-sim.github.io/docs/.

Build from source

Before build

Make sure all submodules are initialized git submodule update --init --recursive.

Build with Docker

To build SAPIEN, simply run ./scripts/docker_build_wheels.sh. It is not recommended to build outside of our provided docker.

For reference, the Dockerfile is provided here. Note that PhysX needs to be compiled with clang-9 into static libraries before building the Docker image.

Build without Docker

It can be tricky to setup all dependencies outside of a Docker environment. You need to install all dependencies according to the Docker environment. If all dependencies set up correctly, run python setup.py bdist_wheel to build the wheel.

Cite SAPIEN

If you use SAPIEN and its assets, please cite the following works:

@InProceedings{Xiang_2020_SAPIEN,
author = {Xiang, Fanbo and Qin, Yuzhe and Mo, Kaichun and Xia, Yikuan and Zhu, Hao and Liu, Fangchen and Liu, Minghua and Jiang, Hanxiao and Yuan, Yifu and Wang, He and Yi, Li and Chang, Angel X. and Guibas, Leonidas J. and Su, Hao},
title = {{SAPIEN}: A SimulAted Part-based Interactive ENvironment},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}}
@InProceedings{Mo_2019_CVPR,
author = {Mo, Kaichun and Zhu, Shilin and Chang, Angel X. and Yi, Li and Tripathi, Subarna and Guibas, Leonidas J. and Su, Hao},
title = {{PartNet}: A Large-Scale Benchmark for Fine-Grained and Hierarchical Part-Level {3D} Object Understanding},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2019}
}
@article{chang2015shapenet,
title={Shapenet: An information-rich 3d model repository},
author={Chang, Angel X and Funkhouser, Thomas and Guibas, Leonidas and Hanrahan, Pat and Huang, Qixing and Li, Zimo and Savarese, Silvio and Savva, Manolis and Song, Shuran and Su, Hao and others},
journal={arXiv preprint arXiv:1512.03012},
year={2015}
}

If you use SAPIEN Realistic Depth generated by SAPIEN's simulated depth sensor, please cite the following work:

@ARTICLE{10027470,
  author={Zhang, Xiaoshuai and Chen, Rui and Li, Ang and Xiang, Fanbo and Qin, Yuzhe and Gu, Jiayuan and Ling, Zhan and Liu, Minghua and Zeng, Peiyu and Han, Songfang and Huang, Zhiao and Mu, Tongzhou and Xu, Jing and Su, Hao},
  journal={IEEE Transactions on Robotics}, 
  title={Close the Optical Sensing Domain Gap by Physics-Grounded Active Stereo Sensor Simulation}, 
  year={2023},
  volume={},
  number={},
  pages={1-19},
  doi={10.1109/TRO.2023.3235591}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sapien-3.0.3-cp314-cp314-win_amd64.whl (45.4 MB view details)

Uploaded CPython 3.14Windows x86-64

sapien-3.0.3-cp314-cp314-manylinux_2_28_x86_64.whl (51.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

sapien-3.0.3-cp314-cp314-macosx_12_0_universal2.whl (35.7 MB view details)

Uploaded CPython 3.14macOS 12.0+ universal2 (ARM64, x86-64)

sapien-3.0.3-cp313-cp313-win_amd64.whl (44.6 MB view details)

Uploaded CPython 3.13Windows x86-64

sapien-3.0.3-cp313-cp313-manylinux_2_28_x86_64.whl (51.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

sapien-3.0.3-cp313-cp313-macosx_12_0_universal2.whl (35.7 MB view details)

Uploaded CPython 3.13macOS 12.0+ universal2 (ARM64, x86-64)

sapien-3.0.3-cp312-cp312-win_amd64.whl (44.6 MB view details)

Uploaded CPython 3.12Windows x86-64

sapien-3.0.3-cp312-cp312-manylinux_2_28_x86_64.whl (51.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

sapien-3.0.3-cp312-cp312-macosx_12_0_universal2.whl (35.7 MB view details)

Uploaded CPython 3.12macOS 12.0+ universal2 (ARM64, x86-64)

sapien-3.0.3-cp311-cp311-win_amd64.whl (44.6 MB view details)

Uploaded CPython 3.11Windows x86-64

sapien-3.0.3-cp311-cp311-manylinux_2_28_x86_64.whl (51.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

sapien-3.0.3-cp311-cp311-macosx_12_0_universal2.whl (35.6 MB view details)

Uploaded CPython 3.11macOS 12.0+ universal2 (ARM64, x86-64)

sapien-3.0.3-cp310-cp310-win_amd64.whl (44.6 MB view details)

Uploaded CPython 3.10Windows x86-64

sapien-3.0.3-cp310-cp310-manylinux_2_28_x86_64.whl (51.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

sapien-3.0.3-cp310-cp310-macosx_12_0_universal2.whl (35.6 MB view details)

Uploaded CPython 3.10macOS 12.0+ universal2 (ARM64, x86-64)

File details

Details for the file sapien-3.0.3-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: sapien-3.0.3-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 45.4 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sapien-3.0.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c9c74cee9d45ad0b622eae0b2ebc73651659f50a892d58dc5bbf7e9b28282596
MD5 7b02c56bfba5c6163ab3f9d3c447c17d
BLAKE2b-256 8ab154d0201151b7ea997e3ad54bdb07fc4f345c982260ed25ce17cb8cb0c6a4

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7a82849cab35e0e643ecc33f06d0c7c699dea389e5f8804aeb11458ac2695369
MD5 9d4d05c0249319aa851461d407695cd8
BLAKE2b-256 04d38464dd4de7a3c1725c98fc79e465e99212820c32fa84f51734b38203587e

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp314-cp314-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp314-cp314-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 512d504da6f2803eda8256a43905c21e57ea9a59c7597e0676755f2fc8b2b813
MD5 3eb575ea12ca8a3d6b730466223d87f4
BLAKE2b-256 2a3a715cf600b324eba0e19e64a7d0f1ec326fefb6d1600bd840ff37879d3abd

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: sapien-3.0.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 44.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sapien-3.0.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bff70bf2ffe1fca0f8324f9fb20ac6aab94742d9a3b4339a6d83639f4b5785fc
MD5 1fec2cd50c545e8c7ae5e6ba41087fc5
BLAKE2b-256 6e02e297d9da0ab636612ed49235b5c83eefbb8c3eb9cb3fc44fc771a3f8009a

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a8a15c53eeeb01e02674b0c414e5b148ba84ca8b60d9ac2d65ea73f6c4967054
MD5 b3d122fb1157ec76ae4d55d02fbce0f4
BLAKE2b-256 ff079dafe2c7f690e90ef49ddd94aa00fe4f5543816bcc9a3e6bc8384e672a0d

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp313-cp313-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp313-cp313-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 c92f20560209715f5c051a94e797d4d36f34d356c35dda5de908e725e7dff546
MD5 527c68dae79c47a19ff0d7cfc157a03f
BLAKE2b-256 aab281e5bca0a17ff597ae0cfa5dabebaf78fe7c207aa80df33dcda2c8f5e7de

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: sapien-3.0.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 44.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sapien-3.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b9af3676cd76788d468ed7114e6496f16280393f25bb1b87665f14798a98f7e6
MD5 6c36d6c9a275d701ffcf616727da9463
BLAKE2b-256 f45968ca835587aa0e63235d48dcd6ef71dc4dd9ac98e0cd70394998c1cff297

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 98200797b2ac41bda48ca21cf89c9ebeb6a20e84f584013378ba45c844425ca5
MD5 39917cbe62c7ee6ca225efd7f12cc058
BLAKE2b-256 75379b1c6fd9696225600d42b9f9b6727450283e4d4bbd1e665195b563d8f64b

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp312-cp312-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp312-cp312-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 331a749cc1aa2d869e9257d43a2f35899006cc5df0833a8b84b676b6f5afa396
MD5 7afe1e61be92fce16f6b4cf2c4dee0a1
BLAKE2b-256 6dd2f931aa6745663cee4b93ae71d83db08eb24550301e0ffa0c064682e5ae91

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: sapien-3.0.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 44.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sapien-3.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5b93861445c92ebffd27848bed9e560a56f5cd6679f9908e002bc4deb64ebf82
MD5 2ef307e44f44313300b1947d5613325d
BLAKE2b-256 8036a19e2f5ddebfb8ca61b2ddab4c60c154853500a5b841c4cdadab5a0cf28d

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a5eb4dc2efdf9b451cdd77a955d45578a5d81474d4e98089bbc36eeb4a07e45
MD5 686149196611d56a4b2f28fb79899653
BLAKE2b-256 8edd78e25ff9733bbe0dcdc5ea6c06e2dbeb73e696f0f43e946711110fa279fc

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp311-cp311-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp311-cp311-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 1ac4f940238d79f239bd0d34d406d8b1bd9954e13c8464f93fe517ef5b20f9e1
MD5 bc87c3f458c8734c94da9f1d032c48af
BLAKE2b-256 ea5fbdabddd1bcb8d09fdbd5359115dff8bba7fc104a5ffccadba296231cc0bd

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: sapien-3.0.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 44.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sapien-3.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c2ff1a73461a63d463ca26837e916e66bf6c6beca9bed7f7eb7ffbbae5f11af7
MD5 972ae869654308e40f31a0703e2fa7f9
BLAKE2b-256 c6793b79ed7d8024805dc617c242f7f603b7e6f5b21d00782fb271395a19e826

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 72cb4ec50498bfee3d2f8f238043ba8cdd49ce89663b0826469a46b3796513c1
MD5 63e663ce97f5f9276e8dff45c27320dd
BLAKE2b-256 f78e90d3b9fb5af8386eeca7000f3a69eee8a97417f09154cc73f2c3086b6d3c

See more details on using hashes here.

File details

Details for the file sapien-3.0.3-cp310-cp310-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for sapien-3.0.3-cp310-cp310-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 24080c743249e2b13eed806db2075ae767462776ed88ed934c7fe88ddc86890e
MD5 b7522d7ce6ba97d85e384d81bfb5c4e2
BLAKE2b-256 4d05c0428b5585249dcb01bf85555470b81b2de385af7404a678e271a6dd9f92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page