@pollen-robotics/reachy-mini-sdk 1.7.3 → 1.8.0-main.54c2dcd
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/APP_CREATION_GUIDE.md +1795 -0
- package/README.md +65 -5
- package/dist/animation/distance.d.ts +87 -0
- package/dist/animation/distance.d.ts.map +1 -0
- package/dist/animation/distance.js +140 -0
- package/dist/animation/distance.js.map +1 -0
- package/dist/animation/index.d.ts +34 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/index.js +33 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/animation/pose.d.ts +40 -0
- package/dist/animation/pose.d.ts.map +1 -0
- package/dist/animation/pose.js +15 -0
- package/dist/animation/pose.js.map +1 -0
- package/dist/animation/presets.d.ts +85 -0
- package/dist/animation/presets.d.ts.map +1 -0
- package/dist/animation/presets.js +82 -0
- package/dist/animation/presets.js.map +1 -0
- package/dist/animation/safe-return.d.ts +90 -0
- package/dist/animation/safe-return.d.ts.map +1 -0
- package/dist/animation/safe-return.js +123 -0
- package/dist/animation/safe-return.js.map +1 -0
- package/dist/lib/math.d.ts +23 -0
- package/dist/lib/math.d.ts.map +1 -0
- package/dist/lib/math.js +40 -0
- package/dist/lib/math.js.map +1 -0
- package/dist/lib/reachy-mini.d.ts +193 -0
- package/dist/lib/reachy-mini.d.ts.map +1 -0
- package/dist/lib/reachy-mini.js +1495 -0
- package/dist/lib/reachy-mini.js.map +1 -0
- package/dist/lib/types.d.ts +384 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +9 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/upload-helpers.d.ts +18 -0
- package/dist/lib/upload-helpers.d.ts.map +1 -0
- package/dist/lib/upload-helpers.js +44 -0
- package/dist/lib/upload-helpers.js.map +1 -0
- package/dist/lib/url-helpers.d.ts +63 -0
- package/dist/lib/url-helpers.d.ts.map +1 -0
- package/dist/lib/url-helpers.js +153 -0
- package/dist/lib/url-helpers.js.map +1 -0
- package/dist/reachy-mini-sdk.d.ts +69 -0
- package/dist/reachy-mini-sdk.d.ts.map +1 -0
- package/dist/reachy-mini-sdk.js +68 -0
- package/dist/reachy-mini-sdk.js.map +1 -0
- package/host/README.md +157 -0
- package/host/dist/ReachyHost.d.ts +40 -0
- package/host/dist/ReachyHost.d.ts.map +1 -0
- package/host/dist/assets/index.d.ts +16 -0
- package/host/dist/assets/index.d.ts.map +1 -0
- package/host/dist/chunks/index-CyLPysJS.js +400 -0
- package/host/dist/chunks/mountHost-zdJ99_oZ.js +48392 -0
- package/host/dist/chunks/reachy-mini-BV9nAnC1.js +1283 -0
- package/host/dist/components/ConnectingView.d.ts +13 -0
- package/host/dist/components/ConnectingView.d.ts.map +1 -0
- package/host/dist/components/EmbedFrame.d.ts +16 -0
- package/host/dist/components/EmbedFrame.d.ts.map +1 -0
- package/host/dist/components/ErrorView.d.ts +21 -0
- package/host/dist/components/ErrorView.d.ts.map +1 -0
- package/host/dist/components/LeavingView.d.ts +33 -0
- package/host/dist/components/LeavingView.d.ts.map +1 -0
- package/host/dist/components/PickerView.d.ts +51 -0
- package/host/dist/components/PickerView.d.ts.map +1 -0
- package/host/dist/components/PostOAuthSplash.d.ts +25 -0
- package/host/dist/components/PostOAuthSplash.d.ts.map +1 -0
- package/host/dist/components/ReachyHostShell.d.ts +21 -0
- package/host/dist/components/ReachyHostShell.d.ts.map +1 -0
- package/host/dist/components/SignInView.d.ts +32 -0
- package/host/dist/components/SignInView.d.ts.map +1 -0
- package/host/dist/components/StepsProgressIndicator.d.ts +41 -0
- package/host/dist/components/StepsProgressIndicator.d.ts.map +1 -0
- package/host/dist/components/TopBar.d.ts +52 -0
- package/host/dist/components/TopBar.d.ts.map +1 -0
- package/host/dist/components/WelcomeBackOverlay.d.ts +28 -0
- package/host/dist/components/WelcomeBackOverlay.d.ts.map +1 -0
- package/host/dist/embed/index.d.ts +152 -0
- package/host/dist/embed/index.d.ts.map +1 -0
- package/host/dist/entry/auto.d.ts +12 -0
- package/host/dist/entry/auto.d.ts.map +1 -0
- package/host/dist/entry/auto.js +6 -0
- package/host/dist/entry/embed.d.ts +12 -0
- package/host/dist/entry/embed.d.ts.map +1 -0
- package/host/dist/entry/embed.js +6 -0
- package/host/dist/hooks/useHfProfile.d.ts +7 -0
- package/host/dist/hooks/useHfProfile.d.ts.map +1 -0
- package/host/dist/hooks/useHostBridge.d.ts +37 -0
- package/host/dist/hooks/useHostBridge.d.ts.map +1 -0
- package/host/dist/hooks/useOAuth.d.ts +16 -0
- package/host/dist/hooks/useOAuth.d.ts.map +1 -0
- package/host/dist/hooks/useRobots.d.ts +17 -0
- package/host/dist/hooks/useRobots.d.ts.map +1 -0
- package/host/dist/hooks/useSdk.d.ts +16 -0
- package/host/dist/hooks/useSdk.d.ts.map +1 -0
- package/host/dist/index.d.ts +25 -0
- package/host/dist/index.d.ts.map +1 -0
- package/host/dist/index.js +14 -0
- package/host/dist/lib/centralListener.d.ts +73 -0
- package/host/dist/lib/centralListener.d.ts.map +1 -0
- package/host/dist/lib/centralRest.d.ts +35 -0
- package/host/dist/lib/centralRest.d.ts.map +1 -0
- package/host/dist/lib/protocol.d.ts +230 -0
- package/host/dist/lib/protocol.d.ts.map +1 -0
- package/host/dist/lib/protocol.js +47 -0
- package/host/dist/lib/sdk-types.d.ts +46 -0
- package/host/dist/lib/sdk-types.d.ts.map +1 -0
- package/host/dist/lib/settings.d.ts +70 -0
- package/host/dist/lib/settings.d.ts.map +1 -0
- package/host/dist/lib/signalingUrl.d.ts +28 -0
- package/host/dist/lib/signalingUrl.d.ts.map +1 -0
- package/host/dist/lib/theme.d.ts +4 -0
- package/host/dist/lib/theme.d.ts.map +1 -0
- package/host/dist/lib/themeMode.d.ts +9 -0
- package/host/dist/lib/themeMode.d.ts.map +1 -0
- package/host/dist/lib/tokens.d.ts +64 -0
- package/host/dist/lib/tokens.d.ts.map +1 -0
- package/host/dist/mountHost.d.ts +36 -0
- package/host/dist/mountHost.d.ts.map +1 -0
- package/package.json +79 -11
- package/reachy-mini-sdk.js +0 -2013
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../animation/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAsB,MAAM,CAAC,MAAM,CAAC;IAChE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACV,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACV,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACV,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;CACb,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA8B,MAAM,CAAC,MAAM,CAAC;IACtE,CAAC,MAAM,EAAE,MAAM;CAClB,CAA8B,CAAC;AAEhC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAW,CAAC,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAmB,MAAM,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,mBAAoD;IAC1D,QAAQ,EAAE,iBAAkE;IAC5E,QAAQ,EAAE,iBAAiB;CAC9B,CAAC,CAAC;AAyBH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAmC,MAAM,CAAC,MAAM,CAAC;IACxF,iBAAiB,EAAE,KAAK;IACxB,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE,GAAG;CACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exit-handler helpers.
|
|
3
|
+
*
|
|
4
|
+
* Two thin convenience functions on top of the SDK's existing motion
|
|
5
|
+
* primitives (`setMotorMode`, `gotoTarget`) + the lib's pose math
|
|
6
|
+
* (`scaledDuration`). They exist so that:
|
|
7
|
+
*
|
|
8
|
+
* 1. App authors get a one-liner for the "return to safe pose on
|
|
9
|
+
* exit" pattern instead of copy-pasting the three-call sequence.
|
|
10
|
+
* 2. The pattern is consistent across apps (same target, same
|
|
11
|
+
* scaled-duration tuning, same error handling for closed
|
|
12
|
+
* channels).
|
|
13
|
+
*
|
|
14
|
+
* No daemon-side primitive is introduced; everything routes through
|
|
15
|
+
* existing data-channel commands.
|
|
16
|
+
*/
|
|
17
|
+
import type { PartialPose } from "./pose.js";
|
|
18
|
+
import { type ScaledDurationPreset } from "./presets.js";
|
|
19
|
+
import { type ScaledDurationResult } from "./distance.js";
|
|
20
|
+
import type { ReachyMiniInstance } from "../lib/types.js";
|
|
21
|
+
/** Options for `safelyReturnToPose`. */
|
|
22
|
+
export interface SafelyReturnOptions {
|
|
23
|
+
/** Where to return to. Defaults to `INIT_POSE`. */
|
|
24
|
+
target?: PartialPose;
|
|
25
|
+
/** Scaled-duration tuning. Defaults to `DEFAULT_SCALED_DURATION_PRESET`. */
|
|
26
|
+
preset?: ScaledDurationPreset;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Smooth, distance-scaled return to a target pose. Routes through the
|
|
30
|
+
* existing SDK primitives:
|
|
31
|
+
*
|
|
32
|
+
* 1. `reachy.setMotorMode("enabled")` — safe by construction since
|
|
33
|
+
* daemon PR #1138 (the daemon pins all targets to the present
|
|
34
|
+
* pose before flipping torque on).
|
|
35
|
+
* 2. Read `reachy.robotState` for the current pose snapshot.
|
|
36
|
+
* 3. Compute `scaledDuration(current, target, preset)`.
|
|
37
|
+
* 4. Call `reachy.gotoTarget({ ...target, duration })`.
|
|
38
|
+
*
|
|
39
|
+
* Returns **synchronously after dispatching** the goto — does NOT
|
|
40
|
+
* await completion. Callers who want to await the move should
|
|
41
|
+
* subscribe to the `state` event or
|
|
42
|
+
* `await sleep(result.duration * 1000)`.
|
|
43
|
+
*
|
|
44
|
+
* Safe to call when the data channel is closed: every SDK call
|
|
45
|
+
* swallows the "channel closed" error silently, and the planned
|
|
46
|
+
* duration is still returned for log lines.
|
|
47
|
+
*
|
|
48
|
+
* The returned `ScaledDurationResult` carries the diagnostic data
|
|
49
|
+
* (which channel was the slowest, per-channel candidate durations)
|
|
50
|
+
* so apps can log "why does the home return take 1.2 s?".
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Host-shell embedded app:
|
|
54
|
+
* onLeave(() => safelyReturnToPose(reachy));
|
|
55
|
+
*
|
|
56
|
+
* // Custom target:
|
|
57
|
+
* safelyReturnToPose(reachy, {
|
|
58
|
+
* target: { head: customHeadMatrix, antennas: [0, 0], body_yaw: 0 },
|
|
59
|
+
* });
|
|
60
|
+
*/
|
|
61
|
+
export declare function safelyReturnToPose(reachy: ReachyMiniInstance, options?: SafelyReturnOptions): ScaledDurationResult;
|
|
62
|
+
/** Options for `installShutdownHandler`. */
|
|
63
|
+
export interface InstallShutdownHandlerOptions extends SafelyReturnOptions {
|
|
64
|
+
/**
|
|
65
|
+
* Skip when `reachy.state !== "streaming"`. Defaults to `true` —
|
|
66
|
+
* the handler only fires when a session is actually live, so a
|
|
67
|
+
* stale tab where the user never picked a robot doesn't try to
|
|
68
|
+
* command anything on close.
|
|
69
|
+
*/
|
|
70
|
+
onlyWhenStreaming?: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Wire `pagehide` + `beforeunload` so the robot returns to its safe-rest
|
|
74
|
+
* pose when the app closes.
|
|
75
|
+
*
|
|
76
|
+
* Use case: **standalone apps** (test benches, custom dashboards)
|
|
77
|
+
* that don't have a host shell to manage their lifecycle. Host-shell
|
|
78
|
+
* embedded apps should use the `onLeave` callback from
|
|
79
|
+
* `connectToHost()` instead — it integrates with the host's
|
|
80
|
+
* leave-protocol budget and avoids double-firing.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* const reachy = new ReachyMini(...);
|
|
84
|
+
* await reachy.authenticate();
|
|
85
|
+
* await reachy.connect();
|
|
86
|
+
* // ...pick robot, startSession...
|
|
87
|
+
* installShutdownHandler(reachy);
|
|
88
|
+
*/
|
|
89
|
+
export declare function installShutdownHandler(reachy: ReachyMiniInstance, options?: InstallShutdownHandlerOptions): void;
|
|
90
|
+
//# sourceMappingURL=safe-return.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-return.d.ts","sourceRoot":"","sources":["../../animation/safe-return.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAGH,KAAK,oBAAoB,EAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAChC,mDAAmD;IACnD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,kBAAkB,CAC9B,MAAM,EAAE,kBAAkB,EAC1B,OAAO,GAAE,mBAAwB,GAClC,oBAAoB,CA+BtB;AAED,4CAA4C;AAC5C,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACtE;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAClC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,GAAE,6BAAkC,GAC5C,IAAI,CAoBN"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exit-handler helpers.
|
|
3
|
+
*
|
|
4
|
+
* Two thin convenience functions on top of the SDK's existing motion
|
|
5
|
+
* primitives (`setMotorMode`, `gotoTarget`) + the lib's pose math
|
|
6
|
+
* (`scaledDuration`). They exist so that:
|
|
7
|
+
*
|
|
8
|
+
* 1. App authors get a one-liner for the "return to safe pose on
|
|
9
|
+
* exit" pattern instead of copy-pasting the three-call sequence.
|
|
10
|
+
* 2. The pattern is consistent across apps (same target, same
|
|
11
|
+
* scaled-duration tuning, same error handling for closed
|
|
12
|
+
* channels).
|
|
13
|
+
*
|
|
14
|
+
* No daemon-side primitive is introduced; everything routes through
|
|
15
|
+
* existing data-channel commands.
|
|
16
|
+
*/
|
|
17
|
+
import { DEFAULT_SCALED_DURATION_PRESET, INIT_POSE, } from "./presets.js";
|
|
18
|
+
import { scaledDuration } from "./distance.js";
|
|
19
|
+
/**
|
|
20
|
+
* Smooth, distance-scaled return to a target pose. Routes through the
|
|
21
|
+
* existing SDK primitives:
|
|
22
|
+
*
|
|
23
|
+
* 1. `reachy.setMotorMode("enabled")` — safe by construction since
|
|
24
|
+
* daemon PR #1138 (the daemon pins all targets to the present
|
|
25
|
+
* pose before flipping torque on).
|
|
26
|
+
* 2. Read `reachy.robotState` for the current pose snapshot.
|
|
27
|
+
* 3. Compute `scaledDuration(current, target, preset)`.
|
|
28
|
+
* 4. Call `reachy.gotoTarget({ ...target, duration })`.
|
|
29
|
+
*
|
|
30
|
+
* Returns **synchronously after dispatching** the goto — does NOT
|
|
31
|
+
* await completion. Callers who want to await the move should
|
|
32
|
+
* subscribe to the `state` event or
|
|
33
|
+
* `await sleep(result.duration * 1000)`.
|
|
34
|
+
*
|
|
35
|
+
* Safe to call when the data channel is closed: every SDK call
|
|
36
|
+
* swallows the "channel closed" error silently, and the planned
|
|
37
|
+
* duration is still returned for log lines.
|
|
38
|
+
*
|
|
39
|
+
* The returned `ScaledDurationResult` carries the diagnostic data
|
|
40
|
+
* (which channel was the slowest, per-channel candidate durations)
|
|
41
|
+
* so apps can log "why does the home return take 1.2 s?".
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Host-shell embedded app:
|
|
45
|
+
* onLeave(() => safelyReturnToPose(reachy));
|
|
46
|
+
*
|
|
47
|
+
* // Custom target:
|
|
48
|
+
* safelyReturnToPose(reachy, {
|
|
49
|
+
* target: { head: customHeadMatrix, antennas: [0, 0], body_yaw: 0 },
|
|
50
|
+
* });
|
|
51
|
+
*/
|
|
52
|
+
export function safelyReturnToPose(reachy, options = {}) {
|
|
53
|
+
const target = options.target ?? INIT_POSE;
|
|
54
|
+
const preset = options.preset ?? DEFAULT_SCALED_DURATION_PRESET;
|
|
55
|
+
try {
|
|
56
|
+
reachy.setMotorMode("enabled");
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Already in the right mode, or data channel closed; both are
|
|
60
|
+
// benign here — we still compute and emit the goto.
|
|
61
|
+
}
|
|
62
|
+
const current = reachy.robotState;
|
|
63
|
+
const plan = scaledDuration(current, target, preset);
|
|
64
|
+
const args = {
|
|
65
|
+
duration: plan.duration,
|
|
66
|
+
};
|
|
67
|
+
if (target.head !== undefined)
|
|
68
|
+
args.head = target.head.slice();
|
|
69
|
+
if (target.antennas !== undefined) {
|
|
70
|
+
args.antennas = [target.antennas[0] ?? 0, target.antennas[1] ?? 0];
|
|
71
|
+
}
|
|
72
|
+
if (target.body_yaw !== undefined)
|
|
73
|
+
args.body_yaw = target.body_yaw;
|
|
74
|
+
try {
|
|
75
|
+
reachy.gotoTarget(args);
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
// Closed channel / shutting down / session torn down between
|
|
79
|
+
// the read and the send. The plan is still useful for logs.
|
|
80
|
+
}
|
|
81
|
+
return plan;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Wire `pagehide` + `beforeunload` so the robot returns to its safe-rest
|
|
85
|
+
* pose when the app closes.
|
|
86
|
+
*
|
|
87
|
+
* Use case: **standalone apps** (test benches, custom dashboards)
|
|
88
|
+
* that don't have a host shell to manage their lifecycle. Host-shell
|
|
89
|
+
* embedded apps should use the `onLeave` callback from
|
|
90
|
+
* `connectToHost()` instead — it integrates with the host's
|
|
91
|
+
* leave-protocol budget and avoids double-firing.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* const reachy = new ReachyMini(...);
|
|
95
|
+
* await reachy.authenticate();
|
|
96
|
+
* await reachy.connect();
|
|
97
|
+
* // ...pick robot, startSession...
|
|
98
|
+
* installShutdownHandler(reachy);
|
|
99
|
+
*/
|
|
100
|
+
export function installShutdownHandler(reachy, options = {}) {
|
|
101
|
+
const onlyWhenStreaming = options.onlyWhenStreaming ?? true;
|
|
102
|
+
// Reentry guard: `pagehide` and `beforeunload` both fire on a real
|
|
103
|
+
// tab close, so without this flag `safelyReturnToPose` would dispatch
|
|
104
|
+
// twice (idempotent in practice — the second goto overrides the first
|
|
105
|
+
// with the same duration — but wasteful and noisy in the daemon log).
|
|
106
|
+
// Matches the `shuttingDown` boolean in Rémi's `reachy-mini-js-practices`
|
|
107
|
+
// bench, which is the reference behaviour for this helper.
|
|
108
|
+
let shuttingDown = false;
|
|
109
|
+
const fire = () => {
|
|
110
|
+
if (shuttingDown)
|
|
111
|
+
return;
|
|
112
|
+
shuttingDown = true;
|
|
113
|
+
if (onlyWhenStreaming && reachy.state !== "streaming")
|
|
114
|
+
return;
|
|
115
|
+
safelyReturnToPose(reachy, {
|
|
116
|
+
target: options.target,
|
|
117
|
+
preset: options.preset,
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
window.addEventListener("pagehide", fire);
|
|
121
|
+
window.addEventListener("beforeunload", fire);
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=safe-return.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-return.js","sourceRoot":"","sources":["../../animation/safe-return.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GA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6DAA6D;QAC7D,4DAA4D;IAChE,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAaD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,sBAAsB,CAClC,MAA0B,EAC1B,UAAyC,EAAE;IAE3C,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,IAAI,IAAI,CAAC;IAC5D,mEAAmE;IACnE,sEAAsE;IACtE,sEAAsE;IACtE,sEAAsE;IACtE,0EAA0E;IAC1E,2DAA2D;IAC3D,IAAI,YAAY,GAAG,KAAK,CAAC;IACzB,MAAM,IAAI,GAAG,GAAS,EAAE;QACpB,IAAI,YAAY;YAAE,OAAO;QACzB,YAAY,GAAG,IAAI,CAAC;QACpB,IAAI,iBAAiB,IAAI,MAAM,CAAC,KAAK,KAAK,WAAW;YAAE,OAAO;QAC9D,kBAAkB,CAAC,MAAM,EAAE;YACvB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,OAAO,CAAC,MAAM;SACzB,CAAC,CAAC;IACP,CAAC,CAAC;IACF,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Math utilities for the ReachyMini SDK.
|
|
3
|
+
*
|
|
4
|
+
* These are the canonical conversions between human-readable
|
|
5
|
+
* roll/pitch/yaw degrees and the wire format the daemon expects
|
|
6
|
+
* (4×4 rotation matrices, ZYX convention).
|
|
7
|
+
*/
|
|
8
|
+
export declare function degToRad(deg: number): number;
|
|
9
|
+
export declare function radToDeg(rad: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Roll/pitch/yaw (degrees) → 4×4 rotation matrix (ZYX convention).
|
|
12
|
+
* This is the wire format for the robot's `set_target` command.
|
|
13
|
+
*/
|
|
14
|
+
export declare function rpyToMatrix(rollDeg: number, pitchDeg: number, yawDeg: number): number[][];
|
|
15
|
+
/**
|
|
16
|
+
* Rotation matrix (3×3 or 4×4) → { roll, pitch, yaw } in degrees.
|
|
17
|
+
*/
|
|
18
|
+
export declare function matrixToRpy(m: number[][]): {
|
|
19
|
+
roll: number;
|
|
20
|
+
pitch: number;
|
|
21
|
+
yaw: number;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../lib/math.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACvB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACf,MAAM,EAAE,EAAE,CAWZ;AAED;;GAEG;AACH,wBAAgB,WAAW,CACvB,CAAC,EAAE,MAAM,EAAE,EAAE,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAM9C"}
|
package/dist/lib/math.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Math utilities for the ReachyMini SDK.
|
|
3
|
+
*
|
|
4
|
+
* These are the canonical conversions between human-readable
|
|
5
|
+
* roll/pitch/yaw degrees and the wire format the daemon expects
|
|
6
|
+
* (4×4 rotation matrices, ZYX convention).
|
|
7
|
+
*/
|
|
8
|
+
export function degToRad(deg) {
|
|
9
|
+
return deg * Math.PI / 180;
|
|
10
|
+
}
|
|
11
|
+
export function radToDeg(rad) {
|
|
12
|
+
return rad * 180 / Math.PI;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Roll/pitch/yaw (degrees) → 4×4 rotation matrix (ZYX convention).
|
|
16
|
+
* This is the wire format for the robot's `set_target` command.
|
|
17
|
+
*/
|
|
18
|
+
export function rpyToMatrix(rollDeg, pitchDeg, yawDeg) {
|
|
19
|
+
const r = degToRad(rollDeg), p = degToRad(pitchDeg), y = degToRad(yawDeg);
|
|
20
|
+
const cy = Math.cos(y), sy = Math.sin(y);
|
|
21
|
+
const cp = Math.cos(p), sp = Math.sin(p);
|
|
22
|
+
const cr = Math.cos(r), sr = Math.sin(r);
|
|
23
|
+
return [
|
|
24
|
+
[cy * cp, cy * sp * sr - sy * cr, cy * sp * cr + sy * sr, 0],
|
|
25
|
+
[sy * cp, sy * sp * sr + cy * cr, sy * sp * cr - cy * sr, 0],
|
|
26
|
+
[-sp, cp * sr, cp * cr, 0],
|
|
27
|
+
[0, 0, 0, 1],
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Rotation matrix (3×3 or 4×4) → { roll, pitch, yaw } in degrees.
|
|
32
|
+
*/
|
|
33
|
+
export function matrixToRpy(m) {
|
|
34
|
+
return {
|
|
35
|
+
roll: radToDeg(Math.atan2(m[2][1], m[2][2])),
|
|
36
|
+
pitch: radToDeg(Math.asin(-m[2][0])),
|
|
37
|
+
yaw: radToDeg(Math.atan2(m[1][0], m[0][0])),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.js","sourceRoot":"","sources":["../../lib/math.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,UAAU,QAAQ,CAAC,GAAW;IAChC,OAAO,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAW;IAChC,OAAO,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC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C,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC;QAChD,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC;QACtC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC;KAClD,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReachyMini — Browser SDK for controlling a Reachy Mini robot over WebRTC.
|
|
3
|
+
* See `../reachy-mini-sdk.ts` for the package's barrel and the README for
|
|
4
|
+
* a quick-start guide.
|
|
5
|
+
*/
|
|
6
|
+
import type { ApplyAudioConfigOptions, AudioConfigEntry, AutoConnectOptions, AutoConnectResult, MotionAwaitOptions, MoveData, PlayMoveOptions, PlayMoveResult, PlayUploadedAudioOptions, ReachyMiniInstance, ReachyMiniOptions, RobotInfo, RobotState, SubscribeLogsOptions, UploadAudioOptions } from './types.js';
|
|
7
|
+
export declare class ReachyMini extends EventTarget implements ReachyMiniInstance {
|
|
8
|
+
private readonly _signalingUrl;
|
|
9
|
+
private readonly _clientId;
|
|
10
|
+
private readonly _appName;
|
|
11
|
+
private readonly _videoJitterBufferTargetMs;
|
|
12
|
+
private _autoStartFromUrl;
|
|
13
|
+
private _autoStartAttempted;
|
|
14
|
+
private _state;
|
|
15
|
+
private _robots;
|
|
16
|
+
private _robotState;
|
|
17
|
+
private readonly _preselectedRobotId;
|
|
18
|
+
private _token;
|
|
19
|
+
private _username;
|
|
20
|
+
private _tokenExpires;
|
|
21
|
+
private _sseAbortController;
|
|
22
|
+
_pc: RTCPeerConnection | null;
|
|
23
|
+
private _dc;
|
|
24
|
+
private _sessionId;
|
|
25
|
+
private _selectedRobotId;
|
|
26
|
+
private _pendingRemoteIce;
|
|
27
|
+
_micStream: MediaStream | null;
|
|
28
|
+
private _micMuted;
|
|
29
|
+
private _audioMuted;
|
|
30
|
+
private _micSupported;
|
|
31
|
+
private _latencyMonitorId;
|
|
32
|
+
private _stateRefreshInterval;
|
|
33
|
+
private _versionResolve;
|
|
34
|
+
private _hardwareIdResolve;
|
|
35
|
+
private _volumeResolve;
|
|
36
|
+
private _micVolumeResolve;
|
|
37
|
+
private _applyAudioConfigResolve;
|
|
38
|
+
private _readAudioParameterResolve;
|
|
39
|
+
private readonly _logSubscribers;
|
|
40
|
+
private _broadcastWaiters;
|
|
41
|
+
private _activeMoveUploadId;
|
|
42
|
+
private _activeAudioUploadId;
|
|
43
|
+
private _sessionResolve;
|
|
44
|
+
private _sessionReject;
|
|
45
|
+
private _iceConnected;
|
|
46
|
+
private _dcOpen;
|
|
47
|
+
private readonly _pendingMotionCompletions;
|
|
48
|
+
private _videoElement;
|
|
49
|
+
constructor(options?: ReachyMiniOptions);
|
|
50
|
+
get state(): 'disconnected' | 'connected' | 'streaming';
|
|
51
|
+
get robots(): RobotInfo[];
|
|
52
|
+
get robotState(): RobotState;
|
|
53
|
+
get username(): string | null;
|
|
54
|
+
get isAuthenticated(): boolean;
|
|
55
|
+
get micSupported(): boolean;
|
|
56
|
+
get micMuted(): boolean;
|
|
57
|
+
get audioMuted(): boolean;
|
|
58
|
+
get preselectedRobotId(): string | null;
|
|
59
|
+
get isEmbedded(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Internal: try to honour the `autoStartFromUrl` constructor
|
|
62
|
+
* option. Called from the signaling-message handler after every
|
|
63
|
+
* `robotsChanged` emit, so a robot that comes online after the
|
|
64
|
+
* SDK is already `connected` still triggers the auto-start.
|
|
65
|
+
*/
|
|
66
|
+
_maybeAutoStart(): void;
|
|
67
|
+
authenticate(): Promise<boolean>;
|
|
68
|
+
login(): Promise<void>;
|
|
69
|
+
logout(): void;
|
|
70
|
+
connect(token?: string): Promise<void>;
|
|
71
|
+
autoConnect(options?: AutoConnectOptions): Promise<AutoConnectResult>;
|
|
72
|
+
private _fetchOwnedRobots;
|
|
73
|
+
private _waitForRobotInList;
|
|
74
|
+
startSession(robotId: string): Promise<void>;
|
|
75
|
+
private _failSessionRejected;
|
|
76
|
+
stopSession(): Promise<void>;
|
|
77
|
+
disconnect(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Atomic raw-units pose update over the data channel. Channels you
|
|
80
|
+
* omit are held at their last commanded value (per-axis, independent).
|
|
81
|
+
*
|
|
82
|
+
* **Head pose is in the WORLD frame.** The daemon's IK splits the
|
|
83
|
+
* requested head world-yaw between body rotation and the stewart
|
|
84
|
+
* platform, subject to the mechanical limit
|
|
85
|
+
* `|head_yaw_world − body_yaw| ≤ 65°`.
|
|
86
|
+
*
|
|
87
|
+
* **If you want the head to FOLLOW the body** (tank-style rotation):
|
|
88
|
+
* a `setTarget({ body_yaw })` on its own does NOT rotate the head —
|
|
89
|
+
* the head's commanded world yaw is unchanged, so its gaze stays
|
|
90
|
+
* pinned in world frame while the body turns under it. To make the
|
|
91
|
+
* head turn with the body, include a `head` matrix in the SAME call
|
|
92
|
+
* with the body-yaw delta added to the head RPY's yaw:
|
|
93
|
+
*
|
|
94
|
+
* ```ts
|
|
95
|
+
* // Body-yaw drag handler: tank-couple the head so it follows.
|
|
96
|
+
* const delta = newBodyDeg - lastCommandedBodyDeg;
|
|
97
|
+
* const nextHeadYaw = lastCommandedHeadYawDeg + delta;
|
|
98
|
+
* robot.setTarget({
|
|
99
|
+
* head: rpyToMatrix(headRoll, headPitch, nextHeadYaw).flat(),
|
|
100
|
+
* body_yaw: degToRad(newBodyDeg),
|
|
101
|
+
* });
|
|
102
|
+
* lastCommandedHeadYawDeg = nextHeadYaw;
|
|
103
|
+
* lastCommandedBodyDeg = newBodyDeg;
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* **Baseline must be the last COMMANDED value, not telemetry.** For
|
|
107
|
+
* continuous-input controllers (slider drag, joystick), do not use
|
|
108
|
+
* `state.head` from the `state` event as the baseline for incremental
|
|
109
|
+
* commands — telemetry lags one WebRTC round-trip, so cumulative
|
|
110
|
+
* deltas computed against it stall (every iteration in a rapid drag
|
|
111
|
+
* adds the same `delta` to the same stale baseline → the head fails
|
|
112
|
+
* to keep up). Track the last-commanded RPY in your own buffer.
|
|
113
|
+
*
|
|
114
|
+
* @param head Flat row-major 4×4 matrix (16 finite numbers) in
|
|
115
|
+
* the world frame. Omit to hold the previous head target.
|
|
116
|
+
* @param antennas `[rightRad, leftRad]` (radians). Omit to hold.
|
|
117
|
+
* @param body_yaw Signed radians. Omit to hold.
|
|
118
|
+
* @returns `true` if the command was queued on the data channel,
|
|
119
|
+
* `false` if the channel is not open.
|
|
120
|
+
*/
|
|
121
|
+
setTarget({ head, antennas, body_yaw }?: {
|
|
122
|
+
head?: number[];
|
|
123
|
+
antennas?: number[];
|
|
124
|
+
body_yaw?: number;
|
|
125
|
+
}): boolean;
|
|
126
|
+
gotoTarget({ head, antennas, body_yaw, duration }: {
|
|
127
|
+
head?: number[];
|
|
128
|
+
antennas?: number[];
|
|
129
|
+
body_yaw?: number;
|
|
130
|
+
duration: number;
|
|
131
|
+
}): boolean;
|
|
132
|
+
setHeadRpyDeg(rollDeg: number, pitchDeg: number, yawDeg: number): boolean;
|
|
133
|
+
setAntennasDeg(rightDeg: number, leftDeg: number): boolean;
|
|
134
|
+
setBodyYawDeg(yawDeg: number): boolean;
|
|
135
|
+
playSound(file: string): boolean;
|
|
136
|
+
setMotorMode(mode: 'enabled' | 'disabled' | 'gravity_compensation'): boolean;
|
|
137
|
+
setMotorTorque(on: boolean, ids?: string[] | null): boolean;
|
|
138
|
+
wakeUp({ timeoutMs }?: MotionAwaitOptions): Promise<void>;
|
|
139
|
+
gotoSleep({ timeoutMs }?: MotionAwaitOptions): Promise<void>;
|
|
140
|
+
private _sendCommandAwaitCompletion;
|
|
141
|
+
private _rejectPendingMotionCompletions;
|
|
142
|
+
isAwake(): boolean;
|
|
143
|
+
ensureAwake(timeoutMs?: number): Promise<boolean>;
|
|
144
|
+
getVersion(): Promise<string | null>;
|
|
145
|
+
getHardwareId(): Promise<string | null>;
|
|
146
|
+
getVolume(): Promise<number | null>;
|
|
147
|
+
setVolume(volume: number): Promise<number | null>;
|
|
148
|
+
getMicrophoneVolume(): Promise<number | null>;
|
|
149
|
+
setMicrophoneVolume(volume: number): Promise<number | null>;
|
|
150
|
+
applyAudioConfig(config: AudioConfigEntry[], { verify }?: ApplyAudioConfigOptions): Promise<boolean>;
|
|
151
|
+
readAudioParameter(name: string): Promise<number[] | null>;
|
|
152
|
+
/**
|
|
153
|
+
* Internal: send a command and await the matching daemon response in a
|
|
154
|
+
* named single-resolver slot. Used by the volume helpers and the
|
|
155
|
+
* XVF3800 audio-config helpers — every one of them has a strict
|
|
156
|
+
* request/response shape where a single in-flight call per slot is
|
|
157
|
+
* sufficient. If a previous request on the same slot is still
|
|
158
|
+
* pending when a new one comes in, the older promise is resolved to
|
|
159
|
+
* `null` so its caller doesn't hang forever.
|
|
160
|
+
*
|
|
161
|
+
* Slot access is passed in as getter/setter closures rather than a
|
|
162
|
+
* key into `this`: that keeps the helper fully generic-checked (T is
|
|
163
|
+
* inferred from the slot's resolver type at each call site) with no
|
|
164
|
+
* indexed-property casts.
|
|
165
|
+
*/
|
|
166
|
+
private _slotRoundtrip;
|
|
167
|
+
sendRaw(data: unknown): boolean;
|
|
168
|
+
subscribeLogs({ onLine, onError }: SubscribeLogsOptions): () => void;
|
|
169
|
+
requestState(): boolean;
|
|
170
|
+
setAudioMuted(muted: boolean): void;
|
|
171
|
+
setMicMuted(muted: boolean): void;
|
|
172
|
+
attachVideo(videoElement: HTMLVideoElement): () => void;
|
|
173
|
+
playMove(motion: MoveData, { audioBlob, audioLeadMs, description, encoding, playFrequency, initialGotoDuration, startTimeoutMs, onProgress, onStarted, }?: PlayMoveOptions): Promise<PlayMoveResult>;
|
|
174
|
+
cancelMove(uploadId?: string | null): boolean;
|
|
175
|
+
uploadAudio(audioBlob: Blob, { description, onProgress }?: UploadAudioOptions): Promise<string>;
|
|
176
|
+
playUploadedAudio(uploadId: string, { timeoutMs }?: PlayUploadedAudioOptions): Promise<{
|
|
177
|
+
started: true;
|
|
178
|
+
}>;
|
|
179
|
+
cancelAudio(uploadId?: string | null): boolean;
|
|
180
|
+
private _emit;
|
|
181
|
+
private _waitForBroadcast;
|
|
182
|
+
private _awaitDataChannelDrain;
|
|
183
|
+
private _sendToServer;
|
|
184
|
+
private _sendCommand;
|
|
185
|
+
private _checkSessionReady;
|
|
186
|
+
private _handleSignalingMessage;
|
|
187
|
+
private _handleEndSession;
|
|
188
|
+
private _handlePeerMessage;
|
|
189
|
+
private _handleRobotMessage;
|
|
190
|
+
/** Snap video playback to live edge if buffered lag exceeds 0.5 s. */
|
|
191
|
+
private _startLatencyMonitor;
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=reachy-mini.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reachy-mini.d.ts","sourceRoot":"","sources":["../../lib/reachy-mini.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuBH,OAAO,KAAK,EACR,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EAEjB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,cAAc,EACd,wBAAwB,EAExB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,UAAU,EAEV,oBAAoB,EACpB,kBAAkB,EACrB,MAAM,YAAY,CAAC;AA0CpB,qBAAa,UAAW,SAAQ,WAAY,YAAW,kBAAkB;IAGrE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,0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