openphysgraspgen 1.0.0rc1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. openphysgraspgen-1.0.0rc1/LICENSE +201 -0
  2. openphysgraspgen-1.0.0rc1/NOTICE +9 -0
  3. openphysgraspgen-1.0.0rc1/PKG-INFO +199 -0
  4. openphysgraspgen-1.0.0rc1/README.md +171 -0
  5. openphysgraspgen-1.0.0rc1/pyproject.toml +45 -0
  6. openphysgraspgen-1.0.0rc1/setup.cfg +4 -0
  7. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/__init__.py +64 -0
  8. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/__main__.py +5 -0
  9. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/benchmark/__init__.py +25 -0
  10. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/benchmark/cli.py +85 -0
  11. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/benchmark/pg_t1.py +1448 -0
  12. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/benchmark/pg_t1_report.py +571 -0
  13. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/confidence.py +42 -0
  14. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/constitutive.py +255 -0
  15. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/dataset/__init__.py +45 -0
  16. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/dataset/check_criteria.yaml +53 -0
  17. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/dataset/check_dataset.py +4784 -0
  18. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/dataset/finalize.py +394 -0
  19. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/dataset/reader.py +113 -0
  20. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/dataset/video.py +300 -0
  21. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/dataset/writer.py +925 -0
  22. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/estimation.py +58 -0
  23. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/formulations.py +89 -0
  24. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/generation.py +115 -0
  25. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/pipeline.py +130 -0
  26. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/records.py +132 -0
  27. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/sensors/__init__.py +13 -0
  28. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/sensors/deformable_contact_sensor.py +21 -0
  29. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/sensors/force_label.py +126 -0
  30. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/sensors/frame.py +21 -0
  31. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/sensors/layers/__init__.py +6 -0
  32. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/sensors/layers/base.py +14 -0
  33. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/sensors/layers/force.py +20 -0
  34. openphysgraspgen-1.0.0rc1/src/openphysgraspgen/sensors/recorder.py +20 -0
  35. openphysgraspgen-1.0.0rc1/src/openphysgraspgen.egg-info/PKG-INFO +199 -0
  36. openphysgraspgen-1.0.0rc1/src/openphysgraspgen.egg-info/SOURCES.txt +45 -0
  37. openphysgraspgen-1.0.0rc1/src/openphysgraspgen.egg-info/dependency_links.txt +1 -0
  38. openphysgraspgen-1.0.0rc1/src/openphysgraspgen.egg-info/entry_points.txt +2 -0
  39. openphysgraspgen-1.0.0rc1/src/openphysgraspgen.egg-info/requires.txt +11 -0
  40. openphysgraspgen-1.0.0rc1/src/openphysgraspgen.egg-info/top_level.txt +1 -0
  41. openphysgraspgen-1.0.0rc1/tests/test_check_dataset.py +3594 -0
  42. openphysgraspgen-1.0.0rc1/tests/test_collect_metrics.py +202 -0
  43. openphysgraspgen-1.0.0rc1/tests/test_constitutive.py +67 -0
  44. openphysgraspgen-1.0.0rc1/tests/test_dataset.py +2280 -0
  45. openphysgraspgen-1.0.0rc1/tests/test_pg_t1.py +2436 -0
  46. openphysgraspgen-1.0.0rc1/tests/test_pipeline.py +47 -0
  47. openphysgraspgen-1.0.0rc1/tests/test_sensors.py +73 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,9 @@
