@wandelbots/wandelbots-js-react-components 5.8.0 → 5.9.0-pr.feat-allow-increment-jogging-for-tcp-orientation.619.7cb22c0
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 +1 -1
- package/dist/SafetyBar/index.cjs +1 -1
- package/dist/SafetyBar/index.js +1 -1
- package/dist/chunks/{MotionGroupVisualizer-DKuoN4_j.cjs → MotionGroupVisualizer-CQM7YY5t.cjs} +1 -1
- package/dist/chunks/{MotionGroupVisualizer-Da-rqhb2.js → MotionGroupVisualizer-DUOPtwog.js} +17 -17
- package/dist/chunks/{SafetyBar-CxxIVVeR.js → SafetyBar-BwRxye23.js} +1 -1
- package/dist/chunks/{SafetyBar-VvOZ9aRM.cjs → SafetyBar-C0nTqK_K.cjs} +1 -1
- package/dist/chunks/{externalizeComponent-EDymnaGR.js → externalizeComponent-JETX1Xbc.js} +58 -38
- package/dist/chunks/{externalizeComponent-OO4jcrz5.cjs → externalizeComponent-qE94FGXZ.cjs} +2 -2
- package/dist/chunks/{interpolation-DG8VTxzS.js → interpolation-CYfFv8VA.js} +1 -1
- package/dist/chunks/{interpolation-C9sLsved.cjs → interpolation-DTeU_M2z.cjs} +1 -1
- package/dist/chunks/theming-Ci4EYa3H.cjs +4 -0
- package/dist/chunks/{theming-BAMo7Vnk.js → theming-DpntKkW_.js} +1100 -1292
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +25 -24
- package/dist/index.cjs +1 -1
- package/dist/index.js +56 -55
- package/dist/lib/ConnectedMotionGroup.d.ts +1 -2
- package/dist/lib/JoggerConnection.d.ts +0 -1
- package/dist/lib/incrementalCartesianMotion.d.ts +33 -0
- package/dist/lib/rotationVector.d.ts +11 -0
- package/dist/themes/createDarkTheme.d.ts +7 -2
- package/dist/themes/themeTypes.d.ts +21 -71
- package/dist/themes/theming.d.ts +21 -4
- package/package.json +2 -1
- package/dist/chunks/theming-IwLOrP7-.cjs +0 -4
- package/dist/themes/createLightTheme.d.ts +0 -1
package/dist/3d.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/MotionGroupVisualizer-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/MotionGroupVisualizer-CQM7YY5t.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.LinearAxis=e.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=e.MANUFACTURER_HOME_CONFIGS;exports.MotionGroupVisualizer=e.MotionGroupVisualizer;exports.PresetEnvironment=e.PresetEnvironment;exports.Robot=e.Robot;exports.RobotCard=e.RobotCard;exports.SafetyZonesRenderer=e.SafetyZonesRenderer;exports.SupportedLinearAxis=e.SupportedLinearAxis;exports.SupportedRobot=e.SupportedRobot;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.defaultAxisConfig=e.defaultAxisConfig;exports.defaultGetModel=e.defaultGetModel;exports.extractManufacturer=e.extractManufacturer;exports.getDefaultHomeConfig=e.getDefaultHomeConfig;
|
package/dist/3d.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as o, L as r, M as s, h as t, P as n, b as i, R as d, S as f, c as u, f as R, T as l, a as C, d as p, e as M, g as S } from "./chunks/MotionGroupVisualizer-
|
|
1
|
+
import { C as o, L as r, M as s, h as t, P as n, b as i, R as d, S as f, c as u, f as R, T as l, a as C, d as p, e as M, g as S } from "./chunks/MotionGroupVisualizer-DUOPtwog.js";
|
|
2
2
|
export {
|
|
3
3
|
o as CollisionSceneRenderer,
|
|
4
4
|
r as LinearAxis,
|
package/dist/SafetyBar/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/SafetyBar-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../chunks/SafetyBar-C0nTqK_K.cjs");exports.SafetyBar=e.SafetyBar;exports.default=e.SafetyBar;
|
package/dist/SafetyBar/index.js
CHANGED
package/dist/chunks/{MotionGroupVisualizer-DKuoN4_j.cjs → MotionGroupVisualizer-CQM7YY5t.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),b=require("three"),O=require("three-stdlib"),l=require("react"),L=require("./externalizeComponent-OO4jcrz5.cjs"),M=require("@react-three/drei"),he=require("@mui/material/styles"),v=require("@mui/material/Box"),X=require("@mui/material/Button"),me=require("@mui/material/Card"),Z=require("@mui/material/Divider"),K=require("@mui/material/Typography"),k=require("@react-three/fiber"),xe=require("mobx-react-lite"),ye=require("react-i18next"),E=require("./interpolation-C9sLsved.cjs"),R=require("@wandelbots/nova-js/v2"),ee=require("react-error-boundary");function ge(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const w=ge(b);function je(t){switch(t.shape_type){case"convex_hull":return new O.ConvexGeometry(t.vertices.map(r=>new w.Vector3(r[0]/1e3,r[1]/1e3,r[2]/1e3)));case"box":return new w.BoxGeometry(t.size_x/1e3,t.size_y/1e3,t.size_z/1e3);case"sphere":return new w.SphereGeometry(t.radius/1e3);case"capsule":return new w.CapsuleGeometry(t.radius/1e3,t.cylinder_height/1e3);case"cylinder":return new w.CylinderGeometry(t.radius/1e3,t.radius/1e3,t.height/1e3);case"rectangle":return new w.BoxGeometry(t.size_x/1e3,t.size_y/1e3,0);default:return console.warn(`${t.shape_type} is not supported`),new w.BufferGeometry}}function be({name:t,collider:n,children:r}){var d,c;const o=((d=n.pose)==null?void 0:d.position)??[0,0,0],a=((c=n.pose)==null?void 0:c.orientation)??[0,0,0];return n.margin&&console.warn(`${t} margin is not supported`),e.jsx("mesh",{name:t,position:new w.Vector3(o[0],o[1],o[2]).divideScalar(1e3),rotation:new w.Euler(a[0],a[1],a[2],"XYZ"),geometry:je(n.shape),children:r})}function we({name:t,colliders:n,meshChildrenProvider:r,...o}){return e.jsx("group",{name:t,...o,children:Object.entries(n).map(([a,d])=>e.jsx(be,{name:a,collider:d,children:r(a,d)},a))})}function Re({scene:t,meshChildrenProvider:n}){const r=t.colliders;return e.jsx("group",{children:r&&e.jsx(we,{meshChildrenProvider:n,colliders:r})})}function D(){return e.jsx(M.Environment,{frames:1,children:e.jsx(ve,{})})}const Me=[2,0,2,0,2,0,2,0];function ve({positions:t=Me}){return e.jsxs(e.Fragment,{children:[e.jsx(M.Lightformer,{intensity:5,"rotation-x":Math.PI/2,position:[0,5,-9],scale:[10,10,1]}),e.jsx("group",{rotation:[0,.5,0],children:e.jsx("group",{children:t.map((n,r)=>e.jsx(M.Lightformer,{form:"circle",intensity:5,rotation:[Math.PI/2,0,0],position:[n,4,r*4],scale:[3,1,1]},r))})}),e.jsx(M.Lightformer,{intensity:40,"rotation-y":Math.PI/2,position:[-5,1,-1],scale:[20,.1,1]}),e.jsx(M.Lightformer,{intensity:20,"rotation-y":-Math.PI,position:[-5,-2,-1],scale:[20,.1,1]}),e.jsx(M.Lightformer,{"rotation-y":Math.PI/2,position:[-5,-1,-1],scale:[20,.5,1],intensity:5}),e.jsx(M.Lightformer,{"rotation-y":-Math.PI/2,position:[10,1,0],scale:[20,1,1],intensity:10}),e.jsx(M.Lightformer,{form:"ring",color:"white",intensity:5,scale:10,position:[-15,4,-18],target:[0,0,0]})]})}const z={attach:"material",color:"#009f4d",opacity:.2,depthTest:!1,depthWrite:!1,transparent:!0,polygonOffset:!0};function Se({safetyZones:t,dhParameters:n,...r}){const o=l.useMemo(()=>L.dhParametersToPlaneSize(n??[]),[n]),a=(c,s)=>{var p,y;if(!((p=s==null?void 0:s.pose)!=null&&p.position)||!((y=s==null?void 0:s.pose)!=null&&y.orientation))return null;const g=new w.Vector3(s.pose.position[0]/1e3,s.pose.position[1]/1e3,s.pose.position[2]/1e3),i=new w.Vector3(s.pose.orientation[0],s.pose.orientation[1],s.pose.orientation[2]);let m;const u=s.shape.shape_type==="plane"?{...z,side:w.DoubleSide}:{...z,side:w.FrontSide};switch(s.shape.shape_type){case"plane":m=e.jsx("planeGeometry",{args:[o,o]});break;case"sphere":{const x=(s==null?void 0:s.shape).radius/1e3;m=e.jsx("sphereGeometry",{args:[x]});break}case"capsule":{const x=(s==null?void 0:s.shape).radius/1e3,f=(s==null?void 0:s.shape).cylinder_height/1e3;m=e.jsx("capsuleGeometry",{args:[x,f]});break}case"convex_hull":{const x=(s==null?void 0:s.shape).vertices.map(h=>new w.Vector3(h[0]/1e3,h[1]/1e3,h[2]/1e3)),f=L.verticesToCoplanarity(x);if(f.isCoplanar&&f.normal){const j=new w.Vector3().addVectors(x[0],f.normal.multiplyScalar(1e-4));x.push(j)}try{m=e.jsx("primitive",{object:new O.ConvexGeometry(x),attach:"geometry"})}catch(h){return console.log("Error creating ConvexGeometry:",h),null}break}case"rectangular_capsule":{const x=s.shape,f=x.radius/1e3,h=x.sphere_center_distance_x/1e3,j=x.sphere_center_distance_y/1e3,S=f*2;m=e.jsx("primitive",{object:new O.RoundedBoxGeometry(h,j,S,2,f),attach:"geometry"});break}default:console.warn("Unsupported safety zone shape type:",s.shape.shape_type),m=null}return e.jsxs("mesh",{renderOrder:c,position:g,quaternion:L.orientationToQuaternion(i),children:[m,e.jsx("meshStandardMaterial",{...u,polygonOffsetFactor:-c})]},`safety-zone-${s.shape.shape_type}-${c}`)},d=l.useMemo(()=>Object.values(t??{}).map((c,s)=>a(s,c)),[t,o]);return e.jsx("group",{...r,children:d})}function _e({trajectory:t,...n}){const r=(t==null?void 0:t.map(o=>{if(o.position&&o.position.length>=3){const[a,d,c]=o.position;if(Number.isFinite(a)&&Number.isFinite(d)&&Number.isFinite(c))return new w.Vector3(a/1e3,c/1e3,-d/1e3)}return null}).filter(o=>o!==null))||[];return e.jsx("group",{...n,children:r.length>0&&e.jsx(M.Line,{points:r,lineWidth:3,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:10})})}const V=new Map;async function G(t,n){if(V.has(t))return V.get(t);const r=(async()=>{var c;const o=n||"",a=new R.Nova({instanceUrl:o}),d=a.api.motionGroupModels;(c=d.axios)!=null&&c.interceptors&&d.axios.interceptors.request.use(s=>{var g;return(g=s.url)!=null&&g.includes("/glb")&&(s.responseType="blob"),s});try{const s=await a.api.motionGroupModels.getMotionGroupGlbModel(t);return URL.createObjectURL(s)}catch(s){throw console.error("Failed to fetch model:",s),s}})();return V.set(t,r),r}function te(t){function n(r){return r.children.length===0?[r]:[r,...r.children.flatMap(o=>n(o))]}return n(t).filter(r=>ne(r))}function re(t){return t.name.endsWith("_FLG")}function ne(t){return/_J[0-9]+$/.test(t.name)}function Te(t,n){let r;function o(a){if(re(a)){if(r)throw Error(`Found multiple flange groups in robot model ${n}; first ${r.name} then ${a.name}. Only one _FLG group is allowed.`);r=a}ne(a),a.children.map(o)}if(o(t.scene),!r)throw Error(`No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`);return{gltf:t}}const se=l.forwardRef(function({rapidlyChangingMotionState:n,dhParameters:r,onRotationChanged:o,children:a},d){const c=l.useRef(null),s=l.useRef([]),g=l.useRef(null),{invalidate:i}=k.useThree(),m=l.useRef(n);m.current=n,l.useEffect(()=>{const f=n.joint_position.filter(h=>h!==void 0);return g.current=new E.ValueInterpolator(f,{tension:120,friction:20,threshold:.001}),()=>{var h;(h=g.current)==null||h.destroy()}},[]),k.useFrame((f,h)=>{if(!g.current)return;s.current.length===0&&c.current&&p();const j=g.current.update(h);y(),j||i()});function u(f){c.current=f,f&&p()}function p(){c.current&&(s.current=te(c.current),y(),i())}l.useImperativeHandle(d,()=>({recollectJoints:p}));function y(){var h;const f=((h=g.current)==null?void 0:h.getCurrentValues())||[];if(o)o(s.current,f);else for(const[j,S]of s.current.entries()){const T=r[j],F=T.theta||0,B=T.reverse_rotation_direction?-1:1;S.rotation.y=B*(f[j]||0)+F}}function x(f){var j;const h=f.joint_position.filter(S=>S!==void 0);(j=g.current)==null||j.setTarget(h),i()}return E.useAutorun(()=>{x(m.current)}),l.useEffect(()=>{x(n)},[n]),e.jsx("group",{ref:u,children:a})}),Le="line",ke="mesh";function Ee({rapidlyChangingMotionState:t,dhParameters:n,...r}){const o=new b.Matrix4,a=l.useRef([]),d=l.useRef([]);l.useEffect(()=>{a.current=new Array(n.length).fill(null),d.current=new Array(n.length).fill(null)},[n.length]);function c(i,m){const u=new b.Vector3,p=new b.Quaternion,y=new b.Vector3;o.decompose(u,p,y);const x=u.clone(),f=new b.Matrix4().makeRotationY(i.theta+m*(i.reverse_rotation_direction?-1:1)).multiply(new b.Matrix4().makeTranslation(0,i.d/1e3,0)).multiply(new b.Matrix4().makeTranslation(i.a/1e3,0,0)).multiply(new b.Matrix4().makeRotationX(i.alpha));return o.multiply(f),o.decompose(u,p,y),{a:x,b:u}}function s(i,m,u,p){if(!n)return;const y=n[i];if(!y)return;const{a:x,b:f}=c(y,p);m.geometry.setPositions([x.toArray(),f.toArray()].flat()),u.position.set(f.x,f.y,f.z)}function g(i,m){o.identity();for(let u=0;u<Math.min(i.length,m.length);u++){const p=a.current[u],y=d.current[u];p&&y&&s(u,p,y,m[u])}}return e.jsx(se,{rapidlyChangingMotionState:t,dhParameters:n,onRotationChanged:g,children:e.jsxs("group",{...r,name:"Scene",children:[e.jsxs("mesh",{children:[e.jsx("sphereGeometry",{args:[.01,32,32]}),e.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),n==null?void 0:n.map((i,m)=>{const{a:u,b:p}=c(i,t.joint_position[m]??0),y=`dhrobot_J0${m}`;return e.jsxs("group",{name:y,children:[e.jsx(M.Line,{ref:x=>{a.current[m]=x},name:Le,points:[u,p],color:"white",lineWidth:5}),e.jsxs("mesh",{ref:x=>{d.current[m]=x},name:ke,position:p,children:[e.jsx("sphereGeometry",{args:[.01,32,32]}),e.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},`mesh_${m}`)]},y)})]})})}const Ge=console.warn;function oe(){return l.useEffect(()=>{console.warn=t=>{t!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&Ge(t)}},[]),null}function Ae(t){return t.type==="Mesh"}function Ce({url:t,flangeRef:n,postModelRender:r,...o}){const a=M.useGLTF(t),c=Te(a,"robot.glb").gltf,s=l.useCallback(i=>{i&&r&&r()},[r]);function g(i){try{return Ae(i)?i.geometry?e.jsx("mesh",{name:i.name,geometry:i.geometry,material:i.material,position:i.position,rotation:i.rotation},i.uuid):e.jsx("group",{name:i.name,position:i.position,rotation:i.rotation},i.uuid):e.jsx("group",{name:i.name,position:i.position,rotation:i.rotation,ref:re(i)?n:void 0,children:i.children.map(g)},i.uuid)}catch(m){return console.warn("Error rendering node",i.name,m),null}}return e.jsx("group",{...o,dispose:null,ref:s,children:g(c.scene)})}function ie({modelURL:t,flangeRef:n,postModelRender:r,...o}){const[a,d]=l.useState(null);return l.useEffect(()=>{let c=!1;return(async()=>{try{const g=typeof t=="string"?t:await t;c||d(i=>i===g?i:g)}catch(g){console.error("Failed to resolve model URL:",g)}})(),()=>{c=!0}},[t]),a?e.jsx(Ce,{url:a,flangeRef:n,postModelRender:r,...o}):null}const ae=(t,n)=>{t.userData.isGhost||(t.traverse(r=>{if(r instanceof w.Mesh){r.material instanceof w.Material&&(r.material.colorWrite=!1);const o=r.clone(),a=r.clone();o.material=new w.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:w.DoubleSide}),o.userData.isGhost=!0,a.material=new w.MeshStandardMaterial({color:n,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:w.DoubleSide}),a.userData.isGhost=!0,r.parent&&(r.parent.add(o),r.parent.add(a))}}),t.userData.isGhost=!0)},ce=t=>{if(!t.userData.isGhost)return;const n=[];t.traverse(r=>{var o;r instanceof w.Mesh&&((o=r.userData)!=null&&o.isGhost?n.push(r):r.material instanceof w.Material&&(r.material.colorWrite=!0))}),n.forEach(r=>{r.parent&&r.parent.remove(r)}),t.userData.isGhost=!1},J=L.externalizeComponent(({rapidlyChangingMotionState:t,modelFromController:n,dhParameters:r,getModel:o=G,flangeRef:a,postModelRender:d,transparentColor:c,instanceUrl:s,...g})=>{const[i,m]=l.useState(null),u=l.useRef(null),p=l.useCallback(h=>{m(h)},[]),y=l.useCallback(()=>{var h;(h=u.current)==null||h.recollectJoints(),d==null||d()},[d]);l.useEffect(()=>{i&&(c?ae(i,c):ce(i))},[i,c]);const x=l.useMemo(()=>{const h=o(n,s);if(!h)throw new Error(`No model found for robot "${n}". Ensure the model is available or provide a custom getModel function.`);return h},[n,s,o]),f=e.jsx(Ee,{rapidlyChangingMotionState:t,dhParameters:r,...g});return e.jsxs(ee.ErrorBoundary,{fallback:f,onError:h=>{console.warn(h)},children:[e.jsx(l.Suspense,{fallback:f,children:e.jsx("group",{ref:p,children:e.jsx(se,{ref:u,rapidlyChangingMotionState:t,dhParameters:r,children:e.jsx(ie,{modelURL:x,postModelRender:y,flangeRef:a,...g})})})}),e.jsx(oe,{})]})});function ue({connectedMotionGroup:t,getModel:n=G,flangeRef:r,transparentColor:o,postModelRender:a,...d}){return t.dhParameters?e.jsx(J,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,modelFromController:t.modelFromController||"",dhParameters:t.dhParameters,getModel:n,flangeRef:r,transparentColor:o,postModelRender:a,...d}):null}const Ie=L.externalizeComponent(xe.observer(({robotName:t,programState:n,safetyState:r,operationMode:o,driveToHomeEnabled:a=!1,onDriveToHomePress:d,onDriveToHomeRelease:c,connectedMotionGroup:s,robotComponent:g=ue,customContentComponent:i,className:m})=>{var H;const u=he.useTheme(),{t:p}=ye.useTranslation(),[y,x]=l.useState(!1),f=l.useRef(null),h=l.useRef(null),[j,S]=l.useState(!1),[T,F]=l.useState({width:400,height:600}),[B,pe]=l.useState(0);l.useEffect(()=>{const P=()=>{if(h.current){const{offsetWidth:Y,offsetHeight:Q}=h.current;S(Y>Q),F({width:Y,height:Q})}};P();const $=new ResizeObserver(P);return h.current&&$.observe(h.current),()=>{$.disconnect()}},[]);const N=l.useCallback(()=>{pe(P=>P+1)},[]),A=l.useCallback(()=>{!a||!d||(x(!0),d())},[a,d]),C=l.useCallback(()=>{!a||!c||(x(!1),c())},[a,c]),W=l.useCallback(()=>{y&&c&&(x(!1),c())},[y,c]),_=j?T.width<350:T.height<200,I=j?T.height<310:T.height<450;return e.jsx(me,{ref:h,className:m,sx:{width:"100%",height:"100%",display:"flex",flexDirection:j?"row":"column",position:"relative",overflow:"hidden",minWidth:{xs:180,sm:220,md:250},minHeight:j?{xs:200,sm:240,md:260}:{xs:150,sm:180,md:220},border:`1px solid ${u.palette.divider}`,borderRadius:"18px",boxShadow:"none",backgroundColor:((H=u.palette.backgroundPaperElevation)==null?void 0:H[8])||"#2A2A3F",backgroundImage:"none"},children:j?e.jsxs(e.Fragment,{children:[e.jsx(v,{sx:{flex:"0 0 50%",position:"relative",height:"100%",minHeight:"100%",maxHeight:"100%",borderRadius:1,m:{xs:1.5,sm:2,md:3},mr:{xs:.75,sm:1,md:1.5},overflow:"hidden",display:_?"none":"block"},children:!_&&e.jsxs(k.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:u.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute",top:0,left:0},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[e.jsx(D,{}),e.jsx(M.Bounds,{fit:!0,observe:!0,margin:1,maxDuration:1,children:e.jsx(g,{connectedMotionGroup:s,postModelRender:N})})]})}),e.jsxs(v,{sx:{flex:"1",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:_?"100%":"50%"},children:[e.jsxs(v,{sx:{p:{xs:1.5,sm:2,md:3},pb:{xs:1,sm:1.5,md:2},textAlign:"left"},children:[e.jsx(K,{variant:"h6",component:"h2",sx:{mb:1},children:t}),e.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:o})]}),e.jsxs(v,{sx:{p:{xs:1.5,sm:2,md:3},pt:0,flex:"1",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[!I&&i&&e.jsxs(v,{children:[e.jsx(i,{}),e.jsx(Z,{sx:{mt:1,mb:0,borderColor:u.palette.divider,opacity:.5}})]}),e.jsx(v,{sx:{mt:!I&&i?"auto":0},children:e.jsx(v,{sx:{display:"flex",justifyContent:"flex-start",mt:{xs:1,sm:1.5,md:2},mb:{xs:.5,sm:.75,md:1}},children:e.jsx(X,{ref:f,variant:"contained",color:"secondary",size:"small",disabled:!a,onMouseDown:A,onMouseUp:C,onMouseLeave:W,onTouchStart:A,onTouchEnd:C,sx:{textTransform:"none",px:1.5,py:.5},children:p("RobotCard.DriveToHome.bt")})})})]})]})]}):e.jsx(e.Fragment,{children:e.jsxs(v,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(v,{children:[e.jsx(K,{variant:"h6",component:"h2",sx:{mb:1},children:t}),e.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:o})]}),e.jsx(v,{sx:{flex:_?0:1,position:"relative",minHeight:_?0:{xs:120,sm:150,md:200},height:_?0:"auto",borderRadius:1,overflow:"hidden",display:_?"none":"block"},children:!_&&e.jsxs(k.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:u.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute"},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[e.jsx(D,{}),e.jsx(M.Bounds,{fit:!0,clip:!0,observe:!0,margin:1,maxDuration:1,children:e.jsx(g,{connectedMotionGroup:s,postModelRender:N})})]})}),e.jsxs(v,{children:[!I&&i&&e.jsxs(e.Fragment,{children:[e.jsx(i,{}),e.jsx(Z,{sx:{mt:1,mb:0,borderColor:u.palette.divider,opacity:.5}})]}),e.jsx(v,{sx:{display:"flex",justifyContent:"flex-start",mt:!I&&i?{xs:1,sm:2,md:5}:{xs:.5,sm:1,md:2},mb:{xs:.5,sm:.75,md:1}},children:e.jsx(X,{ref:f,variant:"contained",color:"secondary",size:"small",disabled:!a,onMouseDown:A,onMouseUp:C,onMouseLeave:W,onTouchStart:A,onTouchEnd:C,sx:{textTransform:"none",px:1.5,py:.5},children:p("RobotCard.DriveToHome.bt")})})]})]})})})})),Pe=Array(6).fill(2*Math.PI);function le({rapidlyChangingMotionState:t,dhParameters:n,onTranslationChanged:r,children:o}){const a=l.useRef([]),d=l.useRef([]),c=l.useRef(null),{invalidate:s}=k.useThree();l.useEffect(()=>{const u=t.joint_position.filter(p=>p!==void 0);return c.current=new E.ValueInterpolator(u,{tension:120,friction:20,threshold:.001}),()=>{var p;(p=c.current)==null||p.destroy()}},[]),k.useFrame((u,p)=>{if(c.current){const y=c.current.update(p);i(),y||s()}});function g(u){u&&(d.current=te(u),i(),s())}function i(){var p;const u=((p=c.current)==null?void 0:p.getCurrentValues())||[];if(r)r(d.current,u);else for(const[y,x]of d.current.entries()){const h=n[y].reverse_rotation_direction?-1:1;x.position.y=h*(u[y]||0)/1e3}}const m=l.useCallback(()=>{const u=t.joint_position.filter(p=>p!==void 0);requestAnimationFrame(()=>{var p;a.current=u,(p=c.current)==null||p.setTarget(u)})},[t]);return l.useEffect(()=>{m()},[t,m]),E.useAutorun(()=>{m()}),e.jsx("group",{ref:g,children:o})}function fe({rapidlyChangingMotionState:t,dhParameters:n,...r}){const o=new b.Matrix4,a=l.useRef(null),d=l.useRef(null);function c(i){const m=new b.Matrix4;for(let x=0;x<n.length;x++){const f=n[x],h=i[x]??0,j=new b.Matrix4().makeRotationY(f.theta).multiply(new b.Matrix4().makeTranslation(f.a/1e3,(f.d+h*(f.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new b.Matrix4().makeRotationX(f.alpha));m.multiply(j)}const u=new b.Vector3,p=new b.Quaternion,y=new b.Vector3;return m.decompose(u,p,y),u}const s=c(t.joint_position);function g(i,m){o.identity();let u=new b.Vector3;for(let f=0;f<n.length;f++){const h=m[f]??0,j=n[f],S=new b.Matrix4().makeRotationY(j.theta).multiply(new b.Matrix4().makeTranslation(j.a/1e3,(j.d+h*(j.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new b.Matrix4().makeRotationX(j.alpha));o.multiply(S)}const p=new b.Vector3,y=new b.Quaternion,x=new b.Vector3;if(o.decompose(p,y,x),u=p,a.current&&a.current.position.set(u.x,u.y,u.z),d.current){const f=d.current.geometry;f!=null&&f.setPositions&&f.setPositions([0,0,0,u.x,u.y,u.z])}}return e.jsx(le,{rapidlyChangingMotionState:t,dhParameters:n,onTranslationChanged:g,children:e.jsxs("group",{...r,name:"Scene",children:[e.jsxs("mesh",{name:"Base",position:[0,0,0],children:[e.jsx("sphereGeometry",{args:[.02,32,32]}),e.jsx("meshStandardMaterial",{color:"green",depthTest:!0})]}),e.jsx(M.Line,{ref:d,points:[new b.Vector3(0,0,0),s],color:"White",lineWidth:5}),e.jsxs("mesh",{ref:a,name:"TCP",position:s,children:[e.jsx("sphereGeometry",{args:[.025,32,32]}),e.jsx("meshStandardMaterial",{color:"red",depthTest:!0})]})]})})}const U=L.externalizeComponent(({rapidlyChangingMotionState:t,modelFromController:n,dhParameters:r,getModel:o=G,flangeRef:a,postModelRender:d,transparentColor:c,instanceUrl:s,...g})=>{const[i,m]=l.useState(null),u=l.useCallback(y=>{m(y)},[]);l.useEffect(()=>{i&&(c?ae(i,c):ce(i))},[i,c]);const p=e.jsx(fe,{rapidlyChangingMotionState:t,dhParameters:r,...g});return e.jsxs(ee.ErrorBoundary,{fallback:p,onError:y=>{console.warn(y)},children:[e.jsx(l.Suspense,{fallback:p,children:e.jsx("group",{ref:u,children:e.jsx(le,{rapidlyChangingMotionState:t,dhParameters:r,children:e.jsx(ie,{modelURL:(()=>{const y=o(n,s);if(!y){const x=new Blob([],{type:"model/gltf-binary"}),f=new File([x],`${n}.glb`,{type:"model/gltf-binary"});return Promise.resolve(URL.createObjectURL(f))}return y})(),postModelRender:d,flangeRef:a,...g})})})}),e.jsx(oe,{})]})});function Fe({connectedMotionGroup:t,getModel:n=G,flangeRef:r,transparentColor:o,postModelRender:a,...d}){if(!t.dhParameters)return null;const c=t.modelFromController||"";return c&&n(c)?e.jsx(U,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,modelFromController:c,dhParameters:t.dhParameters,getModel:n,flangeRef:r,transparentColor:o,postModelRender:a,...d}):e.jsx(fe,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,dhParameters:t.dhParameters,...d})}const q={[R.Manufacturer.Abb]:[0,0,0,0,Math.PI/2,0,0],[R.Manufacturer.Fanuc]:[0,0,0,0,-Math.PI/2,0,0],[R.Manufacturer.Yaskawa]:[0,0,0,0,-Math.PI/2,0,0],[R.Manufacturer.Kuka]:[0,-Math.PI/2,Math.PI/2,0,Math.PI/2,0,0],[R.Manufacturer.Universalrobots]:[0,-Math.PI/2,-Math.PI/2,-Math.PI/2,Math.PI/2,-Math.PI/2,0],[R.Manufacturer.Staubli]:[0,-Math.PI/2,Math.PI/2,0,0,0,0]};function de(t){const[n]=t.split("_");switch(n){case"ABB":return R.Manufacturer.Abb;case"FANUC":return R.Manufacturer.Fanuc;case"YASKAWA":return R.Manufacturer.Yaskawa;case"KUKA":return R.Manufacturer.Kuka;case"UniversalRobots":return R.Manufacturer.Universalrobots;case"STAUBLI":return R.Manufacturer.Staubli;default:return null}}function Ve(t,n){const r=de(t);return r&&r in q?q[r]:n||null}const Oe=L.externalizeComponent(t=>{const{inverseSolver:n,dhParameters:r,...o}=t,[a,d]=l.useState(R.JointTypeEnum.RevoluteJoint);l.useEffect(()=>{r.length&&d(r[0].type??R.JointTypeEnum.RevoluteJoint)},[r]);const c=l.useMemo(()=>n===null&&a===R.JointTypeEnum.RevoluteJoint,[n,a]),s=l.useMemo(()=>n===null&&a===R.JointTypeEnum.PrismaticJoint,[n,a]);return l.useMemo(()=>!!n,[n])||c?e.jsx(J,{dhParameters:r,...o}):s?e.jsx(U,{dhParameters:r,...o}):null});exports.CollisionSceneRenderer=Re;exports.LinearAxis=Fe;exports.MANUFACTURER_HOME_CONFIGS=q;exports.MotionGroupVisualizer=Oe;exports.PresetEnvironment=D;exports.Robot=ue;exports.RobotCard=Ie;exports.SafetyZonesRenderer=Se;exports.SupportedLinearAxis=U;exports.SupportedRobot=J;exports.TrajectoryRenderer=_e;exports.defaultAxisConfig=Pe;exports.defaultGetModel=G;exports.extractManufacturer=de;exports.getDefaultHomeConfig=Ve;
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),b=require("three"),O=require("three-stdlib"),l=require("react"),L=require("./externalizeComponent-qE94FGXZ.cjs"),M=require("@react-three/drei"),he=require("@mui/material/styles"),v=require("@mui/material/Box"),X=require("@mui/material/Button"),me=require("@mui/material/Card"),Z=require("@mui/material/Divider"),K=require("@mui/material/Typography"),k=require("@react-three/fiber"),xe=require("mobx-react-lite"),ye=require("react-i18next"),E=require("./interpolation-DTeU_M2z.cjs"),R=require("@wandelbots/nova-js/v2"),ee=require("react-error-boundary");function ge(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const w=ge(b);function je(t){switch(t.shape_type){case"convex_hull":return new O.ConvexGeometry(t.vertices.map(r=>new w.Vector3(r[0]/1e3,r[1]/1e3,r[2]/1e3)));case"box":return new w.BoxGeometry(t.size_x/1e3,t.size_y/1e3,t.size_z/1e3);case"sphere":return new w.SphereGeometry(t.radius/1e3);case"capsule":return new w.CapsuleGeometry(t.radius/1e3,t.cylinder_height/1e3);case"cylinder":return new w.CylinderGeometry(t.radius/1e3,t.radius/1e3,t.height/1e3);case"rectangle":return new w.BoxGeometry(t.size_x/1e3,t.size_y/1e3,0);default:return console.warn(`${t.shape_type} is not supported`),new w.BufferGeometry}}function be({name:t,collider:n,children:r}){var d,c;const o=((d=n.pose)==null?void 0:d.position)??[0,0,0],a=((c=n.pose)==null?void 0:c.orientation)??[0,0,0];return n.margin&&console.warn(`${t} margin is not supported`),e.jsx("mesh",{name:t,position:new w.Vector3(o[0],o[1],o[2]).divideScalar(1e3),rotation:new w.Euler(a[0],a[1],a[2],"XYZ"),geometry:je(n.shape),children:r})}function we({name:t,colliders:n,meshChildrenProvider:r,...o}){return e.jsx("group",{name:t,...o,children:Object.entries(n).map(([a,d])=>e.jsx(be,{name:a,collider:d,children:r(a,d)},a))})}function Re({scene:t,meshChildrenProvider:n}){const r=t.colliders;return e.jsx("group",{children:r&&e.jsx(we,{meshChildrenProvider:n,colliders:r})})}function D(){return e.jsx(M.Environment,{frames:1,children:e.jsx(ve,{})})}const Me=[2,0,2,0,2,0,2,0];function ve({positions:t=Me}){return e.jsxs(e.Fragment,{children:[e.jsx(M.Lightformer,{intensity:5,"rotation-x":Math.PI/2,position:[0,5,-9],scale:[10,10,1]}),e.jsx("group",{rotation:[0,.5,0],children:e.jsx("group",{children:t.map((n,r)=>e.jsx(M.Lightformer,{form:"circle",intensity:5,rotation:[Math.PI/2,0,0],position:[n,4,r*4],scale:[3,1,1]},r))})}),e.jsx(M.Lightformer,{intensity:40,"rotation-y":Math.PI/2,position:[-5,1,-1],scale:[20,.1,1]}),e.jsx(M.Lightformer,{intensity:20,"rotation-y":-Math.PI,position:[-5,-2,-1],scale:[20,.1,1]}),e.jsx(M.Lightformer,{"rotation-y":Math.PI/2,position:[-5,-1,-1],scale:[20,.5,1],intensity:5}),e.jsx(M.Lightformer,{"rotation-y":-Math.PI/2,position:[10,1,0],scale:[20,1,1],intensity:10}),e.jsx(M.Lightformer,{form:"ring",color:"white",intensity:5,scale:10,position:[-15,4,-18],target:[0,0,0]})]})}const z={attach:"material",color:"#009f4d",opacity:.2,depthTest:!1,depthWrite:!1,transparent:!0,polygonOffset:!0};function Se({safetyZones:t,dhParameters:n,...r}){const o=l.useMemo(()=>L.dhParametersToPlaneSize(n??[]),[n]),a=(c,s)=>{var p,y;if(!((p=s==null?void 0:s.pose)!=null&&p.position)||!((y=s==null?void 0:s.pose)!=null&&y.orientation))return null;const g=new w.Vector3(s.pose.position[0]/1e3,s.pose.position[1]/1e3,s.pose.position[2]/1e3),i=new w.Vector3(s.pose.orientation[0],s.pose.orientation[1],s.pose.orientation[2]);let m;const u=s.shape.shape_type==="plane"?{...z,side:w.DoubleSide}:{...z,side:w.FrontSide};switch(s.shape.shape_type){case"plane":m=e.jsx("planeGeometry",{args:[o,o]});break;case"sphere":{const x=(s==null?void 0:s.shape).radius/1e3;m=e.jsx("sphereGeometry",{args:[x]});break}case"capsule":{const x=(s==null?void 0:s.shape).radius/1e3,f=(s==null?void 0:s.shape).cylinder_height/1e3;m=e.jsx("capsuleGeometry",{args:[x,f]});break}case"convex_hull":{const x=(s==null?void 0:s.shape).vertices.map(h=>new w.Vector3(h[0]/1e3,h[1]/1e3,h[2]/1e3)),f=L.verticesToCoplanarity(x);if(f.isCoplanar&&f.normal){const j=new w.Vector3().addVectors(x[0],f.normal.multiplyScalar(1e-4));x.push(j)}try{m=e.jsx("primitive",{object:new O.ConvexGeometry(x),attach:"geometry"})}catch(h){return console.log("Error creating ConvexGeometry:",h),null}break}case"rectangular_capsule":{const x=s.shape,f=x.radius/1e3,h=x.sphere_center_distance_x/1e3,j=x.sphere_center_distance_y/1e3,S=f*2;m=e.jsx("primitive",{object:new O.RoundedBoxGeometry(h,j,S,2,f),attach:"geometry"});break}default:console.warn("Unsupported safety zone shape type:",s.shape.shape_type),m=null}return e.jsxs("mesh",{renderOrder:c,position:g,quaternion:L.orientationToQuaternion(i),children:[m,e.jsx("meshStandardMaterial",{...u,polygonOffsetFactor:-c})]},`safety-zone-${s.shape.shape_type}-${c}`)},d=l.useMemo(()=>Object.values(t??{}).map((c,s)=>a(s,c)),[t,o]);return e.jsx("group",{...r,children:d})}function _e({trajectory:t,...n}){const r=(t==null?void 0:t.map(o=>{if(o.position&&o.position.length>=3){const[a,d,c]=o.position;if(Number.isFinite(a)&&Number.isFinite(d)&&Number.isFinite(c))return new w.Vector3(a/1e3,c/1e3,-d/1e3)}return null}).filter(o=>o!==null))||[];return e.jsx("group",{...n,children:r.length>0&&e.jsx(M.Line,{points:r,lineWidth:3,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:10})})}const V=new Map;async function G(t,n){if(V.has(t))return V.get(t);const r=(async()=>{var c;const o=n||"",a=new R.Nova({instanceUrl:o}),d=a.api.motionGroupModels;(c=d.axios)!=null&&c.interceptors&&d.axios.interceptors.request.use(s=>{var g;return(g=s.url)!=null&&g.includes("/glb")&&(s.responseType="blob"),s});try{const s=await a.api.motionGroupModels.getMotionGroupGlbModel(t);return URL.createObjectURL(s)}catch(s){throw console.error("Failed to fetch model:",s),s}})();return V.set(t,r),r}function te(t){function n(r){return r.children.length===0?[r]:[r,...r.children.flatMap(o=>n(o))]}return n(t).filter(r=>ne(r))}function re(t){return t.name.endsWith("_FLG")}function ne(t){return/_J[0-9]+$/.test(t.name)}function Te(t,n){let r;function o(a){if(re(a)){if(r)throw Error(`Found multiple flange groups in robot model ${n}; first ${r.name} then ${a.name}. Only one _FLG group is allowed.`);r=a}ne(a),a.children.map(o)}if(o(t.scene),!r)throw Error(`No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`);return{gltf:t}}const se=l.forwardRef(function({rapidlyChangingMotionState:n,dhParameters:r,onRotationChanged:o,children:a},d){const c=l.useRef(null),s=l.useRef([]),g=l.useRef(null),{invalidate:i}=k.useThree(),m=l.useRef(n);m.current=n,l.useEffect(()=>{const f=n.joint_position.filter(h=>h!==void 0);return g.current=new E.ValueInterpolator(f,{tension:120,friction:20,threshold:.001}),()=>{var h;(h=g.current)==null||h.destroy()}},[]),k.useFrame((f,h)=>{if(!g.current)return;s.current.length===0&&c.current&&p();const j=g.current.update(h);y(),j||i()});function u(f){c.current=f,f&&p()}function p(){c.current&&(s.current=te(c.current),y(),i())}l.useImperativeHandle(d,()=>({recollectJoints:p}));function y(){var h;const f=((h=g.current)==null?void 0:h.getCurrentValues())||[];if(o)o(s.current,f);else for(const[j,S]of s.current.entries()){const T=r[j],F=T.theta||0,B=T.reverse_rotation_direction?-1:1;S.rotation.y=B*(f[j]||0)+F}}function x(f){var j;const h=f.joint_position.filter(S=>S!==void 0);(j=g.current)==null||j.setTarget(h),i()}return E.useAutorun(()=>{x(m.current)}),l.useEffect(()=>{x(n)},[n]),e.jsx("group",{ref:u,children:a})}),Le="line",ke="mesh";function Ee({rapidlyChangingMotionState:t,dhParameters:n,...r}){const o=new b.Matrix4,a=l.useRef([]),d=l.useRef([]);l.useEffect(()=>{a.current=new Array(n.length).fill(null),d.current=new Array(n.length).fill(null)},[n.length]);function c(i,m){const u=new b.Vector3,p=new b.Quaternion,y=new b.Vector3;o.decompose(u,p,y);const x=u.clone(),f=new b.Matrix4().makeRotationY(i.theta+m*(i.reverse_rotation_direction?-1:1)).multiply(new b.Matrix4().makeTranslation(0,i.d/1e3,0)).multiply(new b.Matrix4().makeTranslation(i.a/1e3,0,0)).multiply(new b.Matrix4().makeRotationX(i.alpha));return o.multiply(f),o.decompose(u,p,y),{a:x,b:u}}function s(i,m,u,p){if(!n)return;const y=n[i];if(!y)return;const{a:x,b:f}=c(y,p);m.geometry.setPositions([x.toArray(),f.toArray()].flat()),u.position.set(f.x,f.y,f.z)}function g(i,m){o.identity();for(let u=0;u<Math.min(i.length,m.length);u++){const p=a.current[u],y=d.current[u];p&&y&&s(u,p,y,m[u])}}return e.jsx(se,{rapidlyChangingMotionState:t,dhParameters:n,onRotationChanged:g,children:e.jsxs("group",{...r,name:"Scene",children:[e.jsxs("mesh",{children:[e.jsx("sphereGeometry",{args:[.01,32,32]}),e.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),n==null?void 0:n.map((i,m)=>{const{a:u,b:p}=c(i,t.joint_position[m]??0),y=`dhrobot_J0${m}`;return e.jsxs("group",{name:y,children:[e.jsx(M.Line,{ref:x=>{a.current[m]=x},name:Le,points:[u,p],color:"white",lineWidth:5}),e.jsxs("mesh",{ref:x=>{d.current[m]=x},name:ke,position:p,children:[e.jsx("sphereGeometry",{args:[.01,32,32]}),e.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},`mesh_${m}`)]},y)})]})})}const Ge=console.warn;function oe(){return l.useEffect(()=>{console.warn=t=>{t!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&Ge(t)}},[]),null}function Ce(t){return t.type==="Mesh"}function Ie({url:t,flangeRef:n,postModelRender:r,...o}){const a=M.useGLTF(t),c=Te(a,"robot.glb").gltf,s=l.useCallback(i=>{i&&r&&r()},[r]);function g(i){try{return Ce(i)?i.geometry?e.jsx("mesh",{name:i.name,geometry:i.geometry,material:i.material,position:i.position,rotation:i.rotation},i.uuid):e.jsx("group",{name:i.name,position:i.position,rotation:i.rotation},i.uuid):e.jsx("group",{name:i.name,position:i.position,rotation:i.rotation,ref:re(i)?n:void 0,children:i.children.map(g)},i.uuid)}catch(m){return console.warn("Error rendering node",i.name,m),null}}return e.jsx("group",{...o,dispose:null,ref:s,children:g(c.scene)})}function ie({modelURL:t,flangeRef:n,postModelRender:r,...o}){const[a,d]=l.useState(null);return l.useEffect(()=>{let c=!1;return(async()=>{try{const g=typeof t=="string"?t:await t;c||d(i=>i===g?i:g)}catch(g){console.error("Failed to resolve model URL:",g)}})(),()=>{c=!0}},[t]),a?e.jsx(Ie,{url:a,flangeRef:n,postModelRender:r,...o}):null}const ae=(t,n)=>{t.userData.isGhost||(t.traverse(r=>{if(r instanceof w.Mesh){r.material instanceof w.Material&&(r.material.colorWrite=!1);const o=r.clone(),a=r.clone();o.material=new w.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:w.DoubleSide}),o.userData.isGhost=!0,a.material=new w.MeshStandardMaterial({color:n,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:w.DoubleSide}),a.userData.isGhost=!0,r.parent&&(r.parent.add(o),r.parent.add(a))}}),t.userData.isGhost=!0)},ce=t=>{if(!t.userData.isGhost)return;const n=[];t.traverse(r=>{var o;r instanceof w.Mesh&&((o=r.userData)!=null&&o.isGhost?n.push(r):r.material instanceof w.Material&&(r.material.colorWrite=!0))}),n.forEach(r=>{r.parent&&r.parent.remove(r)}),t.userData.isGhost=!1},J=L.externalizeComponent(({rapidlyChangingMotionState:t,modelFromController:n,dhParameters:r,getModel:o=G,flangeRef:a,postModelRender:d,transparentColor:c,instanceUrl:s,...g})=>{const[i,m]=l.useState(null),u=l.useRef(null),p=l.useCallback(h=>{m(h)},[]),y=l.useCallback(()=>{var h;(h=u.current)==null||h.recollectJoints(),d==null||d()},[d]);l.useEffect(()=>{i&&(c?ae(i,c):ce(i))},[i,c]);const x=l.useMemo(()=>{const h=o(n,s);if(!h)throw new Error(`No model found for robot "${n}". Ensure the model is available or provide a custom getModel function.`);return h},[n,s,o]),f=e.jsx(Ee,{rapidlyChangingMotionState:t,dhParameters:r,...g});return e.jsxs(ee.ErrorBoundary,{fallback:f,onError:h=>{console.warn(h)},children:[e.jsx(l.Suspense,{fallback:f,children:e.jsx("group",{ref:p,children:e.jsx(se,{ref:u,rapidlyChangingMotionState:t,dhParameters:r,children:e.jsx(ie,{modelURL:x,postModelRender:y,flangeRef:a,...g})})})}),e.jsx(oe,{})]})});function ue({connectedMotionGroup:t,getModel:n=G,flangeRef:r,transparentColor:o,postModelRender:a,...d}){return t.dhParameters?e.jsx(J,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,modelFromController:t.modelFromController||"",dhParameters:t.dhParameters,getModel:n,flangeRef:r,transparentColor:o,postModelRender:a,...d}):null}const Ae=L.externalizeComponent(xe.observer(({robotName:t,programState:n,safetyState:r,operationMode:o,driveToHomeEnabled:a=!1,onDriveToHomePress:d,onDriveToHomeRelease:c,connectedMotionGroup:s,robotComponent:g=ue,customContentComponent:i,className:m})=>{var H;const u=he.useTheme(),{t:p}=ye.useTranslation(),[y,x]=l.useState(!1),f=l.useRef(null),h=l.useRef(null),[j,S]=l.useState(!1),[T,F]=l.useState({width:400,height:600}),[B,pe]=l.useState(0);l.useEffect(()=>{const P=()=>{if(h.current){const{offsetWidth:Y,offsetHeight:Q}=h.current;S(Y>Q),F({width:Y,height:Q})}};P();const $=new ResizeObserver(P);return h.current&&$.observe(h.current),()=>{$.disconnect()}},[]);const N=l.useCallback(()=>{pe(P=>P+1)},[]),C=l.useCallback(()=>{!a||!d||(x(!0),d())},[a,d]),I=l.useCallback(()=>{!a||!c||(x(!1),c())},[a,c]),W=l.useCallback(()=>{y&&c&&(x(!1),c())},[y,c]),_=j?T.width<350:T.height<200,A=j?T.height<310:T.height<450;return e.jsx(me,{ref:h,className:m,sx:{width:"100%",height:"100%",display:"flex",flexDirection:j?"row":"column",position:"relative",overflow:"hidden",minWidth:{xs:180,sm:220,md:250},minHeight:j?{xs:200,sm:240,md:260}:{xs:150,sm:180,md:220},border:`1px solid ${u.palette.divider}`,borderRadius:"18px",boxShadow:"none",backgroundColor:((H=u.palette.backgroundPaperElevation)==null?void 0:H[8])||"#292B3F",backgroundImage:"none"},children:j?e.jsxs(e.Fragment,{children:[e.jsx(v,{sx:{flex:"0 0 50%",position:"relative",height:"100%",minHeight:"100%",maxHeight:"100%",borderRadius:1,m:{xs:1.5,sm:2,md:3},mr:{xs:.75,sm:1,md:1.5},overflow:"hidden",display:_?"none":"block"},children:!_&&e.jsxs(k.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:u.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute",top:0,left:0},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[e.jsx(D,{}),e.jsx(M.Bounds,{fit:!0,observe:!0,margin:1,maxDuration:1,children:e.jsx(g,{connectedMotionGroup:s,postModelRender:N})})]})}),e.jsxs(v,{sx:{flex:"1",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:_?"100%":"50%"},children:[e.jsxs(v,{sx:{p:{xs:1.5,sm:2,md:3},pb:{xs:1,sm:1.5,md:2},textAlign:"left"},children:[e.jsx(K,{variant:"h6",component:"h2",sx:{mb:1},children:t}),e.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:o})]}),e.jsxs(v,{sx:{p:{xs:1.5,sm:2,md:3},pt:0,flex:"1",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[!A&&i&&e.jsxs(v,{children:[e.jsx(i,{}),e.jsx(Z,{sx:{mt:1,mb:0,borderColor:u.palette.divider,opacity:.5}})]}),e.jsx(v,{sx:{mt:!A&&i?"auto":0},children:e.jsx(v,{sx:{display:"flex",justifyContent:"flex-start",mt:{xs:1,sm:1.5,md:2},mb:{xs:.5,sm:.75,md:1}},children:e.jsx(X,{ref:f,variant:"contained",color:"secondary",size:"small",disabled:!a,onMouseDown:C,onMouseUp:I,onMouseLeave:W,onTouchStart:C,onTouchEnd:I,sx:{textTransform:"none",px:1.5,py:.5},children:p("RobotCard.DriveToHome.bt")})})})]})]})]}):e.jsx(e.Fragment,{children:e.jsxs(v,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(v,{children:[e.jsx(K,{variant:"h6",component:"h2",sx:{mb:1},children:t}),e.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:o})]}),e.jsx(v,{sx:{flex:_?0:1,position:"relative",minHeight:_?0:{xs:120,sm:150,md:200},height:_?0:"auto",borderRadius:1,overflow:"hidden",display:_?"none":"block"},children:!_&&e.jsxs(k.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:u.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute"},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[e.jsx(D,{}),e.jsx(M.Bounds,{fit:!0,clip:!0,observe:!0,margin:1,maxDuration:1,children:e.jsx(g,{connectedMotionGroup:s,postModelRender:N})})]})}),e.jsxs(v,{children:[!A&&i&&e.jsxs(e.Fragment,{children:[e.jsx(i,{}),e.jsx(Z,{sx:{mt:1,mb:0,borderColor:u.palette.divider,opacity:.5}})]}),e.jsx(v,{sx:{display:"flex",justifyContent:"flex-start",mt:!A&&i?{xs:1,sm:2,md:5}:{xs:.5,sm:1,md:2},mb:{xs:.5,sm:.75,md:1}},children:e.jsx(X,{ref:f,variant:"contained",color:"secondary",size:"small",disabled:!a,onMouseDown:C,onMouseUp:I,onMouseLeave:W,onTouchStart:C,onTouchEnd:I,sx:{textTransform:"none",px:1.5,py:.5},children:p("RobotCard.DriveToHome.bt")})})]})]})})})})),Pe=Array(6).fill(2*Math.PI);function le({rapidlyChangingMotionState:t,dhParameters:n,onTranslationChanged:r,children:o}){const a=l.useRef([]),d=l.useRef([]),c=l.useRef(null),{invalidate:s}=k.useThree();l.useEffect(()=>{const u=t.joint_position.filter(p=>p!==void 0);return c.current=new E.ValueInterpolator(u,{tension:120,friction:20,threshold:.001}),()=>{var p;(p=c.current)==null||p.destroy()}},[]),k.useFrame((u,p)=>{if(c.current){const y=c.current.update(p);i(),y||s()}});function g(u){u&&(d.current=te(u),i(),s())}function i(){var p;const u=((p=c.current)==null?void 0:p.getCurrentValues())||[];if(r)r(d.current,u);else for(const[y,x]of d.current.entries()){const h=n[y].reverse_rotation_direction?-1:1;x.position.y=h*(u[y]||0)/1e3}}const m=l.useCallback(()=>{const u=t.joint_position.filter(p=>p!==void 0);requestAnimationFrame(()=>{var p;a.current=u,(p=c.current)==null||p.setTarget(u)})},[t]);return l.useEffect(()=>{m()},[t,m]),E.useAutorun(()=>{m()}),e.jsx("group",{ref:g,children:o})}function fe({rapidlyChangingMotionState:t,dhParameters:n,...r}){const o=new b.Matrix4,a=l.useRef(null),d=l.useRef(null);function c(i){const m=new b.Matrix4;for(let x=0;x<n.length;x++){const f=n[x],h=i[x]??0,j=new b.Matrix4().makeRotationY(f.theta).multiply(new b.Matrix4().makeTranslation(f.a/1e3,(f.d+h*(f.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new b.Matrix4().makeRotationX(f.alpha));m.multiply(j)}const u=new b.Vector3,p=new b.Quaternion,y=new b.Vector3;return m.decompose(u,p,y),u}const s=c(t.joint_position);function g(i,m){o.identity();let u=new b.Vector3;for(let f=0;f<n.length;f++){const h=m[f]??0,j=n[f],S=new b.Matrix4().makeRotationY(j.theta).multiply(new b.Matrix4().makeTranslation(j.a/1e3,(j.d+h*(j.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new b.Matrix4().makeRotationX(j.alpha));o.multiply(S)}const p=new b.Vector3,y=new b.Quaternion,x=new b.Vector3;if(o.decompose(p,y,x),u=p,a.current&&a.current.position.set(u.x,u.y,u.z),d.current){const f=d.current.geometry;f!=null&&f.setPositions&&f.setPositions([0,0,0,u.x,u.y,u.z])}}return e.jsx(le,{rapidlyChangingMotionState:t,dhParameters:n,onTranslationChanged:g,children:e.jsxs("group",{...r,name:"Scene",children:[e.jsxs("mesh",{name:"Base",position:[0,0,0],children:[e.jsx("sphereGeometry",{args:[.02,32,32]}),e.jsx("meshStandardMaterial",{color:"green",depthTest:!0})]}),e.jsx(M.Line,{ref:d,points:[new b.Vector3(0,0,0),s],color:"White",lineWidth:5}),e.jsxs("mesh",{ref:a,name:"TCP",position:s,children:[e.jsx("sphereGeometry",{args:[.025,32,32]}),e.jsx("meshStandardMaterial",{color:"red",depthTest:!0})]})]})})}const U=L.externalizeComponent(({rapidlyChangingMotionState:t,modelFromController:n,dhParameters:r,getModel:o=G,flangeRef:a,postModelRender:d,transparentColor:c,instanceUrl:s,...g})=>{const[i,m]=l.useState(null),u=l.useCallback(y=>{m(y)},[]);l.useEffect(()=>{i&&(c?ae(i,c):ce(i))},[i,c]);const p=e.jsx(fe,{rapidlyChangingMotionState:t,dhParameters:r,...g});return e.jsxs(ee.ErrorBoundary,{fallback:p,onError:y=>{console.warn(y)},children:[e.jsx(l.Suspense,{fallback:p,children:e.jsx("group",{ref:u,children:e.jsx(le,{rapidlyChangingMotionState:t,dhParameters:r,children:e.jsx(ie,{modelURL:(()=>{const y=o(n,s);if(!y){const x=new Blob([],{type:"model/gltf-binary"}),f=new File([x],`${n}.glb`,{type:"model/gltf-binary"});return Promise.resolve(URL.createObjectURL(f))}return y})(),postModelRender:d,flangeRef:a,...g})})})}),e.jsx(oe,{})]})});function Fe({connectedMotionGroup:t,getModel:n=G,flangeRef:r,transparentColor:o,postModelRender:a,...d}){if(!t.dhParameters)return null;const c=t.modelFromController||"";return c&&n(c)?e.jsx(U,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,modelFromController:c,dhParameters:t.dhParameters,getModel:n,flangeRef:r,transparentColor:o,postModelRender:a,...d}):e.jsx(fe,{rapidlyChangingMotionState:t.rapidlyChangingMotionState,dhParameters:t.dhParameters,...d})}const q={[R.Manufacturer.Abb]:[0,0,0,0,Math.PI/2,0,0],[R.Manufacturer.Fanuc]:[0,0,0,0,-Math.PI/2,0,0],[R.Manufacturer.Yaskawa]:[0,0,0,0,-Math.PI/2,0,0],[R.Manufacturer.Kuka]:[0,-Math.PI/2,Math.PI/2,0,Math.PI/2,0,0],[R.Manufacturer.Universalrobots]:[0,-Math.PI/2,-Math.PI/2,-Math.PI/2,Math.PI/2,-Math.PI/2,0],[R.Manufacturer.Staubli]:[0,-Math.PI/2,Math.PI/2,0,0,0,0]};function de(t){const[n]=t.split("_");switch(n){case"ABB":return R.Manufacturer.Abb;case"FANUC":return R.Manufacturer.Fanuc;case"YASKAWA":return R.Manufacturer.Yaskawa;case"KUKA":return R.Manufacturer.Kuka;case"UniversalRobots":return R.Manufacturer.Universalrobots;case"STAUBLI":return R.Manufacturer.Staubli;default:return null}}function Ve(t,n){const r=de(t);return r&&r in q?q[r]:n||null}const Oe=L.externalizeComponent(t=>{const{inverseSolver:n,dhParameters:r,...o}=t,[a,d]=l.useState(R.JointTypeEnum.RevoluteJoint);l.useEffect(()=>{r.length&&d(r[0].type??R.JointTypeEnum.RevoluteJoint)},[r]);const c=l.useMemo(()=>n===null&&a===R.JointTypeEnum.RevoluteJoint,[n,a]),s=l.useMemo(()=>n===null&&a===R.JointTypeEnum.PrismaticJoint,[n,a]);return l.useMemo(()=>!!n,[n])||c?e.jsx(J,{dhParameters:r,...o}):s?e.jsx(U,{dhParameters:r,...o}):null});exports.CollisionSceneRenderer=Re;exports.LinearAxis=Fe;exports.MANUFACTURER_HOME_CONFIGS=q;exports.MotionGroupVisualizer=Oe;exports.PresetEnvironment=D;exports.Robot=ue;exports.RobotCard=Ae;exports.SafetyZonesRenderer=Se;exports.SupportedLinearAxis=U;exports.SupportedRobot=J;exports.TrajectoryRenderer=_e;exports.defaultAxisConfig=Pe;exports.defaultGetModel=G;exports.extractManufacturer=de;exports.getDefaultHomeConfig=Ve;
|
|
@@ -2,9 +2,9 @@ import { jsx as r, jsxs as x, Fragment as J } from "react/jsx-runtime";
|
|
|
2
2
|
import * as w from "three";
|
|
3
3
|
import { Matrix4 as v, Vector3 as L, Quaternion as $ } from "three";
|
|
4
4
|
import { ConvexGeometry as ce, RoundedBoxGeometry as Ge } from "three-stdlib";
|
|
5
|
-
import Le, { useMemo as F, forwardRef as Ie, useRef as R, useEffect as T, useImperativeHandle as
|
|
6
|
-
import { d as
|
|
7
|
-
import { Environment as Oe, Lightformer as
|
|
5
|
+
import Le, { useMemo as F, forwardRef as Ie, useRef as R, useEffect as T, useImperativeHandle as Pe, useState as I, useCallback as G, Suspense as le } from "react";
|
|
6
|
+
import { d as Ae, v as Fe, o as De, e as C } from "./externalizeComponent-JETX1Xbc.js";
|
|
7
|
+
import { Environment as Oe, Lightformer as A, Line as N, useGLTF as Ve, Bounds as z } from "@react-three/drei";
|
|
8
8
|
import { useTheme as Ee } from "@mui/material/styles";
|
|
9
9
|
import M from "@mui/material/Box";
|
|
10
10
|
import ee from "@mui/material/Button";
|
|
@@ -14,7 +14,7 @@ import re from "@mui/material/Typography";
|
|
|
14
14
|
import { useThree as ue, useFrame as fe, Canvas as ne } from "@react-three/fiber";
|
|
15
15
|
import { observer as Je } from "mobx-react-lite";
|
|
16
16
|
import { useTranslation as Ce } from "react-i18next";
|
|
17
|
-
import { V as pe, c as de, b as oe } from "./interpolation-
|
|
17
|
+
import { V as pe, c as de, b as oe } from "./interpolation-CYfFv8VA.js";
|
|
18
18
|
import { Nova as je, Manufacturer as _, JointTypeEnum as U } from "@wandelbots/nova-js/v2";
|
|
19
19
|
import { ErrorBoundary as he } from "react-error-boundary";
|
|
20
20
|
function Be(e) {
|
|
@@ -112,7 +112,7 @@ const Ne = [2, 0, 2, 0, 2, 0, 2, 0];
|
|
|
112
112
|
function He({ positions: e = Ne }) {
|
|
113
113
|
return /* @__PURE__ */ x(J, { children: [
|
|
114
114
|
/* @__PURE__ */ r(
|
|
115
|
-
|
|
115
|
+
A,
|
|
116
116
|
{
|
|
117
117
|
intensity: 5,
|
|
118
118
|
"rotation-x": Math.PI / 2,
|
|
@@ -121,7 +121,7 @@ function He({ positions: e = Ne }) {
|
|
|
121
121
|
}
|
|
122
122
|
),
|
|
123
123
|
/* @__PURE__ */ r("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ r("group", { children: e.map((n, t) => /* @__PURE__ */ r(
|
|
124
|
-
|
|
124
|
+
A,
|
|
125
125
|
{
|
|
126
126
|
form: "circle",
|
|
127
127
|
intensity: 5,
|
|
@@ -132,7 +132,7 @@ function He({ positions: e = Ne }) {
|
|
|
132
132
|
t
|
|
133
133
|
)) }) }),
|
|
134
134
|
/* @__PURE__ */ r(
|
|
135
|
-
|
|
135
|
+
A,
|
|
136
136
|
{
|
|
137
137
|
intensity: 40,
|
|
138
138
|
"rotation-y": Math.PI / 2,
|
|
@@ -141,7 +141,7 @@ function He({ positions: e = Ne }) {
|
|
|
141
141
|
}
|
|
142
142
|
),
|
|
143
143
|
/* @__PURE__ */ r(
|
|
144
|
-
|
|
144
|
+
A,
|
|
145
145
|
{
|
|
146
146
|
intensity: 20,
|
|
147
147
|
"rotation-y": -Math.PI,
|
|
@@ -150,7 +150,7 @@ function He({ positions: e = Ne }) {
|
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
152
|
/* @__PURE__ */ r(
|
|
153
|
-
|
|
153
|
+
A,
|
|
154
154
|
{
|
|
155
155
|
"rotation-y": Math.PI / 2,
|
|
156
156
|
position: [-5, -1, -1],
|
|
@@ -159,7 +159,7 @@ function He({ positions: e = Ne }) {
|
|
|
159
159
|
}
|
|
160
160
|
),
|
|
161
161
|
/* @__PURE__ */ r(
|
|
162
|
-
|
|
162
|
+
A,
|
|
163
163
|
{
|
|
164
164
|
"rotation-y": -Math.PI / 2,
|
|
165
165
|
position: [10, 1, 0],
|
|
@@ -168,7 +168,7 @@ function He({ positions: e = Ne }) {
|
|
|
168
168
|
}
|
|
169
169
|
),
|
|
170
170
|
/* @__PURE__ */ r(
|
|
171
|
-
|
|
171
|
+
A,
|
|
172
172
|
{
|
|
173
173
|
form: "ring",
|
|
174
174
|
color: "white",
|
|
@@ -195,7 +195,7 @@ function Rt({
|
|
|
195
195
|
...t
|
|
196
196
|
}) {
|
|
197
197
|
const s = F(
|
|
198
|
-
() =>
|
|
198
|
+
() => Ae(n ?? []),
|
|
199
199
|
[n]
|
|
200
200
|
), a = (c, o) => {
|
|
201
201
|
var p, y;
|
|
@@ -409,7 +409,7 @@ const be = Ie(
|
|
|
409
409
|
function p() {
|
|
410
410
|
c.current && (o.current = me(c.current), y(), i());
|
|
411
411
|
}
|
|
412
|
-
|
|
412
|
+
Pe(f, () => ({ recollectJoints: p }));
|
|
413
413
|
function y() {
|
|
414
414
|
var d;
|
|
415
415
|
const u = ((d = g.current) == null ? void 0 : d.getCurrentValues()) || [];
|
|
@@ -417,7 +417,7 @@ const be = Ie(
|
|
|
417
417
|
s(o.current, u);
|
|
418
418
|
else
|
|
419
419
|
for (const [b, S] of o.current.entries()) {
|
|
420
|
-
const
|
|
420
|
+
const P = t[b], B = P.theta || 0, H = P.reverse_rotation_direction ? -1 : 1;
|
|
421
421
|
S.rotation.y = H * (u[b] || 0) + B;
|
|
422
422
|
}
|
|
423
423
|
}
|
|
@@ -745,7 +745,7 @@ const Mt = C(
|
|
|
745
745
|
className: h
|
|
746
746
|
}) => {
|
|
747
747
|
var X;
|
|
748
|
-
const l = Ee(), { t: p } = Ce(), [y, m] = I(!1), u = R(null), d = R(null), [b, S] = I(!1), [
|
|
748
|
+
const l = Ee(), { t: p } = Ce(), [y, m] = I(!1), u = R(null), d = R(null), [b, S] = I(!1), [P, B] = I({ width: 400, height: 600 }), [H, ke] = I(0);
|
|
749
749
|
T(() => {
|
|
750
750
|
const E = () => {
|
|
751
751
|
if (d.current) {
|
|
@@ -767,7 +767,7 @@ const Mt = C(
|
|
|
767
767
|
!a || !c || (m(!1), c());
|
|
768
768
|
}, [a, c]), q = G(() => {
|
|
769
769
|
y && c && (m(!1), c());
|
|
770
|
-
}, [y, c]), k = b ?
|
|
770
|
+
}, [y, c]), k = b ? P.width < 350 : P.height < 200, V = b ? P.height < 310 : P.height < 450;
|
|
771
771
|
return /* @__PURE__ */ r(
|
|
772
772
|
Ue,
|
|
773
773
|
{
|
|
@@ -786,7 +786,7 @@ const Mt = C(
|
|
|
786
786
|
border: `1px solid ${l.palette.divider}`,
|
|
787
787
|
borderRadius: "18px",
|
|
788
788
|
boxShadow: "none",
|
|
789
|
-
backgroundColor: ((X = l.palette.backgroundPaperElevation) == null ? void 0 : X[8]) || "#
|
|
789
|
+
backgroundColor: ((X = l.palette.backgroundPaperElevation) == null ? void 0 : X[8]) || "#292B3F",
|
|
790
790
|
backgroundImage: "none"
|
|
791
791
|
// Override any gradient from elevation
|
|
792
792
|
},
|
|
@@ -2,7 +2,7 @@ import { jsxs as f, Fragment as B, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import h from "@mui/material/Divider";
|
|
3
3
|
import y from "@mui/material/Stack";
|
|
4
4
|
import { observer as d, useLocalObservable as M } from "mobx-react-lite";
|
|
5
|
-
import { t as v, e as O } from "./externalizeComponent-
|
|
5
|
+
import { t as v, e as O } from "./externalizeComponent-JETX1Xbc.js";
|
|
6
6
|
import { useTheme as E } from "@mui/material/styles";
|
|
7
7
|
import { useId as T } from "react";
|
|
8
8
|
import { useTranslation as m, Trans as s } from "react-i18next";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),x=require("@mui/material/Divider"),T=require("@mui/material/Stack"),d=require("mobx-react-lite"),h=require("./externalizeComponent-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),x=require("@mui/material/Divider"),T=require("@mui/material/Stack"),d=require("mobx-react-lite"),h=require("./externalizeComponent-qE94FGXZ.cjs"),f=require("@mui/material/styles"),E=require("react"),i=require("react-i18next"),c=require("./safety-state-stop-CgPfwC18.cjs"),j=require("@mui/material/Popover"),B=require("@mui/material/SvgIcon"),y=require("@mui/material/Typography"),b=require("axios");function v(a,o){throw new Error(`${o} ${JSON.stringify(a)}`)}function M(a){var o,r,n,t;return a instanceof b.AxiosError&&a.code==="ERR_NETWORK"?"Failed to connect to the server. Please check your internet connection.":a instanceof b.AxiosError&&a.response?`${(o=a.response)==null?void 0:o.status} ${(r=a.response)==null?void 0:r.statusText} from ${(n=a.response)==null?void 0:n.config.url}: ${JSON.stringify((t=a.response)==null?void 0:t.data)}`:a instanceof Error?a.message:`Unexpected error: ${h.tryStringifyJson(a)||a}`}const S=d.observer(({id:a,icon:o,color:r,title:n,name:t,label:l,explanation:s,literalValue:p,anchorOrigin:m,transformOrigin:A})=>{const u=d.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!u.anchorEl},openPopover(_){u.anchorEl=_.currentTarget},closePopover(){u.anchorEl=null}}));return e.jsxs(e.Fragment,{children:[e.jsxs(T,{"aria-owns":u.isPopoverOpen?a:void 0,"aria-haspopup":"true",onMouseEnter:u.openPopover,onMouseLeave:u.closePopover,direction:"row",spacing:1,sx:{cursor:"pointer"},children:[e.jsx(B,{component:o,sx:{color:r}}),l&&e.jsx("div",{style:{color:r},children:l})]}),e.jsx(j,{id:a,sx:{pointerEvents:"none"},open:u.isPopoverOpen,anchorEl:u.anchorEl,anchorOrigin:m??{vertical:"bottom",horizontal:"left"},transformOrigin:A??{vertical:"top",horizontal:"left"},onClose:u.closePopover,disableRestoreFocus:!0,children:e.jsxs(T,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[e.jsxs("div",{children:[n&&e.jsx(y,{component:"span",fontSize:"14px",children:`${n}: `}),e.jsx(y,{component:"span",color:r,fontWeight:"bold",fontSize:"14px",children:t})]}),e.jsx(y,{fontSize:"14px",children:s}),p&&e.jsx(y,{fontSize:"12px",children:p})]})})]})}),O=d.observer(({isVirtual:a,motionGroupId:o,anchorOrigin:r,transformOrigin:n,compact:t})=>{const l=f.useTheme(),s=E.useId(),{t:p}=i.useTranslation();return a?e.jsx(S,{id:`motion-group-virtual-${s}`,icon:c.ForwardRef$1,color:l.palette.tertiary.main,name:p("SafetyBar.ControllerType.Virtual.lb"),label:t?null:p("SafetyBar.ControllerType.Virtual.lb"),explanation:e.jsxs(i.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:o},children:["Motion group ",e.jsx("code",{children:o})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:r,transformOrigin:n}):e.jsx(S,{id:`motion-group-physical-${s}`,icon:c.ForwardRef,color:l.palette.primary.main,name:p("SafetyBar.ControllerType.Physical.lb"),label:t?null:p("SafetyBar.ControllerType.Physical.lb"),explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:o},components:{code:e.jsx("code",{}),strong:e.jsx("strong",{})}}),anchorOrigin:r,transformOrigin:n})}),R=d.observer(({operationMode:a,anchorOrigin:o,transformOrigin:r,compact:n})=>{const{t}=i.useTranslation(),l=f.useTheme(),s=E.useId();switch(a){case"OPERATION_MODE_AUTO":return e.jsx(S,{id:`operation-mode-auto-${s}`,icon:c.ForwardRef$2,title:t("SafetyBar.OperationMode.ti"),name:t("SafetyBar.OperationMode.Automatic.ti"),label:n?null:t("SafetyBar.OperationMode.Automatic.ti"),color:l.palette.text.secondary,explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.OperationMode.Auto.Explanation.lb",children:"The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode."}),anchorOrigin:o,transformOrigin:r});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return e.jsx(S,{id:`operation-mode-manual-${s}`,icon:c.ForwardRef$4,color:l.palette.warning.main,title:t("SafetyBar.OperationMode.ti"),name:t("SafetyBar.OperationMode.Manual.lb"),label:n?null:t("SafetyBar.OperationMode.Manual.lb"),explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.OperationMode.Manual.Explanation.lb",children:"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully."}),literalValue:a,anchorOrigin:o,transformOrigin:r});default:return e.jsx(S,{id:`operation-mode-error-${s}`,icon:c.ForwardRef$3,color:l.palette.warning.main,title:t("SafetyBar.OperationMode.ti"),name:t("SafetyBar.OperationMode.Error.lb"),label:n?null:t("SafetyBar.OperationMode.Error.lb"),explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.OperationMode.Error.Explanation.lb",children:"The robot controller has entered an unexpected operation mode. Motion group movement may not be possible."}),literalValue:a,anchorOrigin:o,transformOrigin:r})}}),F=d.observer(({safetyState:a,anchorOrigin:o,transformOrigin:r,compact:n})=>{const{t}=i.useTranslation(),l=f.useTheme(),s=E.useId();switch(a){case"SAFETY_STATE_NORMAL":return e.jsx(S,{id:`safety-state-normal-${s}`,title:t("SafetyBar.SafetyState.ti"),name:t("SafetyBar.SafetyState.Normal.lb"),label:n?null:t("SafetyBar.SafetyState.Normal.lb"),icon:c.ForwardRef$8,color:l.palette.text.secondary,explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.SafetyState.Normal.Explanation.lb",children:"The robot controller is in a normal safety state. Movement is not prevented by this state."}),anchorOrigin:o,transformOrigin:r});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return e.jsx(S,{id:`safety-state-estop-${s}`,title:t("SafetyBar.SafetyState.ti"),name:t("SafetyBar.SafetyState.Estop.lb"),label:n?null:t("SafetyBar.SafetyState.Estop.lb"),icon:c.ForwardRef$6,color:l.palette.error.main,explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.StopState.Estop.Explanation.lb",children:"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released."}),literalValue:a,anchorOrigin:o,transformOrigin:r});case"SAFETY_STATE_STOP_0":case"SAFETY_STATE_STOP_1":case"SAFETY_STATE_STOP_2":case"SAFETY_STATE_PROTECTIVE_STOP":case"SAFETY_STATE_STOP":return e.jsx(S,{id:`safety-state-stop-${s}`,icon:c.ForwardRef$9,title:t("SafetyBar.SafetyState.ti"),name:t("SafetyBar.SafetyState.Stop.lb"),label:n?null:t("SafetyBar.SafetyState.Stop.lb"),color:l.palette.warning.main,explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.SafetyState.Stop.Explanation.lb",children:"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved."}),literalValue:a,anchorOrigin:o,transformOrigin:r});case"SAFETY_STATE_REDUCED":case"SAFETY_STATE_MASTERING":case"SAFETY_STATE_CONFIRM_SAFETY":case"SAFETY_STATE_OPERATOR_SAFETY":case"SAFETY_STATE_RECOVERY":case"SAFETY_STATE_VIOLATION":return e.jsx(S,{id:`safety-state-manual-action-required-${s}`,icon:c.ForwardRef$7,color:l.palette.warning.main,title:t("SafetyBar.SafetyState.ti"),name:t("SafetyBar.SafetyState.ManualActionRequired.lb"),label:n?null:t("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.SafetyState.ManualActionRequired.Explanation.lb",children:"The robot controller has entered a safety state requiring manual action to resolve."}),literalValue:a,anchorOrigin:o,transformOrigin:r});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return e.jsx(S,{id:`safety-state-error-${s}`,icon:c.ForwardRef$5,color:l.palette.error.main,title:t("SafetyBar.SafetyState.ti"),name:t("SafetyBar.SafetyState.Error.lb"),label:n?null:t("SafetyBar.SafetyState.Error.lb"),explanation:e.jsx(i.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:a,anchorOrigin:o,transformOrigin:r});default:v(a,`Unknown safety state ${a}`)}}),w=h.externalizeComponent(d.observer(({isVirtual:a,motionGroupId:o,operationMode:r,safetyState:n,anchorOrigin:t,transformOrigin:l,compact:s=!0})=>{const p=s?1:2;return e.jsxs(T,{direction:"row",gap:p,alignItems:"center",sx:{height:"24px"},children:[e.jsx(F,{safetyState:n,anchorOrigin:t,transformOrigin:l,compact:s}),e.jsx(x,{orientation:"vertical",flexItem:!0}),e.jsx(R,{operationMode:r,anchorOrigin:t,transformOrigin:l,compact:s}),e.jsx(x,{orientation:"vertical",flexItem:!0}),e.jsx(O,{isVirtual:a,motionGroupId:o,anchorOrigin:t,transformOrigin:l,compact:s})]})}));exports.SafetyBar=w;exports.makeErrorMessage=M;
|
|
@@ -1,42 +1,60 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as n from "three";
|
|
2
|
+
import { Vector3 as y, Quaternion as c } from "three";
|
|
2
3
|
import { jsx as g } from "react/jsx-runtime";
|
|
3
|
-
import { memo as
|
|
4
|
-
import { I18nextProvider as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
4
|
+
import { memo as p } from "react";
|
|
5
|
+
import { I18nextProvider as f } from "react-i18next";
|
|
6
|
+
import h from "i18next";
|
|
7
|
+
import R from "i18next-browser-languagedetector";
|
|
8
|
+
const S = 1e-9;
|
|
9
|
+
function P(e) {
|
|
10
|
+
const t = new y(
|
|
11
|
+
e[0] ?? 0,
|
|
12
|
+
e[1] ?? 0,
|
|
13
|
+
e[2] ?? 0
|
|
14
|
+
), o = t.length();
|
|
15
|
+
return o < S ? new c() : new c().setFromAxisAngle(t.divideScalar(o), o);
|
|
16
|
+
}
|
|
17
|
+
function O(e) {
|
|
18
|
+
const t = e.clone().normalize();
|
|
19
|
+
t.w < 0 && t.set(-t.x, -t.y, -t.z, -t.w);
|
|
20
|
+
const o = Math.sqrt(t.x * t.x + t.y * t.y + t.z * t.z);
|
|
21
|
+
if (o < S)
|
|
22
|
+
return [0, 0, 0];
|
|
23
|
+
const r = 2 * Math.atan2(o, t.w) / o;
|
|
24
|
+
return [t.x * r, t.y * r, t.z * r];
|
|
25
|
+
}
|
|
26
|
+
function N(e) {
|
|
8
27
|
try {
|
|
9
28
|
return JSON.stringify(e);
|
|
10
29
|
} catch {
|
|
11
30
|
return;
|
|
12
31
|
}
|
|
13
32
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return n;
|
|
33
|
+
function x(e) {
|
|
34
|
+
return P([
|
|
35
|
+
e.x,
|
|
36
|
+
e.y,
|
|
37
|
+
e.z
|
|
38
|
+
]);
|
|
21
39
|
}
|
|
22
|
-
function
|
|
40
|
+
function w(e) {
|
|
23
41
|
if (!e || e.length === 0)
|
|
24
42
|
return 5;
|
|
25
|
-
const
|
|
26
|
-
return !Number.isFinite(
|
|
43
|
+
const a = e.reduce((r, l) => r + Math.abs(l.a ?? 0) / 1e3 + Math.abs(l.d ?? 0) / 1e3, 0) * 2;
|
|
44
|
+
return !Number.isFinite(a) || a <= 0 ? 5 : a;
|
|
27
45
|
}
|
|
28
|
-
function
|
|
46
|
+
function z(e) {
|
|
29
47
|
if (e.length < 3)
|
|
30
48
|
return console.log("Not enough vertices to define a plane"), { isCoplanar: !1 };
|
|
31
|
-
const t = new
|
|
32
|
-
for (let
|
|
33
|
-
const
|
|
34
|
-
if (Math.abs(
|
|
49
|
+
const t = new n.Vector3(e[0].x, e[0].y, e[0].z), o = new n.Vector3(e[1].x, e[1].y, e[1].z), a = new n.Vector3(e[2].x, e[2].y, e[2].z), r = new n.Vector3().subVectors(o, t), l = new n.Vector3().subVectors(a, t), s = new n.Vector3().crossVectors(r, l).normalize();
|
|
50
|
+
for (let i = 3; i < e.length; i++) {
|
|
51
|
+
const u = new n.Vector3(e[i].x, e[i].y, e[i].z), m = new n.Vector3().subVectors(u, t), d = s.dot(m);
|
|
52
|
+
if (Math.abs(d) > 1e-6)
|
|
35
53
|
return console.log("Vertices are not on the same plane"), { isCoplanar: !1 };
|
|
36
54
|
}
|
|
37
55
|
return { isCoplanar: !0, normal: s };
|
|
38
56
|
}
|
|
39
|
-
const
|
|
57
|
+
const I = {
|
|
40
58
|
"Jogging.Cartesian.Translation.velocityMmPerSec.lb": "{{amount}} mm/s",
|
|
41
59
|
"Jogging.Cartesian.Rotation.velocityDegPerSec.lb": "{{amount}}°/s",
|
|
42
60
|
"Jogging.Velocity.lb": "Geschwindigkeit",
|
|
@@ -135,7 +153,7 @@ Bei einem physischen Roboter bedeutet dies im Allgemeinen, dass ein Freigabescha
|
|
|
135
153
|
"RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb": "Voraussetzung nicht erfüllt",
|
|
136
154
|
"RobotCard.Runtime.lb": "Laufzeit",
|
|
137
155
|
"RobotCard.DriveToHome.bt": "Zur Home-Position fahren"
|
|
138
|
-
},
|
|
156
|
+
}, T = {
|
|
139
157
|
"Jogging.Cartesian.Translation.velocityMmPerSec.lb": "{{amount}} mm/s",
|
|
140
158
|
"Jogging.Cartesian.Rotation.velocityDegPerSec.lb": "{{amount}}°/s",
|
|
141
159
|
"Jogging.Velocity.lb": "Velocity",
|
|
@@ -234,15 +252,15 @@ Bei einem physischen Roboter bedeutet dies im Allgemeinen, dass ein Freigabescha
|
|
|
234
252
|
"RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb": "Precondition not fulfilled",
|
|
235
253
|
"RobotCard.Runtime.lb": "Runtime",
|
|
236
254
|
"RobotCard.DriveToHome.bt": "Drive to Home"
|
|
237
|
-
},
|
|
238
|
-
|
|
255
|
+
}, b = h.createInstance();
|
|
256
|
+
b.use(R).init({
|
|
239
257
|
supportedLngs: ["en", "de"],
|
|
240
258
|
resources: {
|
|
241
259
|
en: {
|
|
242
|
-
translations:
|
|
260
|
+
translations: T
|
|
243
261
|
},
|
|
244
262
|
de: {
|
|
245
|
-
translations:
|
|
263
|
+
translations: I
|
|
246
264
|
}
|
|
247
265
|
},
|
|
248
266
|
ns: ["translations"],
|
|
@@ -251,18 +269,20 @@ S.use(y).init({
|
|
|
251
269
|
order: ["navigator", "htmlTag"]
|
|
252
270
|
}
|
|
253
271
|
});
|
|
254
|
-
function
|
|
255
|
-
const t =
|
|
256
|
-
return ((
|
|
272
|
+
function k(e) {
|
|
273
|
+
const t = p(e);
|
|
274
|
+
return ((a) => /* @__PURE__ */ g(C, { children: /* @__PURE__ */ g(t, { ...a }) }));
|
|
257
275
|
}
|
|
258
|
-
const
|
|
276
|
+
const C = ({
|
|
259
277
|
children: e
|
|
260
|
-
}) => /* @__PURE__ */ g(
|
|
278
|
+
}) => /* @__PURE__ */ g(f, { i18n: b, children: e });
|
|
261
279
|
export {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
280
|
+
w as d,
|
|
281
|
+
k as e,
|
|
282
|
+
b as i,
|
|
283
|
+
x as o,
|
|
284
|
+
P as q,
|
|
285
|
+
O as r,
|
|
286
|
+
N as t,
|
|
287
|
+
z as v
|
|
268
288
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
2
|
-
Bei einem physischen Roboter bedeutet dies im Allgemeinen, dass ein Freigabeschalter gedrückt werden muss, damit sich der Roboter erfolgreich bewegen kann.`,"SafetyBar.OperationMode.Manual.lb":"Manuell","SafetyBar.OperationMode.ti":"Betriebsmodus","SafetyBar.SafetyState.Error.Explanation.lb":"Die Robotersteuerung ist in einen unerwarteten Sicherheitszustand eingetreten.","SafetyBar.SafetyState.Error.lb":"Fehler","SafetyBar.SafetyState.Estop.lb":"NOT-AUS","SafetyBar.SafetyState.ManualActionRequired.Explanation.lb":"Die Robotersteuerung ist in einen Sicherheitszustand eingetreten, der manuelle Maßnahmen zur Behebung erfordert.","SafetyBar.SafetyState.ManualActionRequired.lb":"Aktion erforderlich","SafetyBar.SafetyState.Normal.Explanation.lb":"Die Robotersteuerung befindet sich in einem sicheren Zustand. Roboterbewegungen sind möglich.","SafetyBar.SafetyState.Normal.lb":"Sicher","SafetyBar.SafetyState.Stop.Explanation.lb":"Die Robotersteuerung ist in einen Stoppzustand übergegangen. Bis der Stoppzustand aufgelöst ist, ist keine Bewegung mehr möglich.","SafetyBar.SafetyState.Stop.lb":"Stopp","SafetyBar.SafetyState.ti":"Sicherheitszustand","SafetyBar.StopState.Estop.Explanation.lb":"NOT-AUS aktiviert. NOT-AUS freischalten, um Roboter zu bewegen.","Jogging.Increment.hlb":"Schrittgröße","Jogging.CoordinateSystem.hlb":"Koordinatensystem","Jogging.Cartesian.bt":"Kartesisch","Jogging.Joints.bt":"Gelenke","Jogging.Velocity.bt":"Geschwindigkeit","CycleTimer.RemainingTime.lb":"Verbleibende Zeit","CycleTimer.OfTime.lb":"von {{time}}","CycleTimer.Time.lb":"{{time}}","CycleTimer.Error.lb":"Fehler","CycleTimer.WaitingForCycle.lb":"Warten auf Programmzyklus","CycleTimer.CycleTime.lb":"Zykluszeit","CycleTimer.Measuring.lb":"wird gemessen...","CycleTimer.Determined.lb":"bestimmt","Timer.error":"Fehler","ProgramControl.Start.bt":"Start","ProgramControl.Resume.bt":"Weiter","ProgramControl.Retry.bt":"Wiederholen","ProgramControl.Pause.bt":"Pause","ProgramControl.Stop.bt":"Stopp","ProgramStateIndicator.Preparing.lb":"Vorbereitung","ProgramStateIndicator.Starting.lb":"Startet","ProgramStateIndicator.Running.lb":"In Betrieb","ProgramStateIndicator.Pausing.lb":"Pausiert","ProgramStateIndicator.Stopping.lb":"Stoppt","ProgramStateIndicator.Completed.lb":"Abgeschlossen","ProgramStateIndicator.Failed.lb":"Fehlgeschlagen","ProgramStateIndicator.Error.lb":"Fehler","ProgramStateIndicator.EStop.lb":"Not-Aus","ProgramStateIndicator.Idle.lb":"Leerlauf","ProgramStateIndicator.Paused.lb":"Pausiert","ProgramStateIndicator.Ready.lb":"Bereit","ProgramStateIndicator.Stopped.lb":"Gestoppt","ProgramStateIndicator.Auto.lb":"Auto","ProgramStateIndicator.Manual.lb":"Manuell","ProgramStateIndicator.ManualT1.lb":"Manuell T1","ProgramStateIndicator.ManualT2.lb":"Manuell T2","RobotSetupReadinessIndicator.Ready.lb":"Bereit","RobotSetupReadinessIndicator.RobotDisconnected.lb":"Roboter getrennt","RobotSetupReadinessIndicator.CellOpen.lb":"Zelle offen","RobotSetupReadinessIndicator.EStop.lb":"Not-Stopp","RobotSetupReadinessIndicator.ManualMode.lb":"Manueller Modus","RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb":"Voraussetzung nicht erfüllt","RobotCard.Runtime.lb":"Laufzeit","RobotCard.DriveToHome.bt":"Zur Home-Position fahren"},
|
|
1
|
+
"use strict";const g=require("three"),s=require("react/jsx-runtime"),p=require("react"),f=require("react-i18next"),h=require("i18next"),R=require("i18next-browser-languagedetector");function P(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const n=P(g),b=1e-9;function u(e){const t=new g.Vector3(e[0]??0,e[1]??0,e[2]??0),o=t.length();return o<b?new g.Quaternion:new g.Quaternion().setFromAxisAngle(t.divideScalar(o),o)}function I(e){const t=e.clone().normalize();t.w<0&&t.set(-t.x,-t.y,-t.z,-t.w);const o=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);if(o<b)return[0,0,0];const r=2*Math.atan2(o,t.w)/o;return[t.x*r,t.y*r,t.z*r]}function T(e){try{return JSON.stringify(e)}catch{return}}function C(e){return u([e.x,e.y,e.z])}function J(e){if(!e||e.length===0)return 5;const a=e.reduce((r,l)=>r+Math.abs(l.a??0)/1e3+Math.abs(l.d??0)/1e3,0)*2;return!Number.isFinite(a)||a<=0?5:a}function E(e){if(e.length<3)return console.log("Not enough vertices to define a plane"),{isCoplanar:!1};const t=new n.Vector3(e[0].x,e[0].y,e[0].z),o=new n.Vector3(e[1].x,e[1].y,e[1].z),a=new n.Vector3(e[2].x,e[2].y,e[2].z),r=new n.Vector3().subVectors(o,t),l=new n.Vector3().subVectors(a,t),S=new n.Vector3().crossVectors(r,l).normalize();for(let i=3;i<e.length;i++){const d=new n.Vector3(e[i].x,e[i].y,e[i].z),m=new n.Vector3().subVectors(d,t),y=S.dot(m);if(Math.abs(y)>1e-6)return console.log("Vertices are not on the same plane"),{isCoplanar:!1}}return{isCoplanar:!0,normal:S}}const B={"Jogging.Cartesian.Translation.velocityMmPerSec.lb":"{{amount}} mm/s","Jogging.Cartesian.Rotation.velocityDegPerSec.lb":"{{amount}}°/s","Jogging.Velocity.lb":"Geschwindigkeit","General.degree.variable":"{{amount}}°","General.mm.variable":"{{amount}} mm","Jogging.Blocked.ti":"Verbindung blockiert","Jogging.Blocked.lb":"Ein anderer Client kontrolliert das Jogging.","Jogging.Blocked.Reenable.bt":"Neu verbinden","Jogging.Cartesian.MotionType.lb":"Bewegungstyp","Jogging.Cartesian.Translation.bt":"Translation","Jogging.Cartesian.Rotation.bt":"Rotation","Jogging.Joints.JointValues.lb":"Gelenkwerte","Jogging.Increment.Continuous.dd":"Fortlaufend","Jogging.Cartesian.Orientation.lb":"Orientierung","Jogging.JointLimitsReached.lb":"Gelenkgrenzen für Gelenk {{jointNumbers}} erreicht","Jogging.Orientation.coordsys":"Roboterbasis","Jogging.Orientation.tool":"Werkzeug","Jogging.StreamStateSection.lb":"Status Stream:","Jogging.StreamStateSection.RUNNING.lb":"In Bewegung","Jogging.StreamStateSection.PAUSED_BY_USER.lb":"Pausiert (Nutzer)","Jogging.StreamStateSection.PAUSED_NEAR_COLLISION.lb":"Pausiert (Kollisionsnähe)","Jogging.StreamStateSection.PAUSED_NEAR_JOINT_LIMIT.lb":"Pausiert (nahe Gelenkgrenze)","Jogging.StreamStateSection.PAUSED_NEAR_SINGULARITY.lb":"Pausiert (nahe Singularität)","Jogging.StreamStateSection.PAUSED_ON_IO.lb":"Pausiert (I/O-Ereignis)","Jogging.StreamStateSection.END_OF_TRAJECTORY.lb":"Trajektorie beendet","Jogging.StreamStateSection.WAIT_FOR_IO.lb":"Warte auf I/O","Jogging.StreamStateSection.KIND_UNKNOWN.lb":"Bereit","SafetyBar.ActivationToggle.Activate.bt":"Aktivieren","SafetyBar.ActivationToggle.Activated.bt":"Aktiviert","SafetyBar.ActivationToggle.Activating.bt":"Wird aktiviert…","SafetyBar.ActivationToggle.Deactivating.bt":"Wird deaktiviert…","SafetyBar.ControllerType.Physical.lb":"Physisch","SafetyBar.ControllerType.Virtual.lb":"Virtuell","SafetyBar.MotionGroup.Physical.Explanation.lb":"<code>{{motionGroupId}}</code> ist ein physische Robotersteuerung. Für die Bewegung dieses Roboters sind <strong>Sicherheitsmaßnahmen</strong> aktiv.","SafetyBar.MotionGroup.Virtual.Explanation.lb":"<1>{{motionGroupId}}</1> ist eine virtuelle Robotersteuerung ohne physisches Gegenstück. Der Roboter kann ohne Sicherheitsmaßnahmen bewegt werden.","SafetyBar.OperationMode.Auto.Explanation.lb":"Automatischer Betriebsmodus der Robotersteuerung aktiv. Automatisierte Bewegung ohne manuelle Bestätigung freigegeben.","SafetyBar.OperationMode.Automatic.ti":"Automatisch","SafetyBar.OperationMode.Error.Explanation.lb":"Fehler beim Abrufen des Betriebsmodus. Originalhandbediengerät des Roboters verwenden, um Fehler zu lösen.","SafetyBar.OperationMode.Error.lb":"Fehler","SafetyBar.OperationMode.Manual.Explanation.lb":`Die Robotersteuerung befindet sich im manuellen Betriebsmodus.
|
|
2
|
+
Bei einem physischen Roboter bedeutet dies im Allgemeinen, dass ein Freigabeschalter gedrückt werden muss, damit sich der Roboter erfolgreich bewegen kann.`,"SafetyBar.OperationMode.Manual.lb":"Manuell","SafetyBar.OperationMode.ti":"Betriebsmodus","SafetyBar.SafetyState.Error.Explanation.lb":"Die Robotersteuerung ist in einen unerwarteten Sicherheitszustand eingetreten.","SafetyBar.SafetyState.Error.lb":"Fehler","SafetyBar.SafetyState.Estop.lb":"NOT-AUS","SafetyBar.SafetyState.ManualActionRequired.Explanation.lb":"Die Robotersteuerung ist in einen Sicherheitszustand eingetreten, der manuelle Maßnahmen zur Behebung erfordert.","SafetyBar.SafetyState.ManualActionRequired.lb":"Aktion erforderlich","SafetyBar.SafetyState.Normal.Explanation.lb":"Die Robotersteuerung befindet sich in einem sicheren Zustand. Roboterbewegungen sind möglich.","SafetyBar.SafetyState.Normal.lb":"Sicher","SafetyBar.SafetyState.Stop.Explanation.lb":"Die Robotersteuerung ist in einen Stoppzustand übergegangen. Bis der Stoppzustand aufgelöst ist, ist keine Bewegung mehr möglich.","SafetyBar.SafetyState.Stop.lb":"Stopp","SafetyBar.SafetyState.ti":"Sicherheitszustand","SafetyBar.StopState.Estop.Explanation.lb":"NOT-AUS aktiviert. NOT-AUS freischalten, um Roboter zu bewegen.","Jogging.Increment.hlb":"Schrittgröße","Jogging.CoordinateSystem.hlb":"Koordinatensystem","Jogging.Cartesian.bt":"Kartesisch","Jogging.Joints.bt":"Gelenke","Jogging.Velocity.bt":"Geschwindigkeit","CycleTimer.RemainingTime.lb":"Verbleibende Zeit","CycleTimer.OfTime.lb":"von {{time}}","CycleTimer.Time.lb":"{{time}}","CycleTimer.Error.lb":"Fehler","CycleTimer.WaitingForCycle.lb":"Warten auf Programmzyklus","CycleTimer.CycleTime.lb":"Zykluszeit","CycleTimer.Measuring.lb":"wird gemessen...","CycleTimer.Determined.lb":"bestimmt","Timer.error":"Fehler","ProgramControl.Start.bt":"Start","ProgramControl.Resume.bt":"Weiter","ProgramControl.Retry.bt":"Wiederholen","ProgramControl.Pause.bt":"Pause","ProgramControl.Stop.bt":"Stopp","ProgramStateIndicator.Preparing.lb":"Vorbereitung","ProgramStateIndicator.Starting.lb":"Startet","ProgramStateIndicator.Running.lb":"In Betrieb","ProgramStateIndicator.Pausing.lb":"Pausiert","ProgramStateIndicator.Stopping.lb":"Stoppt","ProgramStateIndicator.Completed.lb":"Abgeschlossen","ProgramStateIndicator.Failed.lb":"Fehlgeschlagen","ProgramStateIndicator.Error.lb":"Fehler","ProgramStateIndicator.EStop.lb":"Not-Aus","ProgramStateIndicator.Idle.lb":"Leerlauf","ProgramStateIndicator.Paused.lb":"Pausiert","ProgramStateIndicator.Ready.lb":"Bereit","ProgramStateIndicator.Stopped.lb":"Gestoppt","ProgramStateIndicator.Auto.lb":"Auto","ProgramStateIndicator.Manual.lb":"Manuell","ProgramStateIndicator.ManualT1.lb":"Manuell T1","ProgramStateIndicator.ManualT2.lb":"Manuell T2","RobotSetupReadinessIndicator.Ready.lb":"Bereit","RobotSetupReadinessIndicator.RobotDisconnected.lb":"Roboter getrennt","RobotSetupReadinessIndicator.CellOpen.lb":"Zelle offen","RobotSetupReadinessIndicator.EStop.lb":"Not-Stopp","RobotSetupReadinessIndicator.ManualMode.lb":"Manueller Modus","RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb":"Voraussetzung nicht erfüllt","RobotCard.Runtime.lb":"Laufzeit","RobotCard.DriveToHome.bt":"Zur Home-Position fahren"},A={"Jogging.Cartesian.Translation.velocityMmPerSec.lb":"{{amount}} mm/s","Jogging.Cartesian.Rotation.velocityDegPerSec.lb":"{{amount}}°/s","Jogging.Velocity.lb":"Velocity","General.degree.variable":"{{amount}}°","General.mm.variable":"{{amount}} mm","Jogging.Blocked.ti":"Connection blocked","Jogging.Blocked.lb":"Another client is currently controlling the jogging.","Jogging.Blocked.Reenable.bt":"Reconnect","Jogging.Cartesian.MotionType.lb":"Motion type","Jogging.Cartesian.Translation.bt":"Translation","Jogging.Cartesian.Rotation.bt":"Rotation","Jogging.Joints.JointValues.lb":"Joint values","Jogging.Increment.Continuous.dd":"Continuous","Jogging.Cartesian.Orientation.lb":"Orientation","Jogging.Activating.lb":"Activating jogging","Jogging.JointLimitsReached.lb":"Joint limit reached for joint {{jointNumbers}}","Jogging.Orientation.coordsys":"Robot base","Jogging.Orientation.tool":"Tool","Jogging.StreamStateSection.lb":"State stream:","Jogging.StreamStateSection.RUNNING.lb":"Running","Jogging.StreamStateSection.PAUSED_BY_USER.lb":"Paused (by user)","Jogging.StreamStateSection.PAUSED_NEAR_COLLISION.lb":"Paused (collision proximity)","Jogging.StreamStateSection.PAUSED_NEAR_JOINT_LIMIT.lb":"Paused (near joint limit)","Jogging.StreamStateSection.PAUSED_NEAR_SINGULARITY.lb":"Paused (near singularity)","Jogging.StreamStateSection.PAUSED_ON_IO.lb":"Paused (I/O event)","Jogging.StreamStateSection.END_OF_TRAJECTORY.lb":"End of trajectory","Jogging.StreamStateSection.WAIT_FOR_IO.lb":"Waiting for I/O","Jogging.StreamStateSection.KIND_UNKNOWN.lb":"Ready","SafetyBar.ActivationToggle.Activate.bt":"Activate","SafetyBar.ActivationToggle.Activated.bt":"Activated","SafetyBar.ActivationToggle.Activating.bt":"Activating","SafetyBar.ActivationToggle.Deactivating.bt":"Deactivating","SafetyBar.ControllerType.Physical.lb":"Physical","SafetyBar.ControllerType.Virtual.lb":"Virtual","SafetyBar.MotionGroup.Physical.Explanation.lb":"<code>{{motionGroupId}}</code> is a physical robot controller. <strong>Safety precautions</strong> are active for the movement of this robot.","SafetyBar.MotionGroup.Virtual.Explanation.lb":"<1>{{motionGroupId}}</1> is a virtual robot controller with no physical counterpart. It can be freely manipulated without safety precautions.","SafetyBar.OperationMode.Auto.Explanation.lb":"Automatic operation mode active. Automated movement without manual confirmation enabled.","SafetyBar.OperationMode.Automatic.ti":"Automatic","SafetyBar.OperationMode.Error.Explanation.lb":"Failed to get operation mode. Use the original control panel to resolve the error.","SafetyBar.OperationMode.Error.lb":"Error","SafetyBar.OperationMode.Manual.Explanation.lb":"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully.","SafetyBar.OperationMode.Manual.lb":"Manual","SafetyBar.OperationMode.ti":"Operation mode","SafetyBar.SafetyState.Error.Explanation.lb":"The robot controller has entered an unexpected safety state.","SafetyBar.SafetyState.Error.lb":"Error","SafetyBar.SafetyState.Estop.lb":"E-Stop","SafetyBar.SafetyState.ManualActionRequired.Explanation.lb":"The robot controller has entered a safety state requiring manual action to resolve.","SafetyBar.SafetyState.ManualActionRequired.lb":"Action required","SafetyBar.SafetyState.Normal.Explanation.lb":"The robot controller is in a safe state. Robot movement is enabled.","SafetyBar.SafetyState.Normal.lb":"Safe","SafetyBar.SafetyState.Stop.Explanation.lb":"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved.","SafetyBar.SafetyState.Stop.lb":"Stop","SafetyBar.SafetyState.ti":"Safety state","SafetyBar.StopState.Estop.Explanation.lb":"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released.","Jogging.Increment.hlb":"Increment","Jogging.CoordinateSystem.hlb":"Coordinate system","Jogging.Cartesian.bt":"Cartesian","Jogging.Joints.bt":"Joints","Jogging.Velocity.bt":"Velocity","CycleTimer.RemainingTime.lb":"Time remaining","CycleTimer.OfTime.lb":"of {{time}}","CycleTimer.Time.lb":"{{time}}","CycleTimer.Error.lb":"Error","CycleTimer.WaitingForCycle.lb":"Waiting for program cycle","CycleTimer.CycleTime.lb":"Cycle Time","CycleTimer.Measuring.lb":"measuring...","CycleTimer.Determined.lb":"determined","Timer.error":"Error","ProgramControl.Start.bt":"Start","ProgramControl.Resume.bt":"Resume","ProgramControl.Retry.bt":"Retry","ProgramControl.Pause.bt":"Pause","ProgramControl.Stop.bt":"Stop","ProgramStateIndicator.Preparing.lb":"Preparing","ProgramStateIndicator.Starting.lb":"Starting","ProgramStateIndicator.Running.lb":"Running","ProgramStateIndicator.Pausing.lb":"Pausing","ProgramStateIndicator.Stopping.lb":"Stopping","ProgramStateIndicator.Completed.lb":"Completed","ProgramStateIndicator.Failed.lb":"Failed","ProgramStateIndicator.Error.lb":"Error","ProgramStateIndicator.EStop.lb":"E-Stop","ProgramStateIndicator.Idle.lb":"Idle","ProgramStateIndicator.Paused.lb":"Paused","ProgramStateIndicator.Ready.lb":"Ready","ProgramStateIndicator.Stopped.lb":"Stopped","ProgramStateIndicator.Auto.lb":"Auto","ProgramStateIndicator.Manual.lb":"Manual","ProgramStateIndicator.ManualT1.lb":"Manual T1","ProgramStateIndicator.ManualT2.lb":"Manual T2","RobotSetupReadinessIndicator.Ready.lb":"Ready","RobotSetupReadinessIndicator.RobotDisconnected.lb":"Robot disconnected","RobotSetupReadinessIndicator.CellOpen.lb":"Cell open","RobotSetupReadinessIndicator.EStop.lb":"E-Stop","RobotSetupReadinessIndicator.ManualMode.lb":"Manual mode","RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb":"Precondition not fulfilled","RobotCard.Runtime.lb":"Runtime","RobotCard.DriveToHome.bt":"Drive to Home"},c=h.createInstance();c.use(R).init({supportedLngs:["en","de"],resources:{en:{translations:A},de:{translations:B}},ns:["translations"],defaultNS:"translations",detection:{order:["navigator","htmlTag"]}});function M(e){const t=p.memo(e);return(a=>s.jsx(O,{children:s.jsx(t,{...a})}))}const O=({children:e})=>s.jsx(f.I18nextProvider,{i18n:c,children:e});exports.dhParametersToPlaneSize=J;exports.externalizeComponent=M;exports.i18n=c;exports.orientationToQuaternion=C;exports.quaternionFromRotationVector=u;exports.rotationVectorFromQuaternion=I;exports.tryStringifyJson=T;exports.verticesToCoplanarity=E;
|
|
@@ -4,7 +4,7 @@ import R from "@mui/material/Chip";
|
|
|
4
4
|
import _ from "@mui/material/Typography";
|
|
5
5
|
import { observer as P } from "mobx-react-lite";
|
|
6
6
|
import { useTranslation as C } from "react-i18next";
|
|
7
|
-
import { e as O } from "./externalizeComponent-
|
|
7
|
+
import { e as O } from "./externalizeComponent-JETX1Xbc.js";
|
|
8
8
|
import x from "@mui/icons-material/Pause";
|
|
9
9
|
import I from "@mui/icons-material/PlayArrow";
|
|
10
10
|
import S from "@mui/icons-material/Stop";
|