@wandelbots/wandelbots-js-react-components 1.35.0 → 1.36.0

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.
Files changed (38) hide show
  1. package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
  2. package/dist/components/jogging/PoseCartesianValues.d.ts +1 -1
  3. package/dist/components/jogging/PoseCartesianValues.d.ts.map +1 -1
  4. package/dist/components/robots/DHRobot.d.ts.map +1 -1
  5. package/dist/components/robots/GenericRobot.d.ts +13 -2
  6. package/dist/components/robots/GenericRobot.d.ts.map +1 -1
  7. package/dist/components/robots/Robot.d.ts.map +1 -1
  8. package/dist/components/robots/RobotAnimator.d.ts +3 -5
  9. package/dist/components/robots/RobotAnimator.d.ts.map +1 -1
  10. package/dist/components/robots/SupportedRobot.d.ts +4 -4
  11. package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
  12. package/dist/components/robots/ghostStyle.d.ts +4 -0
  13. package/dist/components/robots/ghostStyle.d.ts.map +1 -0
  14. package/dist/components/robots/robotModelLogic.d.ts +25 -0
  15. package/dist/components/robots/robotModelLogic.d.ts.map +1 -0
  16. package/dist/index.cjs +30 -30
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +3464 -3398
  21. package/dist/index.js.map +1 -1
  22. package/package.json +49 -34
  23. package/src/components/jogging/JoggingOptions.tsx +1 -0
  24. package/src/components/jogging/PoseCartesianValues.tsx +2 -4
  25. package/src/components/robots/DHRobot.tsx +2 -10
  26. package/src/components/robots/GenericRobot.tsx +30 -9
  27. package/src/components/robots/Robot.tsx +2 -1
  28. package/src/components/robots/RobotAnimator.tsx +6 -13
  29. package/src/components/robots/SupportedRobot.tsx +35 -111
  30. package/src/components/robots/ghostStyle.ts +70 -0
  31. package/src/components/robots/robotModelLogic.ts +90 -0
  32. package/src/index.ts +1 -0
  33. package/dist/components/robots/types.d.ts +0 -19
  34. package/dist/components/robots/types.d.ts.map +0 -1
  35. package/dist/components/utils/robotTreeQuery.d.ts +0 -6
  36. package/dist/components/utils/robotTreeQuery.d.ts.map +0 -1
  37. package/src/components/robots/types.ts +0 -21
  38. package/src/components/utils/robotTreeQuery.ts +0 -27