1
+ OpenPhysGraspGen
2
+ Copyright 2026 SpaceAI (주식회사 스페이스에이아이)
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ This product does not bundle third-party source code. At install time it
7
+ depends on NumPy (https://numpy.org), distributed under BSD-3-Clause AND 0BSD
8
+ AND MIT AND Zlib AND CC0-1.0. The full list of components and licenses for each
9
+ release is published as an SPDX and CycloneDX SBOM in the release assets.
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: openphysgraspgen
3
+ Version: 1.0.0rc1
4
+ Summary: Physics-labelled grasp data generation for deformable objects
5
+ Author: SpaceAI
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/Official-Space-AI/OpenPhysGraspGen
8
+ Project-URL: Issues, https://github.com/Official-Space-AI/OpenPhysGraspGen/issues
9
+ Keywords: robotics,grasping,deformable,simulation,hyperelasticity,dataset
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Topic :: Scientific/Engineering :: Physics
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ License-File: NOTICE
18
+ Requires-Dist: numpy>=1.24
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest>=9.0.3; extra == "dev"
21
+ Requires-Dist: pytest-cov>=5; extra == "dev"
22
+ Requires-Dist: ruff==0.17.2; extra == "dev"
23
+ Provides-Extra: dataset
24
+ Requires-Dist: numpy>=1.26; extra == "dataset"
25
+ Requires-Dist: pyarrow>=23.0.1; extra == "dataset"
26
+ Requires-Dist: pyyaml>=6; extra == "dataset"
27
+ Dynamic: license-file
28
+
29
+ # OpenPhysGraspGen
30
+
31
+ [![CI](https://github.com/Official-Space-AI/OpenPhysGraspGen/actions/workflows/ci.yml/badge.svg)](https://github.com/Official-Space-AI/OpenPhysGraspGen/actions/workflows/ci.yml)
32
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
33
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue)
34
+ ![Status](https://img.shields.io/badge/status-release%20candidate-yellow)
35
+
36
+ [한국어 README](README.ko.md)
37
+
38
+ OpenPhysGraspGen generates physics-labelled grasp data for **deformable objects**.
39
+ It calibrates a material model from measurements, transfers the calibrated
40
+ parameters to the simulator you generate data with, and records contact force and
41
+ internal stress for every grasp so that a policy can learn how hard it is
42
+ squeezing, not only where it is grasping.
43
+
44
+ It is the open part of SpaceAI's PhysGraspGen project. The library is pure Python
45
+ and NumPy, with sensor layers that read contact buffers from
46
+ [NVIDIA Newton](https://github.com/newton-physics/newton) (VBD solver).
47
+
48
+ > **Status: release candidate (`1.0.0rc1`).** APIs can still change before `1.0.0`.
49
+ > See the [roadmap](#roadmap) for what comes next.
50
+
51
+ ## What is included
52
+
53
+ | Module | What it does |
54
+ |---|---|
55
+ | `constitutive` | Hyperelastic laws (Yeoh, Mooney–Rivlin, three-term Ogden): strain energy, Cauchy stress, von Mises stress |
56
+ | `formulations`, `generation` | Calibrate material parameters against measured response, transfer them from a calibration model to a production model, build training samples with fracture labels |
57
+ | `estimation`, `confidence` | Joint estimator of material and internal stress from robot observations, plus a confidence gate that limits action scale when the estimate is unreliable |
58
+ | `sensors` | `DeformableContactSensor` and `SensorRecorder`: per-contact and net gripper/ground force labels from a Newton simulation frame |
59
+ | `records` | Typed records shared by the stages above |
60
+
61
+ The high-precision solver core, customer data and internal tooling are not part of
62
+ this repository. See [Scope of the open release](#scope-of-the-open-release).
63
+
64
+ ## Install
65
+
66
+ Python 3.10 or newer. The package is `openphysgraspgen` on PyPI:
67
+
68
+ ```bash
69
+ pip install openphysgraspgen
70
+ ```
71
+
72
+ To install the latest `main` instead:
73
+
74
+ ```bash
75
+ pip install "git+https://github.com/Official-Space-AI/OpenPhysGraspGen.git"
76
+ ```
77
+
78
+ For development:
79
+
80
+ ```bash
81
+ git clone https://github.com/Official-Space-AI/OpenPhysGraspGen.git
82
+ cd OpenPhysGraspGen
83
+ pip install -e ".[dev]"
84
+ ruff check . && ruff format --check .
85
+ pytest
86
+ ```
87
+
88
+ The same checks run in CI on every pull request, with tests on Python 3.10 to 3.14.
89
+
90
+ ## Quick start
91
+
92
+ Run the end-to-end reference pipeline (calibration → transfer → data generation →
93
+ estimation → confidence gate) on a small synthetic problem:
94
+
95
+ ```bash
96
+ openphysgraspgen --fracture-threshold 0.25 --confidence-threshold 0.5
97
+ ```
98
+
99
+ It prints a JSON summary with the calibrated and transferred parameters, the number
100
+ of training and fracture samples, the estimate, and whether the confidence gate
101
+ allowed it.
102
+
103
+ Score the PG-T1 benchmark from a dataset in the [public format](docs/dataset/format.md),
104
+ with the `dataset` extra installed (`pip install "openphysgraspgen[dataset]"`):
105
+
106
+ ```bash
107
+ openphysgraspgen benchmark pg-t1 path/to/dataset --json pg-t1.json
108
+ ```
109
+
110
+ It prints one table per task and writes the report to `pg-t1.json`, with one record
111
+ per episode in `pg-t1.episodes.jsonl` beside it. The scoring rules are in
112
+ [docs/benchmark/pg-t1.md](docs/benchmark/pg-t1.md).
113
+
114
+ Check a dataset against the four items of the dataset test (scale, metadata,
115
+ consistency, diversity) with the script it ships, from the dataset's root, the folder
116
+ that holds `metadata.yaml`:
117
+
118
+ ```bash
119
+ python -I tools/check_dataset.py . --seed <the tester's seed>
120
+ ```
121
+
122
+ It needs only Python 3.10 or newer with NumPy, PyArrow and PyYAML, and nothing from
123
+ this package. The options, the acceptance values and the report are under
124
+ [The check](docs/dataset/format.md#the-check).
125
+
126
+ Evaluate a constitutive law directly:
127
+
128
+ ```python
129
+ import numpy as np
130
+ from openphysgraspgen import YeohParams, cauchy_stress, von_mises_stress
131
+
132
+ silicone = YeohParams(c10=0.12e6, c20=0.01e6, c30=0.0, nu=0.45)
133
+ F = np.diag([1.2, 0.92, 0.92]) # uniaxial stretch
134
+ sigma = cauchy_stress(F, silicone) # 3x3 Cauchy stress [Pa]
135
+ print(von_mises_stress(sigma)) # about 1.4e5 Pa
136
+ ```
137
+
138
+ Record contact force labels from a Newton simulation:
139
+
140
+ ```python
141
+ from openphysgraspgen import DeformableContactSensor, SensorRecorder, SimFrame
142
+
143
+ recorder = SensorRecorder([DeformableContactSensor(contact_provenance="newton-vbd")])
144
+ frame = SimFrame(
145
+ model=model,
146
+ particle_q=state.particle_q,
147
+ contacts=contacts,
148
+ body_q=state.body_q,
149
+ n_robot_shapes=n_gripper_shapes,
150
+ )
151
+ labels = recorder.record_frame(frame) # {"force": ForceLabel(...)}
152
+ ```
153
+
154
+ ## Roadmap
155
+
156
+ Releases follow the plan of the funded project.
157
+
158
+ | Release | Target | Contents |
159
+ |---|---|---|
160
+ | Beta `0.1.0b0` | Aug 2026 | Constitutive laws, contact sensor, calibration/transfer pipeline (published 2026-08-25) |
161
+ | `1.0.0rc1` | Oct 2026 | Grasp data recorder, PyPI package, public dataset on Hugging Face (1,000,000 frames) with its check script, PG-T1 benchmark reproduction from the dataset, Docker image, CI and SBOM on every release |
162
+ | `1.0.0` | Nov 2026 | Benchmarks, tutorials, license verification |
163
+
164
+ ## Scope of the open release
165
+
166
+ PhysGraspGen is developed as open core.
167
+
168
+ | Part | Where | License |
169
+ |---|---|---|
170
+ | Library (this repository) | GitHub | Apache-2.0 |
171
+ | Grasp dataset | Hugging Face Hub (with `1.0.0rc1`) | CC-BY-NC-4.0 |
172
+ | Benchmarks and reproduction scripts | This repository (PG-T1 with `1.0.0rc1`, the rest with `1.0.0`) | Apache-2.0 |
173
+ | High-precision solver core | Not published | Commercial |
174
+
175
+ ## How development works
176
+
177
+ Day-to-day development of PhysGraspGen happens in a private repository that also
178
+ holds customer-specific code. This repository receives the general-purpose parts as
179
+ reviewed pull requests and tagged releases, so its commit history is shorter than
180
+ the project's. From now on, work on the open library is planned and reviewed here
181
+ in public: every change starts as an issue and lands through a reviewed pull
182
+ request, and releases ship with release notes and an SBOM.
183
+
184
+ ## Community and support
185
+
186
+ - Questions and ideas: [GitHub Discussions](https://github.com/Official-Space-AI/OpenPhysGraspGen/discussions)
187
+ - Bugs: [GitHub Issues](https://github.com/Official-Space-AI/OpenPhysGraspGen/issues)
188
+ - Where to ask what, and response times: [COMMUNITY.md](COMMUNITY.md)
189
+ - Security vulnerabilities: [SECURITY.md](SECURITY.md) (please do not open a public issue)
190
+
191
+ Contributions are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md) and the
192
+ [`good first issue`](https://github.com/Official-Space-AI/OpenPhysGraspGen/labels/good%20first%20issue)
193
+ label. Everyone taking part follows the [Code of Conduct](CODE_OF_CONDUCT.md). Who
194
+ decides what, and how releases are approved, is in [GOVERNANCE.md](GOVERNANCE.md).
195
+
196
+ ## License
197
+
198
+ Code is released under the [Apache License 2.0](LICENSE). The dataset is released
199
+ under [CC-BY-NC-4.0](https://creativecommons.org/licenses/by-nc/4.0/).
@@ -0,0 +1,171 @@
1
+ # OpenPhysGraspGen
2
+
3
+ [![CI](https://github.com/Official-Space-AI/OpenPhysGraspGen/actions/workflows/ci.yml/badge.svg)](https://github.com/Official-Space-AI/OpenPhysGraspGen/actions/workflows/ci.yml)
4
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
5
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue)
6
+ ![Status](https://img.shields.io/badge/status-release%20candidate-yellow)
7
+
8
+ [한국어 README](README.ko.md)
9
+
10
+ OpenPhysGraspGen generates physics-labelled grasp data for **deformable objects**.
11
+ It calibrates a material model from measurements, transfers the calibrated
12
+ parameters to the simulator you generate data with, and records contact force and
13
+ internal stress for every grasp so that a policy can learn how hard it is
14
+ squeezing, not only where it is grasping.
15
+
16
+ It is the open part of SpaceAI's PhysGraspGen project. The library is pure Python
17
+ and NumPy, with sensor layers that read contact buffers from
18
+ [NVIDIA Newton](https://github.com/newton-physics/newton) (VBD solver).
19
+
20
+ > **Status: release candidate (`1.0.0rc1`).** APIs can still change before `1.0.0`.
21
+ > See the [roadmap](#roadmap) for what comes next.
22
+
23
+ ## What is included
24
+
25
+ | Module | What it does |
26
+ |---|---|
27
+ | `constitutive` | Hyperelastic laws (Yeoh, Mooney–Rivlin, three-term Ogden): strain energy, Cauchy stress, von Mises stress |
28
+ | `formulations`, `generation` | Calibrate material parameters against measured response, transfer them from a calibration model to a production model, build training samples with fracture labels |
29
+ | `estimation`, `confidence` | Joint estimator of material and internal stress from robot observations, plus a confidence gate that limits action scale when the estimate is unreliable |
30
+ | `sensors` | `DeformableContactSensor` and `SensorRecorder`: per-contact and net gripper/ground force labels from a Newton simulation frame |
31
+ | `records` | Typed records shared by the stages above |
32
+
33
+ The high-precision solver core, customer data and internal tooling are not part of
34
+ this repository. See [Scope of the open release](#scope-of-the-open-release).
35
+
36
+ ## Install
37
+
38
+ Python 3.10 or newer. The package is `openphysgraspgen` on PyPI:
39
+
40
+ ```bash
41
+ pip install openphysgraspgen
42
+ ```
43
+
44
+ To install the latest `main` instead:
45
+
46
+ ```bash
47
+ pip install "git+https://github.com/Official-Space-AI/OpenPhysGraspGen.git"
48
+ ```
49
+
50
+ For development:
51
+
52
+ ```bash
53
+ git clone https://github.com/Official-Space-AI/OpenPhysGraspGen.git
54
+ cd OpenPhysGraspGen
55
+ pip install -e ".[dev]"
56
+ ruff check . && ruff format --check .
57
+ pytest
58
+ ```
59
+
60
+ The same checks run in CI on every pull request, with tests on Python 3.10 to 3.14.
61
+
62
+ ## Quick start
63
+
64
+ Run the end-to-end reference pipeline (calibration → transfer → data generation →
65
+ estimation → confidence gate) on a small synthetic problem:
66
+
67
+ ```bash
68
+ openphysgraspgen --fracture-threshold 0.25 --confidence-threshold 0.5
69
+ ```
70
+
71
+ It prints a JSON summary with the calibrated and transferred parameters, the number
72
+ of training and fracture samples, the estimate, and whether the confidence gate
73
+ allowed it.
74
+
75
+ Score the PG-T1 benchmark from a dataset in the [public format](docs/dataset/format.md),
76
+ with the `dataset` extra installed (`pip install "openphysgraspgen[dataset]"`):
77
+
78
+ ```bash
79
+ openphysgraspgen benchmark pg-t1 path/to/dataset --json pg-t1.json
80
+ ```
81
+
82
+ It prints one table per task and writes the report to `pg-t1.json`, with one record
83
+ per episode in `pg-t1.episodes.jsonl` beside it. The scoring rules are in
84
+ [docs/benchmark/pg-t1.md](docs/benchmark/pg-t1.md).
85
+
86
+ Check a dataset against the four items of the dataset test (scale, metadata,
87
+ consistency, diversity) with the script it ships, from the dataset's root, the folder
88
+ that holds `metadata.yaml`:
89
+
90
+ ```bash
91
+ python -I tools/check_dataset.py . --seed <the tester's seed>
92
+ ```
93
+
94
+ It needs only Python 3.10 or newer with NumPy, PyArrow and PyYAML, and nothing from
95
+ this package. The options, the acceptance values and the report are under
96
+ [The check](docs/dataset/format.md#the-check).
97
+
98
+ Evaluate a constitutive law directly:
99
+
100
+ ```python
101
+ import numpy as np
102
+ from openphysgraspgen import YeohParams, cauchy_stress, von_mises_stress
103
+
104
+ silicone = YeohParams(c10=0.12e6, c20=0.01e6, c30=0.0, nu=0.45)
105
+ F = np.diag([1.2, 0.92, 0.92]) # uniaxial stretch
106
+ sigma = cauchy_stress(F, silicone) # 3x3 Cauchy stress [Pa]
107
+ print(von_mises_stress(sigma)) # about 1.4e5 Pa
108
+ ```
109
+
110
+ Record contact force labels from a Newton simulation:
111
+
112
+ ```python
113
+ from openphysgraspgen import DeformableContactSensor, SensorRecorder, SimFrame
114
+
115
+ recorder = SensorRecorder([DeformableContactSensor(contact_provenance="newton-vbd")])
116
+ frame = SimFrame(
117
+ model=model,
118
+ particle_q=state.particle_q,
119
+ contacts=contacts,
120
+ body_q=state.body_q,
121
+ n_robot_shapes=n_gripper_shapes,
122
+ )
123
+ labels = recorder.record_frame(frame) # {"force": ForceLabel(...)}
124
+ ```
125
+
126
+ ## Roadmap
127
+
128
+ Releases follow the plan of the funded project.
129
+
130
+ | Release | Target | Contents |
131
+ |---|---|---|
132
+ | Beta `0.1.0b0` | Aug 2026 | Constitutive laws, contact sensor, calibration/transfer pipeline (published 2026-08-25) |
133
+ | `1.0.0rc1` | Oct 2026 | Grasp data recorder, PyPI package, public dataset on Hugging Face (1,000,000 frames) with its check script, PG-T1 benchmark reproduction from the dataset, Docker image, CI and SBOM on every release |
134
+ | `1.0.0` | Nov 2026 | Benchmarks, tutorials, license verification |
135
+
136
+ ## Scope of the open release
137
+
138
+ PhysGraspGen is developed as open core.
139
+
140
+ | Part | Where | License |
141
+ |---|---|---|
142
+ | Library (this repository) | GitHub | Apache-2.0 |
143
+ | Grasp dataset | Hugging Face Hub (with `1.0.0rc1`) | CC-BY-NC-4.0 |
144
+ | Benchmarks and reproduction scripts | This repository (PG-T1 with `1.0.0rc1`, the rest with `1.0.0`) | Apache-2.0 |
145
+ | High-precision solver core | Not published | Commercial |
146
+
147
+ ## How development works
148
+
149
+ Day-to-day development of PhysGraspGen happens in a private repository that also
150
+ holds customer-specific code. This repository receives the general-purpose parts as
151
+ reviewed pull requests and tagged releases, so its commit history is shorter than
152
+ the project's. From now on, work on the open library is planned and reviewed here
153
+ in public: every change starts as an issue and lands through a reviewed pull
154
+ request, and releases ship with release notes and an SBOM.
155
+
156
+ ## Community and support
157
+
158
+ - Questions and ideas: [GitHub Discussions](https://github.com/Official-Space-AI/OpenPhysGraspGen/discussions)
159
+ - Bugs: [GitHub Issues](https://github.com/Official-Space-AI/OpenPhysGraspGen/issues)
160
+ - Where to ask what, and response times: [COMMUNITY.md](COMMUNITY.md)
161
+ - Security vulnerabilities: [SECURITY.md](SECURITY.md) (please do not open a public issue)
162
+
163
+ Contributions are welcome. Start with [CONTRIBUTING.md](CONTRIBUTING.md) and the
164
+ [`good first issue`](https://github.com/Official-Space-AI/OpenPhysGraspGen/labels/good%20first%20issue)
165
+ label. Everyone taking part follows the [Code of Conduct](CODE_OF_CONDUCT.md). Who
166
+ decides what, and how releases are approved, is in [GOVERNANCE.md](GOVERNANCE.md).
167
+
168
+ ## License
169
+
170
+ Code is released under the [Apache License 2.0](LICENSE). The dataset is released
171
+ under [CC-BY-NC-4.0](https://creativecommons.org/licenses/by-nc/4.0/).
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["setuptools>=84.1.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "openphysgraspgen"
7
+ version = "1.0.0rc1"
8
+ description = "Physics-labelled grasp data generation for deformable objects"
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE", "NOTICE"]
12
+ authors = [{ name = "SpaceAI" }]
13
+ requires-python = ">=3.10"
14
+ dependencies = ["numpy>=1.24"]
15
+ keywords = ["robotics", "grasping", "deformable", "simulation", "hyperelasticity", "dataset"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Science/Research",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Scientific/Engineering :: Physics",
21
+ ]
22
+
23
+ [project.optional-dependencies]
24
+ dev = ["pytest>=9.0.3", "pytest-cov>=5", "ruff==0.17.2"]
25
+ dataset = ["numpy>=1.26", "pyarrow>=23.0.1", "pyyaml>=6"]
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/Official-Space-AI/OpenPhysGraspGen"
29
+ Issues = "https://github.com/Official-Space-AI/OpenPhysGraspGen/issues"
30
+
31
+ [project.scripts]
32
+ openphysgraspgen = "openphysgraspgen.pipeline:main"
33
+
34
+ [tool.setuptools.packages.find]
35
+ where = ["src"]
36
+
37
+ [tool.setuptools.package-data]
38
+ # The acceptance values finalize_dataset ships in every dataset with the check.
39
+ "openphysgraspgen.dataset" = ["check_criteria.yaml"]
40
+
41
+ [tool.pytest.ini_options]
42
+ testpaths = ["tests"]
43
+
44
+ [tool.ruff]
45
+ target-version = "py310"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+