@wandelbots/wandelbots-js-react-components 6.3.0 → 6.4.0-pr.chore-public-names.673.cb7ee37
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 +255 -122
- package/dist/3d.cjs +1 -1
- package/dist/3d.d.ts +7 -3
- package/dist/3d.js +20 -20
- package/dist/CurrentPoseBar/index.cjs +1 -0
- package/dist/CurrentPoseBar/index.d.ts +2 -0
- package/dist/CurrentPoseBar/index.js +5 -0
- package/dist/JoggingButtons/index.cjs +1 -0
- package/dist/JoggingButtons/index.d.ts +3 -0
- package/dist/JoggingButtons/index.js +5 -0
- package/dist/JoggingGizmo/index.cjs +1 -0
- package/dist/JoggingGizmo/index.d.ts +5 -0
- package/dist/JoggingGizmo/index.js +6 -0
- package/dist/JoggingJointSlider/index.cjs +1 -0
- package/dist/JoggingJointSlider/index.d.ts +2 -0
- package/dist/JoggingJointSlider/index.js +5 -0
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.js +1 -1
- package/dist/chunks/ConnectedMotionGroup-D9JJSyXB.js +1822 -0
- package/dist/chunks/ConnectedMotionGroup-ir7Vf690.cjs +3 -0
- package/dist/chunks/CurrentPoseBar-Cbz4AO36.cjs +1 -0
- package/dist/chunks/CurrentPoseBar-CpwvWpEY.js +619 -0
- package/dist/chunks/JoggingButtons-i8FdMpCx.js +108 -0
- package/dist/chunks/JoggingButtons-paQCBXf4.cjs +1 -0
- package/dist/chunks/JoggingGizmoOrientation-CKZeLcMp.js +893 -0
- package/dist/chunks/JoggingGizmoOrientation-EPtBeAun.cjs +1 -0
- package/dist/chunks/JoggingJointSlider-DQhJOmcc.js +378 -0
- package/dist/chunks/JoggingJointSlider-YcEBMgF1.cjs +1 -0
- package/dist/chunks/Pose3-Ci1bxEvz.js +1373 -0
- package/dist/chunks/Pose3-DwMOSTKO.cjs +1 -0
- package/dist/chunks/SafetyBar-Be1c6Vz9.cjs +1 -0
- package/dist/chunks/{SafetyBar-Cy9DiXp9.js → SafetyBar-WXLP3Yi0.js} +34 -32
- package/dist/chunks/{externalizeComponent-EDymnaGR.js → externalizeComponent-7OVHUIUh.js} +84 -134
- package/dist/chunks/externalizeComponent-B0n_tR3v.cjs +2 -0
- package/dist/chunks/holdSafety-Cbej6-Kc.js +62 -0
- package/dist/chunks/holdSafety-TeMXlYQe.cjs +1 -0
- package/dist/chunks/joggingColors-BKRoSGQu.js +132 -0
- package/dist/chunks/joggingColors-BkPm75Hr.cjs +1 -0
- package/dist/chunks/json-3cqBD7UQ.js +18 -0
- package/dist/chunks/json-Bd6uGfgP.cjs +1 -0
- package/dist/chunks/loadRobotSession-Bt1-Brjp.js +3761 -0
- package/dist/chunks/loadRobotSession-DHVuK_pj.cjs +1 -0
- package/dist/chunks/novaConnection-BTSIgWd1.cjs +1 -0
- package/dist/chunks/novaConnection-J6_ohIQ0.js +14 -0
- package/dist/chunks/poseText-BXUaQWnK.cjs +1 -0
- package/dist/chunks/poseText-CtdXIeT_.js +41 -0
- package/dist/chunks/useSmoothedMotionState-C_Vo0py0.js +202 -0
- package/dist/chunks/useSmoothedMotionState-Ce9NjwBu.cjs +1 -0
- package/dist/components/AppHeader.d.ts +1 -1
- package/dist/components/VelocitySlider.d.ts +6 -1
- package/dist/components/currentPoseBar/CurrentPoseBar.d.ts +48 -0
- package/dist/components/currentPoseBar/OrientationFormatPopover.d.ts +19 -0
- package/dist/components/currentPoseBar/StreamStatus.d.ts +10 -0
- package/dist/components/currentPoseBar/orientation.d.ts +34 -0
- package/dist/components/currentPoseBar/poseValues.d.ts +15 -0
- package/dist/components/jogging/JoggingButtons.d.ts +18 -0
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +8 -2
- package/dist/components/jogging/JoggingCartesianTab.d.ts +3 -0
- package/dist/components/jogging/JoggingJointTab.d.ts +4 -1
- package/dist/components/jogging/JoggingJointValueControl.d.ts +7 -1
- package/dist/components/jogging/JoggingPanel.d.ts +6 -3
- package/dist/components/jogging/JoggingRefusedError.d.ts +24 -0
- package/dist/components/jogging/JoggingStore.d.ts +382 -40
- package/dist/components/jogging/gizmo/JoggingGizmo.d.ts +53 -0
- package/dist/components/jogging/gizmo/JoggingGizmoOrientation.d.ts +26 -0
- package/dist/components/jogging/gizmo/RotationHandles.d.ts +7 -0
- package/dist/components/jogging/gizmo/RotationScene.d.ts +6 -0
- package/dist/components/jogging/gizmo/TranslationHandles.d.ts +6 -0
- package/dist/components/jogging/gizmo/TranslationScene.d.ts +6 -0
- package/dist/components/jogging/gizmo/arcGrabAreas.d.ts +58 -0
- package/dist/components/jogging/gizmo/arcs.d.ts +54 -0
- package/dist/components/jogging/gizmo/arrows.d.ts +63 -0
- package/dist/components/jogging/gizmo/gizmoShared.d.ts +135 -0
- package/dist/components/jogging/gizmo/gizmoView.d.ts +42 -0
- package/dist/components/jogging/gizmo/useGizmoTurn.d.ts +11 -0
- package/dist/components/jogging/holdSafety.d.ts +82 -0
- package/dist/components/jogging/jogError.d.ts +9 -0
- package/dist/components/jogging/jogHandle.d.ts +23 -0
- package/dist/components/jogging/joggingColors.d.ts +30 -0
- package/dist/components/jogging/joggingVelocity.d.ts +21 -0
- package/dist/components/jogging/joint/JoggingJointSlider.d.ts +56 -0
- package/dist/components/jogging/joint/JointSliderTrack.d.ts +27 -0
- package/dist/components/jogging/joint/jointJog.d.ts +55 -0
- package/dist/components/jogging/joint/useJointJogHold.d.ts +43 -0
- package/dist/components/jogging/useHold.d.ts +42 -0
- package/dist/components/jogging/useJogControls.d.ts +44 -0
- package/dist/components/robotControl/PanelSelect.d.ts +13 -0
- package/dist/components/robotControl/SmallSelect.d.ts +15 -0
- package/dist/components/robotControl/poseText.d.ts +43 -0
- package/dist/components/robotControl/robotControlTypes.d.ts +36 -0
- package/dist/components/robotControl/useCopyText.d.ts +12 -0
- package/dist/components/robotControl/useEveryFrame.d.ts +6 -0
- package/dist/components/robots/GenericRobot.d.ts +2 -1
- package/dist/components/robots/LinearAxis.d.ts +1 -1
- package/dist/components/robots/LinearAxisAnimator.d.ts +11 -2
- package/dist/components/robots/Robot.d.ts +1 -1
- package/dist/components/robots/robotModelLogic.d.ts +11 -9
- package/dist/components/utils/converters.d.ts +0 -2
- package/dist/components/utils/hooks.d.ts +1 -6
- package/dist/components/utils/json.d.ts +4 -0
- package/dist/components/utils/useSmoothedMotionState.d.ts +11 -2
- package/dist/components/utils/useWebGLRenderer.d.ts +32 -0
- package/dist/components/utils/webglSupport.d.ts +11 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +28 -20
- package/dist/core.js +57 -54
- package/dist/index.cjs +1 -1
- package/dist/index.js +73 -70
- package/dist/lib/ConnectedMotionGroup.d.ts +9 -8
- package/dist/lib/ControllerStateStream.d.ts +125 -0
- package/dist/lib/JoggerConnection.d.ts +172 -27
- package/dist/lib/MotionStreamConnection.d.ts +16 -6
- package/dist/lib/Pose3.d.ts +22 -0
- package/dist/lib/PoseTransformer.d.ts +44 -0
- package/dist/lib/TrajectoryExecutionStore.d.ts +260 -0
- package/dist/lib/connectionLogger.d.ts +9 -0
- package/dist/lib/controllerStateSource.d.ts +38 -0
- package/dist/lib/incrementalCartesianMotion.d.ts +40 -0
- package/dist/lib/motionGroupModelResources.d.ts +1 -0
- package/dist/lib/motionStateUpdate.d.ts +44 -0
- package/dist/lib/nats/natsControllerStateSource.d.ts +27 -0
- package/dist/lib/novaConnection.d.ts +23 -0
- package/dist/lib/planErrorTranslation.d.ts +8 -0
- package/dist/lib/poseMath.d.ts +51 -0
- package/dist/lib/robotSession/RobotActivation.d.ts +90 -0
- package/dist/lib/robotSession/RobotDescription.d.ts +84 -0
- package/dist/lib/robotSession/RobotLiveState.d.ts +65 -0
- package/dist/lib/robotSession/RobotLoadProgress.d.ts +72 -0
- package/dist/lib/robotSession/RobotSafety.d.ts +59 -0
- package/dist/lib/robotSession/RobotSession.d.ts +117 -0
- package/dist/lib/robotSession/RobotTargetPose.d.ts +116 -0
- package/dist/lib/robotSession/loadRobotResources.d.ts +46 -0
- package/dist/lib/robotSession/loadRobotSession.d.ts +81 -0
- package/dist/lib/robotSession/robotPose.d.ts +27 -0
- package/dist/lib/rotation.d.ts +12 -0
- package/dist/nats.cjs +1 -0
- package/dist/nats.d.ts +4 -0
- package/dist/nats.js +131 -0
- package/dist/session.cjs +1 -0
- package/dist/session.d.ts +22 -0
- package/dist/session.js +33 -0
- package/package.json +68 -66
- package/dist/Setup.d.ts +0 -11
- package/dist/chunks/MotionGroupVisualizer-DshWR1wY.js +0 -1653
- package/dist/chunks/MotionGroupVisualizer-eD7yFEcF.cjs +0 -1
- package/dist/chunks/SafetyBar-DPrv_OQA.cjs +0 -1
- package/dist/chunks/externalizeComponent-OO4jcrz5.cjs +0 -2
- package/dist/chunks/theming-DfSy4-Ic.cjs +0 -4
- package/dist/chunks/theming-mF9Rt8SS.js +0 -5542
- package/dist/chunks/useSmoothedMotionState-DyDgSVYX.js +0 -478
- package/dist/chunks/useSmoothedMotionState-VYxEIyfr.cjs +0 -1
- package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +0 -11
- package/dist/components/AdornedTextField.d.ts +0 -7
- package/dist/components/CopyableText.d.ts +0 -6
- package/dist/components/CycleTimer/CycleTimer.d.ts +0 -3
- package/dist/components/CycleTimer/DefaultVariant.d.ts +0 -9
- package/dist/components/CycleTimer/SmallVariant.d.ts +0 -10
- package/dist/components/CycleTimer/index.d.ts +0 -27
- package/dist/components/CycleTimer/types.d.ts +0 -49
- package/dist/components/CycleTimer/useAnimations.d.ts +0 -14
- package/dist/components/CycleTimer/useTimerLogic.d.ts +0 -24
- package/dist/components/CycleTimer/utils.d.ts +0 -21
- package/dist/components/CycleTimer.d.ts +0 -3
- package/dist/components/DataGrid.d.ts +0 -66
- package/dist/components/LogPanel.d.ts +0 -38
- package/dist/components/LogStore.d.ts +0 -12
- package/dist/components/LogViewer.d.ts +0 -46
- package/dist/components/ProgramControl.d.ts +0 -55
- package/dist/components/ProgramStateIndicator.d.ts +0 -26
- package/dist/components/RobotCard.d.ts +0 -98
- package/dist/components/RobotListItem.d.ts +0 -34
- package/dist/components/RobotSetupReadinessIndicator.d.ts +0 -37
- package/dist/components/SelectableFab.d.ts +0 -7
- package/dist/components/TabBar.d.ts +0 -45
- package/dist/components/ThemeSelect.d.ts +0 -6
- package/dist/components/Timer/Timer.d.ts +0 -3
- package/dist/components/Timer/TimerDefaultVariant.d.ts +0 -9
- package/dist/components/Timer/TimerSmallVariant.d.ts +0 -10
- package/dist/components/Timer/index.d.ts +0 -19
- package/dist/components/Timer/types.d.ts +0 -35
- package/dist/components/Timer/useTimerAnimations.d.ts +0 -10
- package/dist/components/Timer/useTimerLogic.d.ts +0 -19
- package/dist/components/Timer/utils.d.ts +0 -17
- package/dist/components/Timer.d.ts +0 -3
- package/dist/components/TransparentOverlay.d.ts +0 -4
- package/dist/components/jogging/JoggingFreedriveTab.d.ts +0 -1
- package/dist/components/jogging/PoseCartesianValues.d.ts +0 -9
- package/dist/components/jogging/PoseJointValues.d.ts +0 -8
- package/dist/components/robots/AxisConfig.d.ts +0 -2
- package/dist/components/robots/manufacturerHomePositions.d.ts +0 -20
- package/dist/icons/DropdownArrowIcon.d.ts +0 -2
- package/dist/icons/index.d.ts +0 -12
- package/dist/lib/novaCompat.d.ts +0 -16
- package/dist/themes/createDarkTheme.d.ts +0 -7
- package/dist/themes/themeTypes.d.ts +0 -40
- package/dist/themes/theming.d.ts +0 -24
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { JogDirection } from "../jogHandle";
|
|
2
|
+
/**
|
|
3
|
+
* Props of {@link JoggingJointSlider}
|
|
4
|
+
*/
|
|
5
|
+
export type JoggingJointSliderProps = {
|
|
6
|
+
/** Short name of the joint, e.g. "J1" */
|
|
7
|
+
label: string;
|
|
8
|
+
/** What the joint is, e.g. "Base", shown after the label */
|
|
9
|
+
name?: string;
|
|
10
|
+
/** The joint's live position, in NOVA's units: radians, or mm for a linear axis */
|
|
11
|
+
value: number;
|
|
12
|
+
/**
|
|
13
|
+
* The joint's lower limit, the left end of the track. A revolute joint
|
|
14
|
+
* with one limit spans one turn from it, and without limits the turn it
|
|
15
|
+
* stands in. A linear axis needs both limits to be jogged with the slider:
|
|
16
|
+
* without them, it only shows its value.
|
|
17
|
+
*/
|
|
18
|
+
min?: number;
|
|
19
|
+
/** The joint's upper limit, the right end of the track: see `min` */
|
|
20
|
+
max?: number;
|
|
21
|
+
/** A linear axis, in mm. Defaults to a revolute joint, in radians. */
|
|
22
|
+
linear?: boolean;
|
|
23
|
+
/** How a revolute joint is shown: in degrees (default) or radians */
|
|
24
|
+
angleUnit?: "deg" | "rad";
|
|
25
|
+
/**
|
|
26
|
+
* The slider was pressed: jog the joint in `direction` until `onJogStop`.
|
|
27
|
+
* The joint stops on its own once it gets to the goal, and starts again
|
|
28
|
+
* when the goal moves on, so one press can bring several starts and stops,
|
|
29
|
+
* always in turn.
|
|
30
|
+
*
|
|
31
|
+
* When the goal passes the joint, onJogStop and the onJogStart of the
|
|
32
|
+
* other way come in the same event. An app whose jog commands are
|
|
33
|
+
* asynchronous must apply them in that order, and must not tear down its
|
|
34
|
+
* jogging connection on that stop.
|
|
35
|
+
*/
|
|
36
|
+
onJogStart: (direction: JogDirection) => void;
|
|
37
|
+
/**
|
|
38
|
+
* The joint must stop: it got to its goal, the slider was let go, or the
|
|
39
|
+
* pointer left it
|
|
40
|
+
*/
|
|
41
|
+
onJogStop: () => void;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* One joint as a slider across its limits, with the thumb at the joint's
|
|
46
|
+
* value and the limits below. Hovering the track shows the goal under the
|
|
47
|
+
* pointer; pressing there jogs the joint toward it until it gets there, the
|
|
48
|
+
* slider is let go, or the pointer leaves the slider. While held, the goal
|
|
49
|
+
* follows the pointer, and the joint turns around when the goal passes it.
|
|
50
|
+
* Only a pointer jogs: the keyboard reaches the slider, which says the
|
|
51
|
+
* joint's value, but an arrow key on it moves nothing.
|
|
52
|
+
*
|
|
53
|
+
* An app shows one slider per joint. It moves nothing itself: onJogStart and
|
|
54
|
+
* onJogStop leave that to the app, which also keeps to one joint at a time.
|
|
55
|
+
*/
|
|
56
|
+
export declare const JoggingJointSlider: ({ label, name, value, min, max, linear, angleUnit, onJogStart, onJogStop, disabled, }: JoggingJointSliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
export type JointSliderTrackProps = {
|
|
3
|
+
/** The rail, which the pointer is placed along */
|
|
4
|
+
railRef?: Ref<HTMLDivElement>;
|
|
5
|
+
/** Where the joint is along the track, 0 to 1; null to draw no thumb */
|
|
6
|
+
at: number | null;
|
|
7
|
+
/** Where the goal is along the track, 0 to 1; null for none */
|
|
8
|
+
goalAt: number | null;
|
|
9
|
+
/** Whether the slider is held: the goal is the jog's, not only hovered */
|
|
10
|
+
held: boolean;
|
|
11
|
+
/** Where the joint's zero is along the track, 0 to 1; null for none */
|
|
12
|
+
zeroAt: number | null;
|
|
13
|
+
/** The limits below the ends of the track, as shown; omitted for none */
|
|
14
|
+
limits?: {
|
|
15
|
+
min: string;
|
|
16
|
+
max: string;
|
|
17
|
+
};
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The drawing of a joint slider: the rail across the limits, the stretch to
|
|
22
|
+
* the goal, a mark at zero, the thumb at the joint, and the limits below.
|
|
23
|
+
*
|
|
24
|
+
* Positions change with every frame of motion: they go in `style`, not in
|
|
25
|
+
* `sx`, which would add a CSS rule for each new value and never remove it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function JointSliderTrack({ railRef, at, goalAt, held, zeroAt, limits, disabled, }: JointSliderTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { JogDirection } from "../jogHandle";
|
|
2
|
+
/** A joint's limits as a slider takes them, in NOVA's units */
|
|
3
|
+
export type JointLimits = {
|
|
4
|
+
/** The lower limit, the left end of the track */
|
|
5
|
+
min?: number;
|
|
6
|
+
/** The upper limit, the right end of the track */
|
|
7
|
+
max?: number;
|
|
8
|
+
/** A linear axis, in mm; otherwise a revolute joint, in radians */
|
|
9
|
+
linear?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** The stretch of joint values a slider's track spans */
|
|
12
|
+
export type JointRange = {
|
|
13
|
+
min: number;
|
|
14
|
+
max: number;
|
|
15
|
+
};
|
|
16
|
+
/** How a joint's values are shown */
|
|
17
|
+
export type JointUnit = "deg" | "rad" | "mm";
|
|
18
|
+
/**
|
|
19
|
+
* The range a joint's track spans: its limits. A revolute joint with one
|
|
20
|
+
* limit spans one turn from it; without limits, the turn its `value` is in,
|
|
21
|
+
* so it can be jogged both ways wherever it stands. A linear axis without
|
|
22
|
+
* both limits has nothing to be placed in: no range.
|
|
23
|
+
*/
|
|
24
|
+
export declare function jointSliderRange({ min, max, linear }: JointLimits, value: number): JointRange | null;
|
|
25
|
+
/** Where `value` sits along a track spanning `range`, from 0 to 1 */
|
|
26
|
+
export declare function fractionOf(value: number, range: JointRange): number;
|
|
27
|
+
/**
|
|
28
|
+
* The joint value at `fraction` of the way along a track spanning `range`.
|
|
29
|
+
* Past an end it is the limit, so a goal is never out of reach.
|
|
30
|
+
*/
|
|
31
|
+
export declare function valueAt(fraction: number, range: JointRange): number;
|
|
32
|
+
/** Where the joint's zero sits along its track, or null when it lies outside */
|
|
33
|
+
export declare function zeroFraction(range: JointRange): number | null;
|
|
34
|
+
/**
|
|
35
|
+
* Which way to jog from `current` to reach `goal`, or null when the joint is
|
|
36
|
+
* within `deadband` of it already
|
|
37
|
+
*/
|
|
38
|
+
export declare function directionToward(current: number, goal: number, deadband: number): JogDirection | null;
|
|
39
|
+
/**
|
|
40
|
+
* Whether a joint jogging in `direction` has got to `goal`: at it, or past it,
|
|
41
|
+
* as a jog overshoots a little before its stop lands
|
|
42
|
+
*/
|
|
43
|
+
export declare function hasReachedGoal(current: number, goal: number, direction: JogDirection): boolean;
|
|
44
|
+
/** How a joint is shown: a linear axis in mm, a revolute joint in `angleUnit` */
|
|
45
|
+
export declare function jointUnit(linear: boolean, angleUnit: "deg" | "rad"): JointUnit;
|
|
46
|
+
/** A joint value in the unit it is shown in, e.g. degrees */
|
|
47
|
+
export declare function shownJointValue(value: number, unit: JointUnit): number;
|
|
48
|
+
/** A joint value as shown, e.g. "35.2°" */
|
|
49
|
+
export declare function formatJointValue(value: number, unit: JointUnit): string;
|
|
50
|
+
/**
|
|
51
|
+
* A joint limit as shown below its track, with its sign: whole in degrees and
|
|
52
|
+
* mm, e.g. "+185°", with two decimals in radians. Halves round away from
|
|
53
|
+
* zero, so symmetric limits stay symmetric.
|
|
54
|
+
*/
|
|
55
|
+
export declare function formatJointLimit(value: number, unit: JointUnit): string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { JogDirection } from "../jogHandle";
|
|
2
|
+
/** A held joint slider: its goal, and which way the joint jogs to it (null: there) */
|
|
3
|
+
export type JointHold = {
|
|
4
|
+
goal: number;
|
|
5
|
+
direction: JogDirection | null;
|
|
6
|
+
/**
|
|
7
|
+
* The goal the joint last stopped at, while it stands there: the pointer
|
|
8
|
+
* must move away from it to jog the joint again
|
|
9
|
+
*/
|
|
10
|
+
settledAt: number | null;
|
|
11
|
+
/** The pointer that holds it, by its id */
|
|
12
|
+
pointer: number;
|
|
13
|
+
/** The slider, which has the pointer's capture */
|
|
14
|
+
element: Element;
|
|
15
|
+
};
|
|
16
|
+
export type JointJogHoldOptions = {
|
|
17
|
+
/** The joint's live value */
|
|
18
|
+
value: number;
|
|
19
|
+
onJogStart: (direction: JogDirection) => void;
|
|
20
|
+
onJogStop: () => void;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Holding a joint slider: the joint jogs toward the goal while the slider is
|
|
25
|
+
* held, and stops when it gets there (still held: a new goal jogs it on) or
|
|
26
|
+
* when the hold ends. One hold at a time: a second pointer is ignored. Only
|
|
27
|
+
* a pointer holds the slider: the keyboard does not jog.
|
|
28
|
+
*
|
|
29
|
+
* Every way a hold can end without a release reaching the slider stops it:
|
|
30
|
+
* becoming disabled, the window losing focus, the tab being hidden, unmount
|
|
31
|
+
* (shared with the other jog controls: see holdSafety).
|
|
32
|
+
* The hold is recorded before the app is called, so a failing onJogStart
|
|
33
|
+
* still gets its onJogStop. A hold that ends while its pointer is still
|
|
34
|
+
* down, e.g. when the pointer left the slider, gives the capture back.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useJointJogHold({ value, onJogStart, onJogStop, disabled, }: JointJogHoldOptions): {
|
|
37
|
+
hold: JointHold | null;
|
|
38
|
+
isHolding: () => boolean;
|
|
39
|
+
holdingPointer: () => number | null;
|
|
40
|
+
begin: (goal: number, deadband: number, pointer: number, element: Element) => boolean;
|
|
41
|
+
moveGoal: (goal: number, deadband: number) => void;
|
|
42
|
+
end: () => void;
|
|
43
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type FocusEvent, type PointerEvent } from "react";
|
|
2
|
+
import { preventContextMenu } from "./holdSafety";
|
|
3
|
+
export type HoldOptions<T> = {
|
|
4
|
+
/** A control was pressed: act on `target` until `onStop` */
|
|
5
|
+
onStart: (target: T) => void;
|
|
6
|
+
onStop: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Whether two targets are the same control */
|
|
9
|
+
isSame: (a: T, b: T) => boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Press-and-hold for a set of controls that move the robot: the motion runs
|
|
13
|
+
* exactly as long as one control is held with a pointer. It stops when the
|
|
14
|
+
* pointer is let go, wherever that happens, and when it leaves the control,
|
|
15
|
+
* as RobotPad's jog buttons do. The keyboard does not move the robot: Space
|
|
16
|
+
* or Enter on a focused control start nothing, and a key pressed during a
|
|
17
|
+
* hold ends it.
|
|
18
|
+
*
|
|
19
|
+
* Only one hold runs at a time; pressing a second control while one is held
|
|
20
|
+
* does nothing. Every way a hold can end (release, leaving the control,
|
|
21
|
+
* cancel, lost pointer capture, a move with the primary button up, blur, a
|
|
22
|
+
* key pressed, the window losing focus, the tab being hidden, becoming
|
|
23
|
+
* disabled, unmount) stops it, and stops it once. The pointer is captured,
|
|
24
|
+
* so its moves and its release reach the control wherever they happen; each
|
|
25
|
+
* move then asks whether the pointer is still on the control. The controls
|
|
26
|
+
* can be any element, e.g. buttons or the handles of a gizmo. The safety
|
|
27
|
+
* rules are shared with the joint slider: see holdSafety.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useHold<T>({ onStart, onStop, disabled, isSame, }: HoldOptions<T>): {
|
|
30
|
+
held: T | null;
|
|
31
|
+
handlersFor: (target: T, isControl?: (element: Element) => boolean) => {
|
|
32
|
+
onPointerDown: (event: PointerEvent<Element>) => void;
|
|
33
|
+
onPointerMove: (event: PointerEvent<Element>) => void;
|
|
34
|
+
onPointerLeave: (_event: PointerEvent<Element>) => void;
|
|
35
|
+
onPointerUp: () => void;
|
|
36
|
+
onPointerCancel: () => void;
|
|
37
|
+
onLostPointerCapture: () => void;
|
|
38
|
+
onBlur: (_event: FocusEvent<Element>) => void;
|
|
39
|
+
onContextMenu: typeof preventContextMenu;
|
|
40
|
+
};
|
|
41
|
+
stop: () => void;
|
|
42
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type JogAxis, type JogDirection, type JogHandle } from "./jogHandle";
|
|
2
|
+
/**
|
|
3
|
+
* The props that every set of jog controls takes (JoggingGizmo,
|
|
4
|
+
* JoggingButtons), so an app wires them the same way and can show both
|
|
5
|
+
*/
|
|
6
|
+
export type JogControlsProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the controls move the robot along the axes or turn it about
|
|
9
|
+
* them. Defaults to `"translate"`. A jog that runs when it changes stops.
|
|
10
|
+
*/
|
|
11
|
+
motion?: "translate" | "rotate";
|
|
12
|
+
/**
|
|
13
|
+
* A control was pressed: jog along `axis` (or about it, in `"rotate"`
|
|
14
|
+
* motion) until `onJogStop`
|
|
15
|
+
*/
|
|
16
|
+
onJogStart: (axis: JogAxis, direction: JogDirection) => void;
|
|
17
|
+
/** The held control was let go */
|
|
18
|
+
onJogStop: () => void;
|
|
19
|
+
/** Shows a control as pressed while it is not held, e.g. a running step */
|
|
20
|
+
activeHandle?: JogHandle | null;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Hold-to-jog for a set of jog controls, one per jog handle (e.g. X+): see
|
|
25
|
+
* {@link useHold} for how a hold starts and ends. A change of the motion also
|
|
26
|
+
* ends it: a translation must not go on as a rotation.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useJogControls({ motion, onJogStart, onJogStop, activeHandle, disabled, }: JogControlsProps): {
|
|
29
|
+
held: JogHandle | null;
|
|
30
|
+
handlersFor: (target: JogHandle, isControl?: ((element: Element) => boolean) | undefined) => {
|
|
31
|
+
onPointerDown: (event: import("react").PointerEvent<Element>) => void;
|
|
32
|
+
onPointerMove: (event: import("react").PointerEvent<Element>) => void;
|
|
33
|
+
onPointerLeave: (_event: import("react").PointerEvent<Element>) => void;
|
|
34
|
+
onPointerUp: () => void;
|
|
35
|
+
onPointerCancel: () => void;
|
|
36
|
+
onLostPointerCapture: () => void;
|
|
37
|
+
onBlur: (_event: import("react").FocusEvent<Element>) => void;
|
|
38
|
+
onContextMenu: typeof import("./holdSafety").preventContextMenu;
|
|
39
|
+
};
|
|
40
|
+
/** The accessible name of a control, e.g. "Jog X+", or "Jog Rx+" rotating */
|
|
41
|
+
label: (handle: JogHandle) => string;
|
|
42
|
+
/** Whether a control shows as pressed: while it is held or shown as active */
|
|
43
|
+
isPressed: (handle: JogHandle) => boolean;
|
|
44
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RobotControlOption } from "./robotControlTypes";
|
|
2
|
+
type SelectProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
options: RobotControlOption[];
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (id: string) => void;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** A select of the panel with its label inside, e.g. the TCP */
|
|
10
|
+
export declare function PanelSelect({ label, options, value, onChange, disabled, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/** A select with its label to the left of it, e.g. the step size */
|
|
12
|
+
export declare function InlineSelect({ label, options, value, onChange, disabled, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RobotControlSelect } from "./robotControlTypes";
|
|
2
|
+
type SmallSelectProps = RobotControlSelect & {
|
|
3
|
+
/** The id of the element that names the select */
|
|
4
|
+
labelId: string;
|
|
5
|
+
width: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The select of Figma's bars (CurrentPoseBar, RobotHeader): 36 px high, its
|
|
9
|
+
* value as input/value (14 px), smaller than the design system's small
|
|
10
|
+
* select (41 px). It renders again only for other options or another value:
|
|
11
|
+
* an open menu measures its place on every render, and an app may render on
|
|
12
|
+
* every update of the robot.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SmallSelect: import("react").NamedExoticComponent<SmallSelectProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A pose as typed and copied: "(x, y, z, rx, ry, rz)", position in mm and
|
|
3
|
+
* orientation as a rotation vector in rad; joints as "[j1, j2, …]" in rad
|
|
4
|
+
* (mm for a linear axis). The same format and rules as robot-pad's typed
|
|
5
|
+
* target pose, so a pose copied in one app reads the same in the other.
|
|
6
|
+
*/
|
|
7
|
+
import type { RobotControlPose, RobotControlTarget } from "./robotControlTypes";
|
|
8
|
+
/**
|
|
9
|
+
* A pose as text: position to 0.1 mm, orientation to 0.0001 rad unless asked
|
|
10
|
+
* otherwise. A value that a NOVA pose leaves out is 0.
|
|
11
|
+
*/
|
|
12
|
+
export declare function poseToText(pose: {
|
|
13
|
+
position?: readonly number[];
|
|
14
|
+
orientation?: readonly number[];
|
|
15
|
+
}, precision?: {
|
|
16
|
+
positionPrecision?: number;
|
|
17
|
+
rotationPrecision?: number;
|
|
18
|
+
}): string;
|
|
19
|
+
/** Joint values as text, each to 0.0001 */
|
|
20
|
+
export declare function jointsToText(joints: readonly number[]): string;
|
|
21
|
+
/**
|
|
22
|
+
* The pose in `text`, or null if it is not one: six comma-separated numbers,
|
|
23
|
+
* optionally in parentheses. Anything else is rejected rather than guessed,
|
|
24
|
+
* e.g. a forgotten comma, which would otherwise shift every value after it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parsePoseText(text: string): RobotControlPose | null;
|
|
27
|
+
/**
|
|
28
|
+
* The joint values in `text`, or null if they are not exactly
|
|
29
|
+
* `jointCount` comma-separated numbers, optionally in square brackets
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseJointsText(text: string, jointCount: number): number[] | null;
|
|
32
|
+
/**
|
|
33
|
+
* The target of a move in `text`, or null if it is none: a pose of the TCP
|
|
34
|
+
* in parentheses, or joint values in square brackets, as many as the robot
|
|
35
|
+
* has joints (`jointCount`; null when they are not known, which takes none).
|
|
36
|
+
* Numbers without brackets are what the field shows: a pose of the TCP, or
|
|
37
|
+
* joint values for a robot that takes no TCP poses (`poses` is false), for
|
|
38
|
+
* which a pose is no target either.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseTargetText(text: string, { poses, jointCount }: {
|
|
41
|
+
poses: boolean;
|
|
42
|
+
jointCount: number | null;
|
|
43
|
+
}): RobotControlTarget | null;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data types of the Robot control panel that other parts use too (the
|
|
3
|
+
* pose bar): on their own, so that such a part does not load the panel.
|
|
4
|
+
*/
|
|
5
|
+
/** Whether a jog moves the TCP along the axes or turns it about them */
|
|
6
|
+
export type JogMotion = "translate" | "rotate";
|
|
7
|
+
/** A choice of one of the panel's selects */
|
|
8
|
+
export type RobotControlOption = {
|
|
9
|
+
id: string;
|
|
10
|
+
/** As shown, e.g. "Flange" */
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
/** A select of the panel, e.g. the TCP: the app gives its choices */
|
|
14
|
+
export type RobotControlSelect = {
|
|
15
|
+
options: RobotControlOption[];
|
|
16
|
+
/** The `id` of the chosen option */
|
|
17
|
+
value: string;
|
|
18
|
+
onChange: (id: string) => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A pose of the TCP: the position in mm and the orientation as a rotation
|
|
22
|
+
* vector in rad, as NOVA gives it
|
|
23
|
+
*/
|
|
24
|
+
export type RobotControlPose = {
|
|
25
|
+
position: [number, number, number];
|
|
26
|
+
orientation: [number, number, number];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Joint values as a target of Move to, one per joint: in rad, or in mm for
|
|
30
|
+
* a linear axis
|
|
31
|
+
*/
|
|
32
|
+
export type RobotControlJointTarget = {
|
|
33
|
+
joints: number[];
|
|
34
|
+
};
|
|
35
|
+
/** Where Move to goes: a pose of the TCP, or joint values */
|
|
36
|
+
export type RobotControlTarget = RobotControlPose | RobotControlJointTarget;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copies a text to the clipboard; `copied` is true for 3 s after it did.
|
|
3
|
+
*
|
|
4
|
+
* The clipboard API needs a secure context; NOVA instances are often reached
|
|
5
|
+
* over plain http, as RobotPad notes. Then the legacy command copies the
|
|
6
|
+
* selected text: `select` selects the shown text, which stays selected to
|
|
7
|
+
* copy by hand if that fails; without it, a hidden field holds the text.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCopyText(): {
|
|
10
|
+
copied: boolean;
|
|
11
|
+
copy: (text: string, select?: () => void) => Promise<void>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `read()`, read every animation frame while `active`: for what follows the
|
|
3
|
+
* robot, which changes too fast for a prop. It renders only when the value
|
|
4
|
+
* changes, so `read` returns a string, a number or a boolean.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useEveryFrame<T extends string | number | boolean>(read: () => T, active: boolean): T;
|
|
@@ -5,7 +5,8 @@ export type RobotModelProps = {
|
|
|
5
5
|
modelURL: string | Promise<string>;
|
|
6
6
|
/**
|
|
7
7
|
* Called after a robot model has been loaded and
|
|
8
|
-
* rendered into the threejs scene
|
|
8
|
+
* rendered into the threejs scene, when the components above it
|
|
9
|
+
* (RobotAnimator, LinearAxisAnimator) have mounted
|
|
9
10
|
*/
|
|
10
11
|
postModelRender?: () => void;
|
|
11
12
|
flangeRef?: React.Ref<Group>;
|
|
@@ -15,7 +15,7 @@ export type LinearAxisProps = {
|
|
|
15
15
|
*
|
|
16
16
|
* @param {LinearAxisProps} props - The properties for the LinearAxis component.
|
|
17
17
|
* @param {ConnectedMotionGroup} props.connectedMotionGroup - The connected motion group containing motion state and parameters.
|
|
18
|
-
* @param {Function} [props.getModel
|
|
18
|
+
* @param {Function} [props.getModel] - Optional function to get the model URL. Defaults to defaultGetModel with the connection of the connected motion group (its URL and access token).
|
|
19
19
|
* @param {Object} props - Additional properties passed to the underlying component.
|
|
20
20
|
*
|
|
21
21
|
* @returns {JSX.Element} The rendered SupportedLinearAxis or DHLinearAxis component.
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { DHParameter, MotionGroupState } from "@wandelbots/nova-js/v2";
|
|
2
2
|
import type React from "react";
|
|
3
3
|
import type { Object3D, Quaternion } from "three";
|
|
4
|
+
export type LinearAxisAnimatorHandle = {
|
|
5
|
+
/**
|
|
6
|
+
* Re-scan the linear axis group for joints and re-apply the current
|
|
7
|
+
* position. Must be called whenever the (async-loaded) model mounts its
|
|
8
|
+
* meshes into the scene, since the group ref callback only fires when the
|
|
9
|
+
* outer group itself mounts — not when its children appear later.
|
|
10
|
+
*/
|
|
11
|
+
recollectJoints: () => void;
|
|
12
|
+
};
|
|
4
13
|
type LinearAxisAnimatorProps = {
|
|
5
14
|
rapidlyChangingMotionState: MotionGroupState;
|
|
6
15
|
dhParameters: DHParameter[];
|
|
@@ -16,5 +25,5 @@ type LinearAxisAnimatorProps = {
|
|
|
16
25
|
* given. If damped/spring transitions are desired, run the motion state
|
|
17
26
|
* through {@link useSmoothedMotionState} before passing it here.
|
|
18
27
|
*/
|
|
19
|
-
|
|
20
|
-
export
|
|
28
|
+
declare const LinearAxisAnimator: React.ForwardRefExoticComponent<LinearAxisAnimatorProps & React.RefAttributes<LinearAxisAnimatorHandle>>;
|
|
29
|
+
export default LinearAxisAnimator;
|
|
@@ -15,7 +15,7 @@ export type RobotProps = {
|
|
|
15
15
|
*
|
|
16
16
|
* @param {RobotProps} props - The properties for the Robot component.
|
|
17
17
|
* @param {ConnectedMotionGroup} props.connectedMotionGroup - The connected motion group containing motion state and parameters.
|
|
18
|
-
* @param {Function} [props.getModel
|
|
18
|
+
* @param {Function} [props.getModel] - Optional function to get the model URL. Defaults to defaultGetModel with the connection of the connected motion group (its URL and access token).
|
|
19
19
|
* @param {Object} props - Additional properties passed to the SupportedRobot component.
|
|
20
20
|
*
|
|
21
21
|
* @returns {JSX.Element} The rendered SupportedRobot component.
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { Object3D } from "three";
|
|
2
2
|
import type { GLTF } from "three-stdlib";
|
|
3
|
+
import { type NovaConnection } from "../../lib/novaConnection";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* Downloads the GLB model of a motion group model from a NOVA instance and
|
|
6
|
+
* returns an object URL for it. Each model downloads once per instance; after
|
|
7
|
+
* a failed download, the next call downloads it again.
|
|
8
|
+
*
|
|
9
|
+
* @param modelFromController - The motion group model, e.g. `UniversalRobots_UR5e`
|
|
10
|
+
* @param connection - The NOVA instance: its base URL, or a NOVA client of the
|
|
11
|
+
* app (see `NovaConnection`), which also gives the access token of a cloud
|
|
12
|
+
* instance. `Robot` and `LinearAxis` pass the connection of their
|
|
13
|
+
* `ConnectedMotionGroup`.
|
|
6
14
|
*/
|
|
7
|
-
export declare function
|
|
8
|
-
/**
|
|
9
|
-
* Revoke all cached model object URLs and clear the cache.
|
|
10
|
-
* Useful for cleanup on app teardown.
|
|
11
|
-
*/
|
|
12
|
-
export declare function revokeAllModelUrls(): Promise<void>;
|
|
13
|
-
export declare function defaultGetModel(modelFromController: string, instanceUrlProp?: string): Promise<string>;
|
|
15
|
+
export declare function defaultGetModel(modelFromController: string, connection?: NovaConnection): Promise<string>;
|
|
14
16
|
/**
|
|
15
17
|
* Finds all the joint groups in a GLTF tree, as identified
|
|
16
18
|
* by the _Jxx name ending convention.
|
|
@@ -6,8 +6,6 @@ export interface CoplanarityResult {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function radiansToDegree(radians: number): number;
|
|
8
8
|
export declare function degreesToRadians(degrees: number): number;
|
|
9
|
-
export declare function tryParseJson(json: unknown): unknown;
|
|
10
|
-
export declare function tryStringifyJson(json: unknown): string | undefined;
|
|
11
9
|
export declare function orientationToQuaternion(orientation: THREE.Vector3): THREE.Quaternion;
|
|
12
10
|
export declare function dhParametersToPlaneSize(dhParameters: DHParameter[]): number;
|
|
13
11
|
export declare function verticesToCoplanarity(vertices: THREE.Vector3[]): CoplanarityResult;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { autorun
|
|
1
|
+
import { autorun } from "mobx";
|
|
2
2
|
import { type EffectCallback } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* Run code once on component mount. Shorthand for useEffect(effect, []).
|
|
@@ -9,11 +9,6 @@ export declare function useMounted(effect: EffectCallback): void;
|
|
|
9
9
|
* clean it up when the component unmounts.
|
|
10
10
|
*/
|
|
11
11
|
export declare function useAutorun(view: Parameters<typeof autorun>[0]): void;
|
|
12
|
-
/**
|
|
13
|
-
* Initialize a mobx reaction watcher on component mount, and
|
|
14
|
-
* clean it up when the component unmounts.
|
|
15
|
-
*/
|
|
16
|
-
export declare function useReaction<T>(expression: Parameters<typeof reaction<T>>[0], effect: Parameters<typeof reaction<T>>[1], opts?: Parameters<typeof reaction<T>>[2]): void;
|
|
17
12
|
/**
|
|
18
13
|
* Run a callback on every animation frame. Cleans up
|
|
19
14
|
* after component unmount.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Try to parse something as JSON; undefined if it is not JSON */
|
|
2
|
+
export declare function tryParseJson(json: unknown): unknown;
|
|
3
|
+
/** Try to turn something into JSON; undefined if that fails */
|
|
4
|
+
export declare function tryStringifyJson(json: unknown): string | undefined;
|
|
@@ -14,10 +14,19 @@ import { type InterpolationOptions } from "./interpolation";
|
|
|
14
14
|
* The returned object is a **stable, MobX-observable** motion state whose
|
|
15
15
|
* `joint_position` is mutated in place every animation frame while the spring
|
|
16
16
|
* settles. Because the object identity never changes, passing it to
|
|
17
|
-
* `<
|
|
17
|
+
* `<SupportedRobotExact rapidlyChangingMotionState={...} />` triggers no React
|
|
18
18
|
* re-renders — the visualizer's own MobX autorun reacts to the mutation and
|
|
19
19
|
* updates the scene directly. All non-joint fields mirror the latest input.
|
|
20
20
|
*
|
|
21
|
+
* The spring steps in a `requestAnimationFrame` loop of its own, so the hook
|
|
22
|
+
* needs no canvas. In a canvas, that loop is separate from React Three
|
|
23
|
+
* Fiber's: a drawn frame can show the step of the frame before, and each step
|
|
24
|
+
* lasts from one callback to the next, however long the drawing in between
|
|
25
|
+
* took. The smoothed visualizers (`SupportedRobot`, `SupportedLinearAxis`,
|
|
26
|
+
* `MotionGroupVisualizer`) step the same spring, with its default options, in
|
|
27
|
+
* the canvas's frame loop instead: prefer them for a smoothed robot in a
|
|
28
|
+
* canvas, unless it needs other options.
|
|
29
|
+
*
|
|
21
30
|
* @example
|
|
22
31
|
* ```tsx
|
|
23
32
|
* const smoothed = useSmoothedMotionState(
|
|
@@ -25,7 +34,7 @@ import { type InterpolationOptions } from "./interpolation";
|
|
|
25
34
|
* { tension: 120, friction: 20 },
|
|
26
35
|
* )
|
|
27
36
|
*
|
|
28
|
-
* <
|
|
37
|
+
* <SupportedRobotExact rapidlyChangingMotionState={smoothed} {...props} />
|
|
29
38
|
* ```
|
|
30
39
|
*/
|
|
31
40
|
export declare function useSmoothedMotionState(motionState: MotionGroupState, options?: InterpolationOptions): MotionGroupState;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { WebGLRenderer, type WebGLRendererParameters } from "three";
|
|
2
|
+
/** Where it was found that the browser cannot draw 3D */
|
|
3
|
+
export type WebGLUnavailableContext = "preflight" | "renderer";
|
|
4
|
+
/** Options of {@link useWebGLRenderer} */
|
|
5
|
+
export type WebGLRendererOptions = {
|
|
6
|
+
/** Whether edges are smoothed */
|
|
7
|
+
antialias?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Called when the canvas loses its WebGL context while it is shown (not
|
|
10
|
+
* when it is removed, which loses it too)
|
|
11
|
+
*/
|
|
12
|
+
onContextLost?: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Called once when the browser cannot draw 3D: found before the canvas
|
|
15
|
+
* mounts ("preflight"), or when its renderer cannot be made ("renderer")
|
|
16
|
+
*/
|
|
17
|
+
onWebGLUnavailable?: (context: WebGLUnavailableContext) => void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The renderer of a React Three Fiber `<Canvas>` (its `gl` prop) that does
|
|
21
|
+
* not leave the canvas loading forever when the browser cannot draw 3D:
|
|
22
|
+
* `unavailable` says whether to show something else instead of the canvas.
|
|
23
|
+
*
|
|
24
|
+
* three.js' `WebGLRenderer` throws when the browser cannot make a WebGL
|
|
25
|
+
* context, inside React Three Fiber's async setup, where no React error
|
|
26
|
+
* boundary catches it. So the browser is checked before the canvas mounts,
|
|
27
|
+
* and a renderer that still cannot be made sets `unavailable` too.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useWebGLRenderer({ antialias, onContextLost, onWebGLUnavailable, }?: WebGLRendererOptions): {
|
|
30
|
+
unavailable: WebGLUnavailableContext | null;
|
|
31
|
+
makeRenderer: (defaults: WebGLRendererParameters) => WebGLRenderer;
|
|
32
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the browser can make a WebGL context: a quick check before the 3D
|
|
3
|
+
* view mounts.
|
|
4
|
+
*
|
|
5
|
+
* three.js' `WebGLRenderer` throws when the browser cannot make a WebGL
|
|
6
|
+
* context (WebGL turned off, no GPU, a blocked driver, …). It throws inside
|
|
7
|
+
* React Three Fiber's async setup, where no React error boundary catches it
|
|
8
|
+
* reliably: only an "Uncaught (in promise)" shows. Checking first lets the
|
|
9
|
+
* view say so instead of mounting a canvas that never comes up.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isWebGLAvailable(): boolean;
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@wandelbots/mui");const e=require("./chunks/ConnectedMotionGroup-ir7Vf690.cjs"),n=require("./chunks/CurrentPoseBar-Cbz4AO36.cjs"),i=require("./chunks/JoggingButtons-paQCBXf4.cjs"),a=require("./chunks/JoggingJointSlider-YcEBMgF1.cjs"),o=require("./chunks/loadRobotSession-DHVuK_pj.cjs"),t=require("./chunks/useSmoothedMotionState-Ce9NjwBu.cjs"),s=require("./chunks/externalizeComponent-B0n_tR3v.cjs"),r=require("./chunks/poseText-BXUaQWnK.cjs"),g=require("./chunks/SafetyBar-Be1c6Vz9.cjs");exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.CurrentPoseBar=n.CurrentPoseBar;exports.JoggingButtons=i.JoggingButtons;exports.JoggingJointSlider=a.JoggingJointSlider;exports.ControllerStateStream=o.ControllerStateStream;exports.JoggerConnection=o.JoggerConnection;exports.JoggingRefusedError=o.JoggingRefusedError;exports.JoggingStore=o.JoggingStore;exports.MotionStreamConnection=o.MotionStreamConnection;exports.ROBOT_LOAD_STEP_IDS=o.ROBOT_LOAD_STEP_IDS;exports.RobotActivation=o.RobotActivation;exports.RobotDescription=o.RobotDescription;exports.RobotLiveState=o.RobotLiveState;exports.RobotLoadProgress=o.RobotLoadProgress;exports.RobotLoadStepError=o.RobotLoadStepError;exports.RobotModeChangeError=o.RobotModeChangeError;exports.RobotSafety=o.RobotSafety;exports.RobotSession=o.RobotSession;exports.RobotSessionLoad=o.RobotSessionLoad;exports.RobotTargetPose=o.RobotTargetPose;exports.TrajectoryExecutionStore=o.TrajectoryExecutionStore;exports.deriveSelectedTcpPose=o.deriveSelectedTcpPose;exports.isRobotLoadStepError=o.isRobotLoadStepError;exports.jointValuesEqual=o.jointValuesEqual;exports.loadRobotSession=o.loadRobotSession;exports.planErrorTranslationKey=o.planErrorTranslationKey;exports.poseEqual=o.poseEqual;exports.resolveCoordinateSystemInWorld=o.resolveCoordinateSystemInWorld;exports.tcpMotionEqual=o.tcpMotionEqual;exports.transformPoseToCoordinateSystem=o.transformPoseToCoordinateSystem;exports.unwrapRotationVector=o.unwrapRotationVector;exports.ValueInterpolator=t.ValueInterpolator;exports.useInterpolation=t.useInterpolation;exports.useSmoothedMotionState=t.useSmoothedMotionState;exports.i18n=s.i18n;exports.jointsToText=r.jointsToText;exports.poseToText=r.poseToText;exports.SafetyBar=g.SafetyBar;
|