@@ -1 +1 @@
1
- {"version":3,"file":"JoggingOptions.d.ts","sourceRoot":"","sources":["../../../src/components/jogging/JoggingOptions.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,gBAAgB,CAAA;AAEvB,eAAO,MAAM,cAAc,eAAwB;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE;;CAqHxE,CAAA"}
1
+ {"version":3,"file":"JoggingOptions.d.ts","sourceRoot":"","sources":["../../../src/components/jogging/JoggingOptions.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,gBAAgB,CAAA;AAEvB,eAAO,MAAM,cAAc,eAAwB;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE;;CAsHxE,CAAA"}
@@ -1,4 +1,4 @@
1
- import { MotionStreamConnection } from "@wandelbots/wandelbots-js";
1
+ import type { MotionStreamConnection } from "@wandelbots/wandelbots-js";
2
2
  export declare const PoseCartesianValues: (({ motionStream }: {
3
3
  motionStream: MotionStreamConnection;
4
4
  }) => import("react/jsx-runtime").JSX.Element) & {
@@ -1 +1 @@
1
- {"version":3,"file":"PoseCartesianValues.d.ts","sourceRoot":"","sources":["../../../src/components/jogging/PoseCartesianValues.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EAEvB,MAAM,2BAA2B,CAAA;AAMlC,eAAO,MAAM,mBAAmB,sBACX;IAAE,YAAY,EAAE,sBAAsB,CAAA;CAAE;;CA+B5D,CAAA"}
1
+ {"version":3,"file":"PoseCartesianValues.d.ts","sourceRoot":"","sources":["../../../src/components/jogging/PoseCartesianValues.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAOvE,eAAO,MAAM,mBAAmB,sBACX;IAAE,YAAY,EAAE,sBAAsB,CAAA;CAAE;;CA+B5D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DHRobot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/DHRobot.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAKpD,wBAAgB,OAAO,CAAC,EACtB,0BAA0B,EAC1B,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,YAAY,2CA8Gd"}
1
+ {"version":3,"file":"DHRobot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/DHRobot.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAKpD,wBAAgB,OAAO,CAAC,EACtB,0BAA0B,EAC1B,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,YAAY,2CA0Gd"}
@@ -1,3 +1,14 @@
1
- import type { RobotModelProps } from "./types";
2
- export declare function GenericRobot({ modelURL, flangeRef, ...props }: RobotModelProps): import("react/jsx-runtime").JSX.Element;
1
+ import type { GroupProps } from "@react-three/fiber";
2
+ import React from "react";
3
+ import type { Group } from "three";
4
+ export type RobotModelProps = {
5
+ modelURL: string;
6
+ /**
7
+ * Called after a robot model has been loaded and
8
+ * rendered into the threejs scene
9
+ */
10
+ postModelRender?: () => void;
11
+ flangeRef?: React.Ref<Group>;
12
+ } & GroupProps;
13
+ export declare function GenericRobot({ modelURL, flangeRef, postModelRender, ...props }: RobotModelProps): import("react/jsx-runtime").JSX.Element;
3
14
  //# sourceMappingURL=GenericRobot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenericRobot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/GenericRobot.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAU9C,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,2CAmCjB"}
1
+ {"version":3,"file":"GenericRobot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/GenericRobot.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAsB,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAQ,MAAM,OAAO,CAAA;AAIxC,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;CAC7B,GAAG,UAAU,CAAA;AAMd,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,eAAe,EACf,GAAG,KAAK,EACT,EAAE,eAAe,2CA+CjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Robot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/Robot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAGlC,MAAM,MAAM,UAAU,GAAG;IACvB,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,QAAQ,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAA;IAClD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;CAC7B,GAAG,UAAU,CAAA;AAEd;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,EACpB,oBAAoB,EACpB,QAA0B,EAC1B,OAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,UAAU,kDAkBZ"}
1
+ {"version":3,"file":"Robot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/Robot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAIlC,MAAM,MAAM,UAAU,GAAG;IACvB,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,QAAQ,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAA;IAClD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;CAC7B,GAAG,UAAU,CAAA;AAEd;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,EACpB,oBAAoB,EACpB,QAA0B,EAC1B,OAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,UAAU,kDAkBZ"}
@@ -1,14 +1,12 @@
1
1
  import type { DHParameter, MotionGroupStateResponse } from "@wandelbots/wandelbots-api-client";
2
2
  import React from "react";
3
- import type * as THREE from "three";
4
- import { type RobotSceneJoint } from "../utils/robotTreeQuery";
3
+ import type { Object3D } from "three";
5
4
  type RobotAnimatorProps = {
6
5
  rapidlyChangingMotionState: MotionGroupStateResponse;
7
6
  dhParameters: DHParameter[];
8
- onRotationChanged?: (joints: THREE.Object3D[], jointValues: number[]) => void;
9
- jointCollector?: (rootObject: THREE.Object3D) => RobotSceneJoint[];
7
+ onRotationChanged?: (joints: Object3D[], jointValues: number[]) => void;
10
8
  children: React.ReactNode;
11
9
  };
12
- export default function RobotAnimator({ rapidlyChangingMotionState, dhParameters, jointCollector, onRotationChanged, children, }: RobotAnimatorProps): import("react/jsx-runtime").JSX.Element;
10
+ export default function RobotAnimator({ rapidlyChangingMotionState, dhParameters, onRotationChanged, children, }: RobotAnimatorProps): import("react/jsx-runtime").JSX.Element;
13
11
  export {};
14
12
  //# sourceMappingURL=RobotAnimator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RobotAnimator.d.ts","sourceRoot":"","sources":["../../../src/components/robots/RobotAnimator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACzB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAiB,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAA;AAEhC,KAAK,kBAAkB,GAAG;IACxB,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC7E,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,KAAK,eAAe,EAAE,CAAA;IAClE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,0BAA0B,EAC1B,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,2CAkEpB"}
1
+ {"version":3,"file":"RobotAnimator.d.ts","sourceRoot":"","sources":["../../../src/components/robots/RobotAnimator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACzB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAiB,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAA;AAI5C,KAAK,kBAAkB,GAAG;IACxB,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACvE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,0BAA0B,EAC1B,YAAY,EACZ,iBAAiB,EACjB,QAAQ,GACT,EAAE,kBAAkB,2CAgEpB"}
@@ -1,6 +1,6 @@
1
1
  import type { GroupProps } from "@react-three/fiber";
2
2
  import type { DHParameter, MotionGroupStateResponse } from "@wandelbots/wandelbots-api-client";
3
- import * as THREE from "three";
3
+ import type * as THREE from "three";
4
4
  export type DHRobotProps = {
5
5
  rapidlyChangingMotionState: MotionGroupStateResponse;
6
6
  dhParameters: Array<DHParameter>;
@@ -9,10 +9,10 @@ export type SupportedRobotProps = {
9
9
  rapidlyChangingMotionState: MotionGroupStateResponse;
10
10
  modelFromController: string;
11
11
  dhParameters: DHParameter[];
12
- getModel?: (modelFromController: string) => string;
13
12
  isGhost?: boolean;
14
13
  flangeRef?: React.Ref<THREE.Group>;
14
+ getModel?: (modelFromController: string) => string;
15
+ postModelRender?: () => void;
15
16
  } & GroupProps;
16
- export declare function defaultGetModel(modelFromController: string): string;
17
- export declare const SupportedRobot: ({ rapidlyChangingMotionState, modelFromController, dhParameters, getModel, isGhost, flangeRef, ...props }: SupportedRobotProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const SupportedRobot: ({ rapidlyChangingMotionState, modelFromController, dhParameters, getModel, isGhost, flangeRef, postModelRender, ...props }: SupportedRobotProps) => import("react/jsx-runtime").JSX.Element;
18
18
  //# sourceMappingURL=SupportedRobot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SupportedRobot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/SupportedRobot.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACzB,MAAM,mCAAmC,CAAA;AAI1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,MAAM,YAAY,GAAG;IACzB,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;CACjC,GAAG,UAAU,CAAA;AAEd,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,mBAAmB,EAAE,MAAM,CAAA;IAC3B,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,QAAQ,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAA;IAClD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;CACnC,GAAG,UAAU,CAAA;AAEd,wBAAgB,eAAe,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAMnE;AAED,eAAO,MAAM,cAAc,8GAStB,mBAAmB,4CA6HvB,CAAA"}
1
+ {"version":3,"file":"SupportedRobot.d.ts","sourceRoot":"","sources":["../../../src/components/robots/SupportedRobot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACzB,MAAM,mCAAmC,CAAA;AAK1C,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAQnC,MAAM,MAAM,YAAY,GAAG;IACzB,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;CACjC,GAAG,UAAU,CAAA;AAEd,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B,EAAE,wBAAwB,CAAA;IACpD,mBAAmB,EAAE,MAAM,CAAA;IAC3B,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAA;IAClD,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;CAC7B,GAAG,UAAU,CAAA;AAEd,eAAO,MAAM,cAAc,+HAUtB,mBAAmB,4CAwDvB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { Group } from "three";
2
+ export declare const applyGhostStyle: (robot: Group) => void;
3
+ export declare const removeGhostStyle: (robot: Group) => void;
4
+ //# sourceMappingURL=ghostStyle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ghostStyle.d.ts","sourceRoot":"","sources":["../../../src/components/robots/ghostStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAY,MAAM,OAAO,CAAA;AAG5C,eAAO,MAAM,eAAe,UAAW,KAAK,SA0C3C,CAAA;AAED,eAAO,MAAM,gBAAgB,UAAW,KAAK,SAsB5C,CAAA"}
@@ -0,0 +1,25 @@
1
+ import type { Object3D } from "three";
2
+ import type { GLTF } from "three-stdlib";
3
+ export declare function defaultGetModel(modelFromController: string): string;
4
+ /**
5
+ * Finds all the joint groups in a GLTF tree, as identified
6
+ * by the _Jxx name ending convention.
7
+ */
8
+ export declare function collectJoints(rootObject: Object3D): Object3D[];
9
+ /**
10
+ * Checks if a specified threejs object represents the flange of a
11
+ * robot, based on the _FLG name ending convention.
12
+ */
13
+ export declare function isFlange(node: Object3D): boolean;
14
+ /**
15
+ * Checks if a specified threejs object represents a joint of a
16
+ * robot, based on the _Jxx name ending convention.
17
+ */
18
+ export declare function isJoint(node: Object3D): boolean;
19
+ /**
20
+ * Validates that the loaded GLTF file has six joints and a flange group.
21
+ */
22
+ export declare function parseRobotModel(gltf: GLTF, filename: string): {
23
+ gltf: GLTF;
24
+ };
25
+ //# sourceMappingURL=robotModelLogic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"robotModelLogic.d.ts","sourceRoot":"","sources":["../../../src/components/robots/robotModelLogic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxC,wBAAgB,eAAe,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAMnE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAS9D;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,WAEtC;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,WAErC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CA2C5E"}