1 |
- {"ast":null,"code":"// import { YUpLStrategy } from \"./strategy-manager/y-up-l-strategy.js\";\nimport { YUpRStrategy } from \"./strategy-manager/y-up-r-strategy.js\";\nconst strategies = {\n // \"y-up-l\": YUpLStrategy,\n \"y-up-r\": YUpRStrategy\n};\nexport class UWB {\n constructor({\n upAxis,\n LR,\n worldPose\n }) {\n this.setStrategy(upAxis + '-' + LR, worldPose);\n }\n setStrategy(strategyKey, worldPose) {\n if (!strategies[strategyKey]) {\n throw new Error(`${strategyKey} 策略不存在`);\n }\n this.currentStrategy = new strategies[strategyKey]();\n this.setLocalOriginPose(worldPose);\n }\n unifiedCoordinateSystem(model) {\n if (this.currentStrategy) {\n return this.currentStrategy.unifiedCoordinateSystem(model);\n }\n }\n setLocalOriginPose(worldPose) {\n if (this.currentStrategy) {\n this.currentStrategy.setLocalOriginPose(worldPose);\n }\n }\n convertLocalToWorld(localPosition) {\n if (this.currentStrategy) {\n return this.currentStrategy.convertLocalToWorld(localPosition);\n }\n }\n}","map":{"version":3,"names":["YUpRStrategy","strategies","UWB","constructor","upAxis","LR","worldPose","setStrategy","strategyKey","Error","currentStrategy","setLocalOriginPose","unifiedCoordinateSystem","model","convertLocalToWorld","localPosition"],"sources":["/Users/mac/projects/mime/mine/public/plugin/uwb/index.js"],"sourcesContent":["// import { YUpLStrategy } from \"./strategy-manager/y-up-l-strategy.js\";\nimport { YUpRStrategy } from \"./strategy-manager/y-up-r-strategy.js\";\n\nconst strategies = {\n // \"y-up-l\": YUpLStrategy,\n \"y-up-r\": YUpRStrategy,\n};\n\nexport class UWB {\n constructor({ upAxis, LR, worldPose }) {\n this.setStrategy(upAxis + '-'+LR, worldPose);\n }\n\n setStrategy(strategyKey, worldPose) {\n if (!strategies[strategyKey]) {\n throw new Error(`${strategyKey} 策略不存在`);\n }\n this.currentStrategy = new strategies[strategyKey]();\n this.setLocalOriginPose(worldPose);\n }\n\n unifiedCoordinateSystem(model) {\n if (this.currentStrategy) {\n return this.currentStrategy.unifiedCoordinateSystem(model);\n }\n }\n\n setLocalOriginPose(worldPose) {\n if (this.currentStrategy) {\n this.currentStrategy.setLocalOriginPose(worldPose);\n }\n }\n\n convertLocalToWorld(localPosition) {\n if (this.currentStrategy) {\n return this.currentStrategy.convertLocalToWorld( localPosition);\n }\n }\n}\n"],"mappings":"AAAA;AACA,SAASA,YAAY,QAAQ,uCAAuC;AAEpE,MAAMC,UAAU,GAAG;EACjB;EACA,QAAQ,EAAED;AACZ,CAAC;AAED,OAAO,MAAME,GAAG,CAAC;EACfC,WAAWA,CAAC;IAAEC,MAAM;IAAEC,EAAE;IAAEC;EAAU,CAAC,EAAE;IACrC,IAAI,CAACC,WAAW,CAACH,MAAM,GAAG,GAAG,GAACC,EAAE,EAAEC,SAAS,CAAC;EAC9C;EAEAC,WAAWA,CAACC,WAAW,EAAEF,SAAS,EAAE;IAClC,IAAI,CAACL,UAAU,CAACO,WAAW,CAAC,EAAE;MAC5B,MAAM,IAAIC,KAAK,CAAE,GAAED,WAAY,QAAO,CAAC;IACzC;IACA,IAAI,CAACE,eAAe,GAAG,IAAIT,UAAU,CAACO,WAAW,CAAC,CAAC,CAAC;IACpD,IAAI,CAACG,kBAAkB,CAACL,SAAS,CAAC;EACpC;EAEAM,uBAAuBA,CAACC,KAAK,EAAE;IAC7B,IAAI,IAAI,CAACH,eAAe,EAAE;MACxB,OAAO,IAAI,CAACA,eAAe,CAACE,uBAAuB,CAACC,KAAK,CAAC;IAC5D;EACF;EAEAF,kBAAkBA,CAACL,SAAS,EAAE;IAC5B,IAAI,IAAI,CAACI,eAAe,EAAE;MACxB,IAAI,CAACA,eAAe,CAACC,kBAAkB,CAACL,SAAS,CAAC;IACpD;EACF;EAEAQ,mBAAmBA,CAACC,aAAa,EAAE;IACjC,IAAI,IAAI,CAACL,eAAe,EAAE;MACxB,OAAO,IAAI,CAACA,eAAe,CAACI,mBAAmB,CAAEC,aAAa,CAAC;IACjE;EACF;AACF"},"metadata":{},"sourceType":"module","externalDependencies":[]}
|