@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.bd2ec84 → 6.4.0-pr.revamp.667.ca77f09
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 +172 -40
- package/dist/3d.cjs +1 -1
- package/dist/3d.d.ts +3 -4
- package/dist/3d.js +35 -38
- package/dist/CurrentPose/index.cjs +1 -1
- package/dist/CurrentPose/index.js +2 -2
- package/dist/CurrentPoseBar/index.cjs +1 -1
- package/dist/CurrentPoseBar/index.js +1 -1
- package/dist/JoggingButtons/index.cjs +1 -1
- package/dist/JoggingButtons/index.js +1 -1
- package/dist/JoggingGizmo/index.cjs +1 -1
- package/dist/JoggingGizmo/index.js +2 -2
- package/dist/JoggingJointSlider/index.cjs +1 -1
- package/dist/JoggingJointSlider/index.js +1 -1
- package/dist/RobotControl/index.cjs +1 -1
- package/dist/RobotControl/index.js +2 -2
- package/dist/RobotControlPanel/index.cjs +1 -1
- package/dist/RobotControlPanel/index.d.ts +1 -1
- package/dist/RobotControlPanel/index.js +1 -1
- package/dist/RobotHeader/index.cjs +1 -1
- package/dist/RobotHeader/index.d.ts +3 -5
- package/dist/RobotHeader/index.js +6 -7
- package/dist/RobotScene/index.cjs +1 -1
- package/dist/RobotScene/index.js +3 -3
- package/dist/RobotView/index.cjs +1 -1
- package/dist/RobotView/index.js +2 -2
- package/dist/SafetyBar/IndicatorWithExplanation.d.ts +12 -1
- package/dist/SafetyBar/SafetyBar.d.ts +15 -1
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.d.ts +0 -1
- package/dist/SafetyBar/index.js +3 -4
- package/dist/SafetyBar/robotSafetyOf.d.ts +1 -0
- package/dist/chunks/{ConnectedMotionGroup-BifrgwV1.js → ConnectedMotionGroup-DNYakgxy.js} +6 -5
- package/dist/chunks/ConnectedMotionGroup-IRTsTxwB.cjs +3 -0
- package/dist/chunks/{CurrentPose-CMqO8oqX.cjs → CurrentPose-CAq9e9JY.cjs} +1 -1
- package/dist/chunks/{CurrentPose-CdD2ZB7B.js → CurrentPose-CgdINEh2.js} +3 -3
- package/dist/chunks/{CurrentPoseBar-CX1xFBtm.js → CurrentPoseBar--HkZBGnN.js} +11 -11
- package/dist/chunks/{CurrentPoseBar-BTBAwIO4.cjs → CurrentPoseBar-DoOUfRRs.cjs} +1 -1
- package/dist/chunks/{JoggingButtons-aijK-3g6.js → JoggingButtons-BNOnpcTH.js} +1 -1
- package/dist/chunks/{JoggingButtons-BOHl7hVq.cjs → JoggingButtons-Boaym2hQ.cjs} +1 -1
- package/dist/chunks/{JoggingGizmo-CoKYUtXq.cjs → JoggingGizmo-CNFjpWDv.cjs} +1 -1
- package/dist/chunks/{JoggingGizmo-DHvrJouR.js → JoggingGizmo-RDiEVQes.js} +1 -1
- package/dist/chunks/{JoggingGizmoOrientation-CIvIAIeO.js → JoggingGizmoOrientation-Dzzz2gEz.js} +1 -1
- package/dist/chunks/{JoggingGizmoOrientation-DVcagPRJ.cjs → JoggingGizmoOrientation-laUrgY0N.cjs} +1 -1
- package/dist/chunks/{JoggingJointSlider-DQtt4-pa.js → JoggingJointSlider-BY-Tof8G.js} +1 -1
- package/dist/chunks/{JoggingJointSlider-CTFYKzsU.cjs → JoggingJointSlider-Dm3vILd3.cjs} +1 -1
- package/dist/chunks/{JoggingRefusedError-BIkUM6-g.js → JoggingRefusedError-C4D8_YR_.js} +5 -3
- package/dist/chunks/JoggingRefusedError-DqyrfUcc.cjs +1 -0
- package/dist/chunks/Pose3-BfBNPRDM.cjs +1 -0
- package/dist/chunks/{Pose3-B_fLR-Wv.js → Pose3-DWxfC6Dj.js} +1 -2
- package/dist/chunks/{Robot-C-IWfxP9.js → Robot-B-VAYuAr.js} +5 -5
- package/dist/chunks/{Robot-Cfhjv9Z8.cjs → Robot-DRf8T9Zf.cjs} +1 -1
- package/dist/chunks/RobotActivation-CRVxXvlx.cjs +1 -0
- package/dist/chunks/RobotActivation-oR-8Y0iq.js +143 -0
- package/dist/chunks/RobotControl-Dbe50ZKM.cjs +1 -0
- package/dist/chunks/RobotControl-Ms1F7fFe.js +332 -0
- package/dist/chunks/RobotControlPanel-B7NxoHsO.cjs +1 -0
- package/dist/chunks/RobotControlPanel-CkQlkq8x.js +1029 -0
- package/dist/chunks/RobotHeader-CjOaf9s6.cjs +1 -0
- package/dist/chunks/RobotHeader-LSuRTDFB.js +395 -0
- package/dist/chunks/RobotScene-Au6zpHH1.cjs +1 -0
- package/dist/chunks/RobotScene-C6XEgaVR.js +1284 -0
- package/dist/chunks/RobotSessionProvider-CoF_tX0O.cjs +1 -0
- package/dist/chunks/RobotSessionProvider-DuHi-dtw.js +30 -0
- package/dist/chunks/{RobotView-BGYlAWj-.cjs → RobotView-Cg6JfGiY.cjs} +1 -1
- package/dist/chunks/{RobotView-D-v8jCM7.js → RobotView-CrAxNkyG.js} +3 -3
- package/dist/chunks/{robotSafetyOf-DuKKma1_.js → SafetyBar-C85BAKsL.js} +244 -215
- package/dist/chunks/SafetyBar-D2l81Omq.cjs +1 -0
- package/dist/chunks/externalizeComponent-CA_sHzyH.cjs +2 -0
- package/dist/chunks/{externalizeComponent-4juwPKL5.js → externalizeComponent-CChY_1bN.js} +34 -8
- package/dist/chunks/{useSmoothedMotionState-BSSV8aZN.js → hooks-BWoeBWLV.js} +43 -87
- package/dist/chunks/hooks-BXe2bNMo.cjs +1 -0
- package/dist/chunks/loadRobotSession-BzY9H3F8.cjs +1 -0
- package/dist/chunks/{loadRobotSession-GHHtv5dv.js → loadRobotSession-Ts2MumBB.js} +1065 -679
- package/dist/chunks/poseText-BxG4Caa-.js +48 -0
- package/dist/chunks/poseText-CwplkbDM.cjs +1 -0
- package/dist/chunks/useSmoothedMotionState-CCXmMZ0S.cjs +1 -0
- package/dist/chunks/useSmoothedMotionState-CELh-YJa.js +50 -0
- package/dist/components/VelocitySlider.d.ts +14 -1
- package/dist/components/connectionWarning/ConnectionWarning.d.ts +18 -4
- package/dist/components/connectionWarning/connectionWarningOf.d.ts +1 -11
- package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +7 -1
- package/dist/components/jogging/JoggingCartesianTab.d.ts +6 -0
- package/dist/components/jogging/JoggingJointTab.d.ts +5 -0
- package/dist/components/jogging/JoggingJointValueControl.d.ts +7 -1
- package/dist/components/jogging/JoggingPanel.d.ts +11 -0
- package/dist/components/jogging/JoggingRefusedError.d.ts +8 -3
- package/dist/components/jogging/JoggingStore.d.ts +206 -17
- package/dist/components/jogging/joggingColors.d.ts +6 -0
- package/dist/components/robotControl/CartesianJogTab.d.ts +14 -3
- package/dist/components/robotControl/JogArea.d.ts +6 -3
- package/dist/components/robotControl/JogDisabledReason.d.ts +15 -0
- package/dist/components/robotControl/JointJogTab.d.ts +10 -2
- package/dist/components/robotControl/MoveToTab.d.ts +24 -3
- package/dist/components/robotControl/PoseField.d.ts +3 -1
- package/dist/components/robotControl/RobotControl.d.ts +3 -0
- package/dist/components/robotControl/RobotControlPanel.d.ts +91 -22
- package/dist/components/robotControl/VelocityRow.d.ts +8 -2
- package/dist/components/robotControl/atPose.d.ts +6 -0
- package/dist/components/robotControl/poseText.d.ts +13 -1
- package/dist/components/robotControl/units.d.ts +10 -2
- package/dist/components/robotControl/useRobotControlProps.d.ts +7 -4
- package/dist/components/robotControl/velocityText.d.ts +18 -0
- package/dist/components/robotHeader/ActivationSwitch.d.ts +13 -2
- package/dist/components/robotHeader/RobotHeader.d.ts +25 -4
- package/dist/components/robotHeader/robotActivationOf.d.ts +1 -8
- package/dist/components/robotScene/RobotScene.d.ts +7 -1
- 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.d.ts +8 -10
- package/dist/core.js +60 -69
- package/dist/index.cjs +1 -1
- package/dist/index.js +100 -113
- package/dist/lib/ConnectedMotionGroup.d.ts +11 -0
- package/dist/lib/ControllerStateStream.d.ts +9 -9
- package/dist/lib/JoggerConnection.d.ts +48 -13
- package/dist/lib/MotionStreamConnection.d.ts +3 -2
- package/dist/lib/TrajectoryExecutionStore.d.ts +58 -20
- package/dist/lib/controllerStateSource.d.ts +6 -5
- package/dist/lib/robotSession/RobotActivation.d.ts +52 -21
- package/dist/lib/robotSession/RobotSession.d.ts +27 -8
- package/dist/lib/robotSession/RobotTargetPose.d.ts +4 -2
- package/dist/lib/robotSession/loadRobotSession.d.ts +1 -1
- package/dist/lib/robotSession/robotPose.d.ts +0 -6
- package/dist/session.cjs +1 -1
- package/dist/session.d.ts +6 -6
- package/dist/session.js +30 -38
- package/package.json +22 -1
- package/dist/chunks/ConnectedMotionGroup-CybwJHkh.cjs +0 -3
- package/dist/chunks/JoggingRefusedError-BuCGsVsa.cjs +0 -1
- package/dist/chunks/Pose3-Ch4xVeXV.cjs +0 -1
- package/dist/chunks/RobotActivation-Bb0oNSBN.cjs +0 -1
- package/dist/chunks/RobotActivation-C0rrwpQZ.js +0 -115
- package/dist/chunks/RobotControl-Cv6Sr1Ni.js +0 -289
- package/dist/chunks/RobotControl-DFnOYMAa.cjs +0 -1
- package/dist/chunks/RobotControlPanel-B1_9g9D-.js +0 -850
- package/dist/chunks/RobotControlPanel-BpTpRBgy.cjs +0 -1
- package/dist/chunks/RobotScene-0ZJzXL50.cjs +0 -1
- package/dist/chunks/RobotScene-DpFeFpnx.js +0 -1255
- package/dist/chunks/RobotSessionProvider--AekyPqD.cjs +0 -1
- package/dist/chunks/RobotSessionProvider-TVaKGzqa.js +0 -25
- package/dist/chunks/externalizeComponent-Br_U-QAr.cjs +0 -2
- package/dist/chunks/loadRobotSession-DYbeNnTI.cjs +0 -1
- package/dist/chunks/poseText-BXUaQWnK.cjs +0 -1
- package/dist/chunks/poseText-pg4cxE8R.js +0 -41
- package/dist/chunks/robotActivationOf-B4oV10Za.cjs +0 -1
- package/dist/chunks/robotActivationOf-EzcT9g07.js +0 -368
- package/dist/chunks/robotSafetyOf-Dxm6s7Pp.cjs +0 -1
- package/dist/chunks/useSmoothedMotionState-B9WO73k0.cjs +0 -1
- package/dist/components/robotHeader/robotSafetyOf.d.ts +0 -11
|
@@ -1,3 +0,0 @@
|
|
|
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-Br_U-QAr.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-DYbeNnTI.cjs"),le=require("@mui/material/CircularProgress"),Ie=require("@mui/material/utils"),K=require("lodash-es"),Je=require("./robotSafetyOf-Dxm6s7Pp.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("./useSmoothedMotionState-B9WO73k0.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;o&&(e.locked?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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function n(t){return t.type==="joint"?{type:"joint",joints:t.joints}:{type:"cartesian",pose:t.tcpPose.pose,coordinateSystemId:t.tcpPose.coordSystemId}}const o=(t=[0,0,0],e=[0,0,0])=>t.length===e.length&&t.every((s,r)=>s===e[r]);function i(t,e){return t.motionGroupId!==e.motionGroupId?!1:t.type==="joint"?e.type==="joint"&&o(t.joints,e.joints):e.type==="joint"?!1:t.tcpPose.tcpId===e.tcpPose.tcpId&&t.tcpPose.coordSystemId===e.tcpPose.coordSystemId&&o(t.tcpPose.pose.position,e.tcpPose.pose.position)&&o(t.tcpPose.pose.orientation,e.tcpPose.pose.orientation)}function c(t){switch(t.code){case"locked":return"jogging is locked";case"disconnected":return"the robot's live state stopped coming";case"safety_state":return`the safety state is ${t.value}`;case"operation_mode":return`the operation mode is ${t.value}`;case"deactivated":return"the robot is not activated"}}class p extends Error{constructor(e){super(`Jogging refused: ${c(e)}`),this.name="JoggingRefusedError",this.reason=e}}exports.JoggingRefusedError=p;exports.sameRobotPose=i;exports.trajectoryTargetOf=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("three");function a(t,n){if(n==="QUATERNION"&&t)return new i.Quaternion(...t);if(n==="ROTATION_VECTOR"&&t){if(t&&t.length<3)throw new Error(`Invalid rotation vector length: ${t.length}. Expected at least 3 values.`);const e=new i.Vector3(t[0],t[1],t[2]),o=e.length(),u=e.normalize();return new i.Quaternion().setFromAxisAngle(u,o)}else return console.warn(`Unsupported rotation type '${n}'. Only QUATERNION and ROTATION_VECTOR are supported for now.`),new i.Quaternion}function s(t){const n=new i.Vector3(t.x,t.y,t.z),e=2*Math.atan2(n.length(),Math.abs(t.w));n.normalize();const o=(t.w>=0?1:0)-(t.w<0?1:0);return n.multiplyScalar(o).multiplyScalar(e)}class r{constructor(n,e){this.position=n,this.quaternion=e}static fromPose(n){const e=n.orientation?a(n.orientation,"ROTATION_VECTOR"):new i.Quaternion,o=n.position??[0,0,0];return new r(new i.Vector3(o[0]??0,o[1]??0,o[2]??0),e)}static fromRobotTcp(n){const e=n.orientation?a(n.orientation,n.orientation_type??"ROTATION_VECTOR"):new i.Quaternion,o=n.position??[0,0,0];return new r(new i.Vector3(o[0]??0,o[1]??0,o[2]??0),e)}static fromCoordinateSystem(n){const e=n.orientation?a(n.orientation,n.orientation_type??"ROTATION_VECTOR"):new i.Quaternion,o=n.position??[0,0,0];return new r(new i.Vector3(o[0]??0,o[1]??0,o[2]??0),e)}inverse(){const n=this.quaternion.clone().invert();return new r(this.position.clone().applyQuaternion(n).multiplyScalar(-1),n)}multiply(n){return new r(this.position.clone().add(n.position.clone().applyQuaternion(this.quaternion)),this.quaternion.clone().multiply(n.quaternion).normalize())}get orientation(){return s(this.quaternion)}}exports.Pose3=r;exports.parseRotationToQuaternion=a;exports.quaternionToRotationVector=s;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("@wandelbots/nova-js"),a=require("mobx");class n extends Error{constructor(t,i,s){super(t),this.url=i,this.cause=s,this.name="RobotModeChangeError"}}class d{constructor(t,i,s,e,o,l=async()=>{}){this.nova=t,this.ids=i,this.live=s,this.safety=e,this.logger=o,this.releaseControl=l,this.state="inactive",this.disposers=[],s.controllerState.mode==="MODE_CONTROL"&&(this.state="active"),a.makeAutoObservable(this,{nova:!1,ids:!1,live:!1,safety:!1,logger:!1,releaseControl:!1,disposers:!1},{autoBind:!0}),this.disposers.push(a.reaction(()=>this.live.controllerState.mode,r=>{this.state=r==="MODE_CONTROL"?"active":"inactive"})),this.disposers.push(a.reaction(()=>this.live.connectionQuality,r=>{r==="critical"&&(this.state="inactive")}))}async activate(){if(this.state!=="inactive"){this.logger.warn("Tried to activate while already activating");return}const t=this.safety().activationBlockedReason;if(t){this.logger.warn(`Not enabling control mode for controller "${this.ids.controllerId}" because ${t}`);return}this.state="activating";try{await this.setMode("ROBOT_SYSTEM_MODE_CONTROL"),a.runInAction(()=>{this.live.controllerState.mode==="MODE_CONTROL"&&(this.state="active")})}catch(i){throw a.runInAction(()=>{this.state="inactive"}),i}}async deactivate(){if(this.state!=="active"){this.logger.warn("Tried to deactivate while already deactivating");return}this.state="deactivating";try{await this.releaseControl(),await this.setMode("ROBOT_SYSTEM_MODE_MONITOR"),a.runInAction(()=>{this.live.controllerState.mode!=="MODE_CONTROL"&&(this.state="inactive")})}catch(t){throw a.runInAction(()=>{this.state="active"}),t}}async toggle(){this.state==="inactive"?await this.activate():this.state==="active"&&await this.deactivate()}dispose(){for(const t of this.disposers)t()}async setMode(t){const{cellId:i,controllerId:s}=this.ids;try{await this.nova.api.controller.setDefaultMode(i,s,t)}catch(e){const o=(typeof e=="object"&&e!==null&&"url"in e&&typeof e.url=="string"?e.url:void 0)??`/cells/${i}/controllers/${s}/mode`;throw new n(`Failed to set controller "${s}" to ${t}: ${h.makeErrorMessage(e)}`,o,e)}}}exports.RobotActivation=d;exports.RobotModeChangeError=n;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { makeErrorMessage as h } from "@wandelbots/nova-js";
|
|
2
|
-
import { makeAutoObservable as d, reaction as l, runInAction as a } from "mobx";
|
|
3
|
-
class v extends Error {
|
|
4
|
-
/** @internal The session makes it, see RobotSession */
|
|
5
|
-
constructor(t, i, s) {
|
|
6
|
-
super(t), this.url = i, this.cause = s, this.name = "RobotModeChangeError";
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
class u {
|
|
10
|
-
constructor(t, i, s, e, o, n = async () => {
|
|
11
|
-
}) {
|
|
12
|
-
this.nova = t, this.ids = i, this.live = s, this.safety = e, this.logger = o, this.releaseControl = n, this.state = "inactive", this.disposers = [], s.controllerState.mode === "MODE_CONTROL" && (this.state = "active"), d(
|
|
13
|
-
this,
|
|
14
|
-
{
|
|
15
|
-
nova: !1,
|
|
16
|
-
ids: !1,
|
|
17
|
-
live: !1,
|
|
18
|
-
safety: !1,
|
|
19
|
-
logger: !1,
|
|
20
|
-
releaseControl: !1,
|
|
21
|
-
disposers: !1
|
|
22
|
-
},
|
|
23
|
-
{ autoBind: !0 }
|
|
24
|
-
), this.disposers.push(
|
|
25
|
-
l(
|
|
26
|
-
() => this.live.controllerState.mode,
|
|
27
|
-
(r) => {
|
|
28
|
-
this.state = r === "MODE_CONTROL" ? "active" : "inactive";
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
), this.disposers.push(
|
|
32
|
-
l(
|
|
33
|
-
() => this.live.connectionQuality,
|
|
34
|
-
(r) => {
|
|
35
|
-
r === "critical" && (this.state = "inactive");
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Switches the controller to control mode. Does nothing while a mode change
|
|
42
|
-
* is in progress, or when the safety state or operation mode would make
|
|
43
|
-
* NOVA refuse it (see {@link RobotSafety.activationBlockedReason}). Rejects
|
|
44
|
-
* with a {@link RobotModeChangeError} when NOVA refuses it.
|
|
45
|
-
*/
|
|
46
|
-
async activate() {
|
|
47
|
-
if (this.state !== "inactive") {
|
|
48
|
-
this.logger.warn("Tried to activate while already activating");
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const t = this.safety().activationBlockedReason;
|
|
52
|
-
if (t) {
|
|
53
|
-
this.logger.warn(
|
|
54
|
-
`Not enabling control mode for controller "${this.ids.controllerId}" because ${t}`
|
|
55
|
-
);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
this.state = "activating";
|
|
59
|
-
try {
|
|
60
|
-
await this.setMode("ROBOT_SYSTEM_MODE_CONTROL"), a(() => {
|
|
61
|
-
this.live.controllerState.mode === "MODE_CONTROL" && (this.state = "active");
|
|
62
|
-
});
|
|
63
|
-
} catch (i) {
|
|
64
|
-
throw a(() => {
|
|
65
|
-
this.state = "inactive";
|
|
66
|
-
}), i;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Switches the controller to monitor mode, after handing back a planned
|
|
71
|
-
* move, which holds it in control mode. Rejects with a
|
|
72
|
-
* {@link RobotModeChangeError} when NOVA refuses it.
|
|
73
|
-
*/
|
|
74
|
-
async deactivate() {
|
|
75
|
-
if (this.state !== "active") {
|
|
76
|
-
this.logger.warn("Tried to deactivate while already deactivating");
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
this.state = "deactivating";
|
|
80
|
-
try {
|
|
81
|
-
await this.releaseControl(), await this.setMode("ROBOT_SYSTEM_MODE_MONITOR"), a(() => {
|
|
82
|
-
this.live.controllerState.mode !== "MODE_CONTROL" && (this.state = "inactive");
|
|
83
|
-
});
|
|
84
|
-
} catch (t) {
|
|
85
|
-
throw a(() => {
|
|
86
|
-
this.state = "active";
|
|
87
|
-
}), t;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/** Activates an inactive robot, deactivates an active one */
|
|
91
|
-
async toggle() {
|
|
92
|
-
this.state === "inactive" ? await this.activate() : this.state === "active" && await this.deactivate();
|
|
93
|
-
}
|
|
94
|
-
dispose() {
|
|
95
|
-
for (const t of this.disposers)
|
|
96
|
-
t();
|
|
97
|
-
}
|
|
98
|
-
async setMode(t) {
|
|
99
|
-
const { cellId: i, controllerId: s } = this.ids;
|
|
100
|
-
try {
|
|
101
|
-
await this.nova.api.controller.setDefaultMode(i, s, t);
|
|
102
|
-
} catch (e) {
|
|
103
|
-
const o = (typeof e == "object" && e !== null && "url" in e && typeof e.url == "string" ? e.url : void 0) ?? `/cells/${i}/controllers/${s}/mode`;
|
|
104
|
-
throw new v(
|
|
105
|
-
`Failed to set controller "${s}" to ${t}: ${h(e)}`,
|
|
106
|
-
o,
|
|
107
|
-
e
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
export {
|
|
113
|
-
u as R,
|
|
114
|
-
v as a
|
|
115
|
-
};
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
-
import { observer as Z } from "mobx-react-lite";
|
|
3
|
-
import { a as $ } from "./RobotSessionProvider-TVaKGzqa.js";
|
|
4
|
-
import { R as ee } from "./RobotControlPanel-B1_9g9D-.js";
|
|
5
|
-
import { degreesToRadians as c, radiansToDegrees as te } from "@wandelbots/nova-js";
|
|
6
|
-
import { JointTypeEnum as oe } from "@wandelbots/nova-js/v2";
|
|
7
|
-
import { reaction as ne, runInAction as re } from "mobx";
|
|
8
|
-
import { useEffect as E, useState as F, useRef as x, useMemo as ae } from "react";
|
|
9
|
-
import { useTranslation as ie } from "react-i18next";
|
|
10
|
-
import { Quaternion as ce } from "three";
|
|
11
|
-
import { i as se } from "./externalizeComponent-4juwPKL5.js";
|
|
12
|
-
import { P as le, p as N } from "./Pose3-B_fLR-Wv.js";
|
|
13
|
-
import { s as me, J as de } from "./JoggingRefusedError-BIkUM6-g.js";
|
|
14
|
-
import { c as k } from "./coordSystemLabel-Bfy9MUsV.js";
|
|
15
|
-
import { u as ge } from "./useEveryFrame-D04ygIe7.js";
|
|
16
|
-
const A = [
|
|
17
|
-
"Base",
|
|
18
|
-
"Shoulder",
|
|
19
|
-
"Elbow",
|
|
20
|
-
"Forearm",
|
|
21
|
-
"Wrist",
|
|
22
|
-
"Flange"
|
|
23
|
-
], I = "selected-tcp", C = "coordinate-system:", B = (o) => Math.round(te(o) * 1e6) / 1e6;
|
|
24
|
-
function R(o, a) {
|
|
25
|
-
return {
|
|
26
|
-
type: "cartesian",
|
|
27
|
-
motionGroupId: o.motionGroupId,
|
|
28
|
-
tcpPose: {
|
|
29
|
-
pose: a,
|
|
30
|
-
coordSystemId: o.jogging.selectedCoordSystemId,
|
|
31
|
-
tcpId: o.jogging.selectedTcpId
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function w(o, a) {
|
|
36
|
-
o.targetPose.plan(R(o, a));
|
|
37
|
-
}
|
|
38
|
-
function ue(o, a) {
|
|
39
|
-
switch (o.code) {
|
|
40
|
-
case "disconnected":
|
|
41
|
-
return a("RobotControl.MoveTo.NotMoveable.Disconnected.lb");
|
|
42
|
-
case "safety_state":
|
|
43
|
-
return a("RobotControl.MoveTo.NotMoveable.SafetyState.lb", {
|
|
44
|
-
value: o.value
|
|
45
|
-
});
|
|
46
|
-
case "operation_mode":
|
|
47
|
-
return a("RobotControl.MoveTo.NotMoveable.OperationMode.lb", {
|
|
48
|
-
value: o.value
|
|
49
|
-
});
|
|
50
|
-
case "deactivated":
|
|
51
|
-
return a("RobotControl.MoveTo.NotMoveable.Deactivated.lb");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function pe(o) {
|
|
55
|
-
const a = ge(
|
|
56
|
-
() => o.jogger.motionStream.rapidlyChangingMotionState.joint_position.join(
|
|
57
|
-
" "
|
|
58
|
-
),
|
|
59
|
-
!0
|
|
60
|
-
);
|
|
61
|
-
return ae(() => a ? a.split(" ").map(Number) : [], [a]);
|
|
62
|
-
}
|
|
63
|
-
function fe(o, a = {}) {
|
|
64
|
-
var _;
|
|
65
|
-
const { disabled: S = !1, gizmoOrientation: v } = a, { t: m } = ie(void 0, { i18n: se }), t = o.jogging, { trajectory: d, targetPose: s } = o, P = pe(t), y = t.jointType === oe.PrismaticJoint, l = (_ = t.motionGroupDescription.operation_limits.auto_limits) == null ? void 0 : _.joints, h = d.trajectoryState === "moving" || d.trajectoryState === "stopping", j = o.safety.canBeMoved, V = S || h || !j;
|
|
66
|
-
E(() => {
|
|
67
|
-
if (V)
|
|
68
|
-
return t.lock("external"), () => t.unlock("external");
|
|
69
|
-
}, [t, V]);
|
|
70
|
-
const [Q, G] = F(!1), q = Q ? "moveTo" : t.currentTab.id === "joint" ? "joint" : t.selectedCartesianMotionType;
|
|
71
|
-
function z(e) {
|
|
72
|
-
G(e === "moveTo"), re(() => {
|
|
73
|
-
t.selectedTabId = e === "joint" ? "joint" : "cartesian";
|
|
74
|
-
}), (e === "translate" || e === "rotate") && t.setSelectedCartesianMotionType(e);
|
|
75
|
-
}
|
|
76
|
-
const K = t.selectedIncrementId === "continuous" ? "continuous" : "increment", T = x(
|
|
77
|
-
t.activeDiscreteIncrement ?? t.discreteIncrementOptions[0]
|
|
78
|
-
);
|
|
79
|
-
t.activeDiscreteIncrement && (T.current = t.activeDiscreteIncrement);
|
|
80
|
-
const b = T.current;
|
|
81
|
-
function X(e, n) {
|
|
82
|
-
return t.discreteIncrementOptions.find(
|
|
83
|
-
(r) => e === "translate" ? Math.abs(r.mm - n) < 1e-9 : Math.abs(c(r.degrees) - n) < 1e-9
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
function U() {
|
|
87
|
-
if (t.selectedOrientation === "tool") {
|
|
88
|
-
const n = o.state.rapidlyChangingMotionState.flange_pose, r = n ? le.fromPose(n).quaternion.clone() : new ce(), i = t.selectedTcpId ? o.description.tcpOffsetsById[t.selectedTcpId] : void 0;
|
|
89
|
-
return i != null && i.pose.orientation && r.multiply(
|
|
90
|
-
N(i.pose.orientation, "ROTATION_VECTOR")
|
|
91
|
-
), r;
|
|
92
|
-
}
|
|
93
|
-
const e = t.jogCoordSystem;
|
|
94
|
-
return N(
|
|
95
|
-
e.orientation ?? [1, 0, 0, 0],
|
|
96
|
-
e.orientation_type ?? "QUATERNION"
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
function M(e) {
|
|
100
|
-
o.reportError({
|
|
101
|
-
kind: "jog",
|
|
102
|
-
message: e instanceof Error ? e.message : String(e),
|
|
103
|
-
cause: e
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function g(e) {
|
|
107
|
-
e.catch((n) => {
|
|
108
|
-
n instanceof de || M(n);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
const [u, W] = F(null), O = x(u);
|
|
112
|
-
O.current = u;
|
|
113
|
-
function Y(e) {
|
|
114
|
-
if (W(e), !e) {
|
|
115
|
-
s.resetToLive();
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
w(o, e);
|
|
119
|
-
}
|
|
120
|
-
E(
|
|
121
|
-
() => (
|
|
122
|
-
// Once the robot can move: while it is activating, there is no reason
|
|
123
|
-
// not to, but an app may still lock it, and the session plans nothing
|
|
124
|
-
ne(
|
|
125
|
-
() => o.safety.canBeMoved,
|
|
126
|
-
(e) => {
|
|
127
|
-
const n = O.current, { staged: r, confirming: i } = o.targetPose;
|
|
128
|
-
e && n && !r && !i && w(o, n);
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
),
|
|
132
|
-
[o]
|
|
133
|
-
);
|
|
134
|
-
const J = o.safety.notMoveableReason, p = s.staged, H = u !== null && s.stagedPose !== null && me(s.stagedPose, R(o, u));
|
|
135
|
-
return {
|
|
136
|
-
disabled: S,
|
|
137
|
-
// Jogging waits for a trajectory, for another client's jogging, and for
|
|
138
|
-
// a robot that may move
|
|
139
|
-
jogDisabled: h || t.blocked || !j,
|
|
140
|
-
// A linear axis or a turntable jogs its joints only
|
|
141
|
-
cartesian: t.canJogCartesian,
|
|
142
|
-
tab: q,
|
|
143
|
-
onTabChange: z,
|
|
144
|
-
jogMode: K,
|
|
145
|
-
onJogModeChange: (e) => {
|
|
146
|
-
var n;
|
|
147
|
-
return t.setSelectedIncrementId(
|
|
148
|
-
e === "continuous" ? "continuous" : ((n = T.current) == null ? void 0 : n.id) ?? "continuous"
|
|
149
|
-
);
|
|
150
|
-
},
|
|
151
|
-
gizmoOrientation: v,
|
|
152
|
-
gizmoFrameQuaternion: U,
|
|
153
|
-
tcp: t.tcps.length > 0 ? {
|
|
154
|
-
options: t.tcps.map((e) => ({ id: e.id, label: e.id })),
|
|
155
|
-
value: t.selectedTcpId,
|
|
156
|
-
onChange: (e) => {
|
|
157
|
-
t.requestTcpChange(e).catch(M);
|
|
158
|
-
}
|
|
159
|
-
} : void 0,
|
|
160
|
-
jogFrame: {
|
|
161
|
-
options: [
|
|
162
|
-
{
|
|
163
|
-
id: I,
|
|
164
|
-
label: m("Jogging.MoveRelativeTo.SelectedTcp.dd")
|
|
165
|
-
},
|
|
166
|
-
...t.coordSystems.map((e) => ({
|
|
167
|
-
id: C + e.coordinate_system,
|
|
168
|
-
label: k(t, e)
|
|
169
|
-
}))
|
|
170
|
-
],
|
|
171
|
-
value: t.selectedOrientation === "tool" ? I : C + t.jogCoordSystemId,
|
|
172
|
-
onChange: (e) => e === I ? t.setMoveRelativeToSelectedTcp() : t.setMoveRelativeToCoordSystem(e.slice(C.length))
|
|
173
|
-
},
|
|
174
|
-
velocity: {
|
|
175
|
-
translate: {
|
|
176
|
-
value: t.translationVelocityMmPerSec,
|
|
177
|
-
min: t.minTranslationVelocityMmPerSec,
|
|
178
|
-
max: t.maxTranslationVelocityMmPerSec
|
|
179
|
-
},
|
|
180
|
-
rotate: {
|
|
181
|
-
value: t.rotationVelocityRadsPerSec,
|
|
182
|
-
min: c(t.minRotationVelocityDegPerSec),
|
|
183
|
-
max: c(t.maxRotationVelocityDegPerSec)
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
onVelocityChange: (e, n) => e === "rotate" ? t.setVelocityFromSlider(B(n), !0) : t.setVelocityFromSlider(n, !1),
|
|
187
|
-
// The store jogs: it makes a press that ends before the jogging
|
|
188
|
-
// connection is ready move nothing, and runs one step at a time
|
|
189
|
-
onJogStart: (e, n, r) => g(t.startCartesianJogging(e, n, r)),
|
|
190
|
-
onJogStop: () => g(t.stopJogging()),
|
|
191
|
-
increments: {
|
|
192
|
-
steps: {
|
|
193
|
-
translate: t.discreteIncrementOptions.map((e) => e.mm),
|
|
194
|
-
rotate: t.discreteIncrementOptions.map(
|
|
195
|
-
(e) => c(e.degrees)
|
|
196
|
-
)
|
|
197
|
-
},
|
|
198
|
-
onStep: (e, n, r, i) => {
|
|
199
|
-
const f = X(e, i);
|
|
200
|
-
f && g(
|
|
201
|
-
t.runIncrementalCartesianJog(e, n, r, f)
|
|
202
|
-
);
|
|
203
|
-
},
|
|
204
|
-
running: t.incrementJogInProgress,
|
|
205
|
-
// The store's increments pair a distance with an angle
|
|
206
|
-
step: b && {
|
|
207
|
-
translate: b.mm,
|
|
208
|
-
rotate: c(b.degrees)
|
|
209
|
-
},
|
|
210
|
-
onStepChange: (e, n) => {
|
|
211
|
-
const r = t.discreteIncrementOptions.find(
|
|
212
|
-
(i) => e === "translate" ? i.mm === n : Math.abs(c(i.degrees) - n) < 1e-9
|
|
213
|
-
);
|
|
214
|
-
r && t.setSelectedIncrementId(r.id);
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
joints: {
|
|
218
|
-
joints: P.map((e, n) => {
|
|
219
|
-
var r, i, f, D;
|
|
220
|
-
return {
|
|
221
|
-
value: e,
|
|
222
|
-
min: (i = (r = l == null ? void 0 : l[n]) == null ? void 0 : r.position) == null ? void 0 : i.lower_limit,
|
|
223
|
-
max: (D = (f = l == null ? void 0 : l[n]) == null ? void 0 : f.position) == null ? void 0 : D.upper_limit,
|
|
224
|
-
name: P.length === A.length && !y ? A[n] : void 0
|
|
225
|
-
};
|
|
226
|
-
}),
|
|
227
|
-
linear: y,
|
|
228
|
-
velocity: y ? {
|
|
229
|
-
value: t.translationVelocityMmPerSec,
|
|
230
|
-
min: t.minTranslationVelocityMmPerSec,
|
|
231
|
-
max: t.maxTranslationVelocityMmPerSec
|
|
232
|
-
} : {
|
|
233
|
-
value: t.rotationVelocityRadsPerSec,
|
|
234
|
-
min: c(t.minRotationVelocityDegPerSec),
|
|
235
|
-
max: c(t.maxRotationVelocityDegPerSec)
|
|
236
|
-
},
|
|
237
|
-
onVelocityChange: (e) => y ? t.setVelocityFromSlider(e, !1) : t.setVelocityFromSlider(B(e), !0),
|
|
238
|
-
onJogStart: (e, n) => g(t.startJointJogging(e, n)),
|
|
239
|
-
onJogStop: () => g(t.stopJogging())
|
|
240
|
-
},
|
|
241
|
-
moveTo: {
|
|
242
|
-
getCurrentPose: () => {
|
|
243
|
-
const e = o.state.displayedTcpPose;
|
|
244
|
-
return !(e != null && e.position) || !e.orientation ? null : {
|
|
245
|
-
position: e.position,
|
|
246
|
-
orientation: e.orientation
|
|
247
|
-
};
|
|
248
|
-
},
|
|
249
|
-
// The typed pose is read in the coordinate system of the displayed pose
|
|
250
|
-
frame: {
|
|
251
|
-
options: t.coordSystems.map((e) => ({
|
|
252
|
-
id: e.coordinate_system,
|
|
253
|
-
label: k(t, e)
|
|
254
|
-
})),
|
|
255
|
-
value: t.selectedCoordSystemId,
|
|
256
|
-
onChange: (e) => t.setSelectedCoordSystemId(e)
|
|
257
|
-
},
|
|
258
|
-
onTargetChange: Y,
|
|
259
|
-
// The trajectory's states are the panel's, while it is the target's
|
|
260
|
-
state: s.confirming ? "planning" : H ? d.trajectoryState : "idle",
|
|
261
|
-
error: u && J ? ue(J, m) : p != null && p.errorKey ? m(p.errorKey, {
|
|
262
|
-
// NOVA's reason for a failed move, as it is: React escapes it
|
|
263
|
-
message: p.errorMessage,
|
|
264
|
-
interpolation: { escapeValue: !1 }
|
|
265
|
-
}) : null,
|
|
266
|
-
// The button is held and let go: the session sees to it that the
|
|
267
|
-
// robot moves only while it is held, and only to the pose it shows
|
|
268
|
-
onMoveStart: (e) => {
|
|
269
|
-
s.holdMove(R(o, e));
|
|
270
|
-
},
|
|
271
|
-
onMoveStop: () => {
|
|
272
|
-
s.releaseMove().catch(M);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
const _e = Z(function({
|
|
278
|
-
session: a,
|
|
279
|
-
disabled: S,
|
|
280
|
-
gizmoOrientation: v,
|
|
281
|
-
...m
|
|
282
|
-
}) {
|
|
283
|
-
const t = $(a), d = fe(t, { disabled: S, gizmoOrientation: v });
|
|
284
|
-
return /* @__PURE__ */ L(ee, { ...d, ...m });
|
|
285
|
-
});
|
|
286
|
-
export {
|
|
287
|
-
_e as R,
|
|
288
|
-
fe as u
|
|
289
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const Z=require("react/jsx-runtime"),$=require("mobx-react-lite"),ee=require("./RobotSessionProvider--AekyPqD.cjs"),te=require("./RobotControlPanel-BpTpRBgy.cjs"),s=require("@wandelbots/nova-js"),oe=require("@wandelbots/nova-js/v2"),x=require("mobx"),l=require("react"),ne=require("react-i18next"),re=require("three"),ae=require("./externalizeComponent-Br_U-QAr.cjs"),C=require("./Pose3-Ch4xVeXV.cjs"),F=require("./JoggingRefusedError-BuCGsVsa.cjs"),N=require("./coordSystemLabel-BThpFG9n.cjs"),ie=require("./useEveryFrame-NeKiPXY-.cjs"),k=["Base","Shoulder","Elbow","Forearm","Wrist","Flange"],I="selected-tcp",P="coordinate-system:",A=o=>Math.round(s.radiansToDegrees(o)*1e6)/1e6;function h(o,a){return{type:"cartesian",motionGroupId:o.motionGroupId,tcpPose:{pose:a,coordSystemId:o.jogging.selectedCoordSystemId,tcpId:o.jogging.selectedTcpId}}}function B(o,a){o.targetPose.plan(h(o,a))}function se(o,a){switch(o.code){case"disconnected":return a("RobotControl.MoveTo.NotMoveable.Disconnected.lb");case"safety_state":return a("RobotControl.MoveTo.NotMoveable.SafetyState.lb",{value:o.value});case"operation_mode":return a("RobotControl.MoveTo.NotMoveable.OperationMode.lb",{value:o.value});case"deactivated":return a("RobotControl.MoveTo.NotMoveable.Deactivated.lb")}}function ce(o){const a=ie.useEveryFrame(()=>o.jogger.motionStream.rapidlyChangingMotionState.joint_position.join(" "),!0);return l.useMemo(()=>a?a.split(" ").map(Number):[],[a])}function Q(o,a={}){var _;const{disabled:v=!1,gizmoOrientation:f}=a,{t:u}=ne.useTranslation(void 0,{i18n:ae.i18n}),t=o.jogging,{trajectory:g,targetPose:c}=o,j=ce(t),T=t.jointType===oe.JointTypeEnum.PrismaticJoint,d=(_=t.motionGroupDescription.operation_limits.auto_limits)==null?void 0:_.joints,V=g.trajectoryState==="moving"||g.trajectoryState==="stopping",J=o.safety.canBeMoved,O=v||V||!J;l.useEffect(()=>{if(O)return t.lock("external"),()=>t.unlock("external")},[t,O]);const[w,z]=l.useState(!1),G=w?"moveTo":t.currentTab.id==="joint"?"joint":t.selectedCartesianMotionType;function L(e){z(e==="moveTo"),x.runInAction(()=>{t.selectedTabId=e==="joint"?"joint":"cartesian"}),(e==="translate"||e==="rotate")&&t.setSelectedCartesianMotionType(e)}const K=t.selectedIncrementId==="continuous"?"continuous":"increment",b=l.useRef(t.activeDiscreteIncrement??t.discreteIncrementOptions[0]);t.activeDiscreteIncrement&&(b.current=t.activeDiscreteIncrement);const R=b.current;function X(e,n){return t.discreteIncrementOptions.find(r=>e==="translate"?Math.abs(r.mm-n)<1e-9:Math.abs(s.degreesToRadians(r.degrees)-n)<1e-9)}function H(){if(t.selectedOrientation==="tool"){const n=o.state.rapidlyChangingMotionState.flange_pose,r=n?C.Pose3.fromPose(n).quaternion.clone():new re.Quaternion,i=t.selectedTcpId?o.description.tcpOffsetsById[t.selectedTcpId]:void 0;return i!=null&&i.pose.orientation&&r.multiply(C.parseRotationToQuaternion(i.pose.orientation,"ROTATION_VECTOR")),r}const e=t.jogCoordSystem;return C.parseRotationToQuaternion(e.orientation??[1,0,0,0],e.orientation_type??"QUATERNION")}function M(e){o.reportError({kind:"jog",message:e instanceof Error?e.message:String(e),cause:e})}function m(e){e.catch(n=>{n instanceof F.JoggingRefusedError||M(n)})}const[p,U]=l.useState(null),E=l.useRef(p);E.current=p;function W(e){if(U(e),!e){c.resetToLive();return}B(o,e)}l.useEffect(()=>x.reaction(()=>o.safety.canBeMoved,e=>{const n=E.current,{staged:r,confirming:i}=o.targetPose;e&&n&&!r&&!i&&B(o,n)}),[o]);const q=o.safety.notMoveableReason,S=c.staged,Y=p!==null&&c.stagedPose!==null&&F.sameRobotPose(c.stagedPose,h(o,p));return{disabled:v,jogDisabled:V||t.blocked||!J,cartesian:t.canJogCartesian,tab:G,onTabChange:L,jogMode:K,onJogModeChange:e=>{var n;return t.setSelectedIncrementId(e==="continuous"?"continuous":((n=b.current)==null?void 0:n.id)??"continuous")},gizmoOrientation:f,gizmoFrameQuaternion:H,tcp:t.tcps.length>0?{options:t.tcps.map(e=>({id:e.id,label:e.id})),value:t.selectedTcpId,onChange:e=>{t.requestTcpChange(e).catch(M)}}:void 0,jogFrame:{options:[{id:I,label:u("Jogging.MoveRelativeTo.SelectedTcp.dd")},...t.coordSystems.map(e=>({id:P+e.coordinate_system,label:N.coordSystemLabel(t,e)}))],value:t.selectedOrientation==="tool"?I:P+t.jogCoordSystemId,onChange:e=>e===I?t.setMoveRelativeToSelectedTcp():t.setMoveRelativeToCoordSystem(e.slice(P.length))},velocity:{translate:{value:t.translationVelocityMmPerSec,min:t.minTranslationVelocityMmPerSec,max:t.maxTranslationVelocityMmPerSec},rotate:{value:t.rotationVelocityRadsPerSec,min:s.degreesToRadians(t.minRotationVelocityDegPerSec),max:s.degreesToRadians(t.maxRotationVelocityDegPerSec)}},onVelocityChange:(e,n)=>e==="rotate"?t.setVelocityFromSlider(A(n),!0):t.setVelocityFromSlider(n,!1),onJogStart:(e,n,r)=>m(t.startCartesianJogging(e,n,r)),onJogStop:()=>m(t.stopJogging()),increments:{steps:{translate:t.discreteIncrementOptions.map(e=>e.mm),rotate:t.discreteIncrementOptions.map(e=>s.degreesToRadians(e.degrees))},onStep:(e,n,r,i)=>{const y=X(e,i);y&&m(t.runIncrementalCartesianJog(e,n,r,y))},running:t.incrementJogInProgress,step:R&&{translate:R.mm,rotate:s.degreesToRadians(R.degrees)},onStepChange:(e,n)=>{const r=t.discreteIncrementOptions.find(i=>e==="translate"?i.mm===n:Math.abs(s.degreesToRadians(i.degrees)-n)<1e-9);r&&t.setSelectedIncrementId(r.id)}},joints:{joints:j.map((e,n)=>{var r,i,y,D;return{value:e,min:(i=(r=d==null?void 0:d[n])==null?void 0:r.position)==null?void 0:i.lower_limit,max:(D=(y=d==null?void 0:d[n])==null?void 0:y.position)==null?void 0:D.upper_limit,name:j.length===k.length&&!T?k[n]:void 0}}),linear:T,velocity:T?{value:t.translationVelocityMmPerSec,min:t.minTranslationVelocityMmPerSec,max:t.maxTranslationVelocityMmPerSec}:{value:t.rotationVelocityRadsPerSec,min:s.degreesToRadians(t.minRotationVelocityDegPerSec),max:s.degreesToRadians(t.maxRotationVelocityDegPerSec)},onVelocityChange:e=>T?t.setVelocityFromSlider(e,!1):t.setVelocityFromSlider(A(e),!0),onJogStart:(e,n)=>m(t.startJointJogging(e,n)),onJogStop:()=>m(t.stopJogging())},moveTo:{getCurrentPose:()=>{const e=o.state.displayedTcpPose;return!(e!=null&&e.position)||!e.orientation?null:{position:e.position,orientation:e.orientation}},frame:{options:t.coordSystems.map(e=>({id:e.coordinate_system,label:N.coordSystemLabel(t,e)})),value:t.selectedCoordSystemId,onChange:e=>t.setSelectedCoordSystemId(e)},onTargetChange:W,state:c.confirming?"planning":Y?g.trajectoryState:"idle",error:p&&q?se(q,u):S!=null&&S.errorKey?u(S.errorKey,{message:S.errorMessage,interpolation:{escapeValue:!1}}):null,onMoveStart:e=>{c.holdMove(h(o,e))},onMoveStop:()=>{c.releaseMove().catch(M)}}}}const le=$.observer(function({session:a,disabled:v,gizmoOrientation:f,...u}){const t=ee.useRobotSessionOf(a),g=Q(t,{disabled:v,gizmoOrientation:f});return Z.jsx(te.RobotControlPanel,{...g,...u})});exports.RobotControl=le;exports.useRobotControlProps=Q;
|