@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.4ee5f82 → 6.4.0-pr.revamp.667.59de050
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/dist/3d.cjs +1 -1
- package/dist/3d.js +13 -12
- package/dist/RobotControl/index.cjs +1 -1
- package/dist/RobotControl/index.js +1 -1
- package/dist/RobotControlPanel/index.cjs +1 -1
- package/dist/RobotControlPanel/index.js +1 -1
- package/dist/RobotHeader/index.cjs +1 -1
- package/dist/RobotHeader/index.js +1 -1
- package/dist/RobotScene/index.cjs +1 -1
- package/dist/RobotScene/index.js +1 -1
- package/dist/RobotView/index.cjs +1 -1
- package/dist/RobotView/index.js +1 -1
- package/dist/chunks/ConnectedMotionGroup-CQ4W__Ch.cjs +3 -0
- package/dist/chunks/{ConnectedMotionGroup-CjhZTmlT.js → ConnectedMotionGroup-CgPNxKbs.js} +2 -2
- package/dist/chunks/{Robot-BI3OpLBC.cjs → Robot-229TG9wF.cjs} +1 -1
- package/dist/chunks/{Robot-DzVgWIyl.js → Robot-DGa4V_4u.js} +1 -1
- package/dist/chunks/RobotActivation-CRVxXvlx.cjs +1 -0
- package/dist/chunks/{RobotActivation-CXUp6Szs.js → RobotActivation-oR-8Y0iq.js} +46 -34
- package/dist/chunks/RobotControl-5YZQVCM4.js +332 -0
- package/dist/chunks/RobotControl-Cf1TMWXG.cjs +1 -0
- package/dist/chunks/RobotControlPanel-B7NxoHsO.cjs +1 -0
- package/dist/chunks/RobotControlPanel-CkQlkq8x.js +1029 -0
- package/dist/chunks/RobotScene-BnhM3iuc.cjs +1 -0
- package/dist/chunks/RobotScene-CHQcpJG-.js +1276 -0
- package/dist/chunks/{RobotView-KFlt_Isi.cjs → RobotView-C1_PW7jD.cjs} +1 -1
- package/dist/chunks/{RobotView-Cx_eOS9N.js → RobotView-DdjUVCYj.js} +1 -1
- package/dist/chunks/{useSmoothedMotionState-BSSV8aZN.js → hooks-BWoeBWLV.js} +43 -87
- package/dist/chunks/hooks-BXe2bNMo.cjs +1 -0
- package/dist/chunks/{loadRobotSession-IuZ-zs8x.js → loadRobotSession-CtCpA65z.js} +814 -610
- package/dist/chunks/loadRobotSession-GOa6wyyF.cjs +1 -0
- package/dist/chunks/{robotActivationOf-BsFcsAdF.cjs → robotActivationOf-CvylCSYs.cjs} +1 -1
- package/dist/chunks/{robotActivationOf-SqnXGdFY.js → robotActivationOf-GTYfLNrW.js} +1 -1
- package/dist/chunks/useSmoothedMotionState-CCXmMZ0S.cjs +1 -0
- package/dist/chunks/useSmoothedMotionState-CELh-YJa.js +50 -0
- package/dist/components/jogging/JoggingStore.d.ts +70 -3
- package/dist/components/robotControl/MoveToTab.d.ts +6 -1
- package/dist/components/robotControl/RobotControlPanel.d.ts +15 -8
- package/dist/components/robots/MotionGroupVisualizer.d.ts +6 -4
- package/dist/components/robots/SupportedLinearAxis.d.ts +6 -4
- package/dist/components/robots/SupportedRobot.d.ts +7 -5
- package/dist/components/robots/useFrameSmoothedMotionState.d.ts +25 -0
- package/dist/components/utils/useSmoothedMotionState.d.ts +11 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +23 -22
- package/dist/index.cjs +1 -1
- package/dist/index.js +80 -79
- package/dist/lib/ControllerStateStream.d.ts +6 -1
- package/dist/lib/JoggerConnection.d.ts +17 -1
- package/dist/lib/TrajectoryExecutionStore.d.ts +41 -11
- package/dist/lib/robotSession/RobotActivation.d.ts +18 -7
- package/dist/lib/robotSession/RobotSession.d.ts +20 -7
- package/dist/lib/robotSession/RobotTargetPose.d.ts +4 -2
- package/dist/session.cjs +1 -1
- package/dist/session.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/ConnectedMotionGroup-770Xppk7.cjs +0 -3
- package/dist/chunks/RobotActivation-BaPImZRq.cjs +0 -1
- package/dist/chunks/RobotControl-Do-oagek.cjs +0 -1
- package/dist/chunks/RobotControl-Un5D1r8T.js +0 -318
- package/dist/chunks/RobotControlPanel-BJ80O4ER.cjs +0 -1
- package/dist/chunks/RobotControlPanel-CxTEIelh.js +0 -1019
- package/dist/chunks/RobotScene-C1DNfxXU.js +0 -1246
- package/dist/chunks/RobotScene-hUDf_S6f.cjs +0 -1
- package/dist/chunks/loadRobotSession-BRuiCc0r.cjs +0 -1
- package/dist/chunks/useSmoothedMotionState-B9WO73k0.cjs +0 -1
package/dist/3d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Robot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Robot-229TG9wF.cjs"),o=require("./chunks/RobotScene-BnhM3iuc.cjs"),i=require("./chunks/JoggingGizmo-CNFjpWDv.cjs"),s=require("./chunks/JoggingGizmoOrientation-laUrgY0N.cjs"),a=require("./chunks/RobotControlPanel-B7NxoHsO.cjs"),t=require("./chunks/RobotControl-Cf1TMWXG.cjs"),n=require("./chunks/RobotView-C1_PW7jD.cjs"),u=require("./chunks/hooks-BXe2bNMo.cjs"),R=require("./chunks/useSmoothedMotionState-CCXmMZ0S.cjs"),r=require("./chunks/Pose3-BfBNPRDM.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.JointLimitGizmo=e.JointLimitGizmo;exports.LinearAxis=e.LinearAxis;exports.Robot=e.Robot;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.FLANGE_NODE_SUFFIX=o.FLANGE_NODE_SUFFIX;exports.JOINT_REST_SUFFIX=o.JOINT_REST_SUFFIX;exports.JoggingAxes=o.JoggingAxes;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.MotionGroupVisualizerExact=o.MotionGroupVisualizerExact;exports.PresetEnvironment=o.PresetEnvironment;exports.RobotScene=o.RobotScene;exports.RobotSceneView=o.RobotSceneView;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedLinearAxisExact=o.SupportedLinearAxisExact;exports.SupportedRobot=o.SupportedRobot;exports.SupportedRobotExact=o.SupportedRobotExact;exports.defaultGetModel=o.defaultGetModel;exports.jointIndexOf=o.jointIndexOf;exports.robotModelOf=o.robotModelOf;exports.useRobotSceneProps=o.useRobotSceneProps;exports.JoggingGizmo=i.JoggingGizmo;exports.JoggingGizmoOrientation=s.JoggingGizmoOrientation;exports.RobotControlPanel=a.RobotControlPanel;exports.RobotControl=t.RobotControl;exports.useRobotControlProps=t.useRobotControlProps;exports.RobotCanvas=n.RobotCanvas;exports.RobotView=n.RobotView;exports.ValueInterpolator=u.ValueInterpolator;exports.useSmoothedMotionState=R.useSmoothedMotionState;exports.Pose3=r.Pose3;exports.parseRotationToQuaternion=r.parseRotationToQuaternion;
|
package/dist/3d.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { C as a, J as t, L as r, R as s, T as n } from "./chunks/Robot-
|
|
2
|
-
import { F as p, J as R, a as x, M as u, b as m, P as
|
|
1
|
+
import { C as a, J as t, L as r, R as s, T as n } from "./chunks/Robot-DGa4V_4u.js";
|
|
2
|
+
import { F as p, J as R, a as x, M as u, b as m, P as f, R as S, c as b, S as d, d as l, e as g, f as c, g as J, h as E, j as G, r as P, u as C } from "./chunks/RobotScene-CHQcpJG-.js";
|
|
3
3
|
import { J as L } from "./chunks/JoggingGizmo-RDiEVQes.js";
|
|
4
4
|
import { J as V } from "./chunks/JoggingGizmoOrientation-Dzzz2gEz.js";
|
|
5
|
-
import { R as A } from "./chunks/RobotControlPanel-
|
|
6
|
-
import { R as O, u as T } from "./chunks/RobotControl-
|
|
7
|
-
import { R as j, a as N } from "./chunks/RobotView-
|
|
8
|
-
import { V as v
|
|
9
|
-
import {
|
|
5
|
+
import { R as A } from "./chunks/RobotControlPanel-CkQlkq8x.js";
|
|
6
|
+
import { R as O, u as T } from "./chunks/RobotControl-5YZQVCM4.js";
|
|
7
|
+
import { R as j, a as N } from "./chunks/RobotView-DdjUVCYj.js";
|
|
8
|
+
import { V as v } from "./chunks/hooks-BWoeBWLV.js";
|
|
9
|
+
import { u as y } from "./chunks/useSmoothedMotionState-CELh-YJa.js";
|
|
10
|
+
import { P as X, p as D } from "./chunks/Pose3-DWxfC6Dj.js";
|
|
10
11
|
export {
|
|
11
12
|
a as CollisionSceneRenderer,
|
|
12
13
|
p as FLANGE_NODE_SUFFIX,
|
|
@@ -18,13 +19,13 @@ export {
|
|
|
18
19
|
r as LinearAxis,
|
|
19
20
|
u as MotionGroupVisualizer,
|
|
20
21
|
m as MotionGroupVisualizerExact,
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
X as Pose3,
|
|
23
|
+
f as PresetEnvironment,
|
|
23
24
|
s as Robot,
|
|
24
25
|
j as RobotCanvas,
|
|
25
26
|
O as RobotControl,
|
|
26
27
|
A as RobotControlPanel,
|
|
27
|
-
|
|
28
|
+
S as RobotScene,
|
|
28
29
|
b as RobotSceneView,
|
|
29
30
|
N as RobotView,
|
|
30
31
|
d as SafetyZonesRenderer,
|
|
@@ -36,9 +37,9 @@ export {
|
|
|
36
37
|
v as ValueInterpolator,
|
|
37
38
|
E as defaultGetModel,
|
|
38
39
|
G as jointIndexOf,
|
|
39
|
-
|
|
40
|
+
D as parseRotationToQuaternion,
|
|
40
41
|
P as robotModelOf,
|
|
41
42
|
T as useRobotControlProps,
|
|
42
43
|
C as useRobotSceneProps,
|
|
43
|
-
|
|
44
|
+
y as useSmoothedMotionState
|
|
44
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControl-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControl-Cf1TMWXG.cjs"),e=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.RobotControl=o.RobotControl;exports.default=o.RobotControl;exports.useRobotControlProps=o.useRobotControlProps;exports.RobotSessionProvider=e.RobotSessionProvider;exports.useRobotSession=e.useRobotSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControlPanel-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotControlPanel-B7NxoHsO.cjs");exports.RobotControlPanel=o.RobotControlPanel;exports.default=o.RobotControlPanel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/robotActivationOf-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/robotActivationOf-CvylCSYs.cjs"),t=require("../chunks/robotSafetyOf-Cbp35lO-.cjs");exports.ConnectionWarning=o.ConnectionWarning;exports.RobotHeader=o.RobotHeader;exports.connectionWarningOf=o.connectionWarningOf;exports.default=o.RobotHeader;exports.robotActivationOf=o.robotActivationOf;exports.robotSafetyOf=t.robotSafetyOf;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as n, R as r, c as t, R as e, r as f } from "../chunks/robotActivationOf-
|
|
1
|
+
import { C as n, R as r, c as t, R as e, r as f } from "../chunks/robotActivationOf-GTYfLNrW.js";
|
|
2
2
|
import { r as s } from "../chunks/robotSafetyOf-kNLaX0_5.js";
|
|
3
3
|
export {
|
|
4
4
|
n as ConnectionWarning,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RobotScene-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/RobotScene-BnhM3iuc.cjs"),o=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.JoggingAxes=e.JoggingAxes;exports.RobotScene=e.RobotScene;exports.RobotSceneView=e.RobotSceneView;exports.default=e.RobotScene;exports.useRobotSceneProps=e.useRobotSceneProps;exports.RobotSessionProvider=o.RobotSessionProvider;exports.useRobotSession=o.useRobotSession;
|
package/dist/RobotScene/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as s, R as a, c as t, R, u as r } from "../chunks/RobotScene-
|
|
1
|
+
import { a as s, R as a, c as t, R, u as r } from "../chunks/RobotScene-CHQcpJG-.js";
|
|
2
2
|
import { R as b, u as i } from "../chunks/RobotSessionProvider-TVaKGzqa.js";
|
|
3
3
|
export {
|
|
4
4
|
s as JoggingAxes,
|
package/dist/RobotView/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotView-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("../chunks/RobotView-C1_PW7jD.cjs"),e=require("../chunks/RobotSessionProvider--AekyPqD.cjs");exports.RobotCanvas=o.RobotCanvas;exports.RobotView=o.RobotView;exports.default=o.RobotView;exports.RobotSessionProvider=e.RobotSessionProvider;exports.useRobotSession=e.useRobotSession;
|
package/dist/RobotView/index.js
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),be=require("@mui/material/AppBar"),se=require("@mui/material/Backdrop"),O=require("@mui/material/Box"),ve=require("@mui/material/Menu"),D=require("@mui/material/MenuItem"),je=require("@mui/material/Toolbar"),y=require("@mui/material/Typography"),ye=require("@wandelbots/design-tokens"),Ce=require("@wandelbots/icons/ExpandMoreFilled"),Se=require("@wandelbots/mui"),S=require("mobx-react-lite"),v=require("react"),W=require("./externalizeComponent-CA_sHzyH.cjs"),we=require("@mui/icons-material/OpenWith"),Me=require("@mui/icons-material/Share"),b=require("@mui/material/Stack"),Te=require("@mui/material/Tab"),Ee=require("@mui/material/Tabs"),C=require("mobx"),A=require("react-i18next"),H=require("./loadRobotSession-GOa6wyyF.cjs"),le=require("@mui/material/CircularProgress"),Ie=require("@mui/material/utils"),K=require("lodash-es"),Je=require("./robotSafetyOf-Cbp35lO-.cjs"),ke=require("@mui/material/Alert"),Re=require("@mui/material/AlertTitle"),Q=require("@mui/material/Button"),V=require("@mui/material/styles"),q=require("@mui/material/Divider"),ie=require("@mui/material/ToggleButton"),_=require("@wandelbots/nova-js"),Z=require("@mui/material/IconButton"),te=require("./hooks-BXe2bNMo.cjs"),$=require("./joggingColors-Cqpfuw4G.cjs"),_e=require("@mui/material/InputAdornment"),Ae=require("@mui/material/FormControl"),Pe=require("@mui/material/InputLabel"),Oe=require("@mui/material/Select"),Ve=require("@mui/material/ToggleButtonGroup"),ce=require("@mui/material/Slider"),U=require("@wandelbots/nova-js/v2"),Le=require("@mui/icons-material/ChevronLeft"),De=require("@mui/icons-material/ChevronRight"),qe=require("@mui/material/Dialog"),$e=require("@mui/material/DialogActions"),Be=require("@mui/material/DialogContent"),ze=require("@mui/material/DialogTitle"),Fe=require("three"),G=require("./PoseTransformer-2QIzECOZ.cjs");function de(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const f=de(v),re=de(Fe),Ne=W.externalizeComponent(S.observer(e=>{const{appIcon:n,appName:o,apps:i=[],onAppSelect:a,disabled:l=!1,sx:d}=e,[r,g]=v.useState(null),p=!!r,j=s=>{g(s.currentTarget)},u=()=>{g(null)},c=s=>{u(),s.onClick?s.onClick():s.href&&(window.location.href=s.href),a==null||a(s)};return t.jsxs(t.Fragment,{children:[t.jsx(be,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...d},children:t.jsxs(je,{sx:{minHeight:"62px !important"},children:[t.jsx(O,{sx:{mr:1,display:"flex",alignItems:"center"},children:n}),t.jsxs(O,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[t.jsx(y,{component:"h1",variant:"subtitle1",children:o}),i.length>0&&t.jsx(Se.RoundedIconButton,{icon:t.jsx(Ce.ExpandMoreFilled,{size:20}),ariaLabel:"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:j,disabled:l,sx:{ml:1}})]})]})}),t.jsx(se,{open:p,onClick:u,sx:{backdropFilter:"blur(4px)",backgroundColor:ye.ZeroGravityComponentsBackdropFill,zIndex:s=>s.zIndex.modal-1}}),t.jsx(ve,{id:"app-menu",anchorEl:r,open:p,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{zIndex:s=>s.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:i.map(s=>t.jsxs(D,{onClick:()=>c(s),children:[t.jsx(O,{sx:{display:"flex",alignItems:"center"},children:s.icon}),t.jsx(y,{variant:"body1",sx:{ml:2},children:s.name})]},s.id))})]})})),Ge=({title:e,titleId:n,...o},i)=>f.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("g",{id:"JogMinus"},f.createElement("path",{id:"Minus",d:"M0 13V8H21V13H0Z",fill:"white"}))),He=v.forwardRef(Ge),We=({title:e,titleId:n,...o},i)=>f.createElement("svg",{width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("g",{id:"JogPlus"},f.createElement("g",{id:"Plus"},f.createElement("path",{d:"M0 13V8H8V13H0Z",fill:"white"}),f.createElement("path",{d:"M8 0L13 2.18557e-07L13 21H8L8 0Z",fill:"white"}),f.createElement("path",{d:"M13 13V8H21V13H13Z",fill:"white"})))),Ue=v.forwardRef(We),ee=W.externalizeComponent(S.observer(({colors:e,label:n,getDisplayedValue:o,startJogging:i,stopJogging:a,disabled:l,activeJoggingDirection:d,...r})=>{var E,I,J,k,R,B,z;te.useAnimationFrame(()=>{const T=o(),P=c.current;P&&(P.textContent=T)});const g=V.useTheme(),[p,j]=v.useState(null);v.useEffect(()=>{l&&M()},[l]);const u=d||p,c=v.useRef(null);e||(e={color:"#fff",backgroundColor:"#000",borderColor:"#000",buttonBackgroundColor:{disabled:"#000",default:"#000",hovered:"#000",pressed:"#000"},labelColor:"#000"});const s=u?(E=e.buttonBackgroundColor)==null?void 0:E.pressed:e.borderColor,m={width:"55px",color:e.color,path:{fill:e.color},alignContent:"center",fontSize:"37px",svg:{pointerEvents:"none"}},h={...m,backgroundColor:(I=e.buttonBackgroundColor)==null?void 0:I.default,":hover":{backgroundColor:(J=e.buttonBackgroundColor)==null?void 0:J.hovered},":active":{backgroundColor:(k=e.buttonBackgroundColor)==null?void 0:k.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor}},":disabled":{backgroundColor:(R=e.buttonBackgroundColor)==null?void 0:R.disabled,"svg path":{fill:g.palette.action.disabled}}},w={...m,backgroundColor:(B=e.buttonBackgroundColor)==null?void 0:B.pressed,color:e.backgroundColor,path:{fill:e.backgroundColor},":disabled":{backgroundColor:(z=e.buttonBackgroundColor)==null?void 0:z.pressed,"svg path":{fill:g.palette.action.disabled}}};function L(T,P){l||T.button===0&&(j(P),i(P))}function M(){j(null),a()}return t.jsxs(b,{height:"64px",direction:"row",justifyContent:"center",...r,children:[t.jsx(Z,{disabled:l,disableRipple:!0,onPointerDown:T=>L(T,"-"),onPointerUp:M,onPointerOut:M,size:"large",sx:{...u==="-"?w:h,borderRadius:"16px 0px 0px 16px",borderLeft:`2px solid ${s??"#fff"}`,borderBottom:`2px solid ${s??"#fff"}`,borderTop:`2px solid ${s??"#fff"}`},children:t.jsx(He,{})}),t.jsxs(b,{spacing:"6px",sx:{width:"150px",backgroundColor:e.backgroundColor,alignItems:"center",justifyContent:"center",opacity:"0.9",borderBottom:`2px solid ${s??"#fff"}`,borderTop:`2px solid ${s??"#fff"}`},children:[t.jsx(b,{height:"22px",direction:"row",alignItems:"center",justifyItems:"center",spacing:1,sx:{userSelect:"none",color:e.color,".MuiTypography-root":{fontWeight:700,...l?{color:g.palette.action.disabled}:{}},...l?{"svg path":{fill:g.palette.action.disabled}}:{}},children:n}),t.jsx(y,{height:"22px",sx:{fontSize:"15px",color:l?g.palette.action.disabled:e.color,fontWeight:700,fontVariantNumeric:"tabular-nums",minWidth:"80px",textAlign:"center"},ref:c,children:o()})]}),t.jsx(Z,{disableRipple:!0,disabled:l,onPointerDown:T=>L(T,"+"),onPointerUp:M,onPointerOut:M,size:"large",sx:{...u==="+"?w:h,borderRadius:"0px 16px 16px 0px",borderRight:`2px solid ${s??"#fff"}`,borderBottom:`2px solid ${s??"#fff"}`,borderTop:`2px solid ${s??"#fff"}`},children:t.jsx(Ue,{})})]})})),ge=W.externalizeComponent(S.observer(({startJogging:e,stopJogging:n,lowerLimit:o,upperLimit:i,useDegree:a,getValue:l,disabled:d,...r})=>{var k,R,B,z,T,P,oe;const{t:g}=A.useTranslation(),[p,j]=v.useState(),u=V.useTheme(),c={background:(k=u.palette.backgroundPaperElevation)==null?void 0:k[4],color:(R=u.palette.backgroundPaperElevation)==null?void 0:R[11]},s=S.useLocalObservable(()=>({activeJoggingDir:null,startJogging(x){this.activeJoggingDir=x,e(x)},stopJogging(){this.activeJoggingDir=null,n()}})),m=K.throttle(()=>{const x=a?h(l()):l();(x===void 0||p===void 0||Math.abs(p-x)>1e-9)&&j(x)},50);te.useAnimationFrame(m);function h(x){if(x!==void 0)return _.radiansToDegrees(x)}function w(x){x.button===0&&s.startJogging("-")}function L(x){x.button===0&&s.startJogging("+")}function M(x){s.stopJogging()}function E(x){s.stopJogging()}function I(x,F=1){if(x===void 0||Number.isNaN(x))return"";const N=g("General.degree.variable",{amount:x.toFixed(F)});return x>0&&F===0?`+${N}`:N}function J(x,F=1){if(x===void 0||Number.isNaN(x))return"";const N=g("General.mm.variable",{amount:x.toFixed(F)});return x>0&&F===0?`+${N}`:N}return t.jsxs(b,{height:"64px",width:"100%",maxWidth:"260px",direction:"row",...r,sx:{"& .MuiIconButton-root":{width:"52px",color:u.palette.text.primary,alignContent:"center",backgroundColor:(B=u.palette.backgroundPaperElevation)==null?void 0:B[11],"& svg":{width:"42px",height:"42px"},"&.Mui-disabled":{backgroundColor:(z=u.palette.backgroundPaperElevation)==null?void 0:z[11],color:u.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:(T=u.palette.backgroundPaperElevation)==null?void 0:T[9]},"&:active":{...c}}},children:[t.jsx(Z,{onPointerDown:w,onPointerUp:M,onPointerOut:E,disabled:d,disableRipple:!0,sx:{borderRadius:"16px 0px 0px 16px",...s.activeJoggingDir==="-"?c:{}},children:t.jsx(Le,{sx:{pointerEvents:"none",color:$.jointArrowColor}})}),t.jsxs(b,{flexGrow:1,alignItems:"center",justifyContent:"center",sx:{borderStyle:"solid",borderLeftWidth:0,borderRightWidth:0,border:"none",backgroundColor:(P=u.palette.backgroundPaperElevation)==null?void 0:P[11],paddingLeft:"20px",paddingRight:"20px",zIndex:1},children:[t.jsx(y,{sx:{fontSize:"15px",fontWeight:700,position:"relative",top:"5px",fontVariantNumeric:"tabular-nums",minWidth:"80px",textAlign:"center",color:d?u.palette.action.disabled:u.palette.text.primary},children:a?I(p):J(p)}),t.jsx(ce,{disabled:!0,"aria-label":"Joint position",min:a?h(o):o,max:a?h(i):i,value:p||0,track:!1,sx:{"& .MuiSlider-mark":{display:"none"},"& .MuiSlider-thumb":{width:"5px",height:"12px",borderRadius:"2px",color:d?u.palette.action.disabled:u.palette.text.primary},"& .MuiSlider-markLabel":{top:"20px",fontSize:"12px",color:d?u.palette.action.disabled:u.palette.text.secondary},"& .MuiSlider-rail":{backgroundColor:(oe=u.palette.backgroundPaperElevation)==null?void 0:oe[5],opacity:1}},marks:o!==void 0&&i!==void 0&&[{value:a?h(o):o,label:a?I(h(o),0):J(o)},{value:a?h(i):i,label:a?I(h(i),0):J(i)}]})]}),t.jsx(Z,{onPointerDown:L,onPointerUp:M,onPointerOut:E,disabled:d,disableRipple:!0,sx:{borderRadius:"0px 16px 16px 0px",...s.activeJoggingDir==="+"?c:{}},children:t.jsx(De,{sx:{pointerEvents:"none",color:$.jointArrowColor}})})]})})),ue=e=>{const n=e.softTimeout||3e3,[o,i]=v.useState(!1);return v.useEffect(()=>{const a=setTimeout(()=>{i(!0)},n);return()=>clearTimeout(a)}),t.jsx(b,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:"text.primary"},children:e.error?t.jsx(pe,{loadingMessage:e.message,error:e.error}):t.jsxs(t.Fragment,{children:[t.jsx(le,{sx:{mb:3}}),!!e.message&&t.jsx(y,{variant:"body1",children:e.message}),t.jsx(y,{variant:"body2",sx:{visibility:o?"visible":"hidden",mt:2,color:"text.secondary"},children:"This is taking longer than expected..."})]})})},pe=e=>{const n=Je.makeErrorMessage(e.error),o=e.error instanceof Error?e.error.stack:null;return t.jsxs(b,{sx:{maxHeight:"100%",maxWidth:"min(100%, 800px)",p:2,overflow:"auto",color:"error.main"},children:[t.jsx(y,{variant:"body1",children:(e.loadingMessage?`Error while ${K.lowerFirst(Ie.capitalize(e.loadingMessage))} - `:"")+n}),o&&t.jsx(O,{component:"pre",sx:{typography:"body2",fontFamily:"monospace",whiteSpace:"pre-wrap",wordBreak:"break-word",mt:2,pb:6},children:o})]})},Ye=S.observer(({store:e})=>{const{t:n}=A.useTranslation();return t.jsx(se,{"data-testid":"jogging-blocked","aria-label":"jogging-blocked",open:!0,sx:{position:"absolute",zIndex:o=>o.zIndex.drawer+1,color:"#fff",background:"rgba(15, 15, 15, 0.88)",justifyContent:"flex-start",alignItems:"flex-start"},children:t.jsxs(b,{sx:{m:2,width:"100%"},children:[t.jsxs(ke,{severity:"error",sx:{mb:2},children:[t.jsx(Re,{children:n("Jogging.Blocked.ti")}),n("Jogging.Blocked.lb")]}),t.jsx(Q,{variant:"contained",color:"secondary",onClick:()=>e.unblock(),children:n("Jogging.Blocked.Reenable.bt")})]})})}),Ze=({title:e,titleId:n,...o},i)=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),Xe=v.forwardRef(Ze),Ke=({title:e,titleId:n,...o},i)=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),Qe=v.forwardRef(Ke),et=({title:e,titleId:n,...o},i)=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:19,fill:"none",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z",clipRule:"evenodd"})),tt=v.forwardRef(et),nt=({title:e,titleId:n,...o},i)=>f.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":n,...o},e?f.createElement("title",{id:n},e):null,f.createElement("path",{d:"M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z",fill:"white"})),ot=v.forwardRef(nt),he=S.observer(({store:e})=>{const{t:n}=A.useTranslation(),[o,i]=v.useState(e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),a=v.useRef(o);te.useAnimationFrame(()=>{const d=e.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;K.isEqual(a.current,d)||(a.current=d,i(d))});const l=[];for(const[d,r]of o.entries())r&&l.push(d);return t.jsx(O,{sx:{display:"flex",flexDirection:"row",justifyContent:"center"},children:t.jsx(y,{"data-testid":"jogging-joint-limit-detector","aria-label":"jogging-joint-limit-detector",color:"error",variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2,visibility:l.length?"visible":"hidden"},children:n("Jogging.JointLimitsReached.lb",{jointNumbers:l.map(d=>d+1).join(", ")})})})}),it=V.styled(Ae)(({theme:e})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:"20px",paddingLeft:"12px"},label:{pointerEvents:"none",fontSize:"16px"},".MuiInputLabel-root":{"&.Mui-focused":{color:e.palette.text.primary}}}}));function Y({labelValue:e,...n}){return t.jsxs(it,{fullWidth:!0,variant:"filled",children:[t.jsx(Pe,{id:n.labelId,children:e}),t.jsx(Oe,{...n})]})}const rt=S.observer(({store:e,useDegree:n})=>{var d;const{t:o}=A.useTranslation(),i=v.useId(),a=[];function l(r){switch(r){case"coordsys":return o("Jogging.Orientation.coordsys");case"tool":return o("Jogging.Orientation.tool");default:return r}}return e.showCoordSystemSelect&&a.push(t.jsx(Y,{labelId:`jogging-coord-select-${i}`,labelValue:o("Jogging.CoordinateSystem.hlb"),value:e.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:r=>e.setSelectedCoordSystemId(r.target.value),children:e.coordSystems.map(r=>t.jsx(D,{value:r.coordinate_system,children:r.name&&e.coordSystemCountByName[r.name]>1?`${r.name} / ${r.coordinate_system}`:r.name||r.coordinate_system},r.coordinate_system))},"coord")),e.showTcpSelect&&a.push(t.jsx(Y,{labelId:`jogging-tcp-select-${i}`,labelValue:"TCP",value:e.selectedTcpId,size:"small",variant:"filled",displayEmpty:e.tcpChangeInProgress,onChange:r=>{e.requestTcpChange(r.target.value).catch(g=>{console.error("Failed to change TCP:",g)})},disabled:e.tcpChangeInProgress,endAdornment:e.tcpChangeInProgress?t.jsx(_e,{position:"end",children:t.jsx(le,{size:16})}):void 0,children:e.tcps.map(r=>t.jsx(D,{value:r.id,children:r.id},r.id))},"tcp")),e.showOrientationSelect&&a.push(t.jsx(Y,{labelValue:o("Jogging.Cartesian.Orientation.lb"),labelId:`orientation-select-${i}`,value:e.selectedOrientation,onChange:r=>e.setSelectedOrientation(r.target.value),children:H.ORIENTATION_IDS.map(r=>t.jsx(D,{value:r,children:l(r)},r))},"orientation")),e.showIncrementSelect&&a.push(t.jsxs(Y,{labelValue:o("Jogging.Increment.hlb"),labelId:`jogging-increment-select-${i}`,size:"small",variant:"filled",value:((d=e.activeDiscreteIncrement)==null?void 0:d.id)||"continuous",onChange:r=>e.setSelectedIncrementId(r.target.value),children:[t.jsx(D,{value:"continuous",children:o("Jogging.Increment.Continuous.dd")},"continuous"),e.discreteIncrementOptions.map(r=>t.jsx(D,{value:r.id,children:n?`${r.degrees}°`:`${r.mm}mm`},r.id))]},"increment")),t.jsx(O,{component:"div","data-testid":"jogging-options","aria-label":"jogging-options",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:a.map((r,g)=>t.jsx(O,{sx:{gridColumn:a.length%2===1&&g===a.length-1?"span 2":"auto"},children:r},g))})}),at=V.styled(Ve)(({theme:e})=>{var n;return{"&.MuiToggleButtonGroup-root":{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[8],borderRadius:"8px",padding:"4px",gap:"4px",button:{border:"none",borderRadius:"4px",flex:"1 1 0px",minWidth:0,"&.MuiToggleButtonGroup-firstButton":{borderRadius:"8px 4px 4px 8px"},"&.MuiToggleButtonGroup-lastButton":{borderRadius:"4px 8px 8px 4px"}}}}}),xe=W.externalizeComponent(S.observer(e=>{const{store:n}=e,{t:o}=A.useTranslation();function i(a,l){l===e.velocity||!K.isNumber(l)||e.onVelocityChange(l,e.useDegree)}return t.jsxs(b,{direction:"row",gap:2,alignItems:"center","data-testid":"velocity-slider","aria-label":"velocity-slider",children:[n.showVelocityLegend&&t.jsx(y,{sx:{color:$.velocitySliderLegendColor,fontSize:"14px"},children:o("Jogging.Velocity.bt")}),t.jsx(ce,{value:e.velocity,color:"secondary",onChange:i,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),n.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):t.jsx(ne,{value:e.velocity.toString()}))]})}));function ne({value:e,sx:n}){var i;const o=V.useTheme();return t.jsx(b,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(i=o.palette.backgroundPaperElevation)==null?void 0:i[8],borderRadius:"10px",minWidth:"111px",...n},children:t.jsx(y,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:o.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const me=S.observer(({store:e,useDegree:n})=>{const{t:o}=A.useTranslation();function i(a,l){return l?`ω = ${o("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:a})}`:`v = ${o("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:a})}`}return t.jsx(xe,{store:e,velocity:e.velocityInDisplayUnits(n),min:e.minVelocityInDisplayUnits(n),max:e.maxVelocityInDisplayUnits(n),onVelocityChange:e.setVelocityFromSlider,useDegree:n,disabled:e.isLocked,renderValue:a=>t.jsx(ne,{value:i(a,n),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),fe=S.observer(({store:e})=>{var d,r,g;const{t:n}=A.useTranslation(),o=V.useTheme(),i=((g=(r=(d=e.jogger.motionStream.rapidlyChangingMotionState.execute)==null?void 0:d.details)==null?void 0:r.state)==null?void 0:g.kind)??"KIND_UNKNOWN",a=e.lastJogError,l=e.lastJogErrorTranslationKey;return t.jsxs(O,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",color:o.palette.text.primary},children:[t.jsx(y,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},children:n("Jogging.StreamStateSection.lb")}),t.jsx(y,{variant:"body2",color:a?"error":void 0,sx:{fontSize:"0.75rem",lineHeight:1.2,textAlign:"right"},"data-testid":a?"JOG_ERROR":i,children:a?l?n(l):a:n(`Jogging.StreamStateSection.${i}.lb`)})]})}),st=S.observer(({store:e,children:n})=>{const{t:o}=A.useTranslation(),i=V.useTheme(),a=v.useRef(0);function l(c,s){(s==="translate"||s==="rotate")&&e.setSelectedCartesianMotionType(s)}async function d(c,s){const m=await e.activate(),h=m.motionStream.rapidlyChangingMotionState.tcp_pose,w=m.motionStream.rapidlyChangingMotionState.joint_position;h&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:c.axis,direction:c.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:h,currentJoints:w,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:c.axis,direction:c.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:s.mm}:{type:"rotate",distanceRads:_.degreesToRadians(s.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function r(c){if(e.isLocked)return;const s=++a.current;try{if(await e.activate(),s!==a.current)return;if(e.activeDiscreteIncrement)return await d(c,e.activeDiscreteIncrement);c.motionType==="translate"?await e.jogger.translateTCP({axis:c.axis,direction:c.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.rotateTCP({axis:c.axis,direction:c.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}catch(m){console.error("Jogging failed:",m)}}async function g(){e.activeDiscreteIncrement||(a.current++,await e.deactivate())}const p=[{id:"x",icon:t.jsx(Xe,{}),colors:$.cartesianAxisColors.X},{id:"y",icon:t.jsx(Qe,{}),colors:$.cartesianAxisColors.Y},{id:"z",icon:t.jsx(tt,{}),colors:$.cartesianAxisColors.Z}];function j(c){return o("General.mm.variable",{amount:c.toFixed(1)})}function u(c){return o("General.degree.variable",{amount:_.radiansToDegrees(c).toFixed(1)})}return t.jsxs(b,{"data-testid":"jogging-cartesian-tab","aria-label":"jogging-cartesian-tab",flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[t.jsxs(b,{gap:2,children:[t.jsx(rt,{store:e,useDegree:e.selectedCartesianMotionType==="rotate"}),t.jsx(me,{store:e,useDegree:e.selectedCartesianMotionType==="rotate"}),t.jsx(q,{})]}),t.jsx(b,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:t.jsxs(b,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[t.jsxs(at,{value:e.selectedCartesianMotionType,onChange:l,exclusive:!0,"aria-label":o("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[t.jsx(ie,{value:"translate",children:o("Jogging.Cartesian.Translation.bt")}),t.jsx(ie,{value:"rotate",children:o("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&p.map(c=>{var s,m;return t.jsx(ee,{"data-testid":`jogging-cartesian-axis-control-${c.id}`,"aria-label":`jogging-cartesian-axis-control-${c.id}`,colors:c.colors,disabled:e.isLocked,activeJoggingDirection:((s=e.incrementJogInProgress)==null?void 0:s.axis)===c.id?e.incrementJogInProgress.direction:void 0,label:t.jsxs(t.Fragment,{children:[c.icon,t.jsx(y,{sx:{fontSize:"24px",color:((m=c.colors)==null?void 0:m.labelColor)??i.palette.text.primary},children:c.id.toUpperCase()})]}),getDisplayedValue:()=>{var h,w;return j(((w=(h=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:h.position)==null?void 0:w[_.XYZ_TO_VECTOR[c.id]])||0)},startJogging:h=>r({axis:c.id,motionType:"translate",direction:h}),stopJogging:g},c.id)}),e.selectedCartesianMotionType==="rotate"&&p.map(c=>{var s,m;return t.jsx(ee,{"data-testid":`jogging-cartesian-axis-control-${c.id}`,"aria-label":`jogging-cartesian-axis-control-${c.id}`,colors:c.colors,disabled:e.isLocked,activeJoggingDirection:((s=e.incrementJogInProgress)==null?void 0:s.axis)===c.id?e.incrementJogInProgress.direction:void 0,label:t.jsxs(t.Fragment,{children:[t.jsx(ot,{}),t.jsx(y,{sx:{fontSize:"24px",color:((m=c.colors)==null?void 0:m.labelColor)??i.palette.text.primary},children:c.id.toUpperCase()})]}),getDisplayedValue:()=>{var h,w;return u(((w=(h=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:h.orientation)==null?void 0:w[_.XYZ_TO_VECTOR[c.id]])||0)},startJogging:h=>r({axis:c.id,motionType:"rotate",direction:h}),stopJogging:g},c.id)})]})}),t.jsx(he,{store:e}),t.jsx(q,{}),t.jsx(fe,{store:e}),n&&t.jsx(q,{}),n]})}),lt=S.observer(({store:e,children:n})=>{const o=V.useTheme(),i=v.useRef(0);async function a(d){const r=++i.current;try{if(await e.activate(),r!==i.current)return;await e.jogger.rotateJoints({joint:d.joint,direction:d.direction,velocityUnit:e.jointType===U.JointTypeEnum.PrismaticJoint?"mm/s":"rad/s",velocityValue:e.jointType===U.JointTypeEnum.PrismaticJoint?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec})}catch(g){console.error("Jogging failed:",g)}}async function l(){i.current++,await e.jogger.stop(),await e.deactivate()}return t.jsxs(b,{"data-testid":"jogging-joint-tab","aria-label":"jogging-joint-tab",flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[t.jsx(me,{store:e,useDegree:e.jointType===U.JointTypeEnum.RevoluteJoint}),t.jsx(q,{}),t.jsx(b,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},children:t.jsx(b,{"data-testid":"jogging-joint-value-controls-wrapper","aria-label":"jogging-joint-value-controls-wrapper",alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(d=>{var g,p,j;const r=(j=(p=(g=e.motionGroupDescription.operation_limits.auto_limits)==null?void 0:g.joints)==null?void 0:p[d.index])==null?void 0:j.position;return t.jsxs(b,{"data-testid":`jogging-joint-value-control-${d.index}`,"aria-label":`jogging-joint-value-control-${d.index}`,direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&t.jsx(y,{color:e.isLocked?o.palette.text.disabled:o.palette.text.secondary,children:`G${d.index+1}`}),t.jsx(ge,{disabled:e.isLocked,lowerLimit:r==null?void 0:r.lower_limit,upperLimit:r==null?void 0:r.upper_limit,useDegree:e.jointType===U.JointTypeEnum.RevoluteJoint,getValue:()=>{const u=e.jogger.motionStream.rapidlyChangingMotionState.joint_position[d.index];return u!==void 0?u:void 0},startJogging:u=>a({joint:d.index,direction:u}),stopJogging:l})]},`joint-${d.index}`)})})}),t.jsx(he,{store:e}),t.jsx(q,{}),t.jsx(fe,{store:e}),n&&t.jsx(q,{}),n]})}),ct=W.externalizeComponent(S.observer(e=>{const n=S.useLocalObservable(()=>({joggingStore:null,loadingError:null}));return v.useEffect(()=>{let o=!1,i;async function a(){C.runInAction(()=>{n.loadingError=null,n.joggingStore=null});try{let l=e.store;if(!l){const d=await H.JoggerConnection.open(e.nova,e.motionGroupId,{cellId:e.cellId});if(o){d.dispose();return}try{l=await H.JoggingStore.loadFor(d)}catch(r){throw d.dispose(),r}if(i=l,o){l.dispose();return}}C.runInAction(()=>{n.joggingStore=l}),e.onSetup&&e.onSetup(l)}catch(l){if(o)return;C.runInAction(()=>{n.loadingError=l})}}return a(),()=>{o=!0,i==null||i.dispose()}},[e.store,e.nova,e.motionGroupId,e.cellId]),v.useEffect(()=>{const o=n.joggingStore;if(!(!o||!e.locked))return o.lock("external"),()=>o.unlock("external")},[n.joggingStore,e.locked]),t.jsx(b,{"data-testid":"jogging-panel","aria-label":"jogging-panel",sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:n.joggingStore?t.jsx(dt,{store:n.joggingStore,children:e.children}):t.jsx(ue,{message:"Loading jogging",error:n.loadingError})})})),dt=S.observer(({store:e,children:n})=>{const{t:o}=A.useTranslation();function i(){if(e.currentTab.id==="cartesian")return t.jsx(st,{store:e,children:n});if(e.currentTab.id==="joint")return t.jsx(lt,{store:e,children:n})}return t.jsxs(b,{flexGrow:1,sx:{overflow:"hidden"},children:[t.jsx(Ee,{"data-testid":"jogging-tabs","aria-label":"jogging-tabs",value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(a=>{const l=a.label==="Cartesian"?o("Jogging.Cartesian.bt"):o("Jogging.Joints.bt"),d=a.label==="cartesian"?t.jsx(we,{fontSize:"small",sx:{mr:1}}):t.jsx(Me,{fontSize:"small",sx:{mr:1}});return t.jsx(Te,{"data-testid":`jogging-tab-${a.id}`,"aria-label":`jogging-tab-${a.id}`,label:e.showTabIcons?t.jsxs(b,{direction:"row",alignItems:"center",children:[d,l]}):l,id:`jogging-tab-${a.id}`,"aria-controls":`jogging-tab-${a.id}`},a.id)})}),t.jsx(b,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:i()}),e.blocked&&t.jsx(Ye,{store:e})]})});function gt(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function ut({baseUrl:e=gt(),...n}){return t.jsxs(qe,{"aria-labelledby":"no-motion-group-modal-title",open:!0,fullWidth:!0,sx:{"& .MuiModal-backdrop":{backdropFilter:"blur(10px)"},"& .MuiDialog-paper":{"::before":{content:'""',height:"8px",width:"100%",background:"linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)"},background:"#101629"}},children:[t.jsx(ze,{id:"no-motion-group-modal-title",children:"No motion group found"}),t.jsxs(Be,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[t.jsx(y,{color:"#fff",children:"Found no devices to connect to."}),t.jsx(y,{color:"#fff",children:"Please ensure a motion group has been created."})]}),t.jsx($e,{children:t.jsxs(b,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[t.jsx(Q,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),t.jsx(Q,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const ae=1e-4,pt={a:0,d:0,alpha:0,theta:0,reverse_rotation_direction:!1};class X{constructor(n,o,i,a,l,d,r,g,p,j,u="cell"){this.controller=o,this.motionGroup=i,this.initialMotionState=a,this.motionStateSocket=l,this.isVirtual=d,this.tcps=r,this.description=g,this.initialControllerState=p,this.controllerStateSocket=j,this.cellId=u,this.connectedJoggingSocket=null,this.joggingVelocity=10,this.activationState="inactive",this.nova=G.createNovaClient(n),this.rapidlyChangingMotionState=a,this.controllerState=p,j.addEventListener("message",c=>{var m;const s=(m=_.tryParseJson(c.data))==null?void 0:m.result;s&&C.runInAction(()=>{this.controllerState=s})}),l.addEventListener("message",c=>{var m;const s=(m=_.tryParseJson(c.data))==null?void 0:m.result;if(!s)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${c.data}`);H.jointValuesUnchanged(this.rapidlyChangingMotionState.joint_position,s.joint_position,ae)||C.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=s.joint_position}),H.tcpMotionEqual(this.rapidlyChangingMotionState,s,ae)||C.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=s.tcp_pose}),s.tcp!==void 0&&this.rapidlyChangingMotionState.tcp!==s.tcp&&C.runInAction(()=>{this.rapidlyChangingMotionState.tcp=s.tcp}),this.rapidlyChangingMotionState.standstill!==s.standstill&&C.runInAction(()=>{this.rapidlyChangingMotionState.standstill=s.standstill})}),C.makeAutoObservable(this)}static async connectMultiple(n,o,i={}){const a=G.createNovaClient(n),l=i.cellId??G.cellIdOf(n);return Promise.all(o.map(d=>X.connect(a,d,{...i,cellId:l})))}static async connect(n,o,i={}){var I,J;const a=G.createNovaClient(n),l=i.cellId??G.cellIdOf(n)??"cell",[d,r]=o.split("@"),g=await a.api.controller.getCurrentRobotControllerState(l,r),p=g==null?void 0:g.motion_groups.find(k=>k.motion_group===o);if(!g||!p)throw new Error(`Controller ${r} or motion group ${o} not found`);const j=a.openReconnectingWebsocket(`/cells/${l}/controllers/${r}/motion-groups/${o}/state-stream`),u=await j.firstMessage(),c=(I=_.tryParseJson(u.data))==null?void 0:I.result;if(!c)throw new Error(`Unable to parse initial motion state message ${u.data}`);console.log(`Connected motion state websocket to motion group ${p.motion_group}. Initial state:
|
|
2
|
+
`,c);const m=(await a.api.controller.getRobotController(l,g.controller)).configuration.kind==="VirtualController",h=await a.api.motionGroup.getMotionGroupDescription(l,r,p.motion_group),w=Object.entries(h.tcps||{}).map(([k,R])=>({id:k,readable_name:R.name,position:R.pose.position,orientation:R.pose.orientation})),L=a.openReconnectingWebsocket(`/cells/${l}/controllers/${g.controller}/state-stream?response_rate=1000`),M=await L.firstMessage(),E=(J=_.tryParseJson(M.data))==null?void 0:J.result;if(!E)throw new Error(`Unable to parse initial controller state message ${M.data}`);return console.log(`Connected controller state websocket to controller ${g.controller}. Initial state:
|
|
3
|
+
`,E),new X(a,g,p,c,j,m,w,h,E,L,l)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.description.motion_group_model}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.joint_position.map((n,o)=>({index:o}))}get dhParameters(){if(this.description.dh_parameters!==void 0)return this.description.dh_parameters.map(n=>({...pt,...n}))}get safetyZones(){return this.description.safety_zones}get mountingPosition(){var n,o,i;return this.description.mounting?[(((n=this.description.mounting.position)==null?void 0:n[0])||0)/1e3,(((o=this.description.mounting.position)==null?void 0:o[1])||0)/1e3,(((i=this.description.mounting.position)==null?void 0:i[2])||0)/1e3]:[0,0,0]}get mountingQuaternion(){var a,l,d,r,g,p;const n=new re.Vector3(((l=(a=this.description.mounting)==null?void 0:a.orientation)==null?void 0:l[0])||0,((r=(d=this.description.mounting)==null?void 0:d.orientation)==null?void 0:r[1])||0,((p=(g=this.description.mounting)==null?void 0:g.orientation)==null?void 0:p[2])||0),o=n.length(),i=n.normalize();return new re.Quaternion().setFromAxisAngle(i,o)}get isEstopActive(){return["SAFETY_STATE_ROBOT_EMERGENCY_STOP","SAFETY_STATE_DEVICE_EMERGENCY_STOP"].includes(this.controllerState.safety_state)}get isMoveableSafetyState(){return["SAFETY_STATE_NORMAL","SAFETY_STATE_REDUCED"].includes(this.controllerState.safety_state)}get isMoveableOperationMode(){return["OPERATION_MODE_AUTO","OPERATION_MODE_MANUAL","OPERATION_MODE_MANUAL_T1","OPERATION_MODE_MANUAL_T2"].includes(this.controllerState.operation_mode)}get canBeMoved(){return this.isMoveableSafetyState&&this.isMoveableOperationMode&&this.activationState==="active"}async deactivate(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}C.runInAction(()=>{this.activationState="deactivating"});try{await this.nova.api.controller.setDefaultMode(this.cellId,this.controllerId,"ROBOT_SYSTEM_MODE_MONITOR"),C.runInAction(()=>{this.activationState="inactive"})}catch(n){throw C.runInAction(()=>{this.activationState="active"}),n}}async activate(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}C.runInAction(()=>{this.activationState="activating"});try{await this.nova.api.controller.setDefaultMode(this.cellId,this.controllerId,"ROBOT_SYSTEM_MODE_CONTROL"),C.runInAction(()=>{this.activationState="active"})}catch(n){throw C.runInAction(()=>{this.activationState="inactive"}),n}}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.controllerStateSocket.close(),this.connectedJoggingSocket&&this.connectedJoggingSocket.close()}setJoggingVelocity(n){this.joggingVelocity=n}}exports.AppHeader=Ne;exports.ConnectedMotionGroup=X;exports.JoggingCartesianAxisControl=ee;exports.JoggingJointValueControl=ge;exports.JoggingPanel=ct;exports.LoadingCover=ue;exports.LoadingErrorMessage=pe;exports.NoMotionGroupModal=ut;exports.VelocitySlider=xe;exports.VelocitySliderLabel=ne;
|
|
@@ -20,7 +20,7 @@ import Rt from "@mui/material/Tab";
|
|
|
20
20
|
import _t from "@mui/material/Tabs";
|
|
21
21
|
import { runInAction as w, makeAutoObservable as Pt } from "mobx";
|
|
22
22
|
import { useTranslation as _ } from "react-i18next";
|
|
23
|
-
import { O as Ot, J as At, a as Vt, n as Dt, t as Lt } from "./loadRobotSession-
|
|
23
|
+
import { O as Ot, J as At, a as Vt, n as Dt, t as Lt } from "./loadRobotSession-CtCpA65z.js";
|
|
24
24
|
import mt from "@mui/material/CircularProgress";
|
|
25
25
|
import { capitalize as $t } from "@mui/material/utils";
|
|
26
26
|
import { throttle as Bt, lowerFirst as zt, isEqual as Ft, isNumber as Nt } from "lodash-es";
|
|
@@ -33,7 +33,7 @@ import D from "@mui/material/Divider";
|
|
|
33
33
|
import rt from "@mui/material/ToggleButton";
|
|
34
34
|
import { radiansToDegrees as ft, XYZ_TO_VECTOR as at, degreesToRadians as Ut, tryParseJson as W } from "@wandelbots/nova-js";
|
|
35
35
|
import X from "@mui/material/IconButton";
|
|
36
|
-
import { c as nt } from "./
|
|
36
|
+
import { c as nt } from "./hooks-BWoeBWLV.js";
|
|
37
37
|
import { e as lt, v as Yt, c as Q } from "./joggingColors-sb6IFdj2.js";
|
|
38
38
|
import Zt from "@mui/material/InputAdornment";
|
|
39
39
|
import Kt from "@mui/material/FormControl";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("react/jsx-runtime"),f=require("three"),I=require("three-stdlib"),A=require("@react-three/drei"),O=require("react"),b=require("./RobotScene-
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),f=require("three"),I=require("three-stdlib"),A=require("@react-three/drei"),O=require("react"),b=require("./RobotScene-BnhM3iuc.cjs");function E(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return o.default=e,Object.freeze(o)}const u=E(f);function k(e){switch(e.shape_type){case"convex_hull":return new I.ConvexGeometry(e.vertices.map(n=>new u.Vector3(n[0]/1e3,n[1]/1e3,n[2]/1e3)));case"box":return new u.BoxGeometry(e.size_x/1e3,e.size_y/1e3,e.size_z/1e3);case"sphere":return new u.SphereGeometry(e.radius/1e3);case"capsule":return new u.CapsuleGeometry(e.radius/1e3,e.cylinder_height/1e3);case"cylinder":return new u.CylinderGeometry(e.radius/1e3,e.radius/1e3,e.height/1e3);case"rectangle":return new u.BoxGeometry(e.size_x/1e3,e.size_y/1e3,0);default:return console.warn(`${e.shape_type} is not supported`),new u.BufferGeometry}}function F({name:e,collider:o,children:n}){var a,s;const r=((a=o.pose)==null?void 0:a.position)??[0,0,0],i=((s=o.pose)==null?void 0:s.orientation)??[0,0,0];return o.margin&&console.warn(`${e} margin is not supported`),c.jsx("mesh",{name:e,position:new u.Vector3(r[0],r[1],r[2]).divideScalar(1e3),rotation:new u.Euler(i[0],i[1],i[2],"XYZ"),geometry:k(o.shape),children:n})}function N({name:e,colliders:o,meshChildrenProvider:n,...r}){return c.jsx("group",{name:e,...r,children:Object.entries(o).map(([i,a])=>c.jsx(F,{name:i,collider:a,children:n(i,a)},i))})}function V({scene:e,meshChildrenProvider:o}){const n=e.colliders;return c.jsx("group",{children:n&&c.jsx(N,{meshChildrenProvider:o,colliders:n})})}function v(e){const o=(e==null?void 0:e.position)??[],n=(e==null?void 0:e.orientation)??[],r=new f.Vector3(n[0]??0,n[1]??0,n[2]??0),i=r.length(),a=i>0?new f.Quaternion().setFromAxisAngle(r.normalize(),i):new f.Quaternion;return new f.Matrix4().compose(new f.Vector3(o[0]??0,o[1]??0,o[2]??0).divideScalar(1e3),a,new f.Vector3(1,1,1))}function q(e,o=null,n=[]){const r=v(o);return e.map((i,a)=>{const s=r.clone(),t=(i.reverse_rotation_direction?-1:1)*(n[a]??0),l=i.type==="PRISMATIC_JOINT",m=(i.theta??0)+(l?0:t),d=(i.d??0)+(l?t:0);return r.multiply(new f.Matrix4().makeRotationZ(m)).multiply(new f.Matrix4().makeTranslation((i.a??0)/1e3,0,d/1e3)).multiply(new f.Matrix4().makeRotationX(i.alpha??0)),s})}const T="#ff4b4b",L="#2fa8ff",Q="#8a8d9e",z=96,H=.15,U=new u.Vector3(0,1,0),B=.2,D=2;function J(e){const{lower_limit:o,upper_limit:n}=e??{};return typeof o!="number"||typeof n!="number"||!Number.isFinite(o)||!Number.isFinite(n)||!(o<n)?null:{lower_limit:o,upper_limit:n}}function j({base:e,direction:o,size:n,color:r,opacity:i}){const a=new u.Quaternion().setFromUnitVectors(U,o.clone().normalize()),s=e.clone().addScaledVector(o.clone().normalize(),n/2);return c.jsxs("mesh",{position:s,quaternion:a,renderOrder:10,children:[c.jsx("coneGeometry",{args:[n*.35,n,16]}),c.jsx("meshBasicMaterial",{color:r,depthTest:!1,transparent:!0,opacity:i})]})}function P({points:e,color:o,width:n,opacity:r}){return c.jsx(A.Line,{points:e,color:o,lineWidth:n,depthTest:!1,transparent:!0,opacity:r,renderOrder:10})}function G(e,o){const n=[...e];let r=o;for(;n.length>1;){const i=n[n.length-1],a=n[n.length-2],s=i.distanceTo(a);if(s>r)return n[n.length-1]=i.clone().lerp(a,r/s),n;r-=s,n.pop()}return n}function W(e,o,n,r){const i=n*e,a=n*o,s=Math.abs(a-i),t=Math.max(2,Math.ceil(s/(2*Math.PI)*z));return Array.from({length:t+1},(l,m)=>{const d=i+(a-i)*m/t,p=s*m/t/(2*Math.PI),h=r*(1+H*p);return new u.Vector3(Math.cos(d)*h,Math.sin(d)*h,0)})}function X(e,o,n,r){const i=e.theta??0,a=e.d??0,s=e.type==="PRISMATIC_JOINT",t=e.reverse_rotation_direction?-1:1,{lower_limit:l,upper_limit:m}=o;return O.useMemo(()=>{const d=new u.Matrix4().makeRotationZ(i).multiply(new u.Matrix4().makeTranslation(0,0,s?a/1e3:0)),p=(M,_,S)=>new u.Vector3(M,_,S).applyMatrix4(d),h=new u.Vector3().applyMatrix4(d),g=p(0,0,n),x=(s?[p(n*.25,0,t*l/1e3),p(n*.25,0,t*m/1e3)]:W(l,m,t,n*.6)).map(M=>s?M:M.applyMatrix4(d)),y=p(s?n*.25:n*.6,0,0),C=x.slice(1).reduce((M,_,S)=>M+_.distanceTo(x[S]),0),R=Math.min(r,C/3),w=G(G(x,R).reverse(),R).reverse();return{axisPoints:[h,g],axisTip:g,origin:h,restPoints:[h,y],range:x,limitPoints:w,rangeStart:w[0],rangeEnd:w[w.length-1]}},[i,a,s,t,n,l,m,r])}function Y({frame:e,dh:o,limit:n,size:r,emphasis:i}){const a=i==="highlighted"?D:1,s=i==="dimmed"?B:1,t=r*.2*(i==="highlighted"?1.4:1),l=2*a,{axisPoints:m,axisTip:d,origin:p,restPoints:h,range:g,limitPoints:x,rangeStart:y,rangeEnd:C}=X(o,n,r,t),{position:R,quaternion:w}=O.useMemo(()=>{const M=new u.Vector3,_=new u.Quaternion;return e.decompose(M,_,new u.Vector3),{position:M,quaternion:_}},[e]);return c.jsxs("group",{position:R,quaternion:w,children:[c.jsx(P,{points:m,color:L,width:l,opacity:s}),c.jsx(j,{base:d,direction:d.clone().sub(p),size:t,color:L,opacity:s}),c.jsx(P,{points:h,color:Q,width:1.5*a,opacity:s}),c.jsx(P,{points:x,color:T,width:l,opacity:s}),c.jsx(j,{base:y,direction:g[0].clone().sub(y),size:y.distanceTo(g[0]),color:T,opacity:s}),c.jsx(j,{base:C,direction:g[g.length-1].clone().sub(C),size:C.distanceTo(g[g.length-1]),color:T,opacity:s})]})}function Z({dhParameters:e,chainOffset:o=null,limits:n,jointPositions:r,size:i=.15,highlightedJoint:a=null}){const s=O.useMemo(()=>q(e,o,r),[e,o,r]);return c.jsx("group",{children:s.map((t,l)=>{const m=J(n[l]);return m?c.jsx(Y,{frame:t,dh:e[l],limit:m,size:i,emphasis:a===null?"normal":a===l?"highlighted":"dimmed"},l):null})})}function $({trajectory:e,...o}){const n=(e==null?void 0:e.map(r=>{if(r.position&&r.position.length>=3){const[i,a,s]=r.position;if(Number.isFinite(i)&&Number.isFinite(a)&&Number.isFinite(s))return new u.Vector3(i/1e3,s/1e3,-a/1e3)}return null}).filter(r=>r!==null))||[];return c.jsx("group",{...o,children:n.length>0&&c.jsx(A.Line,{points:n,lineWidth:3,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:10})})}function K({motionGroup:e,connectedMotionGroup:o,getModel:n,flangeRef:r,transparentColor:i,postModelRender:a,...s}){const t=e??o,l=t==null?void 0:t.nova,m=O.useCallback((g,x,y)=>b.defaultGetModel(g,l,y),[l]),d=n??m;if(!(t!=null&&t.dhParameters))return null;const p=t.modelFromController||"";return p?c.jsx(b.SupportedLinearAxis,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,modelFromController:p,dhParameters:t.dhParameters,serialNumber:t.serialNumber,kinematicChainOffset:t.kinematicChainOffset,getModel:d,flangeRef:r,transparentColor:i,postModelRender:a,chainOffsetPosition:t.mountingPosition,chainOffsetQuaternion:t.mountingQuaternion,...s}):c.jsx(b.DHLinearAxis,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,dhParameters:t.dhParameters,chainOffsetPosition:t.mountingPosition,chainOffsetQuaternion:t.mountingQuaternion,...s})}function ee({motionGroup:e,connectedMotionGroup:o,getModel:n,flangeRef:r,transparentColor:i,postModelRender:a,...s}){const t=e??o,l=t==null?void 0:t.nova,m=O.useCallback((d,p,h)=>b.defaultGetModel(d,l,h),[l]);return t!=null&&t.dhParameters?c.jsx(b.SupportedRobot,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,modelFromController:t.modelFromController||"",dhParameters:t.dhParameters,serialNumber:t.serialNumber,kinematicChainOffset:t.kinematicChainOffset,getModel:n??m,flangeRef:r,transparentColor:i,postModelRender:a,chainOffsetPosition:t.mountingPosition,chainOffsetQuaternion:t.mountingQuaternion,...s}):null}exports.CollisionSceneRenderer=V;exports.JointLimitGizmo=Z;exports.LinearAxis=K;exports.Robot=ee;exports.TrajectoryRenderer=$;
|
|
@@ -4,7 +4,7 @@ import { Matrix4 as T, Vector3 as S, Quaternion as I } from "three";
|
|
|
4
4
|
import { ConvexGeometry as v } from "three-stdlib";
|
|
5
5
|
import { Line as E } from "@react-three/drei";
|
|
6
6
|
import { useMemo as L, useCallback as N } from "react";
|
|
7
|
-
import { h as k, d as V, D as Q, f as H } from "./RobotScene-
|
|
7
|
+
import { h as k, d as V, D as Q, f as H } from "./RobotScene-CHQcpJG-.js";
|
|
8
8
|
function U(n) {
|
|
9
9
|
switch (n.shape_type) {
|
|
10
10
|
case "convex_hull":
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const h=require("@wandelbots/nova-js"),r=require("mobx"),g=3e4;class l extends Error{constructor(e,s,i){super(e),this.url=s,this.cause=i,this.name="RobotModeChangeError"}}class u{constructor(e,s,i,t,o,n=async()=>{}){this.nova=e,this.ids=s,this.live=i,this.safety=t,this.logger=o,this.releaseControl=n,this.pending=null,this.disposed=!1,r.makeAutoObservable(this,{nova:!1,ids:!1,live:!1,safety:!1,logger:!1,releaseControl:!1,endPending:!1},{autoBind:!0})}get reported(){return this.live.connectionQuality==="critical"?null:this.live.controllerState.mode==="MODE_CONTROL"?"active":"inactive"}get state(){return this.pending??this.reported??"inactive"}async activate(){if(this.refusedAsDisposed())return;if(this.state!=="inactive"){this.logger.warn("Tried to activate while already activating");return}const e=this.safety().activationBlockedReason;if(e){this.logger.warn(`Not enabling control mode for controller "${this.ids.controllerId}" because ${e}`);return}await this.changeMode("activating",()=>this.setMode("ROBOT_SYSTEM_MODE_CONTROL"))}async deactivate(){if(!this.refusedAsDisposed()){if(this.state!=="active"){this.logger.warn("Tried to deactivate while already deactivating");return}await this.changeMode("deactivating",async()=>{await this.releaseControl(),await this.setMode("ROBOT_SYSTEM_MODE_MONITOR")})}}async toggle(){this.state==="inactive"?await this.activate():this.state==="active"&&await this.deactivate()}dispose(){var e;this.disposed=!0,(e=this.endPending)==null||e.call(this)}refusedAsDisposed(){return this.disposed?(this.logger.warn(`Not changing the mode of controller "${this.ids.controllerId}": its session is disposed`),!0):!1}async changeMode(e,s){var a;const i=e==="activating"?"active":"inactive";let t=()=>{},o;const n=()=>{this.endPending===n&&(this.endPending=void 0,t(),clearTimeout(o),this.setPending(null))};(a=this.endPending)==null||a.call(this),this.endPending=n,this.setPending(e),o=setTimeout(n,g),t=r.when(()=>this.reported===i,n);try{await s()}catch(d){throw n(),d}}setPending(e){this.pending=e}async setMode(e){const{cellId:s,controllerId:i}=this.ids;try{await this.nova.api.controller.setDefaultMode(s,i,e)}catch(t){const o=(typeof t=="object"&&t!==null&&"url"in t&&typeof t.url=="string"?t.url:void 0)??`/cells/${s}/controllers/${i}/mode`;throw new l(`Failed to set controller "${i}" to ${e}: ${h.makeErrorMessage(t)}`,o,t)}}}exports.RobotActivation=u;exports.RobotModeChangeError=l;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { makeErrorMessage as
|
|
2
|
-
import { makeAutoObservable as
|
|
1
|
+
import { makeErrorMessage as d } from "@wandelbots/nova-js";
|
|
2
|
+
import { makeAutoObservable as c, when as h } from "mobx";
|
|
3
3
|
const g = 3e4;
|
|
4
|
-
class
|
|
4
|
+
class u extends Error {
|
|
5
5
|
/** @internal The session makes it, see RobotSession */
|
|
6
|
-
constructor(t,
|
|
7
|
-
super(t), this.url =
|
|
6
|
+
constructor(t, s, i) {
|
|
7
|
+
super(t), this.url = s, this.cause = i, this.name = "RobotModeChangeError";
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
class
|
|
10
|
+
class p {
|
|
11
11
|
/** @internal The session makes it, see RobotSession */
|
|
12
|
-
constructor(t,
|
|
12
|
+
constructor(t, s, i, e, n, a = async () => {
|
|
13
13
|
}) {
|
|
14
|
-
this.nova = t, this.ids =
|
|
14
|
+
this.nova = t, this.ids = s, this.live = i, this.safety = e, this.logger = n, this.releaseControl = a, this.pending = null, this.disposed = !1, c(
|
|
15
15
|
this,
|
|
16
16
|
{
|
|
17
17
|
nova: !1,
|
|
@@ -43,11 +43,13 @@ class M {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Switches the controller to control mode. Does nothing while a mode change
|
|
46
|
-
* is in progress,
|
|
47
|
-
* NOVA refuse it (see {@link RobotSafety.activationBlockedReason})
|
|
48
|
-
*
|
|
46
|
+
* is in progress, when the safety state or operation mode would make
|
|
47
|
+
* NOVA refuse it (see {@link RobotSafety.activationBlockedReason}), and
|
|
48
|
+
* once the session is disposed. Rejects with a
|
|
49
|
+
* {@link RobotModeChangeError} when NOVA refuses it.
|
|
49
50
|
*/
|
|
50
51
|
async activate() {
|
|
52
|
+
if (this.refusedAsDisposed()) return;
|
|
51
53
|
if (this.state !== "inactive") {
|
|
52
54
|
this.logger.warn("Tried to activate while already activating");
|
|
53
55
|
return;
|
|
@@ -66,25 +68,35 @@ class M {
|
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
68
70
|
* Switches the controller to monitor mode, after handing back a planned
|
|
69
|
-
* move, which holds it in control mode.
|
|
70
|
-
* {@link RobotModeChangeError} when NOVA refuses
|
|
71
|
+
* move, which holds it in control mode. Does nothing once the session is
|
|
72
|
+
* disposed. Rejects with a {@link RobotModeChangeError} when NOVA refuses
|
|
73
|
+
* it.
|
|
71
74
|
*/
|
|
72
75
|
async deactivate() {
|
|
73
|
-
if (this.
|
|
74
|
-
this.
|
|
75
|
-
|
|
76
|
+
if (!this.refusedAsDisposed()) {
|
|
77
|
+
if (this.state !== "active") {
|
|
78
|
+
this.logger.warn("Tried to deactivate while already deactivating");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
await this.changeMode("deactivating", async () => {
|
|
82
|
+
await this.releaseControl(), await this.setMode("ROBOT_SYSTEM_MODE_MONITOR");
|
|
83
|
+
});
|
|
76
84
|
}
|
|
77
|
-
await this.changeMode("deactivating", async () => {
|
|
78
|
-
await this.releaseControl(), await this.setMode("ROBOT_SYSTEM_MODE_MONITOR");
|
|
79
|
-
});
|
|
80
85
|
}
|
|
81
86
|
/** Activates an inactive robot, deactivates an active one */
|
|
82
87
|
async toggle() {
|
|
83
88
|
this.state === "inactive" ? await this.activate() : this.state === "active" && await this.deactivate();
|
|
84
89
|
}
|
|
90
|
+
/** Ends a mode change's wait; no mode change is asked for afterwards */
|
|
85
91
|
dispose() {
|
|
86
92
|
var t;
|
|
87
|
-
(t = this.endPending) == null || t.call(this);
|
|
93
|
+
this.disposed = !0, (t = this.endPending) == null || t.call(this);
|
|
94
|
+
}
|
|
95
|
+
/** Whether the session is disposed, which then asks NOVA for nothing */
|
|
96
|
+
refusedAsDisposed() {
|
|
97
|
+
return this.disposed ? (this.logger.warn(
|
|
98
|
+
`Not changing the mode of controller "${this.ids.controllerId}": its session is disposed`
|
|
99
|
+
), !0) : !1;
|
|
88
100
|
}
|
|
89
101
|
/**
|
|
90
102
|
* Shows a mode change until it is over: the controller reports the mode
|
|
@@ -93,32 +105,32 @@ class M {
|
|
|
93
105
|
* what the controller reports again, and the change can be asked for
|
|
94
106
|
* again.
|
|
95
107
|
*/
|
|
96
|
-
async changeMode(t,
|
|
97
|
-
var
|
|
108
|
+
async changeMode(t, s) {
|
|
109
|
+
var r;
|
|
98
110
|
const i = t === "activating" ? "active" : "inactive";
|
|
99
111
|
let e = () => {
|
|
100
112
|
}, n;
|
|
101
|
-
const
|
|
102
|
-
this.endPending ===
|
|
113
|
+
const a = () => {
|
|
114
|
+
this.endPending === a && (this.endPending = void 0, e(), clearTimeout(n), this.setPending(null));
|
|
103
115
|
};
|
|
104
|
-
(
|
|
116
|
+
(r = this.endPending) == null || r.call(this), this.endPending = a, this.setPending(t), n = setTimeout(a, g), e = h(() => this.reported === i, a);
|
|
105
117
|
try {
|
|
106
|
-
await
|
|
118
|
+
await s();
|
|
107
119
|
} catch (l) {
|
|
108
|
-
throw
|
|
120
|
+
throw a(), l;
|
|
109
121
|
}
|
|
110
122
|
}
|
|
111
123
|
setPending(t) {
|
|
112
124
|
this.pending = t;
|
|
113
125
|
}
|
|
114
126
|
async setMode(t) {
|
|
115
|
-
const { cellId:
|
|
127
|
+
const { cellId: s, controllerId: i } = this.ids;
|
|
116
128
|
try {
|
|
117
|
-
await this.nova.api.controller.setDefaultMode(
|
|
129
|
+
await this.nova.api.controller.setDefaultMode(s, i, t);
|
|
118
130
|
} catch (e) {
|
|
119
|
-
const n = (typeof e == "object" && e !== null && "url" in e && typeof e.url == "string" ? e.url : void 0) ?? `/cells/${
|
|
120
|
-
throw new
|
|
121
|
-
`Failed to set controller "${i}" to ${t}: ${
|
|
131
|
+
const n = (typeof e == "object" && e !== null && "url" in e && typeof e.url == "string" ? e.url : void 0) ?? `/cells/${s}/controllers/${i}/mode`;
|
|
132
|
+
throw new u(
|
|
133
|
+
`Failed to set controller "${i}" to ${t}: ${d(e)}`,
|
|
122
134
|
n,
|
|
123
135
|
e
|
|
124
136
|
);
|
|
@@ -126,6 +138,6 @@ class M {
|
|
|
126
138
|
}
|
|
127
139
|
}
|
|
128
140
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
141
|
+
p as R,
|
|
142
|
+
u as a
|
|
131
143
|
};
|