@operato/scene-urdf 1.2.2

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +41 -0
  3. package/assets/images/spinner.png +0 -0
  4. package/demo/index.html +109 -0
  5. package/dist/editors/index.d.ts +0 -0
  6. package/dist/editors/index.js +2 -0
  7. package/dist/editors/index.js.map +1 -0
  8. package/dist/elements/drag-n-drop.d.ts +2 -0
  9. package/dist/elements/drag-n-drop.js +126 -0
  10. package/dist/elements/drag-n-drop.js.map +1 -0
  11. package/dist/elements/urdf-controller-element.d.ts +12 -0
  12. package/dist/elements/urdf-controller-element.js +283 -0
  13. package/dist/elements/urdf-controller-element.js.map +1 -0
  14. package/dist/elements/urdf-drag-controls.d.ts +32 -0
  15. package/dist/elements/urdf-drag-controls.js +185 -0
  16. package/dist/elements/urdf-drag-controls.js.map +1 -0
  17. package/dist/elements/urdf-manipulator-element.d.ts +15 -0
  18. package/dist/elements/urdf-manipulator-element.js +110 -0
  19. package/dist/elements/urdf-manipulator-element.js.map +1 -0
  20. package/dist/elements/urdf-viewer-element.d.ts +53 -0
  21. package/dist/elements/urdf-viewer-element.js +401 -0
  22. package/dist/elements/urdf-viewer-element.js.map +1 -0
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +3 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/templates/index.d.ts +14 -0
  27. package/dist/templates/index.js +4 -0
  28. package/dist/templates/index.js.map +1 -0
  29. package/dist/templates/urdf-controller.d.ts +14 -0
  30. package/dist/templates/urdf-controller.js +16 -0
  31. package/dist/templates/urdf-controller.js.map +1 -0
  32. package/dist/templates/urdf-viewer.d.ts +14 -0
  33. package/dist/templates/urdf-viewer.js +16 -0
  34. package/dist/templates/urdf-viewer.js.map +1 -0
  35. package/dist/urdf-controller.d.ts +27 -0
  36. package/dist/urdf-controller.js +65 -0
  37. package/dist/urdf-controller.js.map +1 -0
  38. package/dist/urdf-viewer.d.ts +50 -0
  39. package/dist/urdf-viewer.js +198 -0
  40. package/dist/urdf-viewer.js.map +1 -0
  41. package/icons/urdf-controller.png +0 -0
  42. package/icons/urdf-viewer.png +0 -0
  43. package/package.json +66 -0
  44. package/src/editors/index.ts +0 -0
  45. package/src/elements/drag-n-drop.ts +142 -0
  46. package/src/elements/urdf-controller-element.ts +297 -0
  47. package/src/elements/urdf-drag-controls.ts +248 -0
  48. package/src/elements/urdf-manipulator-element.ts +133 -0
  49. package/src/elements/urdf-viewer-element.ts +495 -0
  50. package/src/index.ts +2 -0
  51. package/src/templates/index.ts +4 -0
  52. package/src/templates/urdf-controller.ts +16 -0
  53. package/src/templates/urdf-viewer.ts +16 -0
  54. package/src/urdf-controller.ts +82 -0
  55. package/src/urdf-viewer.ts +249 -0
  56. package/things-scene.config.js +7 -0
  57. package/translations/en.json +16 -0
  58. package/translations/ko.json +16 -0
  59. package/translations/ms.json +16 -0
  60. package/translations/zh.json +16 -0
  61. package/tsconfig.json +22 -0
  62. package/tsconfig.tsbuildinfo +1 -0
  63. package/web-dev-server.config.mjs +27 -0
