physical-sandbox 0.1.0__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.
- physical_sandbox-0.1.0/LICENSE +201 -0
- physical_sandbox-0.1.0/NOTICE +15 -0
- physical_sandbox-0.1.0/PKG-INFO +350 -0
- physical_sandbox-0.1.0/README.md +306 -0
- physical_sandbox-0.1.0/pyproject.toml +59 -0
- physical_sandbox-0.1.0/setup.cfg +4 -0
- physical_sandbox-0.1.0/src/physical_sandbox/__init__.py +16 -0
- physical_sandbox-0.1.0/src/physical_sandbox/_atomic.py +16 -0
- physical_sandbox-0.1.0/src/physical_sandbox/bundle.py +642 -0
- physical_sandbox-0.1.0/src/physical_sandbox/camera.py +101 -0
- physical_sandbox-0.1.0/src/physical_sandbox/catalog.py +209 -0
- physical_sandbox-0.1.0/src/physical_sandbox/cli.py +568 -0
- physical_sandbox-0.1.0/src/physical_sandbox/comparison.py +264 -0
- physical_sandbox-0.1.0/src/physical_sandbox/errors.py +21 -0
- physical_sandbox-0.1.0/src/physical_sandbox/fit_screen.py +330 -0
- physical_sandbox-0.1.0/src/physical_sandbox/floor.py +119 -0
- physical_sandbox-0.1.0/src/physical_sandbox/lerobot.py +188 -0
- physical_sandbox-0.1.0/src/physical_sandbox/machine.py +225 -0
- physical_sandbox-0.1.0/src/physical_sandbox/machine_tools.py +426 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/__init__.py +1 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/pack.py +241 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/server.py +532 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/compare.html +326 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/fit-floor.html +356 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/lib/figures.js +50 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/lib/floor.js +50 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/lib/shells.js +146 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/stage.html +1155 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/vendor/LICENSE-ext-apps.txt +313 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/vendor/LICENSE-three.txt +26 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/vendor/ext-apps-app-with-deps.js +104 -0
- physical_sandbox-0.1.0/src/physical_sandbox/mcp/widgets/vendor/three.iife.js +3842 -0
- physical_sandbox-0.1.0/src/physical_sandbox/motion.py +156 -0
- physical_sandbox-0.1.0/src/physical_sandbox/notebook.py +138 -0
- physical_sandbox-0.1.0/src/physical_sandbox/objects.py +143 -0
- physical_sandbox-0.1.0/src/physical_sandbox/push.py +571 -0
- physical_sandbox-0.1.0/src/physical_sandbox/render.py +286 -0
- physical_sandbox-0.1.0/src/physical_sandbox/report.py +129 -0
- physical_sandbox-0.1.0/src/physical_sandbox/scene.py +207 -0
- physical_sandbox-0.1.0/src/physical_sandbox/screens.py +239 -0
- physical_sandbox-0.1.0/src/physical_sandbox/site.py +258 -0
- physical_sandbox-0.1.0/src/physical_sandbox/sources.py +201 -0
- physical_sandbox-0.1.0/src/physical_sandbox/stage.py +665 -0
- physical_sandbox-0.1.0/src/physical_sandbox.egg-info/PKG-INFO +350 -0
- physical_sandbox-0.1.0/src/physical_sandbox.egg-info/SOURCES.txt +70 -0
- physical_sandbox-0.1.0/src/physical_sandbox.egg-info/dependency_links.txt +1 -0
- physical_sandbox-0.1.0/src/physical_sandbox.egg-info/entry_points.txt +2 -0
- physical_sandbox-0.1.0/src/physical_sandbox.egg-info/requires.txt +19 -0
- physical_sandbox-0.1.0/src/physical_sandbox.egg-info/top_level.txt +1 -0
- physical_sandbox-0.1.0/tests/test_bundle.py +228 -0
- physical_sandbox-0.1.0/tests/test_camera.py +67 -0
- physical_sandbox-0.1.0/tests/test_catalog.py +138 -0
- physical_sandbox-0.1.0/tests/test_cli.py +661 -0
- physical_sandbox-0.1.0/tests/test_compare.py +342 -0
- physical_sandbox-0.1.0/tests/test_fit_screen.py +227 -0
- physical_sandbox-0.1.0/tests/test_floor.py +108 -0
- physical_sandbox-0.1.0/tests/test_lerobot.py +218 -0
- physical_sandbox-0.1.0/tests/test_machine.py +315 -0
- physical_sandbox-0.1.0/tests/test_machine_tools.py +133 -0
- physical_sandbox-0.1.0/tests/test_mcp_compare.py +638 -0
- physical_sandbox-0.1.0/tests/test_mcp_site.py +708 -0
- physical_sandbox-0.1.0/tests/test_motion.py +187 -0
- physical_sandbox-0.1.0/tests/test_notebook.py +94 -0
- physical_sandbox-0.1.0/tests/test_objects.py +260 -0
- physical_sandbox-0.1.0/tests/test_push.py +403 -0
- physical_sandbox-0.1.0/tests/test_render.py +452 -0
- physical_sandbox-0.1.0/tests/test_scene.py +258 -0
- physical_sandbox-0.1.0/tests/test_screens.py +97 -0
- physical_sandbox-0.1.0/tests/test_site.py +150 -0
- physical_sandbox-0.1.0/tests/test_site_cameras.py +165 -0
- physical_sandbox-0.1.0/tests/test_sources.py +169 -0
- physical_sandbox-0.1.0/tests/test_stage.py +774 -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 2026 Atsushi Kojo
|
|
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,15 @@
|
|
|
1
|
+
physical-sandbox
|
|
2
|
+
Copyright 2026 Atsushi Kojo
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0.
|
|
5
|
+
|
|
6
|
+
This product bundles third-party code in src/physical_sandbox/mcp/widgets/vendor/, for the in-chat screens:
|
|
7
|
+
|
|
8
|
+
- three.js r180 (MIT License, Copyright 2010-2025 three.js authors) as three.iife.js, to draw the comparison
|
|
9
|
+
screen. Licence: widgets/vendor/LICENSE-three.txt.
|
|
10
|
+
- The MCP Apps SDK, @modelcontextprotocol/ext-apps 2.0.4 (MIT License / Apache License 2.0, Copyright Model
|
|
11
|
+
Context Protocol a Series of LF Projects, LLC.) as ext-apps-app-with-deps.js, the bridge between a screen and
|
|
12
|
+
the chat. That file also bundles the MCP TypeScript SDK (@modelcontextprotocol/client and
|
|
13
|
+
@modelcontextprotocol/core, MIT License / Apache License 2.0), zod (MIT License, Copyright Colin McDonnell),
|
|
14
|
+
content-type (MIT License, Copyright Douglas Christopher Wilson) and @standard-schema/spec (MIT License).
|
|
15
|
+
Licences: widgets/vendor/LICENSE-ext-apps.txt.
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: physical-sandbox
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Overlay robots on photos and videos of a real site at real scale, and compare motions with numbers.
|
|
5
|
+
Author: Atsushi Kojo
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://physicalsandbox.com
|
|
8
|
+
Project-URL: Repository, https://github.com/encassoc/physical-sandbox
|
|
9
|
+
Project-URL: Issues, https://github.com/encassoc/physical-sandbox/issues
|
|
10
|
+
Keywords: robotics,lerobot,sim-to-real,augmented-reality,urdf,mujoco,evaluation
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Operating System :: MacOS
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
License-File: NOTICE
|
|
27
|
+
Requires-Dist: numpy
|
|
28
|
+
Requires-Dist: opencv-python-headless
|
|
29
|
+
Requires-Dist: mujoco>=3
|
|
30
|
+
Requires-Dist: pyarrow
|
|
31
|
+
Requires-Dist: matplotlib
|
|
32
|
+
Requires-Dist: fast-simplification
|
|
33
|
+
Requires-Dist: huggingface_hub>=0.34
|
|
34
|
+
Provides-Extra: sam
|
|
35
|
+
Requires-Dist: ultralytics; extra == "sam"
|
|
36
|
+
Provides-Extra: mcp
|
|
37
|
+
Requires-Dist: mcp>=2.3; extra == "mcp"
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest; extra == "dev"
|
|
40
|
+
Requires-Dist: pillow; extra == "dev"
|
|
41
|
+
Requires-Dist: jsonschema; extra == "dev"
|
|
42
|
+
Requires-Dist: pandas; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# physical-sandbox
|
|
46
|
+
|
|
47
|
+
Overlay robots on photos and videos of a real site, at real scale. Fix a site from a single picture (the
|
|
48
|
+
floor's four corners), put a machine on it, play a robot motion over the picture, and compare two motions with
|
|
49
|
+
numbers and a replay video. The command is `psbx`; `psbx stage` does all of it on one page.
|
|
50
|
+
|
|
51
|
+
Everything runs on your machine: photos, videos and cut-outs never leave it.
|
|
52
|
+
|
|
53
|
+
## Try it
|
|
54
|
+
|
|
55
|
+
Five minutes, one photo of your own desk:
|
|
56
|
+
|
|
57
|
+
1. Download a motion to play: `hf download lerobot/svla_so101_pickplace --repo-type dataset` (`hf` comes with
|
|
58
|
+
psbx).
|
|
59
|
+
2. Put an A4 sheet on a desk and take a photo of it, `desk.jpg`.
|
|
60
|
+
3. `psbx stage desk.jpg`. Drag the four corners onto the sheet's corners, pick A4, press 決定 (Decide). The work
|
|
61
|
+
folder is `desk/`, next to the photo.
|
|
62
|
+
4. In the robot step pick `physical-sandbox/so101` (it is pulled from the public catalog; the page offers it as
|
|
63
|
+
that one line only while no machine is cached, otherwise type `so101` in the catalog search box and take it
|
|
64
|
+
from the hits), drag it beside the sheet, press 決定 (Decide).
|
|
65
|
+
Without the catalog (offline, or a model of your own): `psbx stage desk.jpg --machine DIR`, where `DIR` holds
|
|
66
|
+
the robot's URDF folder, and the robot step lists it.
|
|
67
|
+
5. In the motion step pick `svla_so101_pickplace` from the list, episode 0: choosing from the list loads the
|
|
68
|
+
motion (読み込む (Load) is for a path you typed). Press 再生 (Play): the arm moves on your desk. 動画に書き出す (Export video) writes the replay.
|
|
69
|
+
6. In the compare step pick the same dataset, episode 1, as the second motion and press 比べる (Compare): the
|
|
70
|
+
table of gaps and two shells. 書き出す (Export) writes the report.
|
|
71
|
+
|
|
72
|
+
The steps are described under [Stage](#stage).
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
uv tool install physical-sandbox # the psbx command, in its own environment
|
|
78
|
+
pip install physical-sandbox # or into a virtualenv of yours (python3 -m venv .venv first)
|
|
79
|
+
pip install 'physical-sandbox[sam,mcp]' # plus SAM 2.1 (cut out objects) and the MCP server (screens in the chat)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
From a checkout of this repository:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
python3.12 -m venv .venv
|
|
86
|
+
.venv/bin/pip install -e . # the core: psbx stage, psbx site fit, psbx compare
|
|
87
|
+
.venv/bin/pip install -e '.[sam,mcp,dev]' # plus the extras and what the tests need
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Python 3.10 or newer, macOS or Linux. The core includes everything the stage needs, mesh thinning
|
|
91
|
+
(`fast-simplification`) among it. The extras: `[sam]` cuts out fixed objects with SAM 2.1 (ultralytics), `[mcp]`
|
|
92
|
+
is the MCP SDK that serves the in-chat screens (`psbx mcp`), `[dev]` runs the tests. The replay video is drawn
|
|
93
|
+
with MuJoCo offscreen: on macOS that works as it is; on a Linux machine without a display set `MUJOCO_GL=egl`
|
|
94
|
+
(or `osmesa`).
|
|
95
|
+
|
|
96
|
+
## Stage
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
psbx stage desk.jpg
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
opens one page in your browser with four steps, in this order. A step opens when the one before it is done:
|
|
103
|
+
the robot step after the floor is decided, the motion and compare steps after a machine is placed.
|
|
104
|
+
|
|
105
|
+
1. **床 (Floor).** Drag the four corners onto a rectangle on the ground, going round, 1 to 4. Pick the object's
|
|
106
|
+
size from the menu, or type the lengths of edge 1→2 and edge 2→3 in centimetres. Tick 長さは実測した値
|
|
107
|
+
when you measured them. 決定 writes `site.json`.
|
|
108
|
+
2. **ロボット (Robot).** Pick a machine: the ones in `~/.cache/physical-sandbox/machines`, the ones already
|
|
109
|
+
pulled from the catalog, and the folders you gave with `--machine`. The public catalog can be searched and
|
|
110
|
+
pulled from the page, no account needed; you can also type the path of a URDF. Drag the machine's shell on the
|
|
111
|
+
floor and set its yaw. 決定 writes `scene.json`.
|
|
112
|
+
3. **動き (Motion).** Pick a motion: a record file (`*.record.json`) in the work folder, or a LeRobot dataset
|
|
113
|
+
found under `$HF_HOME/hub` and `$HF_HOME/lerobot/hub` (`~/.cache/huggingface` unless `HF_HOME` is set) or
|
|
114
|
+
given with `--lerobot`, with its episode number; or type a record's path or `lerobot:<folder>#<episode>`.
|
|
115
|
+
Choosing from the list loads it (読み込む (Load) reads a typed path); 再生 (Play) draws it over the photo. To move
|
|
116
|
+
the robot while the motion plays, use the robot step: the shell there follows the motion, and the motion view
|
|
117
|
+
follows the robot. 動画に書き出す (Export video) writes `replay-<label>.mp4` in the work folder, where the
|
|
118
|
+
label is the record file's name without `.record.json` (`<file>-<motion>` when the file holds several motions;
|
|
119
|
+
`<dataset> ep<N>` for a LeRobot episode). A record with one device
|
|
120
|
+
drives the placed machine, and the page says so.
|
|
121
|
+
4. **比べる (Compare).** The motion of the step before is A. Pick a second motion B the same way (and, if you
|
|
122
|
+
like, the しきい値 (threshold) of the grasp, in radians). 比べる (Compare) shows both shells, the tool-tip trails, the line between the two tips and the
|
|
123
|
+
table of figures; 書き出す (Export) writes `compare/<A>-vs-<B>/gaps.json`, `gaps.csv`, `gaps.png` and
|
|
124
|
+
`replay.mp4`, the same files as [`psbx compare`](#compare-two-motions).
|
|
125
|
+
|
|
126
|
+
The options: `--dir DIR` is the work folder (default: next to the picture, named after it), `--camera side`
|
|
127
|
+
names the camera in the site (default: the one the folder's floor was decided with, else `camera`), `--machine DIR` and `--lerobot DIR` offer a machine folder or a
|
|
128
|
+
dataset folder (both repeatable), `--port` fixes the port, `--no-browser` only prints the address, for a machine
|
|
129
|
+
you reach over SSH (forward the port).
|
|
130
|
+
|
|
131
|
+
One folder is one site: a folder fixed on another picture is refused. `stage.json` in the folder keeps what the
|
|
132
|
+
page had (the picture, the machine, motions A and B, the grasp threshold), so `psbx stage desk/` reopens where
|
|
133
|
+
you left off.
|
|
134
|
+
|
|
135
|
+
The page is served on 127.0.0.1 only, at an address with a random token. The photo and the videos never leave
|
|
136
|
+
your machine; the only network use is the catalog search and pull you ask for. The line at the bottom of the page
|
|
137
|
+
shows whether `psbx login` has been run (it only looks at the token file). Searching and pulling the public
|
|
138
|
+
catalog needs no account, and a kept token also lets you pull your own private items; pushing is
|
|
139
|
+
[`psbx push`](#push-to-the-catalog) in a terminal. Ctrl-C in the terminal when done.
|
|
140
|
+
|
|
141
|
+
## Fix a site
|
|
142
|
+
|
|
143
|
+
A site is a JSON file with the camera that took the picture (its lens and where it stands) and the floor, in
|
|
144
|
+
metres: x forward, y left, z up, the floor at z = 0. The first site comes from four corners of a rectangle on
|
|
145
|
+
the ground in one picture and the lengths of two of its edges. Further cameras can then be tied to that site
|
|
146
|
+
through fixed objects both pictures show (`physical_sandbox.site.add_camera` in Python). The stage's first step
|
|
147
|
+
writes it; the rest of this section is for when you want only the floor, or no browser.
|
|
148
|
+
|
|
149
|
+
The rectangle needs real lengths, and a picture cannot give them. The easy way is to put something of a known
|
|
150
|
+
size on the floor before taking the picture: a sheet of A4 paper on a table (21 × 29.7 cm), a pallet on a
|
|
151
|
+
factory floor (110 × 110 cm). Tape on the table and a ruler work too. A lane width or a desk width guessed by eye
|
|
152
|
+
works as well, but then every report says the dimensions are estimated.
|
|
153
|
+
|
|
154
|
+
`psbx site fit photo.jpg --out site.json` is the floor step alone: a page with only the floor, and
|
|
155
|
+
`site.json` written where you say (press 決定 again after a change to overwrite it; Ctrl-C when done). `--camera`, `--edges 0.6 0.4` (the lengths to start from, in metres),
|
|
156
|
+
`--no-browser` and `--port 8797` work as on the stage.
|
|
157
|
+
|
|
158
|
+
### From a script
|
|
159
|
+
|
|
160
|
+
```sh
|
|
161
|
+
psbx site fit photo.jpg --corners 42,330 120,360 290,272 219.6,257.3 --edges 0.061 0.129 --out site.json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
fits the site without the screen, from corners already known in pixels `u,v` (going round; a corner outside
|
|
165
|
+
the picture, with a negative `u`, is fine) and `--edges`, the lengths of edge 1-2 and edge 2-3 in metres. Add
|
|
166
|
+
`--measured` when you measured them. Nobody has confirmed a site made this way, and the file says so. This is
|
|
167
|
+
what [`examples/so101-pickplace`](examples/so101-pickplace) uses, with corners read off a frame of the dataset.
|
|
168
|
+
|
|
169
|
+
### From Claude Desktop
|
|
170
|
+
|
|
171
|
+
An AI agent looks at a photo, proposes the floor's four corners and the fixed objects, and a screen inside the
|
|
172
|
+
chat shows them over the photo. Drag a corner if it is off, press 決定 (Decide), and the site file is written as
|
|
173
|
+
`site.json` in the folder the agent was given.
|
|
174
|
+
|
|
175
|
+
Add this to `claude_desktop_config.json` (Settings > Developer > Edit Config), with your own paths, and quit
|
|
176
|
+
and reopen Claude Desktop with Cmd+Q:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"mcpServers": {
|
|
181
|
+
"physical-sandbox": {
|
|
182
|
+
"command": "/path/to/physical-sandbox/.venv/bin/psbx",
|
|
183
|
+
"args": ["mcp"]
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Needs the `[mcp]` extra, and `[sam]` to cut out objects. A site fixed in the chat calls its camera `camera`
|
|
190
|
+
unless the agent names another. The display copy of a photo is kept in `~/.cache/physical-sandbox/` (set
|
|
191
|
+
`PS_CACHE_DIR` to move it).
|
|
192
|
+
|
|
193
|
+
SAM's weights (about 80 MB) are downloaded the first time an object is cut out; that is the only time the
|
|
194
|
+
network is used. To work offline, fetch them ahead of time with `psbx fetch-sam` (into
|
|
195
|
+
`~/.cache/physical-sandbox/`, or `$PS_CACHE_DIR`; `--dest` puts the file elsewhere, for
|
|
196
|
+
`physical_sandbox.objects.sam_segmenter(weights=...)`).
|
|
197
|
+
|
|
198
|
+
## Take a machine from the catalog
|
|
199
|
+
|
|
200
|
+
```sh
|
|
201
|
+
psbx catalog search arm # name version category display
|
|
202
|
+
psbx pull physical-sandbox/so101 # prints the cache folder
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
from physical_sandbox import catalog
|
|
207
|
+
from physical_sandbox.machine import load_machine
|
|
208
|
+
|
|
209
|
+
machine = load_machine(catalog.urdf_path(catalog.pull("physical-sandbox/so101")))
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Files are checked against the manifest's sha256 and cached under `~/.cache/physical-sandbox/catalog/`
|
|
213
|
+
(`$PS_CACHE_DIR`); a second `pull` of the same version does not touch the network. `$PS_CATALOG_URL` points
|
|
214
|
+
at another catalog server.
|
|
215
|
+
|
|
216
|
+
## Get your own machine ready for the catalog
|
|
217
|
+
|
|
218
|
+
```sh
|
|
219
|
+
psbx machine init my-arm/ # product.json and profile.json templates beside the URDF
|
|
220
|
+
psbx machine check my-arm/ # one line per check: the URDF reads, the meshes are there, the names and
|
|
221
|
+
# licence are filled in, wheels are continuous joints
|
|
222
|
+
psbx machine init statue.glb # a mesh-only object: object.json (with its unit, m or mm)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The browser draws a display bundle made from the URDF (`physical_sandbox.bundle.make_bundle`): `bundle.json`
|
|
226
|
+
and binary meshes, large meshes thinned to 20,000 triangles. The fields of `product.json`, `profile.json` and
|
|
227
|
+
`object.json`, and how the SO-101's grasp was measured, are in [docs/machines.md](docs/machines.md). In Claude
|
|
228
|
+
Desktop the same check is the `ps_machine_check` tool.
|
|
229
|
+
|
|
230
|
+
## Push to the catalog
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
psbx push <handle>/my-arm:1 my-arm/ # a machine folder: checked, bundled, uploaded
|
|
234
|
+
psbx push <handle>/statue statue.stl # an object (beside its object.json); version 1, then 2, ...
|
|
235
|
+
psbx push <handle>/run-1:1 record.json --public # a record (schemaVersion 3), published
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
The first push signs in: it prints a 6-digit code to enter at `<PS.com>/vr`, and keeps the token in
|
|
239
|
+
`~/.config/physical-sandbox/ps-com-token.json` (mode 0600) until it expires (`psbx login` does only this
|
|
240
|
+
step). You push under your own handle, decided once on PS.com at `/catalog/me`. Everything is private (only
|
|
241
|
+
you see it) unless you add `--public`. A version that is already there is refused (`taken`); without a
|
|
242
|
+
version, push takes 1, or one more than the highest number there.
|
|
243
|
+
|
|
244
|
+
A record whose devices name a local machine (`"product": "so101"`) takes that machine along: when
|
|
245
|
+
`<handle>/so101` is not in the catalog, it goes up **privately** as `<handle>/so101:1` from
|
|
246
|
+
`~/.cache/physical-sandbox/machines/so101/` or `--machine-dir DIR` (`DIR/so101/`). When it is there and the
|
|
247
|
+
files are the same it is used as it is; when they differ, it goes up as the next version. The uploaded record
|
|
248
|
+
names `<handle>/so101:<version>`; your file is left as it was. In Claude Desktop, `ps_catalog_push` does the
|
|
249
|
+
same (private by default) once `psbx login` has been run in a terminal.
|
|
250
|
+
|
|
251
|
+
## Compare two motions
|
|
252
|
+
|
|
253
|
+
```sh
|
|
254
|
+
psbx compare --site site.json --scene scene.json --camera camera \
|
|
255
|
+
--a demo.record.json --b policy.record.json --video site.mp4 --out out/
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
writes, into `out/`:
|
|
259
|
+
|
|
260
|
+
- `gaps.json` and `gaps.csv`: the site's quality first (its residual in pixels, whether its dimensions are
|
|
261
|
+
measured or estimated, whether a person confirmed it), then the gaps: the tool tips' distance at the same
|
|
262
|
+
time (maximum, when, mean), the difference in path shape (time ignored), each joint's gap, the durations, the
|
|
263
|
+
smoothness (jerk) and the grasps (where the gripper closes through the middle of the range it went through;
|
|
264
|
+
the threshold used is in the files, and `--grip-threshold` sets another; a gripper that hardly moved, under
|
|
265
|
+
5 % of its joint's range, gets no grasps and a note instead, so its wobble is never counted). What the numbers
|
|
266
|
+
cannot tell yet is listed with the reason.
|
|
267
|
+
- `gaps.png`: the tool gap over time.
|
|
268
|
+
- `replay.mp4`: both machines over the picture as see-through shells, A blue and B orange, with the tool tips'
|
|
269
|
+
paths.
|
|
270
|
+
|
|
271
|
+
A motion (`--a`, `--b`) is either a recording file, `file.record.json` or `file.record.json#label` to pick one
|
|
272
|
+
motion in it, or one episode of a LeRobot v3 dataset, `lerobot:<dataset folder>#<episode>`. With a LeRobot A
|
|
273
|
+
and no `--video`, the replay is drawn on A's own recording, cut to A's episode; `--lerobot-camera side` names
|
|
274
|
+
the dataset's camera when it is not called like the site camera (a site fixed in the chat calls its camera
|
|
275
|
+
`camera`).
|
|
276
|
+
|
|
277
|
+
The scene says where each machine stands on the site. It is a small JSON file next to the site:
|
|
278
|
+
|
|
279
|
+
```json
|
|
280
|
+
{
|
|
281
|
+
"format": "physical-sandbox.scene/1",
|
|
282
|
+
"site": "site",
|
|
283
|
+
"machines": {
|
|
284
|
+
"so101": {"urdf": "robots/so101.urdf", "x": -0.025, "y": 0.251, "yaw": -0.242, "confirmedByPerson": false}
|
|
285
|
+
},
|
|
286
|
+
"records": []
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
`site` is the site's `id`, `x` and `y` are metres on the site and `yaw` radians counter-clockwise; the urdf path
|
|
291
|
+
is relative to the scene's folder. The machine's id (`so101`) is what a motion drives; a LeRobot motion drives
|
|
292
|
+
the scene's only machine. To write one from Python:
|
|
293
|
+
|
|
294
|
+
```python
|
|
295
|
+
from physical_sandbox.machine import load_machine
|
|
296
|
+
from physical_sandbox.scene import PlacedMachine, Scene, save_scene
|
|
297
|
+
from physical_sandbox.site import load_site
|
|
298
|
+
|
|
299
|
+
urdf = "robots/so101.urdf"
|
|
300
|
+
arm = PlacedMachine(load_machine(urdf), urdf, x=-0.025, y=0.251, yaw=-0.242)
|
|
301
|
+
save_scene(Scene(load_site("site.json"), {"so101": arm}), "scene.json")
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Recordings come from numpy (`physical_sandbox.motion.motion_from_numpy`, then `save_record`) or from LeRobot
|
|
305
|
+
directly. [`examples/so101-pickplace`](examples/so101-pickplace) runs all of this on a real LeRobot dataset:
|
|
306
|
+
the site from one frame, the arm placed on it, two episodes compared.
|
|
307
|
+
|
|
308
|
+
### In a notebook
|
|
309
|
+
|
|
310
|
+
The same comparison, on the work folder the stage left, as a Python call: `physical_sandbox.compare(folder, a, b)`
|
|
311
|
+
(the motions are written as on the stage, `file.record.json`, `file.record.json#label` or `lerobot:<dataset>#<n>`,
|
|
312
|
+
and `grip_threshold=` is the stage's threshold). Its result shows the stage's table when it is the last thing in a
|
|
313
|
+
cell, and gives the numbers in the forms a notebook wants:
|
|
314
|
+
|
|
315
|
+
```python
|
|
316
|
+
import physical_sandbox as ps
|
|
317
|
+
|
|
318
|
+
D = "~/.cache/huggingface/lerobot/hub/datasets--lerobot--svla_so101_pickplace/snapshots/<hash>"
|
|
319
|
+
gaps = ps.compare("~/Desktop/desk", f"lerobot:{D}#0", f"lerobot:{D}#1")
|
|
320
|
+
gaps # the stage's table (mm, degrees, seconds), the site line above it
|
|
321
|
+
gaps.figure() # the tool gap over time (what gaps.png draws), a matplotlib Figure
|
|
322
|
+
gaps.to_dataframe() # the rows of gaps.csv as pandas: item, value, unit, at_s, note
|
|
323
|
+
gaps.to_dict() # what gaps.json holds
|
|
324
|
+
|
|
325
|
+
# One line per comparison makes a table over many episodes:
|
|
326
|
+
import pandas as pd
|
|
327
|
+
table = pd.DataFrame(ps.compare("~/Desktop/desk", f"lerobot:{D}#0", f"lerobot:{D}#{i}").row() for i in range(1, 50))
|
|
328
|
+
table[["b", "tool_deviation.max", "shape_deviation", "duration.b"]]
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
`row()` is flat (`a`, `b`, then `item -> value` in metres, radians and seconds). A comparison takes about a
|
|
332
|
+
second; the stage's video is not made here (export it on the stage, or run `psbx compare`).
|
|
333
|
+
|
|
334
|
+
### In Claude Desktop
|
|
335
|
+
|
|
336
|
+
The `ps_compare` tool opens the same comparison as a screen in the chat: the site's picture with both machines
|
|
337
|
+
as see-through shells, the tool-tip paths, a slider and a play button, and the table of numbers (click a time to
|
|
338
|
+
jump there). Its arguments are those of `psbx compare` (`videoCamera` for `--lerobot-camera`, `gripThreshold` for
|
|
339
|
+
`--grip-threshold`); from the chat it opens only local files, `rtsp://` cameras and camera numbers. Leave `b`
|
|
340
|
+
out to look at one motion alone: the same screen without the gaps between two (it shows the duration and the
|
|
341
|
+
grasps).
|
|
342
|
+
|
|
343
|
+
`ps_scene_place(siteDir, machine, x, y, yaw, scenePath=None, urdf=None)` writes the scene file the screen
|
|
344
|
+
needs: it puts `machine` (a catalog ref such as `physical-sandbox/so101`, pulled if it is not cached, or, with
|
|
345
|
+
`urdf`, the id to give that URDF file) at `x`, `y` metres and `yaw` radians on the site in `siteDir`, into
|
|
346
|
+
`siteDir/scene.json` unless `scenePath` says another file.
|
|
347
|
+
|
|
348
|
+
## License
|
|
349
|
+
|
|
350
|
+
Apache-2.0. Copyright Atsushi Kojo. The in-chat screens bundle three.js and the MCP Apps SDK; see `NOTICE`.
|