@hackbuild/humanoid 0.2.1 → 0.2.2
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.
- package/README.md +1 -1
- package/dist/humanoid.iife.js +2 -1
- package/dist/sonic.d.ts +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ The full reference is in [docs/api/humanoid](../../docs/api/humanoid/README.md).
|
|
|
102
102
|
| stepping | nothing more | 0.084 ms per 2 ms step for the G1, about 24 times real time (measured) |
|
|
103
103
|
| the policy | onnxruntime-web on wasm, one thread | 5.7 ms a 20 ms tick in headless Chrome on an Apple M1 (measured) |
|
|
104
104
|
| drawing | three.js 0.186 or later, WebGL | the G1 draws 35 meshes |
|
|
105
|
-
| single file build | `dist/humanoid.iife.js` | `HackbuildHumanoid` global with `THREE` from the page; MuJoCo still loads from its URL |
|
|
105
|
+
| single file build | `dist/humanoid.iife.js` | `HackbuildHumanoid` global with [`THREE`](../../docs/concepts.md#builds-that-run-from-file) from the page; MuJoCo still loads from its URL |
|
|
106
106
|
|
|
107
107
|
## Errors and troubleshooting
|
|
108
108
|
|
package/dist/humanoid.iife.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var HackbuildHumanoid = (function(exports, three) {
|
|
2
|
+
if (!globalThis.THREE) throw new Error("@hackbuild/humanoid: no THREE on the page. import three in a module script, set globalThis.THREE, then load this file with defer.");
|
|
2
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
4
|
// src/runtime.ts
|
|
4
5
|
/**
|
|
@@ -1054,4 +1055,4 @@ var HackbuildHumanoid = (function(exports, three) {
|
|
|
1054
1055
|
exports.referencedFiles = referencedFiles;
|
|
1055
1056
|
exports.toPolicyOrder = toPolicyOrder;
|
|
1056
1057
|
return exports;
|
|
1057
|
-
})({}, THREE);
|
|
1058
|
+
})({}, globalThis.THREE);
|
package/dist/sonic.d.ts
CHANGED
|
@@ -121,9 +121,11 @@ export interface SonicOptions {
|
|
|
121
121
|
ort?: Ort;
|
|
122
122
|
/** Where to load onnxruntime-web from. Default {@link ORT_URL}; its wasm is read beside it. */
|
|
123
123
|
ortUrl?: string;
|
|
124
|
-
/** The encoder
|
|
124
|
+
/** The encoder as a URL or bytes. Default {@link SONIC}'s pinned URL. */
|
|
125
125
|
encoder?: string | Uint8Array | ArrayBuffer;
|
|
126
|
+
/** The decoder as a URL or bytes. Default {@link SONIC}'s pinned URL. */
|
|
126
127
|
decoder?: string | Uint8Array | ArrayBuffer;
|
|
128
|
+
/** The fetch the policy files load through. Default the page's own. */
|
|
127
129
|
fetch?: typeof fetch;
|
|
128
130
|
/** Called with {@link SONIC}'s licence line when the weights load. */
|
|
129
131
|
onLicence?: (line: string) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hackbuild/humanoid",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A physics humanoid in the page: MuJoCo (Google DeepMind's WebAssembly build, loaded at run time and never bundled) runs a robot from its MJCF files, holds joint targets with its position actuators, and gives the body's pose to a three.js view. Starts with the Unitree G1, and runs NVIDIA's GEAR-SONIC policy on it so it balances (weights and onnxruntime-web loaded at run time).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|