@@ -0,0 +1,401 @@
1
+ import * as THREE from 'three';
2
+ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
3
+ import URDFLoader from 'urdf-loader/src/URDFLoader';
4
+ import { XacroLoader } from 'xacro-parser';
5
+ // urdf-viewer element
6
+ // Loads and displays a 3D view of a URDF-formatted robot
7
+ // Events
8
+ // urdf-change: Fires when the URDF has finished loading and getting processed
9
+ // urdf-processed: Fires when the URDF has finished loading and getting processed
10
+ // geometry-loaded: Fires when all the geometry has been fully loaded
11
+ // ignore-limits-change: Fires when the 'ignore-limits' attribute changes
12
+ // angle-change: Fires when an angle changes
13
+ export default class URDFViewerElement extends HTMLElement {
14
+ static get observedAttributes() {
15
+ return ['package', 'urdf', 'up', 'display-shadow', 'ambient-color', 'ignore-limits', 'no-auto-recenter'];
16
+ }
17
+ get package() {
18
+ return this.getAttribute('package') || '';
19
+ }
20
+ set package(val) {
21
+ this.setAttribute('package', val);
22
+ }
23
+ get urdf() {
24
+ return this.getAttribute('urdf') || '';
25
+ }
26
+ set urdf(val) {
27
+ this.setAttribute('urdf', val);
28
+ }
29
+ get ignoreLimits() {
30
+ return this.hasAttribute('ignore-limits') || false;
31
+ }
32
+ set ignoreLimits(val) {
33
+ val ? this.setAttribute('ignore-limits', String(val)) : this.removeAttribute('ignore-limits');
34
+ }
35
+ get up() {
36
+ return this.getAttribute('up') || '+Z';
37
+ }
38
+ set up(val) {
39
+ this.setAttribute('up', val);
40
+ }
41
+ get displayShadow() {
42
+ return this.hasAttribute('display-shadow') || false;
43
+ }
44
+ set displayShadow(val) {
45
+ val ? this.setAttribute('display-shadow', '') : this.removeAttribute('display-shadow');
46
+ }
47
+ get ambientColor() {
48
+ return this.getAttribute('ambient-color') || '#455A64';
49
+ }
50
+ set ambientColor(val) {
51
+ val ? this.setAttribute('ambient-color', val) : this.removeAttribute('ambient-color');
52
+ }
53
+ get noAutoRecenter() {
54
+ return this.hasAttribute('no-auto-recenter') || false;
55
+ }
56
+ set noAutoRecenter(val) {
57
+ val ? this.setAttribute('no-auto-recenter', String(true)) : this.removeAttribute('no-auto-recenter');
58
+ }
59
+ get jointValues() {
60
+ const values = {};
61
+ if (this.robot) {
62
+ for (const name in this.robot.joints) {
63
+ const joint = this.robot.joints[name];
64
+ values[name] = joint.jointValue.length === 1 ? joint.angle : [...joint.jointValue];
65
+ }
66
+ }
67
+ return values;
68
+ }
69
+ set jointValues(val) {
70
+ this.setJointValues(val);
71
+ }
72
+ get angles() {
73
+ return this.jointValues;
74
+ }
75
+ set angles(v) {
76
+ this.jointValues = v;
77
+ }
78
+ /* Lifecycle Functions */
79
+ constructor() {
80
+ super();
81
+ this._requestId = 0;
82
+ this._dirty = true;
83
+ this._loadScheduled = false;
84
+ const scene = new THREE.Scene();
85
+ const ambientLight = new THREE.HemisphereLight(this.ambientColor, '#000');
86
+ ambientLight.groundColor.lerp(ambientLight.color, 0.5);
87
+ ambientLight.intensity = 0.5;
88
+ ambientLight.position.set(0, 1, 0);
89
+ scene.add(ambientLight);
90
+ // Light setup
91
+ const dirLight = new THREE.DirectionalLight(0xffffff);
92
+ dirLight.position.set(4, 10, 1);
93
+ dirLight.shadow.mapSize.width = 2048;
94
+ dirLight.shadow.mapSize.height = 2048;
95
+ dirLight.shadow.normalBias = 0.001;
96
+ dirLight.castShadow = true;
97
+ scene.add(dirLight);
98
+ scene.add(dirLight.target);
99
+ // Renderer setup
100
+ const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
101
+ renderer.setClearColor(0xffffff);
102
+ renderer.setClearAlpha(0);
103
+ renderer.shadowMap.enabled = true;
104
+ renderer.shadowMap.type = THREE.PCFSoftShadowMap;
105
+ renderer.outputEncoding = THREE.sRGBEncoding;
106
+ // Camera setup
107
+ const camera = new THREE.PerspectiveCamera(75, 1, 0.1, 1000);
108
+ camera.position.z = -10;
109
+ // World setup
110
+ const world = new THREE.Object3D();
111
+ scene.add(world);
112
+ const plane = new THREE.Mesh(new THREE.PlaneBufferGeometry(40, 40), new THREE.ShadowMaterial({ side: THREE.DoubleSide, transparent: true, opacity: 0.5 }));
113
+ plane.rotation.x = -Math.PI / 2;
114
+ plane.position.y = -0.5;
115
+ plane.receiveShadow = true;
116
+ plane.scale.set(10, 10, 10);
117
+ scene.add(plane);
118
+ // Controls setup
119
+ const controls = new OrbitControls(camera, renderer.domElement);
120
+ controls.rotateSpeed = 2.0;
121
+ controls.zoomSpeed = 5;
122
+ controls.panSpeed = 2;
123
+ controls.enableZoom = true;
124
+ controls.enableDamping = false;
125
+ controls.maxDistance = 50;
126
+ controls.minDistance = 0.25;
127
+ controls.addEventListener('change', () => this.recenter());
128
+ this.scene = scene;
129
+ this.world = world;
130
+ this.renderer = renderer;
131
+ this.camera = camera;
132
+ this.controls = controls;
133
+ this.plane = plane;
134
+ this.directionalLight = dirLight;
135
+ this.ambientLight = ambientLight;
136
+ this._setUp(this.up);
137
+ }
138
+ connectedCallback() {
139
+ if (!this.querySelector('canvas')) {
140
+ var canvas = this.renderer.domElement;
141
+ canvas.style.display = 'block';
142
+ canvas.style.width = '100%';
143
+ canvas.style.height = '100%';
144
+ this.appendChild(canvas);
145
+ }
146
+ requestAnimationFrame(() => this.recenter());
147
+ }
148
+ disconnectedCallback() { }
149
+ attributeChangedCallback(attr, oldval, newval) {
150
+ this.recenter();
151
+ switch (attr) {
152
+ case 'package':
153
+ case 'urdf': {
154
+ this._scheduleLoad();
155
+ break;
156
+ }
157
+ case 'up': {
158
+ this._setUp(this.up);
159
+ break;
160
+ }
161
+ case 'ambient-color': {
162
+ this.ambientLight.color.set(this.ambientColor);
163
+ this.ambientLight.groundColor.set('#000').lerp(this.ambientLight.color, 0.5);
164
+ break;
165
+ }
166
+ case 'ignore-limits': {
167
+ this._setIgnoreLimits(this.ignoreLimits, true);
168
+ break;
169
+ }
170
+ }
171
+ }
172
+ /* Public API */
173
+ updateSize() {
174
+ const r = this.renderer;
175
+ const w = this.clientWidth;
176
+ const h = this.clientHeight;
177
+ const currsize = r.getSize(new THREE.Vector2());
178
+ if (currsize.width !== w || currsize.height !== h) {
179
+ this.recenter();
180
+ }
181
+ r.setPixelRatio(window.devicePixelRatio);
182
+ r.setSize(w, h, false);
183
+ this.camera.aspect = w / h;
184
+ this.camera.updateProjectionMatrix();
185
+ }
186
+ redraw() {
187
+ if (this.parentNode && this._dirty) {
188
+ this._dirty = false;
189
+ try {
190
+ this.updateSize();
191
+ if (!this.noAutoRecenter) {
192
+ this._updateEnvironment();
193
+ }
194
+ this.renderer.render(this.scene, this.camera);
195
+ // update controls after the environment in
196
+ // case the controls are retargeted
197
+ this.controls.update();
198
+ }
199
+ catch (err) {
200
+ console.error(err);
201
+ }
202
+ finally {
203
+ this._dirty = true;
204
+ }
205
+ }
206
+ }
207
+ recenter() {
208
+ this._updateEnvironment();
209
+ this.redraw();
210
+ }
211
+ // Set the joint with jointName to
212
+ // angle in degrees
213
+ setJointValue(jointName, ...values) {
214
+ if (!this.robot)
215
+ return;
216
+ if (!this.robot.joints[jointName])
217
+ return;
218
+ if (this.robot.joints[jointName].setJointValue(values[0], values[1], values[2])) {
219
+ this.redraw();
220
+ this.dispatchEvent(new CustomEvent('angle-change', { bubbles: true, cancelable: true, detail: jointName }));
221
+ }
222
+ }
223
+ setJointValues(values) {
224
+ for (const name in values)
225
+ this.setJointValue(name, values[name]);
226
+ }
227
+ /* Private Functions */
228
+ // Updates the position of the plane to be at the
229
+ // lowest point below the robot and focuses the
230
+ // camera on the center of the scene
231
+ _updateEnvironment() {
232
+ if (!this.robot)
233
+ return;
234
+ this.world.updateMatrixWorld();
235
+ const bbox = new THREE.Box3();
236
+ bbox.setFromObject(this.robot);
237
+ const center = bbox.getCenter(new THREE.Vector3());
238
+ this.controls.target.y = center.y;
239
+ this.plane.position.y = bbox.min.y - 1e-3;
240
+ const dirLight = this.directionalLight;
241
+ dirLight.castShadow = this.displayShadow;
242
+ if (this.displayShadow) {
243
+ // Update the shadow camera rendering bounds to encapsulate the
244
+ // model. We use the bounding sphere of the bounding box for
245
+ // simplicity -- this could be a tighter fit.
246
+ const sphere = bbox.getBoundingSphere(new THREE.Sphere());
247
+ const minmax = sphere.radius;
248
+ const cam = dirLight.shadow.camera;
249
+ cam.left = cam.bottom = -minmax;
250
+ cam.right = cam.top = minmax;
251
+ // Update the camera to focus on the center of the model so the
252
+ // shadow can encapsulate it
253
+ const offset = dirLight.position.clone().sub(dirLight.target.position);
254
+ dirLight.target.position.copy(center);
255
+ dirLight.position.copy(center).add(offset);
256
+ cam.updateProjectionMatrix();
257
+ }
258
+ }
259
+ _scheduleLoad() {
260
+ // if our current model is already what's being requested
261
+ // or has been loaded then early out
262
+ if (this._prevload === `${this.package}|${this.urdf}`)
263
+ return;
264
+ this._prevload = `${this.package}|${this.urdf}`;
265
+ // if we're already waiting on a load then early out
266
+ if (this._loadScheduled)
267
+ return;
268
+ this._loadScheduled = true;
269
+ if (this.robot) {
270
+ this.robot.traverse((c) => c.dispose && c.dispose());
271
+ this.robot.parent.remove(this.robot);
272
+ delete this.robot;
273
+ }
274
+ requestAnimationFrame(() => {
275
+ this._loadUrdf(this.package, this.urdf);
276
+ this._loadScheduled = false;
277
+ });
278
+ }
279
+ // Watch the package and urdf field and load the robot model.
280
+ // This should _only_ be called from _scheduleLoad because that
281
+ // ensures the that current robot has been removed
282
+ _loadUrdf(pkg, urdf) {
283
+ this.dispatchEvent(new CustomEvent('urdf-change', { bubbles: true, cancelable: true, composed: true }));
284
+ if (urdf) {
285
+ // Keep track of this request and make
286
+ // sure it doesn't get overwritten by
287
+ // a subsequent one
288
+ this._requestId++;
289
+ const requestId = this._requestId;
290
+ const updateMaterials = (mesh) => {
291
+ mesh.traverse(c => {
292
+ if (c.isMesh) {
293
+ c.castShadow = true;
294
+ c.receiveShadow = true;
295
+ if (c.material) {
296
+ const mats = (Array.isArray(c.material) ? c.material : [c.material]).map((m) => {
297
+ if (m instanceof THREE.MeshBasicMaterial) {
298
+ m = new THREE.MeshPhongMaterial();
299
+ }
300
+ if (m.map) {
301
+ m.map.encoding = THREE.GammaEncoding;
302
+ }
303
+ return m;
304
+ });
305
+ c.material = mats.length === 1 ? mats[0] : mats;
306
+ }
307
+ }
308
+ });
309
+ };
310
+ if (pkg.includes(':') && pkg.split(':')[1].substring(0, 2) !== '//') {
311
+ // E.g. pkg = "pkg_name: path/to/pkg_name, pk2: path2/to/pk2"}
312
+ // Convert pkg(s) into a map. E.g.
313
+ // { "pkg_name": "path/to/pkg_name",
314
+ // "pk2": "path2/to/pk2" }
315
+ pkg = pkg.split(',').reduce((map, value) => {
316
+ const split = value.split(/:/).filter(x => !!x);
317
+ const pkgName = split.shift().trim();
318
+ const pkgPath = split.join(':').trim();
319
+ map[pkgName] = pkgPath;
320
+ return map;
321
+ }, {});
322
+ }
323
+ let robot;
324
+ const manager = new THREE.LoadingManager();
325
+ manager.onLoad = () => {
326
+ // If another request has come in to load a new
327
+ // robot, then ignore this one
328
+ if (this._requestId !== requestId) {
329
+ robot.traverse(c => c.dispose && c.dispose());
330
+ return;
331
+ }
332
+ this.robot = robot;
333
+ this.world.add(robot);
334
+ updateMaterials(robot);
335
+ this._setIgnoreLimits(this.ignoreLimits);
336
+ this.dispatchEvent(new CustomEvent('urdf-processed', { bubbles: true, cancelable: true, composed: true }));
337
+ this.dispatchEvent(new CustomEvent('geometry-loaded', { bubbles: true, cancelable: true, composed: true }));
338
+ this.recenter();
339
+ };
340
+ if (this.urlModifierFunc) {
341
+ manager.setURLModifier(this.urlModifierFunc);
342
+ }
343
+ const checkXacro = /[.]/.exec(urdf) ? /[^.]+$/.exec(urdf) : undefined;
344
+ if (checkXacro && checkXacro[0] === 'xacro') {
345
+ const xacroLoader = new XacroLoader();
346
+ try {
347
+ xacroLoader.load(urdf, xml => {
348
+ const loader = new URDFLoader(manager);
349
+ loader.packages = pkg;
350
+ loader.loadMeshCb = this.loadMeshFunc;
351
+ loader.fetchOptions = { mode: 'cors', credentials: 'same-origin' };
352
+ robot = loader.parse(xml);
353
+ }, err => {
354
+ console.error('xacroloader error: ', err);
355
+ });
356
+ }
357
+ catch (error) {
358
+ console.error(error);
359
+ }
360
+ }
361
+ else {
362
+ const loader = new URDFLoader(manager);
363
+ loader.packages = pkg;
364
+ loader.loadMeshCb = this.loadMeshFunc;
365
+ loader.fetchOptions = { mode: 'cors', credentials: 'same-origin' };
366
+ loader.load(urdf, model => (robot = model));
367
+ }
368
+ }
369
+ }
370
+ // Watch the coordinate frame and update the
371
+ // rotation of the scene to match
372
+ _setUp(up) {
373
+ if (!up)
374
+ up = '+Z';
375
+ up = up.toUpperCase();
376
+ const sign = up.replace(/[^-+]/g, '')[0] || '+';
377
+ const axis = up.replace(/[^XYZ]/gi, '')[0] || 'Z';
378
+ const PI = Math.PI;
379
+ const HALFPI = PI / 2;
380
+ if (axis === 'X')
381
+ this.world.rotation.set(0, 0, sign === '+' ? HALFPI : -HALFPI);
382
+ if (axis === 'Z')
383
+ this.world.rotation.set(sign === '+' ? -HALFPI : HALFPI, 0, 0);
384
+ if (axis === 'Y')
385
+ this.world.rotation.set(sign === '+' ? 0 : PI, 0, 0);
386
+ }
387
+ // Updates the current robot's angles to ignore
388
+ // joint limits or not
389
+ _setIgnoreLimits(ignore, dispatch = false) {
390
+ if (this.robot) {
391
+ Object.values(this.robot.joints).forEach(joint => {
392
+ joint.ignoreLimits = ignore;
393
+ joint.setJointValue(joint.jointValue[0], joint.jointValue[1], joint.jointValue[2]);
394
+ });
395
+ }
396
+ if (dispatch) {
397
+ this.dispatchEvent(new CustomEvent('ignore-limits-change', { bubbles: true, cancelable: true, composed: true }));
398
+ }
399
+ }
400
+ }
401
+ //# sourceMappingURL=urdf-viewer-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urdf-viewer-element.js","sourceRoot":"","sources":["../../src/elements/urdf-viewer-element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAA;AACzE,OAAO,UAAoC,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,sBAAsB;AACtB,yDAAyD;AAEzD,SAAS;AACT,8EAA8E;AAC9E,iFAAiF;AACjF,qEAAqE;AACrE,yEAAyE;AACzE,4CAA4C;AAC5C,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,MAAM,KAAK,kBAAkB;QAC3B,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAA;IAC1G,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;IAC3C,CAAC;IACD,IAAI,OAAO,CAAC,GAAG;QACb,IAAI,CAAC,YAAY,CA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,EAAE,CAAC,CAAC,CAAA;SACjH;IACH,CAAC;CACF","sourcesContent":["import * as THREE from 'three'\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'\nimport URDFLoader, { URDFJoint, URDFRobot } from 'urdf-loader/src/URDFLoader'\nimport { XacroLoader } from 'xacro-parser'\n\n// urdf-viewer element\n// Loads and displays a 3D view of a URDF-formatted robot\n\n// Events\n// urdf-change: Fires when the URDF has finished loading and getting processed\n// urdf-processed: Fires when the URDF has finished loading and getting processed\n// geometry-loaded: Fires when all the geometry has been fully loaded\n// ignore-limits-change: Fires when the 'ignore-limits' attribute changes\n// angle-change: Fires when an angle changes\nexport default class URDFViewerElement extends HTMLElement {\n static get observedAttributes() {\n return ['package', 'urdf', 'up', 'display-shadow', 'ambient-color', 'ignore-limits', 'no-auto-recenter']\n }\n\n get package() {\n return this.getAttribute('package') || ''\n }\n set package(val) {\n this.setAttribute('package', val)\n }\n\n get urdf() {\n return this.getAttribute('urdf') || ''\n }\n set urdf(val) {\n this.setAttribute('urdf', val)\n }\n\n get ignoreLimits() {\n return this.hasAttribute('ignore-limits') || false\n }\n set ignoreLimits(val) {\n val ? this.setAttribute('ignore-limits', String(val)) : this.removeAttribute('ignore-limits')\n }\n\n get up() {\n return this.getAttribute('up') || '+Z'\n }\n set up(val) {\n this.setAttribute('up', val)\n }\n\n get displayShadow() {\n return this.hasAttribute('display-shadow') || false\n }\n set displayShadow(val) {\n val ? this.setAttribute('display-shadow', '') : this.removeAttribute('display-shadow')\n }\n\n get ambientColor() {\n return this.getAttribute('ambient-color') || '#455A64'\n }\n set ambientColor(val) {\n val ? this.setAttribute('ambient-color', val) : this.removeAttribute('ambient-color')\n }\n\n get noAutoRecenter() {\n return this.hasAttribute('no-auto-recenter') || false\n }\n set noAutoRecenter(val) {\n val ? this.setAttribute('no-auto-recenter', String(true)) : this.removeAttribute('no-auto-recenter')\n }\n\n get jointValues() {\n const values = {} as any\n if (this.robot) {\n for (const name in this.robot.joints) {\n const joint = this.robot.joints[name]\n values[name] = joint.jointValue.length === 1 ? joint.angle : [...joint.jointValue]\n }\n }\n\n return values\n }\n set jointValues(val) {\n this.setJointValues(val)\n }\n\n get angles() {\n return this.jointValues\n }\n set angles(v) {\n this.jointValues = v\n }\n\n robot?: URDFRobot\n controls: OrbitControls\n scene: THREE.Scene\n camera: THREE.PerspectiveCamera\n\n world: THREE.Object3D\n renderer: THREE.WebGLRenderer\n plane: THREE.Mesh\n directionalLight: THREE.DirectionalLight\n ambientLight: THREE.HemisphereLight\n\n _prevload?: string\n _requestId = 0\n _dirty = true\n _loadScheduled = false\n loadMeshFunc?: (\n url: string,\n manager: THREE.LoadingManager,\n onLoad: (mesh: THREE.Object3D, err?: Error) => void\n ) => void\n urlModifierFunc?: (url: string) => string\n\n /* Lifecycle Functions */\n constructor() {\n super()\n\n const scene = new THREE.Scene()\n\n const ambientLight = new THREE.HemisphereLight(this.ambientColor, '#000')\n ambientLight.groundColor.lerp(ambientLight.color, 0.5)\n ambientLight.intensity = 0.5\n ambientLight.position.set(0, 1, 0)\n scene.add(ambientLight)\n\n // Light setup\n const dirLight = new THREE.DirectionalLight(0xffffff)\n dirLight.position.set(4, 10, 1)\n dirLight.shadow.mapSize.width = 2048\n dirLight.shadow.mapSize.height = 2048\n dirLight.shadow.normalBias = 0.001\n dirLight.castShadow = true\n scene.add(dirLight)\n scene.add(dirLight.target)\n\n // Renderer setup\n const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true })\n renderer.setClearColor(0xffffff)\n renderer.setClearAlpha(0)\n renderer.shadowMap.enabled = true\n renderer.shadowMap.type = THREE.PCFSoftShadowMap\n renderer.outputEncoding = THREE.sRGBEncoding\n\n // Camera setup\n const camera = new THREE.PerspectiveCamera(75, 1, 0.1, 1000)\n camera.position.z = -10\n\n // World setup\n const world = new THREE.Object3D()\n scene.add(world)\n\n const plane = new THREE.Mesh(\n new THREE.PlaneBufferGeometry(40, 40),\n new THREE.ShadowMaterial({ side: THREE.DoubleSide, transparent: true, opacity: 0.5 })\n )\n plane.rotation.x = -Math.PI / 2\n plane.position.y = -0.5\n plane.receiveShadow = true\n plane.scale.set(10, 10, 10)\n scene.add(plane)\n\n // Controls setup\n const controls = new OrbitControls(camera, renderer.domElement)\n controls.rotateSpeed = 2.0\n controls.zoomSpeed = 5\n controls.panSpeed = 2\n controls.enableZoom = true\n controls.enableDamping = false\n controls.maxDistance = 50\n controls.minDistance = 0.25\n controls.addEventListener('change', () => this.recenter())\n\n this.scene = scene\n this.world = world\n this.renderer = renderer\n this.camera = camera\n this.controls = controls\n this.plane = plane\n this.directionalLight = dirLight\n this.ambientLight = ambientLight\n\n this._setUp(this.up)\n }\n\n connectedCallback() {\n if (!this.querySelector('canvas')) {\n var canvas = this.renderer.domElement\n canvas.style.display = 'block'\n canvas.style.width = '100%'\n canvas.style.height = '100%'\n\n this.appendChild(canvas)\n }\n\n requestAnimationFrame(() => this.recenter())\n }\n\n disconnectedCallback() {}\n\n attributeChangedCallback(attr: string, oldval: any, newval: any) {\n this.recenter()\n\n switch (attr) {\n case 'package':\n case 'urdf': {\n this._scheduleLoad()\n break\n }\n\n case 'up': {\n this._setUp(this.up)\n break\n }\n\n case 'ambient-color': {\n this.ambientLight.color.set(this.ambientColor)\n this.ambientLight.groundColor.set('#000').lerp(this.ambientLight.color, 0.5)\n break\n }\n\n case 'ignore-limits': {\n this._setIgnoreLimits(this.ignoreLimits, true)\n break\n }\n }\n }\n\n /* Public API */\n updateSize() {\n const r = this.renderer\n const w = this.clientWidth\n const h = this.clientHeight\n\n const currsize = r.getSize(new THREE.Vector2())\n\n if (currsize.width !== w || currsize.height !== h) {\n this.recenter()\n }\n\n r.setPixelRatio(window.devicePixelRatio)\n r.setSize(w, h, false)\n\n this.camera.aspect = w / h\n this.camera.updateProjectionMatrix()\n }\n\n redraw() {\n if (this.parentNode && this._dirty) {\n this._dirty = false\n try {\n this.updateSize()\n\n if (!this.noAutoRecenter) {\n this._updateEnvironment()\n }\n\n this.renderer.render(this.scene, this.camera)\n\n // update controls after the environment in\n // case the controls are retargeted\n this.controls.update()\n } catch (err) {\n console.error(err)\n } finally {\n this._dirty = true\n }\n }\n }\n\n recenter() {\n this._updateEnvironment()\n this.redraw()\n }\n\n // Set the joint with jointName to\n // angle in degrees\n setJointValue(jointName: string, ...values: Number[]) {\n if (!this.robot) return\n if (!this.robot.joints[jointName]) return\n\n if (this.robot.joints[jointName].setJointValue(values[0], values[1], values[2]) as any) {\n this.redraw()\n this.dispatchEvent(new CustomEvent('angle-change', { bubbles: true, cancelable: true, detail: jointName }))\n }\n }\n\n setJointValues(values: Number[]) {\n for (const name in values) this.setJointValue(name, values[name])\n }\n\n /* Private Functions */\n // Updates the position of the plane to be at the\n // lowest point below the robot and focuses the\n // camera on the center of the scene\n _updateEnvironment() {\n if (!this.robot) return\n\n this.world.updateMatrixWorld()\n\n const bbox = new THREE.Box3()\n bbox.setFromObject(this.robot)\n\n const center = bbox.getCenter(new THREE.Vector3())\n this.controls.target.y = center.y\n this.plane.position.y = bbox.min.y - 1e-3\n\n const dirLight = this.directionalLight\n dirLight.castShadow = this.displayShadow\n\n if (this.displayShadow) {\n // Update the shadow camera rendering bounds to encapsulate the\n // model. We use the bounding sphere of the bounding box for\n // simplicity -- this could be a tighter fit.\n const sphere = bbox.getBoundingSphere(new THREE.Sphere())\n const minmax = sphere.radius\n const cam = dirLight.shadow.camera\n cam.left = cam.bottom = -minmax\n cam.right = cam.top = minmax\n\n // Update the camera to focus on the center of the model so the\n // shadow can encapsulate it\n const offset = dirLight.position.clone().sub(dirLight.target.position)\n dirLight.target.position.copy(center)\n dirLight.position.copy(center).add(offset)\n\n cam.updateProjectionMatrix()\n }\n }\n\n _scheduleLoad() {\n // if our current model is already what's being requested\n // or has been loaded then early out\n if (this._prevload === `${this.package}|${this.urdf}`) return\n this._prevload = `${this.package}|${this.urdf}`\n\n // if we're already waiting on a load then early out\n if (this._loadScheduled) return\n this._loadScheduled = true\n\n if (this.robot) {\n this.robot.traverse((c: any) => c.dispose && c.dispose())\n this.robot.parent!.remove(this.robot)\n delete this.robot\n }\n\n requestAnimationFrame(() => {\n this._loadUrdf(this.package, this.urdf)\n this._loadScheduled = false\n })\n }\n\n // Watch the package and urdf field and load the robot model.\n // This should _only_ be called from _scheduleLoad because that\n // ensures the that current robot has been removed\n _loadUrdf(pkg: string, urdf: string) {\n this.dispatchEvent(new CustomEvent('urdf-change', { bubbles: true, cancelable: true, composed: true }))\n\n if (urdf) {\n // Keep track of this request and make\n // sure it doesn't get overwritten by\n // a subsequent one\n this._requestId++\n const requestId = this._requestId\n\n const updateMaterials = (mesh: URDFRobot) => {\n mesh.traverse(c => {\n if ((c as any).isMesh) {\n c.castShadow = true\n c.receiveShadow = true\n\n if ((c as any).material) {\n const mats = (Array.isArray((c as any).material) ? (c as any).material : [(c as any).material]).map(\n (m: any) => {\n if (m instanceof THREE.MeshBasicMaterial) {\n m = new THREE.MeshPhongMaterial()\n }\n\n if (m.map) {\n m.map.encoding = THREE.GammaEncoding\n }\n\n return m\n }\n )\n\n ;(c as any).material = mats.length === 1 ? mats[0] : mats\n }\n }\n })\n }\n\n if (pkg.includes(':') && pkg.split(':')[1].substring(0, 2) !== '//') {\n // E.g. pkg = \"pkg_name: path/to/pkg_name, pk2: path2/to/pk2\"}\n\n // Convert pkg(s) into a map. E.g.\n // { \"pkg_name\": \"path/to/pkg_name\",\n // \"pk2\": \"path2/to/pk2\" }\n\n pkg = pkg.split(',').reduce((map: any, value: string) => {\n const split = value.split(/:/).filter(x => !!x)\n const pkgName = split.shift()!.trim()\n const pkgPath = split.join(':').trim()\n map[pkgName] = pkgPath\n\n return map\n }, {} as any)\n }\n\n let robot: URDFRobot\n const manager = new THREE.LoadingManager()\n manager.onLoad = () => {\n // If another request has come in to load a new\n // robot, then ignore this one\n if (this._requestId !== requestId) {\n robot.traverse(c => (c as any).dispose && (c as any).dispose())\n return\n }\n\n this.robot = robot\n\n this.world.add(robot)\n updateMaterials(robot)\n\n this._setIgnoreLimits(this.ignoreLimits)\n\n this.dispatchEvent(new CustomEvent('urdf-processed', { bubbles: true, cancelable: true, composed: true }))\n this.dispatchEvent(new CustomEvent('geometry-loaded', { bubbles: true, cancelable: true, composed: true }))\n\n this.recenter()\n }\n\n if (this.urlModifierFunc) {\n manager.setURLModifier(this.urlModifierFunc)\n }\n\n const checkXacro = /[.]/.exec(urdf) ? /[^.]+$/.exec(urdf) : undefined\n\n if (checkXacro && checkXacro[0] === 'xacro') {\n const xacroLoader = new XacroLoader()\n try {\n xacroLoader.load(\n urdf,\n xml => {\n const loader = new URDFLoader(manager)\n loader.packages = pkg\n loader.loadMeshCb = this.loadMeshFunc!\n loader.fetchOptions = { mode: 'cors', credentials: 'same-origin' }\n robot = loader.parse(xml)\n },\n err => {\n console.error('xacroloader error: ', err)\n }\n )\n } catch (error) {\n console.error(error)\n }\n } else {\n const loader = new URDFLoader(manager)\n loader.packages = pkg\n loader.loadMeshCb = this.loadMeshFunc!\n loader.fetchOptions = { mode: 'cors', credentials: 'same-origin' }\n loader.load(urdf, model => (robot = model))\n }\n }\n }\n\n // Watch the coordinate frame and update the\n // rotation of the scene to match\n _setUp(up: string) {\n if (!up) up = '+Z'\n up = up.toUpperCase()\n const sign = up.replace(/[^-+]/g, '')[0] || '+'\n const axis = up.replace(/[^XYZ]/gi, '')[0] || 'Z'\n\n const PI = Math.PI\n const HALFPI = PI / 2\n if (axis === 'X') this.world.rotation.set(0, 0, sign === '+' ? HALFPI : -HALFPI)\n if (axis === 'Z') this.world.rotation.set(sign === '+' ? -HALFPI : HALFPI, 0, 0)\n if (axis === 'Y') this.world.rotation.set(sign === '+' ? 0 : PI, 0, 0)\n }\n\n // Updates the current robot's angles to ignore\n // joint limits or not\n _setIgnoreLimits(ignore: boolean, dispatch = false) {\n if (this.robot) {\n Object.values(this.robot.joints).forEach(joint => {\n joint.ignoreLimits = ignore\n joint.setJointValue(joint.jointValue[0], joint.jointValue[1], joint.jointValue[2])\n })\n }\n\n if (dispatch) {\n this.dispatchEvent(new CustomEvent('ignore-limits-change', { bubbles: true, cancelable: true, composed: true }))\n }\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { default as UrdfViewer } from './urdf-viewer';
2
+ export { default as UrdfController } from './urdf-controller';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { default as UrdfViewer } from './urdf-viewer';
2
+ export { default as UrdfController } from './urdf-controller';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["export { default as UrdfViewer } from './urdf-viewer'\nexport { default as UrdfController } from './urdf-controller'\n"]}
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ group: string;
5
+ icon: string;
6
+ model: {
7
+ type: string;
8
+ left: number;
9
+ top: number;
10
+ width: number;
11
+ height: number;
12
+ };
13
+ }[];
14
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import URDFViewer from './urdf-viewer';
2
+ import URDFController from './urdf-controller';
3
+ export default [URDFViewer, URDFController];
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,eAAe,CAAA;AACtC,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAE9C,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA","sourcesContent":["import URDFViewer from './urdf-viewer'\nimport URDFController from './urdf-controller'\n\nexport default [URDFViewer, URDFController]\n"]}
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ group: string;
5
+ icon: string;
6
+ model: {
7
+ type: string;
8
+ left: number;
9
+ top: number;
10
+ width: number;
11
+ height: number;
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,16 @@
1
+ const icon = new URL('../../icons/urdf-controller.png', import.meta.url).href;
2
+ export default {
3
+ type: 'urdf-controller',
4
+ description: 'urdf-controller',
5
+ group: '3D',
6
+ /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
7
+ icon,
8
+ model: {
9
+ type: 'urdf-controller',
10
+ left: 10,
11
+ top: 10,
12
+ width: 300,
13
+ height: 120
14
+ }
15
+ };
16
+ //# sourceMappingURL=urdf-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urdf-controller.js","sourceRoot":"","sources":["../../src/templates/urdf-controller.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,iCAAiC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE7E,eAAe;IACb,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,KAAK,EAAE,IAAI;IACX,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;KACZ;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/urdf-controller.png', import.meta.url).href\n\nexport default {\n type: 'urdf-controller',\n description: 'urdf-controller',\n group: '3D',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'urdf-controller',\n left: 10,\n top: 10,\n width: 300,\n height: 120\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ type: string;
3
+ description: string;
4
+ group: string;
5
+ icon: string;
6
+ model: {
7
+ type: string;
8
+ left: number;
9
+ top: number;
10
+ width: number;
11
+ height: number;
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,16 @@
1
+ const icon = new URL('../../icons/urdf-viewer.png', import.meta.url).href;
2
+ export default {
3
+ type: 'urdf-viewer',
4
+ description: 'urdf-viewer',
5
+ group: '3D',
6
+ /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
7
+ icon,
8
+ model: {
9
+ type: 'urdf-viewer',
10
+ left: 10,
11
+ top: 10,
12
+ width: 300,
13
+ height: 200
14
+ }
15
+ };
16
+ //# sourceMappingURL=urdf-viewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urdf-viewer.js","sourceRoot":"","sources":["../../src/templates/urdf-viewer.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEzE,eAAe;IACb,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,IAAI;IACX,gGAAgG;IAChG,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;KACZ;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/urdf-viewer.png', import.meta.url).href\n\nexport default {\n type: 'urdf-viewer',\n description: 'urdf-viewer',\n group: '3D',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */\n icon,\n model: {\n type: 'urdf-viewer',\n left: 10,\n top: 10,\n width: 300,\n height: 200\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { HTMLOverlayContainer } from '@hatiolab/things-scene';
2
+ import './elements/urdf-controller-element';
3
+ import URDFControllerElement from './elements/urdf-controller-element';
4
+ import UrdfViewer from './urdf-viewer';
5
+ export default class UrdfController extends HTMLOverlayContainer {
6
+ _reference?: UrdfViewer;
7
+ static get nature(): {
8
+ mutable: boolean;
9
+ resizable: boolean;
10
+ rotatable: boolean;
11
+ properties: {
12
+ type: string;
13
+ label: string;
14
+ name: string;
15
+ property: {
16
+ component: string;
17
+ };
18
+ }[];
19
+ };
20
+ oncreate_element(controller: URDFControllerElement): void;
21
+ dispose(): void;
22
+ setElementProperties(controller: URDFControllerElement): void;
23
+ reposition(): void;
24
+ get tagName(): string;
25
+ get reference(): UrdfViewer | undefined;
26
+ set reference(reference: UrdfViewer | undefined);
27
+ }