@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,38 @@
|
|
|
1
|
+
import type { RobotControllerState } from "@wandelbots/nova-js/v2";
|
|
2
|
+
import { type NovaConnection } from "./novaConnection";
|
|
3
|
+
/**
|
|
4
|
+
* Where a robot's live controller state comes from: NOVA's websocket (what
|
|
5
|
+
* `loadRobotSession` opens without a `stateSource`), NATS
|
|
6
|
+
* (`natsControllerStateSource` of `/nats`), or a source of the app's own.
|
|
7
|
+
* It works like a WebSocket that reconnects itself: the session's
|
|
8
|
+
* `ControllerStateStream` listens to its messages and asks it to reconnect
|
|
9
|
+
* when they stop coming.
|
|
10
|
+
*/
|
|
11
|
+
export type ControllerStateSource = {
|
|
12
|
+
/** Where it connects, for error reports */
|
|
13
|
+
readonly url: string;
|
|
14
|
+
/** 1 (`WebSocket.OPEN`) while it is connected */
|
|
15
|
+
readonly readyState: number;
|
|
16
|
+
addEventListener(type: "message", listener: (event: MessageEvent) => void): void;
|
|
17
|
+
removeEventListener(type: "message", listener: (event: MessageEvent) => void): void;
|
|
18
|
+
/** Resolves with the first message, also when it came already */
|
|
19
|
+
firstMessage(): Promise<MessageEvent>;
|
|
20
|
+
/** Resolves with the next message */
|
|
21
|
+
nextMessage(): Promise<MessageEvent>;
|
|
22
|
+
reconnect(): void;
|
|
23
|
+
close(): void;
|
|
24
|
+
/** The controller state that a message's data holds, if any */
|
|
25
|
+
parse(data: unknown): RobotControllerState | undefined;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The live state of a controller from NOVA's websocket
|
|
29
|
+
* (`/cells/{cell}/controllers/{controller}/state-stream`): safety state,
|
|
30
|
+
* operation mode, mode, and the state of each of its motion groups
|
|
31
|
+
*/
|
|
32
|
+
export declare function controllerStateWebsocket(connection: NovaConnection, { controllerId, cellId, responseRateMs, }: {
|
|
33
|
+
controllerId: string;
|
|
34
|
+
/** Defaults to the cell of an older nova-js client, or "cell" */
|
|
35
|
+
cellId?: string;
|
|
36
|
+
/** How often NOVA sends the state, in ms; NOVA's own default without it */
|
|
37
|
+
responseRateMs?: number;
|
|
38
|
+
}): ControllerStateSource;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Pose } from "@wandelbots/nova-js/v2";
|
|
2
|
+
import { type Quat } from "./poseMath";
|
|
3
|
+
export type JoggingAxis = "x" | "y" | "z";
|
|
4
|
+
export type JoggingDirection = "-" | "+";
|
|
5
|
+
/** The distance of a step jog: a translation in mm or a rotation in rad */
|
|
6
|
+
export type IncrementalMotion = {
|
|
7
|
+
type: "rotate";
|
|
8
|
+
distanceRads: number;
|
|
9
|
+
} | {
|
|
10
|
+
type: "translate";
|
|
11
|
+
distanceMm: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Compute the target TCP pose for a single incremental cartesian jog step.
|
|
15
|
+
*
|
|
16
|
+
* The motion is a fixed translation (mm) or rotation (rad) along/around one
|
|
17
|
+
* cartesian axis. When `useToolCoordinateSystem` is false the axis is
|
|
18
|
+
* interpreted in the coordinate system frame (base/world, or the coordinate
|
|
19
|
+
* system given by `coordinateSystemRotation`); when true it is interpreted in
|
|
20
|
+
* the tool frame, i.e. relative to the current TCP orientation.
|
|
21
|
+
*
|
|
22
|
+
* This mirrors the `use_tool_coordinate_system` flag used for continuous
|
|
23
|
+
* jogging, but here the target pose has to be resolved on the client because
|
|
24
|
+
* the motion is planned as a trajectory to an absolute pose.
|
|
25
|
+
*/
|
|
26
|
+
export declare function computeIncrementalTargetPose({ currentTcpPose, axis, direction, motion, useToolCoordinateSystem, coordinateSystemRotation, }: {
|
|
27
|
+
currentTcpPose: Pose;
|
|
28
|
+
axis: JoggingAxis;
|
|
29
|
+
direction: JoggingDirection;
|
|
30
|
+
motion: IncrementalMotion;
|
|
31
|
+
useToolCoordinateSystem: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Rotation of the coordinate system whose axes the motion follows, relative
|
|
34
|
+
* to the base frame of `currentTcpPose`. Ignored in tool orientation.
|
|
35
|
+
*/
|
|
36
|
+
coordinateSystemRotation?: Quat;
|
|
37
|
+
}): {
|
|
38
|
+
position?: number[];
|
|
39
|
+
orientation?: number[];
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
import type { MotionGroupState, Pose } from "@wandelbots/nova-js/v2";
|
|
2
2
|
import type { Vector3Simple } from "./JoggerConnection";
|
|
3
|
+
/**
|
|
4
|
+
* Whether two sets of joint values are the same within `changeDeltaThreshold`:
|
|
5
|
+
* a different number of joints is never the same
|
|
6
|
+
*
|
|
7
|
+
* @deprecated A helper of the library's motion stream, not meant for apps.
|
|
8
|
+
* Compare the joints in the app. Removed in the next major version.
|
|
9
|
+
*/
|
|
3
10
|
export declare function jointValuesEqual(oldJointValues: number[], newJointValues: number[], changeDeltaThreshold: number): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Like {@link jointValuesEqual}, but a change of the number of joints counts
|
|
13
|
+
* as unchanged: the dedupe of a motion stream, where another number of joints
|
|
14
|
+
* means another motion group, which the stream handles on its own. Not for
|
|
15
|
+
* real equality checks.
|
|
16
|
+
*/
|
|
17
|
+
export declare function jointValuesUnchanged(oldJointValues: number[], newJointValues: number[], changeDeltaThreshold: number): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated A helper of the library's motion stream, not meant for apps.
|
|
20
|
+
* Compare the poses in the app. Removed in the next major version.
|
|
21
|
+
*/
|
|
4
22
|
export declare function poseEqual(oldTcp: Pose | undefined, newTcp: Pose | undefined, changeDeltaThreshold: number): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Runs poseEqual check + coordinate system/tcp name equality
|
|
25
|
+
*
|
|
26
|
+
* @deprecated A helper of the library's motion stream, not meant for apps.
|
|
27
|
+
* Compare the motion states in the app. Removed in the next major version.
|
|
28
|
+
*/
|
|
5
29
|
export declare function tcpMotionEqual(oldMotionState: MotionGroupState, newMotionState: MotionGroupState, changeDeltaThreshold: number): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated A helper of the library's motion stream, not meant for apps.
|
|
32
|
+
* Removed in the next major version.
|
|
33
|
+
*/
|
|
6
34
|
export declare function unwrapRotationVector(newRotationVectorApi: Vector3Simple, currentRotationVectorApi: Vector3Simple): Vector3Simple;
|
|
35
|
+
/** The part of a motion state that pose readouts show */
|
|
36
|
+
export type MotionStateReadout = Pick<MotionGroupState, "joint_position" | "tcp_pose" | "tcp" | "coordinate_system">;
|
|
37
|
+
/**
|
|
38
|
+
* The part of a motion state that pose readouts show, snapshotted so that
|
|
39
|
+
* {@link readoutsEqual} can compare the held reading with the next one. The
|
|
40
|
+
* streams replace these fields instead of mutating them, which keeps a held
|
|
41
|
+
* snapshot intact.
|
|
42
|
+
*/
|
|
43
|
+
export declare function readoutOf(motionState: MotionGroupState): MotionStateReadout;
|
|
44
|
+
/**
|
|
45
|
+
* The `equals` of a computed readout: it keeps showing the reading it holds
|
|
46
|
+
* until a joint moved more than `JOINT_NOISE_THRESHOLD` (0.0002 rad) from it, or the
|
|
47
|
+
* TCP or coordinate system changed. Slow movement adds up against the held
|
|
48
|
+
* reading, so it still shows.
|
|
49
|
+
*/
|
|
50
|
+
export declare function readoutsEqual(shown: MotionStateReadout, next: MotionStateReadout): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ConnectionLogger } from "../connectionLogger";
|
|
2
|
+
import type { ControllerStateSource } from "../controllerStateSource";
|
|
3
|
+
import type { NovaConnection } from "../novaConnection";
|
|
4
|
+
/** What {@link natsControllerStateSource} connects to */
|
|
5
|
+
export type NatsControllerStateSourceOptions = {
|
|
6
|
+
/** The websocket URL of the NATS server, e.g. from {@link natsUrlOf} */
|
|
7
|
+
url: string;
|
|
8
|
+
/** The NOVA cell; defaults to "cell" */
|
|
9
|
+
cellId?: string;
|
|
10
|
+
controllerId: string;
|
|
11
|
+
/** Where the connection logs. Defaults to the console. */
|
|
12
|
+
logger?: ConnectionLogger;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The live state of a controller from NOVA's NATS server, on the subject
|
|
16
|
+
* `nova.v2.cells.{cell}.controllers.{controller}.state`. NATS sends the state
|
|
17
|
+
* as it changes, without the response rate of the websocket.
|
|
18
|
+
*
|
|
19
|
+
* Needs the optional peer dependency `nats.ws`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function natsControllerStateSource(options: NatsControllerStateSourceOptions): ControllerStateSource;
|
|
22
|
+
/**
|
|
23
|
+
* The websocket URL of a NOVA instance's NATS server: `/api/nats` on its
|
|
24
|
+
* host, over wss for https and ws for http. A relative instance URL is read
|
|
25
|
+
* against the page's origin.
|
|
26
|
+
*/
|
|
27
|
+
export declare function natsUrlOf(connection: NovaConnection): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Nova } from "@wandelbots/nova-js/v2";
|
|
2
|
+
/**
|
|
3
|
+
* How the library connects to a NOVA instance: the base URL of the
|
|
4
|
+
* instance, or a NOVA client of the app (`Nova` of `@wandelbots/nova-js`,
|
|
5
|
+
* also of another version than the library's).
|
|
6
|
+
*
|
|
7
|
+
* The library reads only the URL and the access token of the app's client,
|
|
8
|
+
* and connects with its own client of its own nova-js version. So a newer
|
|
9
|
+
* or older nova-js in the app does not change the library.
|
|
10
|
+
*/
|
|
11
|
+
export type NovaConnection = string | {
|
|
12
|
+
readonly config: {
|
|
13
|
+
readonly instanceUrl: string;
|
|
14
|
+
readonly accessToken?: string;
|
|
15
|
+
/** The cell of the cell-scoped `NovaClient` of older nova-js versions */
|
|
16
|
+
readonly cellId?: string;
|
|
17
|
+
};
|
|
18
|
+
readonly accessToken?: string | null;
|
|
19
|
+
};
|
|
20
|
+
/** The library's own NOVA client for a connection */
|
|
21
|
+
export declare function createNovaClient(connection: NovaConnection): Nova;
|
|
22
|
+
/** The cell of a cell-scoped client of an older nova-js version, if any */
|
|
23
|
+
export declare function cellIdOf(connection: NovaConnection): string | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The translation key that explains why the planner rejected a target, from
|
|
3
|
+
* the `errorFeedbackName` of a rejected `TrajectoryExecutionStore.planTrajectory`
|
|
4
|
+
* (e.g. "FeedbackOutOfWorkspace"). Reachability-type failures share one
|
|
5
|
+
* message; anything unrecognized gets the generic fallback. The texts are in
|
|
6
|
+
* the library's `i18n`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function planErrorTranslationKey(errorFeedbackName: string): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { CoordinateSystem, OrientationType, Pose, RobotTcp } from "@wandelbots/nova-js/v2";
|
|
2
|
+
/** x, y, z */
|
|
3
|
+
export type Vec3 = [number, number, number];
|
|
4
|
+
/** A rotation as a quaternion. A three.js `Quaternion` is one too. */
|
|
5
|
+
export type Quat = {
|
|
6
|
+
readonly x: number;
|
|
7
|
+
readonly y: number;
|
|
8
|
+
readonly z: number;
|
|
9
|
+
readonly w: number;
|
|
10
|
+
};
|
|
11
|
+
/** A pose as a position and the quaternion of its orientation */
|
|
12
|
+
export type PlainPose = {
|
|
13
|
+
readonly position: Readonly<Vec3>;
|
|
14
|
+
readonly quaternion: Quat;
|
|
15
|
+
};
|
|
16
|
+
export declare function vectorLength([x, y, z]: Readonly<Vec3>): number;
|
|
17
|
+
export declare function scaleVector([x, y, z]: Readonly<Vec3>, scalar: number): Vec3;
|
|
18
|
+
/** The vector with length 1. A vector without length stays as it is. */
|
|
19
|
+
export declare function normalizeVector(vector: Readonly<Vec3>): Vec3;
|
|
20
|
+
export declare function dotVectors(a: Readonly<Vec3>, b: Readonly<Vec3>): number;
|
|
21
|
+
/** A vector of the given length along one axis */
|
|
22
|
+
export declare function vectorAlongAxis(axis: "x" | "y" | "z", length: number): Vec3;
|
|
23
|
+
/** The vector turned by a quaternion of length 1 */
|
|
24
|
+
export declare function rotateVector([vx, vy, vz]: Readonly<Vec3>, { x: qx, y: qy, z: qz, w: qw }: Quat): Vec3;
|
|
25
|
+
/** The rotation by an angle in rad about an axis of length 1 */
|
|
26
|
+
export declare function quaternionOfAxisAngle(axis: Readonly<Vec3>, angle: number): Quat;
|
|
27
|
+
/** The rotation `b`, then the rotation `a` */
|
|
28
|
+
export declare function multiplyQuaternions(a: Quat, b: Quat): Quat;
|
|
29
|
+
/**
|
|
30
|
+
* The quaternion of an orientation of the NOVA API. Supports rotation
|
|
31
|
+
* vectors and quaternions; any other type warns and gives no rotation. A
|
|
32
|
+
* quaternion is taken as it is, also when it is not of length 1.
|
|
33
|
+
*/
|
|
34
|
+
export declare function quaternionOfOrientation(orientation?: readonly number[], orientationType?: OrientationType): Quat;
|
|
35
|
+
/**
|
|
36
|
+
* A quaternion as a rotation vector: its direction is the axis, its length
|
|
37
|
+
* the angle in rad, up to a half turn
|
|
38
|
+
* See https://code.wabo.run/robotics/wb-robotix/-/blob/develop/src/math/core/include/wb/math/QuaternionBasePlugin.h
|
|
39
|
+
*/
|
|
40
|
+
export declare function rotationVectorOfQuaternion({ x, y, z, w }: Quat): Vec3;
|
|
41
|
+
/** A pose of the NOVA API: its orientation is a rotation vector */
|
|
42
|
+
export declare function poseOf(pose: Pose): PlainPose;
|
|
43
|
+
/**
|
|
44
|
+
* The pose of a coordinate system in its reference, or of a TCP in the
|
|
45
|
+
* flange: its orientation has a type, a rotation vector without one
|
|
46
|
+
*/
|
|
47
|
+
export declare function poseOfFrame(frame: Pick<CoordinateSystem | RobotTcp, "position" | "orientation" | "orientation_type">): PlainPose;
|
|
48
|
+
/** The pose `b`, which is relative to the pose `a`, in the frame that `a` is in */
|
|
49
|
+
export declare function composePoses(a: PlainPose, b: PlainPose): PlainPose;
|
|
50
|
+
/** The pose back: `pose` composed with it is no move and no rotation */
|
|
51
|
+
export declare function invertPose(pose: PlainPose): PlainPose;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the robot is activated, i.e. its controller is in control mode
|
|
3
|
+
* (MODE_CONTROL) rather than monitor mode
|
|
4
|
+
*/
|
|
5
|
+
export type RobotActivationState = "inactive" | "activating" | "deactivating" | "active";
|
|
6
|
+
/**
|
|
7
|
+
* How long a mode change waits for the controller to report the new mode.
|
|
8
|
+
* NOVA accepts a request that the controller does not follow, e.g. in manual
|
|
9
|
+
* operation mode without the confirmation at its panel: the change is over
|
|
10
|
+
* then, and can be asked for again. A controller that confirms later is
|
|
11
|
+
* followed all the same.
|
|
12
|
+
*/
|
|
13
|
+
export declare const MODE_CHANGE_TIMEOUT_MS = 30000;
|
|
14
|
+
/** A mode change that NOVA refused or that failed; `url` is the request's */
|
|
15
|
+
export declare class RobotModeChangeError extends Error {
|
|
16
|
+
readonly url: string;
|
|
17
|
+
readonly cause: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The robot's activation: it follows the mode that the controller reports,
|
|
21
|
+
* and switches the mode on request
|
|
22
|
+
*/
|
|
23
|
+
export declare class RobotActivation {
|
|
24
|
+
private readonly nova;
|
|
25
|
+
private readonly ids;
|
|
26
|
+
private readonly live;
|
|
27
|
+
private readonly safety;
|
|
28
|
+
private readonly logger;
|
|
29
|
+
/**
|
|
30
|
+
* Hands back what holds the controller in control mode (a step that
|
|
31
|
+
* runs, a planned move's execution session): until then, it does not
|
|
32
|
+
* leave it
|
|
33
|
+
*/
|
|
34
|
+
private readonly releaseControl;
|
|
35
|
+
/**
|
|
36
|
+
* The mode change that was asked for and that the controller has not
|
|
37
|
+
* reported yet
|
|
38
|
+
*/
|
|
39
|
+
private pending;
|
|
40
|
+
/** Ends the wait of the pending mode change */
|
|
41
|
+
private endPending;
|
|
42
|
+
/**
|
|
43
|
+
* Set by `dispose`: an app may still show the session, and its robot gets
|
|
44
|
+
* no mode change from it any more
|
|
45
|
+
*/
|
|
46
|
+
private disposed;
|
|
47
|
+
/**
|
|
48
|
+
* What the controller reports, or null while its live state does not
|
|
49
|
+
* come: the mode cannot be confirmed then
|
|
50
|
+
*/
|
|
51
|
+
private get reported();
|
|
52
|
+
/**
|
|
53
|
+
* The mode change in progress, else what the controller reports. The
|
|
54
|
+
* controller's mode is the source of truth: without a mode change, the
|
|
55
|
+
* state is derived from the live state and nothing else, so it cannot
|
|
56
|
+
* drift from it. Inactive while the live state does not come.
|
|
57
|
+
*/
|
|
58
|
+
get state(): RobotActivationState;
|
|
59
|
+
/**
|
|
60
|
+
* Switches the controller to control mode. Does nothing while a mode change
|
|
61
|
+
* is in progress, when the safety state or operation mode would make
|
|
62
|
+
* NOVA refuse it (see {@link RobotSafety.activationBlockedReason}), and
|
|
63
|
+
* once the session is disposed. Rejects with a
|
|
64
|
+
* {@link RobotModeChangeError} when NOVA refuses it.
|
|
65
|
+
*/
|
|
66
|
+
activate(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Switches the controller to monitor mode, after handing back a planned
|
|
69
|
+
* move, which holds it in control mode. Does nothing once the session is
|
|
70
|
+
* disposed. Rejects with a {@link RobotModeChangeError} when NOVA refuses
|
|
71
|
+
* it.
|
|
72
|
+
*/
|
|
73
|
+
deactivate(): Promise<void>;
|
|
74
|
+
/** Activates an inactive robot, deactivates an active one */
|
|
75
|
+
toggle(): Promise<void>;
|
|
76
|
+
/** Ends a mode change's wait; no mode change is asked for afterwards */
|
|
77
|
+
dispose(): void;
|
|
78
|
+
/** Whether the session is disposed, which then asks NOVA for nothing */
|
|
79
|
+
private refusedAsDisposed;
|
|
80
|
+
/**
|
|
81
|
+
* Shows a mode change until it is over: the controller reports the mode
|
|
82
|
+
* that was asked for, the request fails, or the controller has not
|
|
83
|
+
* confirmed it after 30 s (`MODE_CHANGE_TIMEOUT_MS`). Then the state is
|
|
84
|
+
* what the controller reports again, and the change can be asked for
|
|
85
|
+
* again.
|
|
86
|
+
*/
|
|
87
|
+
private changeMode;
|
|
88
|
+
private setPending;
|
|
89
|
+
private setMode;
|
|
90
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type CoordinateSystem, type DHParameter, JointTypeEnum, type KinematicModel, type MotionGroupDescription, type RobotControllerConfiguration } from "@wandelbots/nova-js/v2";
|
|
2
|
+
/**
|
|
3
|
+
* What NOVA describes about a robot: its model, kinematics, limits, safety
|
|
4
|
+
* zones, TCPs and the coordinate systems of its controller
|
|
5
|
+
*/
|
|
6
|
+
export declare class RobotDescription {
|
|
7
|
+
/** The motion group's description as NOVA gives it */
|
|
8
|
+
readonly motionGroupDescription: MotionGroupDescription;
|
|
9
|
+
readonly controllerConfiguration: RobotControllerConfiguration;
|
|
10
|
+
/** The model's kinematics: its inverse solver, chain and flange offsets */
|
|
11
|
+
readonly kinematicModel: KinematicModel;
|
|
12
|
+
/**
|
|
13
|
+
* The model that holds this robot's data: the custom copy registered for
|
|
14
|
+
* its serial number, or {@link RobotDescription.motionGroupModel} otherwise. Planner
|
|
15
|
+
* requests carry only a model name, so they must send this one.
|
|
16
|
+
*/
|
|
17
|
+
readonly resolvedMotionGroupModel: string;
|
|
18
|
+
/**
|
|
19
|
+
* The coordinate systems of the robot's controller. Not a cell-wide list:
|
|
20
|
+
* an id that exists on several controllers would resolve to another
|
|
21
|
+
* robot's frame.
|
|
22
|
+
*/
|
|
23
|
+
readonly coordinateSystems: CoordinateSystem[];
|
|
24
|
+
/**
|
|
25
|
+
* The DH parameters of the joints, with the values that NOVA leaves out
|
|
26
|
+
* because they are 0 filled in; empty for a motion group without them
|
|
27
|
+
*/
|
|
28
|
+
readonly dhParameters: DHParameter[];
|
|
29
|
+
/** A virtual robot of NOVA's simulation, not a physical one */
|
|
30
|
+
get isVirtual(): boolean;
|
|
31
|
+
/** The model the controller reports */
|
|
32
|
+
get motionGroupModel(): string;
|
|
33
|
+
get serialNumber(): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The inverse solver of the model; null for a model without one, such as a
|
|
36
|
+
* linear axis or a turntable, which jogs its joints only
|
|
37
|
+
*/
|
|
38
|
+
get inverseSolver(): string | undefined;
|
|
39
|
+
/** Revolute, or prismatic for a linear axis */
|
|
40
|
+
get jointType(): JointTypeEnum;
|
|
41
|
+
/** The joints' limits in automatic mode, one per joint */
|
|
42
|
+
get jointLimits(): import("@wandelbots/nova-js/v2").JointLimits[];
|
|
43
|
+
get safetyZones(): {
|
|
44
|
+
[key: string]: import("@wandelbots/nova-js/v2").Collider;
|
|
45
|
+
} | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Per-link safety colliders (`safety_link_colliders`): entry k is in the
|
|
48
|
+
* frame after k DH transforms (entry 0 = the static base). Not every
|
|
49
|
+
* controller gives them.
|
|
50
|
+
*/
|
|
51
|
+
get safetyLinkColliders(): {
|
|
52
|
+
[key: string]: import("@wandelbots/nova-js/v2").Collider;
|
|
53
|
+
}[] | undefined;
|
|
54
|
+
/** The collision shapes of each tool (TCP), at the flange */
|
|
55
|
+
get safetyToolColliders(): {
|
|
56
|
+
[key: string]: {
|
|
57
|
+
[key: string]: import("@wandelbots/nova-js/v2").Collider;
|
|
58
|
+
};
|
|
59
|
+
} | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Constant transformation between the motion group base frame and the start
|
|
62
|
+
* of the DH chain. From the kinematic model, which always reflects the
|
|
63
|
+
* current robot data; the motion group description is only the fallback, as
|
|
64
|
+
* controllers snapshot the offset when they are created. Null means
|
|
65
|
+
* identity.
|
|
66
|
+
*/
|
|
67
|
+
get kinematicChainOffset(): import("@wandelbots/nova-js/v2").Pose | null;
|
|
68
|
+
/**
|
|
69
|
+
* Constant transformation between the end of the DH chain and the flange
|
|
70
|
+
* frame, sourced as {@link RobotDescription.kinematicChainOffset}
|
|
71
|
+
*/
|
|
72
|
+
get flangeOffset(): import("@wandelbots/nova-js/v2").Pose | null;
|
|
73
|
+
/** Where the robot is mounted in the cell (mm, rotation vector), if set */
|
|
74
|
+
get mounting(): import("@wandelbots/nova-js/v2").Pose | null;
|
|
75
|
+
/** The robot's TCPs, by id and name */
|
|
76
|
+
get tcps(): {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
}[];
|
|
80
|
+
/** The TCPs' offsets from the flange, by TCP id */
|
|
81
|
+
get tcpOffsetsById(): {
|
|
82
|
+
[key: string]: import("@wandelbots/nova-js/v2").TcpOffset;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type ControllerStateStream } from "../ControllerStateStream";
|
|
2
|
+
import { type MotionStateReadout } from "../motionStateUpdate";
|
|
3
|
+
import { type TcpReferencedPose } from "../PoseTransformer";
|
|
4
|
+
import type { RobotPose } from "./robotPose";
|
|
5
|
+
/**
|
|
6
|
+
* A robot's live state: its controller's state and its motion state as they
|
|
7
|
+
* come, and its TCP pose in the TCP and coordinate system that the jogging
|
|
8
|
+
* store has selected
|
|
9
|
+
*/
|
|
10
|
+
export declare class RobotLiveState {
|
|
11
|
+
/** The stream the state comes from */
|
|
12
|
+
readonly stream: ControllerStateStream;
|
|
13
|
+
private readonly description;
|
|
14
|
+
private readonly jogging;
|
|
15
|
+
/** Safety state, operation mode and mode of the controller */
|
|
16
|
+
get controllerState(): import("@wandelbots/nova-js/v2").RobotControllerState;
|
|
17
|
+
/**
|
|
18
|
+
* The motion state as the last message had it: one object for the whole
|
|
19
|
+
* session, updated in place (see {@link ControllerStateStream})
|
|
20
|
+
*/
|
|
21
|
+
get rapidlyChangingMotionState(): import("@wandelbots/nova-js/v2").MotionGroupState;
|
|
22
|
+
/** What readouts show: it holds while the joints only jitter */
|
|
23
|
+
get readoutState(): MotionStateReadout;
|
|
24
|
+
/** The joints readouts show, from {@link RobotLiveState.readoutState} */
|
|
25
|
+
get jointPose(): number[];
|
|
26
|
+
get connectionQuality(): "good" | "struggling" | "critical";
|
|
27
|
+
get lastValidStateMessage(): {
|
|
28
|
+
receivedAt: number;
|
|
29
|
+
data: import("@wandelbots/nova-js/v2").RobotControllerState;
|
|
30
|
+
};
|
|
31
|
+
get lastInvalidStateMessage(): {
|
|
32
|
+
receivedAt: number;
|
|
33
|
+
data: unknown;
|
|
34
|
+
} | null;
|
|
35
|
+
/**
|
|
36
|
+
* The TCP pose as NOVA reports it, in its own TCP and coordinate system.
|
|
37
|
+
* Throws for a motion group that reports no TCP pose.
|
|
38
|
+
*/
|
|
39
|
+
get measuredTcpPoseReference(): TcpReferencedPose;
|
|
40
|
+
/**
|
|
41
|
+
* The measured TCP pose in the TCP and coordinate system that the jogging
|
|
42
|
+
* store has selected: what a stored or typed pose uses. Throws for a motion
|
|
43
|
+
* group that reports no TCP pose.
|
|
44
|
+
*/
|
|
45
|
+
get displayedTcpPoseReference(): TcpReferencedPose;
|
|
46
|
+
/**
|
|
47
|
+
* The pose readouts show, from {@link RobotLiveState.readoutState}, in the
|
|
48
|
+
* selected frame. null for a motion group that reports no TCP pose (a
|
|
49
|
+
* positioner, a turntable): a readout reads this while it renders, so it
|
|
50
|
+
* does not throw as the poses to store and to plan do.
|
|
51
|
+
*/
|
|
52
|
+
get displayedTcpPose(): TcpReferencedPose["pose"] | null;
|
|
53
|
+
/**
|
|
54
|
+
* Whether the robot stands at a pose: its joints within 0.001, or its TCP
|
|
55
|
+
* within 0.5 mm and 0.01 rad of the pose in the pose's TCP and coordinate
|
|
56
|
+
* system. Not at a pose of a TCP or coordinate system it does not know.
|
|
57
|
+
*/
|
|
58
|
+
isAt(pose: RobotPose): boolean;
|
|
59
|
+
/** The motion state in the stream's next message */
|
|
60
|
+
nextMotionState(): Promise<import("@wandelbots/nova-js/v2").MotionGroupState>;
|
|
61
|
+
/** Resolves once two messages in a row show the joints standing still */
|
|
62
|
+
waitUntilStopped(): Promise<void>;
|
|
63
|
+
private tcpPoseReferenceOf;
|
|
64
|
+
private inSelectedFrame;
|
|
65
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delays before each automatic retry of a failed robot load. A robot that was
|
|
3
|
+
* just powered up or a controller that is still initializing usually recovers
|
|
4
|
+
* within a few seconds, so we retry quietly before bothering the user.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AUTO_RETRY_DELAYS_MS: number[];
|
|
7
|
+
/**
|
|
8
|
+
* The distinct pieces of data an app needs before it can show and control a
|
|
9
|
+
* robot, in the order they are loaded. Kept explicit (rather than implicit in
|
|
10
|
+
* the await chain of the load) so the UI can tell the user
|
|
11
|
+
* how far the load got and which piece failed.
|
|
12
|
+
*/
|
|
13
|
+
export declare const ROBOT_LOAD_STEP_IDS: readonly ["motionGroupDescription", "controllerConfiguration", "kinematicModel", "motionGroupModel", "coordinateSystems", "controllerState", "motionStateStream", "controllerStateStream"];
|
|
14
|
+
export type RobotLoadStepId = (typeof ROBOT_LOAD_STEP_IDS)[number];
|
|
15
|
+
export type RobotLoadStepStatus = "pending" | "running" | "succeeded" | "failed";
|
|
16
|
+
export type RobotLoadStep = {
|
|
17
|
+
id: RobotLoadStepId;
|
|
18
|
+
status: RobotLoadStepStatus;
|
|
19
|
+
/** Endpoint the step talks to; shown to the user and included in support details */
|
|
20
|
+
url: string | null;
|
|
21
|
+
error: unknown;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown by a load step, carrying the step it belongs to so the caller
|
|
25
|
+
* can tell a transient connection problem (worth retrying) apart from a
|
|
26
|
+
* programming error.
|
|
27
|
+
*/
|
|
28
|
+
export declare class RobotLoadStepError extends Error {
|
|
29
|
+
readonly stepId: RobotLoadStepId;
|
|
30
|
+
readonly cause: unknown;
|
|
31
|
+
constructor(stepId: RobotLoadStepId, cause: unknown, message: string);
|
|
32
|
+
}
|
|
33
|
+
export declare function isRobotLoadStepError(err: unknown): err is RobotLoadStepError;
|
|
34
|
+
/**
|
|
35
|
+
* Observable progress of loading a single robot: which steps have completed,
|
|
36
|
+
* which one is currently running, and which one failed. Drives both the
|
|
37
|
+
* loading screen and the failure screen.
|
|
38
|
+
*/
|
|
39
|
+
export declare class RobotLoadProgress {
|
|
40
|
+
/** The robot this progress refers to; null before any load has started */
|
|
41
|
+
motionGroupId: string | null;
|
|
42
|
+
controllerId: string | null;
|
|
43
|
+
steps: RobotLoadStep[];
|
|
44
|
+
/** 0 while on the first try, 1.. while auto-retrying */
|
|
45
|
+
retryAttempt: number;
|
|
46
|
+
/** Set when the load gave up; failure is also implied by a failed step */
|
|
47
|
+
fatalError: unknown;
|
|
48
|
+
/** When the currently running step started, for the "still waiting" hint */
|
|
49
|
+
currentStepStartedAt: number | null;
|
|
50
|
+
/**
|
|
51
|
+
* One instance tracks one load. Concurrent loads must not share one — a load
|
|
52
|
+
* that has been superseded keeps reporting for a step or two before it
|
|
53
|
+
* notices, and those reports would otherwise overwrite the state of the load
|
|
54
|
+
* that replaced it (clearing a recorded failure, for instance).
|
|
55
|
+
*/
|
|
56
|
+
constructor(motionGroupId?: string | null, controllerId?: string | null);
|
|
57
|
+
/** Reset the step states for another attempt at the same robot */
|
|
58
|
+
beginRetry(attempt: number): void;
|
|
59
|
+
private stepById;
|
|
60
|
+
startStep(id: RobotLoadStepId, url: string | null): void;
|
|
61
|
+
updateStepUrl(id: RobotLoadStepId, url: string): void;
|
|
62
|
+
succeedStep(id: RobotLoadStepId): void;
|
|
63
|
+
failStep(id: RobotLoadStepId, error: unknown): void;
|
|
64
|
+
/** A failure that is not tied to a specific step (e.g. an invalid selection) */
|
|
65
|
+
failWith(error: unknown): void;
|
|
66
|
+
get totalCount(): number;
|
|
67
|
+
get succeededCount(): number;
|
|
68
|
+
get runningStep(): RobotLoadStep | undefined;
|
|
69
|
+
get failedStep(): RobotLoadStep | undefined;
|
|
70
|
+
get isFailed(): boolean;
|
|
71
|
+
get isComplete(): boolean;
|
|
72
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a robot cannot move now, as a code an app can translate. `value` is the
|
|
3
|
+
* controller's state behind it.
|
|
4
|
+
*/
|
|
5
|
+
export type RobotNotMoveableReason =
|
|
6
|
+
/** The live state stopped coming */
|
|
7
|
+
{
|
|
8
|
+
code: "disconnected";
|
|
9
|
+
}
|
|
10
|
+
/** The safety state does not allow movement, e.g. an emergency stop */
|
|
11
|
+
| {
|
|
12
|
+
code: "safety_state";
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
/** The operation mode does not allow movement */
|
|
16
|
+
| {
|
|
17
|
+
code: "operation_mode";
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
/** The robot is not activated (the controller is not in control mode) */
|
|
21
|
+
| {
|
|
22
|
+
code: "deactivated";
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Whether a robot may be activated and moved, from its controller's safety
|
|
26
|
+
* state and operation mode, its activation and its connection
|
|
27
|
+
*/
|
|
28
|
+
export declare class RobotSafety {
|
|
29
|
+
private readonly state;
|
|
30
|
+
private readonly activationState;
|
|
31
|
+
private get safetyState();
|
|
32
|
+
private get operationMode();
|
|
33
|
+
/** Whether an emergency stop is active */
|
|
34
|
+
get isEstopActive(): boolean;
|
|
35
|
+
/** Whether the safety state allows movement */
|
|
36
|
+
get isMoveableSafetyState(): boolean;
|
|
37
|
+
/** Whether the operation mode allows movement */
|
|
38
|
+
get isMoveableOperationMode(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the safety state allows switching to control mode: the moveable
|
|
41
|
+
* ones and the stop states (RPS-1296)
|
|
42
|
+
*/
|
|
43
|
+
get isActivatableSafetyState(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Why the controller cannot be switched to control mode now, or null. NOVA
|
|
46
|
+
* refuses the mode change then (an emergency stop needs a hand on the
|
|
47
|
+
* physical controller), so it is not even requested.
|
|
48
|
+
*/
|
|
49
|
+
get activationBlockedReason(): string | null;
|
|
50
|
+
/** Whether the robot may be activated now */
|
|
51
|
+
get canBeActive(): boolean;
|
|
52
|
+
/** Why the robot cannot move now, or null when it can */
|
|
53
|
+
get notMoveableReason(): RobotNotMoveableReason | null;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the robot can move now: a moveable safety state and operation
|
|
56
|
+
* mode, activated, and its live state coming
|
|
57
|
+
*/
|
|
58
|
+
get canBeMoved(): boolean;
|
|
59
|
+
}
|