Metadata-Version: 2.5
Name: proofmass-check
Version: 0.2.0
Summary: Physics checks for SimReady OpenUSD assets: does the asset behave in a simulator?
Project-URL: Homepage, https://github.com/proofmass/proofmass-check
Project-URL: Issues, https://github.com/proofmass/proofmass-check/issues
Project-URL: Changelog, https://github.com/proofmass/proofmass-check/blob/main/CHANGELOG.md
Author: Paweł Kikta
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: isaac-sim,newton,openusd,physics,robotics,simready,simulation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.11
Requires-Dist: numpy>=1.26
Provides-Extra: usd
Requires-Dist: usd-core>=25.5; extra == 'usd'
Description-Content-Type: text/markdown

# proofmass-check

**Does this asset behave in a simulator?**

proofmass-check runs a fixed set of physics checks on a SimReady OpenUSD asset: it does not fall
through the floor, its drives hold and reach their targets, its doors and drawers open, its gripper
holds its rated payload. Each check has one pass rule and fixed numbers, written in
[docs/spec.md](docs/spec.md).

A metadata validator tells you that an asset follows the rules. proofmass-check tells you what the
asset does when physics runs.

> **Status: alpha, in development.** The checks run in PhysX (Isaac Sim 6.1) and, as an
> experiment, in Newton. The rules and numbers may still change before version 1.0; each change
> raises the spec version.

## The checks

| ID | What it checks | Runs on |
|---|---|---|
| `LOAD` | The engine builds every joint and the same total mass as the USD | every asset |
| `DROP` | Dropped from 10 cm, it comes to rest on the floor | assets that are not fixed to the world and have no position drives |
| `HOLD` | Drives hold the rest pose under gravity | joints with a position drive |
| `TRACK` | Drives reach 25 % and 75 % of their range | driven joints with limits |
| `LIMIT` | Limits stop a drive commanded past them | driven joints with limits |
| `STABLE` | No explosion in random poses inside the limits | driven joints with limits |
| `SPEED` | At a 60 Hz physics step, drives stay under their speed limits | driven joints with limits and a speed limit |
| `PASSIVE` | A door or drawer, pushed, reaches both limits and stops there | limited joints without a position drive |
| `GRIP` | The gripper holds 85 % of its rated payload, pulled two ways | gripper sites (NVIDIA rules GR.001 to GR.004) |
| `SHAKE` | The grip holds that load shaken at up to 2 g | gripper sites |
| `STAND` | Dropped with its wheels braked, it stands upright and still | wheeled robots |
| `DRIVE` | It drives straight along +X at the commanded speed | wheeled robots |
| `TURN` | It turns in place at the expected rate | differential and skid-steer robots |
| `STEER` | It drives the circle its steering gives | Ackermann robots |

A check that does not apply to an asset reports `N/A` with the reason. `N/A` does not fail a run.

A wheeled robot needs a short description of its wheels in the USD: see
[docs/wheeled-robots.md](docs/wheeled-robots.md).

## Engines

| Engine | Status | Runs in | Not yet |
|---|---|---|---|
| `physx` | reference engine | Isaac Sim 6.1's Python | joints between free rigid bodies get LOAD, DROP and PASSIVE only |
| `newton` | experimental, needs an NVIDIA GPU; results can differ from run to run ([spec, section 5](docs/spec.md#5-engines)) | a Python with `newton[sim,importers]` | SPEED; STAND, DRIVE, TURN, STEER; the single axes of a D6 joint |

proofmass-check runs in the Python environment that has the engine. It does not look for other
Python installations.

**NVIDIA license.** Isaac Sim asks you to accept the NVIDIA Omniverse License Agreement the first
time it starts. proofmass-check never accepts it for you.

## Install

Install it in the Python environment of your engine: Isaac Sim's Python for `physx`, or the Python
that has Newton for `newton`.

```bash
pip install proofmass-check
```

The development version, from GitHub:

```bash
pip install "proofmass-check @ git+https://github.com/proofmass/proofmass-check"
```

## Run

```bash
proofmass-check run path/to/asset.usd --engine physx
proofmass-check list-checks
```

| Option | What it does |
|---|---|
| `--engine physx` or `newton` | the engine to run on (default `physx`) |
| `--variant SET=VALUE` | select a variant; repeat for more than one. The engine's own variant set (`PhysX`, `Newton`) is selected when the asset has it |
| `--no-floor` | no floor, for a pinned arm whose links reach below its base |
| `--settle S` | seconds a drive gets for a move (spec: 1.5). A run with another value says so in its results |
| `--out DIR` | where to write `results.json` (default `./proofmass-check-<asset name>`) |

The exit status is 0 when no check failed, 1 when a check failed, and 2 when the run could not
finish. `results.json` holds every verdict and number, the versions of the tool, the spec and the
engine, and the SHA-256 of the asset file.
[src/proofmass_check/results.schema.json](src/proofmass_check/results.schema.json) describes it.

## How a run works

1. **Read.** The reader reads bodies, joints and gripper sites from the USD, with the variants
   selected. The file on disk does not change.
2. **Plan.** The plan decides which checks apply to the asset, and gives the reason for each one
   that does not. The plan is the same for every engine.
3. **Simulate.** The engine runs short simulations, each from the asset's rest pose, and reports
   what it measured.
4. **Judge.** Each check compares the measurements with its rule in [docs/spec.md](docs/spec.md).

proofmass-check only measures. It never repairs an asset and never changes a setting to make a
check pass.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md). To report a security problem, see [SECURITY.md](SECURITY.md).

## License

Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).

Developed by [Proofmass](https://proofmass.com).
