@wandelbots/nova-js 3.2.0-pr.dev-e2e-jogging-test.143.34230ab → 3.2.0-pr.feat-v2.155.e91b019
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 +60 -50
- package/dist/{AutoReconnectingWebsocket-BI1ckzP8.d.ts → AutoReconnectingWebsocket-CoU4ZyD2.d.cts} +1 -3
- package/dist/AutoReconnectingWebsocket-CoU4ZyD2.d.cts.map +1 -0
- package/dist/{AutoReconnectingWebsocket-Cr7f9016.d.cts → AutoReconnectingWebsocket-D0gTrkzu.d.ts} +1 -3
- package/dist/AutoReconnectingWebsocket-D0gTrkzu.d.ts.map +1 -0
- package/dist/{LoginWithAuth0-0g0wWRUC.js → LoginWithAuth0-CaX7yo7d.js} +58 -5
- package/dist/LoginWithAuth0-CaX7yo7d.js.map +1 -0
- package/dist/{LoginWithAuth0-C82OCyDy.cjs → LoginWithAuth0-DaPnTz2I.cjs} +99 -4
- package/dist/LoginWithAuth0-DaPnTz2I.cjs.map +1 -0
- package/dist/index.cjs +11 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +11 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/v1/index.cjs +17 -19
- package/dist/lib/v1/index.cjs.map +1 -1
- package/dist/lib/v1/index.d.cts +4 -2
- package/dist/lib/v1/index.d.cts.map +1 -1
- package/dist/lib/v1/index.d.ts +4 -2
- package/dist/lib/v1/index.d.ts.map +1 -1
- package/dist/lib/v1/index.js +7 -10
- package/dist/lib/v1/index.js.map +1 -1
- package/dist/lib/v2/index.cjs +1087 -11
- package/dist/lib/v2/index.cjs.map +1 -1
- package/dist/lib/v2/index.d.cts +256 -7
- package/dist/lib/v2/index.d.cts.map +1 -1
- package/dist/lib/v2/index.d.ts +256 -7
- package/dist/lib/v2/index.d.ts.map +1 -1
- package/dist/lib/v2/index.js +1082 -12
- package/dist/lib/v2/index.js.map +1 -1
- package/dist/wandelscriptUtils-CO5GYRij.js +24 -0
- package/dist/wandelscriptUtils-CO5GYRij.js.map +1 -0
- package/dist/wandelscriptUtils-COHpTIme.d.cts +12 -0
- package/dist/wandelscriptUtils-COHpTIme.d.cts.map +1 -0
- package/dist/wandelscriptUtils-Cl3GBxOp.d.ts +12 -0
- package/dist/wandelscriptUtils-Cl3GBxOp.d.ts.map +1 -0
- package/dist/wandelscriptUtils-DwpJ4jCy.cjs +30 -0
- package/dist/wandelscriptUtils-DwpJ4jCy.cjs.map +1 -0
- package/package.json +2 -2
- package/src/LoginWithAuth0.ts +3 -3
- package/src/index.ts +1 -0
- package/src/lib/converters.ts +5 -23
- package/src/lib/v1/MotionStreamConnection.ts +1 -1
- package/src/lib/v1/NovaClient.ts +6 -0
- package/src/lib/v1/index.ts +6 -0
- package/src/lib/v1/mock/MockNovaInstance.ts +0 -1
- package/src/lib/v1/wandelscriptUtils.ts +22 -0
- package/src/lib/v2/ConnectedMotionGroup.ts +415 -0
- package/src/lib/v2/JoggerConnection.ts +647 -0
- package/src/lib/v2/MotionStreamConnection.ts +222 -0
- package/src/lib/v2/NovaClient.ts +43 -8
- package/src/lib/v2/index.ts +5 -0
- package/src/lib/v2/mock/MockNovaInstance.ts +385 -1
- package/src/lib/v2/motionStateUpdate.ts +76 -0
- package/src/lib/v2/types/vector3.ts +1 -0
- package/src/lib/v2/wandelscriptUtils.ts +27 -0
- package/dist/AutoReconnectingWebsocket-BI1ckzP8.d.ts.map +0 -1
- package/dist/AutoReconnectingWebsocket-Cr7f9016.d.cts.map +0 -1
- package/dist/LoginWithAuth0-0g0wWRUC.js.map +0 -1
- package/dist/LoginWithAuth0-C82OCyDy.cjs.map +0 -1
- package/dist/converters-DP2EIVv6.cjs +0 -108
- package/dist/converters-DP2EIVv6.cjs.map +0 -1
- package/dist/converters-DY6Lf7mb.js +0 -66
- package/dist/converters-DY6Lf7mb.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"converters-DP2EIVv6.cjs","names":[],"sources":["../src/lib/converters.ts"],"sourcesContent":["import type { Pose } from \"@wandelbots/nova-api/v1\"\n\n/** Try to parse something as JSON; return undefined if we can't */\n// biome-ignore lint/suspicious/noExplicitAny: it's json\nexport function tryParseJson(json: unknown): any {\n try {\n return JSON.parse(json as string)\n } catch {\n return undefined\n }\n}\n\n/** Try to turn something into JSON; return undefined if we can't */\nexport function tryStringifyJson(json: unknown): string | undefined {\n try {\n return JSON.stringify(json)\n } catch {\n return undefined\n }\n}\n\n/**\n * Converts object parameters to query string.\n * e.g. { a: \"1\", b: \"2\" } => \"?a=1&b=2\"\n * {} => \"\"\n */\nexport function makeUrlQueryString(obj: Record<string, string>): string {\n const str = new URLSearchParams(obj).toString()\n return str ? `?${str}` : \"\"\n}\n\n/** Convert radians to degrees */\nexport function radiansToDegrees(radians: number): number {\n return radians * (180 / Math.PI)\n}\n\n/** Convert degrees to radians */\nexport function degreesToRadians(degrees: number): number {\n return degrees * (Math.PI / 180)\n}\n\n/**\n * Convert a Pose object representing a motion group position\n * into a string which represents that pose in Wandelscript.\n */\nexport function poseToWandelscriptString(\n pose: Pick<Pose, \"position\" | \"orientation\">,\n) {\n const position = [pose.position.x, pose.position.y, pose.position.z]\n const orientation = [\n pose.orientation?.x ?? 0,\n pose.orientation?.y ?? 0,\n pose.orientation?.z ?? 0,\n ]\n\n const positionValues = position.map((v) => v.toFixed(1))\n // Rotation needs more precision since it's in radians\n const rotationValues = orientation.map((v) => v.toFixed(4))\n\n return `(${positionValues.concat(rotationValues).join(\", \")})`\n}\n\n/**\n * Check for coordinate system id equivalence, accounting for the \"world\" default\n * on empty/undefined values.\n */\nexport function isSameCoordinateSystem(\n firstCoordSystem: string | undefined,\n secondCoordSystem: string | undefined,\n) {\n if (!firstCoordSystem) firstCoordSystem = \"world\"\n if (!secondCoordSystem) secondCoordSystem = \"world\"\n\n return firstCoordSystem === secondCoordSystem\n}\n"],"mappings":";;;AAIA,SAAgB,aAAa,MAAoB;AAC/C,KAAI;AACF,SAAO,KAAK,MAAM,KAAe;SAC3B;AACN;;;;AAKJ,SAAgB,iBAAiB,MAAmC;AAClE,KAAI;AACF,SAAO,KAAK,UAAU,KAAK;SACrB;AACN;;;;;;;;AASJ,SAAgB,mBAAmB,KAAqC;CACtE,MAAM,MAAM,IAAI,gBAAgB,IAAI,CAAC,UAAU;AAC/C,QAAO,MAAM,IAAI,QAAQ;;;AAI3B,SAAgB,iBAAiB,SAAyB;AACxD,QAAO,WAAW,MAAM,KAAK;;;AAI/B,SAAgB,iBAAiB,SAAyB;AACxD,QAAO,WAAW,KAAK,KAAK;;;;;;AAO9B,SAAgB,yBACd,MACA;CACA,MAAM,WAAW;EAAC,KAAK,SAAS;EAAG,KAAK,SAAS;EAAG,KAAK,SAAS;EAAE;CACpE,MAAM,cAAc;EAClB,KAAK,aAAa,KAAK;EACvB,KAAK,aAAa,KAAK;EACvB,KAAK,aAAa,KAAK;EACxB;CAED,MAAM,iBAAiB,SAAS,KAAK,MAAM,EAAE,QAAQ,EAAE,CAAC;CAExD,MAAM,iBAAiB,YAAY,KAAK,MAAM,EAAE,QAAQ,EAAE,CAAC;AAE3D,QAAO,IAAI,eAAe,OAAO,eAAe,CAAC,KAAK,KAAK,CAAC;;;;;;AAO9D,SAAgB,uBACd,kBACA,mBACA;AACA,KAAI,CAAC,iBAAkB,oBAAmB;AAC1C,KAAI,CAAC,kBAAmB,qBAAoB;AAE5C,QAAO,qBAAqB"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
//#region src/lib/converters.ts
|
|
2
|
-
/** Try to parse something as JSON; return undefined if we can't */
|
|
3
|
-
function tryParseJson(json) {
|
|
4
|
-
try {
|
|
5
|
-
return JSON.parse(json);
|
|
6
|
-
} catch {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
/** Try to turn something into JSON; return undefined if we can't */
|
|
11
|
-
function tryStringifyJson(json) {
|
|
12
|
-
try {
|
|
13
|
-
return JSON.stringify(json);
|
|
14
|
-
} catch {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Converts object parameters to query string.
|
|
20
|
-
* e.g. { a: "1", b: "2" } => "?a=1&b=2"
|
|
21
|
-
* {} => ""
|
|
22
|
-
*/
|
|
23
|
-
function makeUrlQueryString(obj) {
|
|
24
|
-
const str = new URLSearchParams(obj).toString();
|
|
25
|
-
return str ? `?${str}` : "";
|
|
26
|
-
}
|
|
27
|
-
/** Convert radians to degrees */
|
|
28
|
-
function radiansToDegrees(radians) {
|
|
29
|
-
return radians * (180 / Math.PI);
|
|
30
|
-
}
|
|
31
|
-
/** Convert degrees to radians */
|
|
32
|
-
function degreesToRadians(degrees) {
|
|
33
|
-
return degrees * (Math.PI / 180);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Convert a Pose object representing a motion group position
|
|
37
|
-
* into a string which represents that pose in Wandelscript.
|
|
38
|
-
*/
|
|
39
|
-
function poseToWandelscriptString(pose) {
|
|
40
|
-
const position = [
|
|
41
|
-
pose.position.x,
|
|
42
|
-
pose.position.y,
|
|
43
|
-
pose.position.z
|
|
44
|
-
];
|
|
45
|
-
const orientation = [
|
|
46
|
-
pose.orientation?.x ?? 0,
|
|
47
|
-
pose.orientation?.y ?? 0,
|
|
48
|
-
pose.orientation?.z ?? 0
|
|
49
|
-
];
|
|
50
|
-
const positionValues = position.map((v) => v.toFixed(1));
|
|
51
|
-
const rotationValues = orientation.map((v) => v.toFixed(4));
|
|
52
|
-
return `(${positionValues.concat(rotationValues).join(", ")})`;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Check for coordinate system id equivalence, accounting for the "world" default
|
|
56
|
-
* on empty/undefined values.
|
|
57
|
-
*/
|
|
58
|
-
function isSameCoordinateSystem(firstCoordSystem, secondCoordSystem) {
|
|
59
|
-
if (!firstCoordSystem) firstCoordSystem = "world";
|
|
60
|
-
if (!secondCoordSystem) secondCoordSystem = "world";
|
|
61
|
-
return firstCoordSystem === secondCoordSystem;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
//#endregion
|
|
65
|
-
export { degreesToRadians, isSameCoordinateSystem, makeUrlQueryString, poseToWandelscriptString, radiansToDegrees, tryParseJson, tryStringifyJson };
|
|
66
|
-
//# sourceMappingURL=converters-DY6Lf7mb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"converters-DY6Lf7mb.js","names":[],"sources":["../src/lib/converters.ts"],"sourcesContent":["import type { Pose } from \"@wandelbots/nova-api/v1\"\n\n/** Try to parse something as JSON; return undefined if we can't */\n// biome-ignore lint/suspicious/noExplicitAny: it's json\nexport function tryParseJson(json: unknown): any {\n try {\n return JSON.parse(json as string)\n } catch {\n return undefined\n }\n}\n\n/** Try to turn something into JSON; return undefined if we can't */\nexport function tryStringifyJson(json: unknown): string | undefined {\n try {\n return JSON.stringify(json)\n } catch {\n return undefined\n }\n}\n\n/**\n * Converts object parameters to query string.\n * e.g. { a: \"1\", b: \"2\" } => \"?a=1&b=2\"\n * {} => \"\"\n */\nexport function makeUrlQueryString(obj: Record<string, string>): string {\n const str = new URLSearchParams(obj).toString()\n return str ? `?${str}` : \"\"\n}\n\n/** Convert radians to degrees */\nexport function radiansToDegrees(radians: number): number {\n return radians * (180 / Math.PI)\n}\n\n/** Convert degrees to radians */\nexport function degreesToRadians(degrees: number): number {\n return degrees * (Math.PI / 180)\n}\n\n/**\n * Convert a Pose object representing a motion group position\n * into a string which represents that pose in Wandelscript.\n */\nexport function poseToWandelscriptString(\n pose: Pick<Pose, \"position\" | \"orientation\">,\n) {\n const position = [pose.position.x, pose.position.y, pose.position.z]\n const orientation = [\n pose.orientation?.x ?? 0,\n pose.orientation?.y ?? 0,\n pose.orientation?.z ?? 0,\n ]\n\n const positionValues = position.map((v) => v.toFixed(1))\n // Rotation needs more precision since it's in radians\n const rotationValues = orientation.map((v) => v.toFixed(4))\n\n return `(${positionValues.concat(rotationValues).join(\", \")})`\n}\n\n/**\n * Check for coordinate system id equivalence, accounting for the \"world\" default\n * on empty/undefined values.\n */\nexport function isSameCoordinateSystem(\n firstCoordSystem: string | undefined,\n secondCoordSystem: string | undefined,\n) {\n if (!firstCoordSystem) firstCoordSystem = \"world\"\n if (!secondCoordSystem) secondCoordSystem = \"world\"\n\n return firstCoordSystem === secondCoordSystem\n}\n"],"mappings":";;AAIA,SAAgB,aAAa,MAAoB;AAC/C,KAAI;AACF,SAAO,KAAK,MAAM,KAAe;SAC3B;AACN;;;;AAKJ,SAAgB,iBAAiB,MAAmC;AAClE,KAAI;AACF,SAAO,KAAK,UAAU,KAAK;SACrB;AACN;;;;;;;;AASJ,SAAgB,mBAAmB,KAAqC;CACtE,MAAM,MAAM,IAAI,gBAAgB,IAAI,CAAC,UAAU;AAC/C,QAAO,MAAM,IAAI,QAAQ;;;AAI3B,SAAgB,iBAAiB,SAAyB;AACxD,QAAO,WAAW,MAAM,KAAK;;;AAI/B,SAAgB,iBAAiB,SAAyB;AACxD,QAAO,WAAW,KAAK,KAAK;;;;;;AAO9B,SAAgB,yBACd,MACA;CACA,MAAM,WAAW;EAAC,KAAK,SAAS;EAAG,KAAK,SAAS;EAAG,KAAK,SAAS;EAAE;CACpE,MAAM,cAAc;EAClB,KAAK,aAAa,KAAK;EACvB,KAAK,aAAa,KAAK;EACvB,KAAK,aAAa,KAAK;EACxB;CAED,MAAM,iBAAiB,SAAS,KAAK,MAAM,EAAE,QAAQ,EAAE,CAAC;CAExD,MAAM,iBAAiB,YAAY,KAAK,MAAM,EAAE,QAAQ,EAAE,CAAC;AAE3D,QAAO,IAAI,eAAe,OAAO,eAAe,CAAC,KAAK,KAAK,CAAC;;;;;;AAO9D,SAAgB,uBACd,kBACA,mBACA;AACA,KAAI,CAAC,iBAAkB,oBAAmB;AAC1C,KAAI,CAAC,kBAAmB,qBAAoB;AAE5C,QAAO,qBAAqB"}
|