From dedf65d089d6da08f687946344dd28b4fb983e22 Mon Sep 17 00:00:00 2001 From: Dave Kozma Date: Wed, 13 Nov 2024 09:59:42 -0500 Subject: [PATCH 1/3] Added missing joint limit and link inertial data --- javascript/src/URDFClasses.d.ts | 11 ++++++++- javascript/src/URDFClasses.js | 6 ++++- javascript/src/URDFLoader.js | 40 +++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/javascript/src/URDFClasses.d.ts b/javascript/src/URDFClasses.d.ts index a49d2ac9..318f9a50 100644 --- a/javascript/src/URDFClasses.d.ts +++ b/javascript/src/URDFClasses.d.ts @@ -14,10 +14,19 @@ export interface URDFVisual extends Object3D { } +interface URDFInertial { + + origin: { xyz: Vector3 | null, rpy: Vector3 | null } | null; + mass: Number | null; + inertia: { ixx: Number, ixy: Number, ixz: Number, iyy: Number, iyz: Number, izz: Number } | null; + +} + export interface URDFLink extends Object3D { isURDFLink: true; urdfNode: Element | null; + inertial: URDFInertial | null; } @@ -30,7 +39,7 @@ export interface URDFJoint extends Object3D { jointType: 'fixed' | 'continuous' | 'revolute' | 'planar' | 'prismatic' | 'floating'; angle: Number; jointValue: Number[]; - limit: { lower: Number, upper: Number }; // TODO: add more + limit: { lower: Number, upper: Number, effort: Number | null, velocity: Number | null }; ignoreLimits: Boolean; mimicJoints: URDFMimicJoint[]; diff --git a/javascript/src/URDFClasses.js b/javascript/src/URDFClasses.js index ad10e286..7f970c7d 100644 --- a/javascript/src/URDFClasses.js +++ b/javascript/src/URDFClasses.js @@ -63,6 +63,8 @@ class URDFLink extends URDFBase { this.isURDFLink = true; this.type = 'URDFLink'; + this.inertial = null; + } } @@ -122,7 +124,7 @@ class URDFJoint extends URDFBase { this.jointValue = null; this.jointType = 'fixed'; this.axis = new Vector3(1, 0, 0); - this.limit = { lower: 0, upper: 0 }; + this.limit = { lower: 0, upper: 0, effort: null, velocity: null }; this.ignoreLimits = false; this.origPosition = null; @@ -141,6 +143,8 @@ class URDFJoint extends URDFBase { this.axis = source.axis.clone(); this.limit.lower = source.limit.lower; this.limit.upper = source.limit.upper; + this.limit.effort = source.limit.effort; + this.limit.velocity = source.limit.velocity; this.ignoreLimits = false; this.jointValue = [...source.jointValue]; diff --git a/javascript/src/URDFLoader.js b/javascript/src/URDFLoader.js index be67d7df..de4823ea 100644 --- a/javascript/src/URDFLoader.js +++ b/javascript/src/URDFLoader.js @@ -37,6 +37,14 @@ function processTuple(val) { } +// take a vector "x y z" and process it into +// a THREE.Vector3 +function processVector(val) { + + return new THREE.Vector3(...processTuple(val)); + +} + // applies a rotation a threejs object in URDF order function applyRotation(obj, rpy, additive = false) { @@ -371,6 +379,8 @@ class URDFLoader { obj.limit.lower = parseFloat(n.getAttribute('lower') || obj.limit.lower); obj.limit.upper = parseFloat(n.getAttribute('upper') || obj.limit.upper); + obj.limit.effort = parseFloat(n.getAttribute('effort') || obj.limit.effort); + obj.limit.velocity = parseFloat(n.getAttribute('velocity') || obj.limit.velocity); } }); @@ -410,6 +420,36 @@ class URDFLoader { target.urdfName = target.name; target.urdfNode = link; + // Extract the attributes + children.forEach(n => { + + const type = n.nodeName.toLowerCase(); + if (type === 'inertial') { + const subNodes = [ ...n.children ]; + const origin = subNodes.find(sn => sn.nodeName.toLowerCase() === 'origin'); + const xyz = origin ? origin.getAttribute('xyz') : null; + const rpy = origin ? origin.getAttribute('rpy') : null; + const mass = subNodes.find(sn => sn.nodeName.toLowerCase() === 'mass'); + const inertia = subNodes.find(sn => sn.nodeName.toLowerCase() === 'inertia'); + target.inertial = origin || mass || inertia ? { + origin: xyz || rpy ? { + xyz: xyz ? processVector(xyz) : null, + rpy: rpy ? processVector(rpy) : null, + } : null, + mass: mass ? parseFloat(mass.getAttribute('value') || 0) : null, + inertia: inertia ? { + ixx: parseFloat(inertia.getAttribute('ixx') || 0), + ixy: parseFloat(inertia.getAttribute('ixy') || 0), + ixz: parseFloat(inertia.getAttribute('ixz') || 0), + iyy: parseFloat(inertia.getAttribute('iyy') || 0), + iyz: parseFloat(inertia.getAttribute('iyz') || 0), + izz: parseFloat(inertia.getAttribute('izz') || 0), + } : null, + } : null; + + } + }); + if (parseVisual) { const visualNodes = children.filter(n => n.nodeName.toLowerCase() === 'visual'); From 98584475c25f613705bde3b47f56c5f203d59936 Mon Sep 17 00:00:00 2001 From: Dave Kozma Date: Thu, 21 Nov 2024 16:37:11 -0500 Subject: [PATCH 2/3] Add `meshPath` to track mesh loading, update UMD files --- javascript/src/URDFClasses.d.ts | 2 + javascript/src/URDFClasses.js | 2 + javascript/src/URDFLoader.js | 5 +- javascript/umd/URDFLoader.js | 155 ++++++++++++++++-- javascript/umd/URDFLoader.js.map | 2 +- javascript/umd/urdf-manipulator-element.js | 12 +- .../umd/urdf-manipulator-element.js.map | 2 +- javascript/umd/urdf-viewer-element.js | 26 ++- javascript/umd/urdf-viewer-element.js.map | 2 +- 9 files changed, 164 insertions(+), 44 deletions(-) diff --git a/javascript/src/URDFClasses.d.ts b/javascript/src/URDFClasses.d.ts index 318f9a50..159306c8 100644 --- a/javascript/src/URDFClasses.d.ts +++ b/javascript/src/URDFClasses.d.ts @@ -4,6 +4,7 @@ export interface URDFCollider extends Object3D { isURDFCollider: true; urdfNode: Element | null; + meshPath: string | null; } @@ -11,6 +12,7 @@ export interface URDFVisual extends Object3D { isURDFVisual: true; urdfNode: Element | null; + meshPath: string | null; } diff --git a/javascript/src/URDFClasses.js b/javascript/src/URDFClasses.js index 7f970c7d..9d172e24 100644 --- a/javascript/src/URDFClasses.js +++ b/javascript/src/URDFClasses.js @@ -38,6 +38,7 @@ class URDFCollider extends URDFBase { super(...args); this.isURDFCollider = true; this.type = 'URDFCollider'; + this.meshPath = null; } @@ -50,6 +51,7 @@ class URDFVisual extends URDFBase { super(...args); this.isURDFVisual = true; this.type = 'URDFVisual'; + this.meshPath = null; } diff --git a/javascript/src/URDFLoader.js b/javascript/src/URDFLoader.js index de4823ea..1fd07478 100644 --- a/javascript/src/URDFLoader.js +++ b/javascript/src/URDFLoader.js @@ -1,7 +1,7 @@ import * as THREE from 'three'; -import { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js'; import { ColladaLoader } from 'three/examples/jsm/loaders/ColladaLoader.js'; -import { URDFRobot, URDFJoint, URDFLink, URDFCollider, URDFVisual, URDFMimicJoint } from './URDFClasses.js'; +import { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js'; +import { URDFCollider, URDFJoint, URDFLink, URDFMimicJoint, URDFRobot, URDFVisual } from './URDFClasses.js'; /* Reference coordinate frames for THREE.js and ROS. @@ -584,6 +584,7 @@ class URDFLoader { // file path is null if a package directory is not provided. if (filePath !== null) { + group.meshPath = filePath; const scaleAttr = n.children[0].getAttribute('scale'); if (scaleAttr) { diff --git a/javascript/umd/URDFLoader.js b/javascript/umd/URDFLoader.js index 1b56a962..49054600 100644 --- a/javascript/umd/URDFLoader.js +++ b/javascript/umd/URDFLoader.js @@ -1,8 +1,8 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three'), require('three/examples/jsm/loaders/STLLoader.js'), require('three/examples/jsm/loaders/ColladaLoader.js')) : - typeof define === 'function' && define.amd ? define(['three', 'three/examples/jsm/loaders/STLLoader.js', 'three/examples/jsm/loaders/ColladaLoader.js'], factory) : + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three'), require('three/examples/jsm/loaders/ColladaLoader.js'), require('three/examples/jsm/loaders/STLLoader.js')) : + typeof define === 'function' && define.amd ? define(['three', 'three/examples/jsm/loaders/ColladaLoader.js', 'three/examples/jsm/loaders/STLLoader.js'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.URDFLoader = factory(global.THREE, global.THREE, global.THREE)); -}(this, (function (THREE, STLLoader_js, ColladaLoader_js) { 'use strict'; +})(this, (function (THREE, ColladaLoader_js, STLLoader_js) { 'use strict'; function _interopNamespace(e) { if (e && e.__esModule) return e; @@ -13,19 +13,25 @@ var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { - return e[k]; - } + get: function () { return e[k]; } }); } }); } - n['default'] = e; + n["default"] = e; return Object.freeze(n); } var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE); + const _tempAxis = new THREE.Vector3(); + const _tempEuler = new THREE.Euler(); + const _tempTransform = new THREE.Matrix4(); + const _tempOrigTransform = new THREE.Matrix4(); + const _tempQuat = new THREE.Quaternion(); + const _tempScale = new THREE.Vector3(1.0, 1.0, 1.0); + const _tempPosition = new THREE.Vector3(); + class URDFBase extends THREE.Object3D { constructor(...args) { @@ -56,6 +62,7 @@ super(...args); this.isURDFCollider = true; this.type = 'URDFCollider'; + this.meshPath = null; } @@ -68,6 +75,7 @@ super(...args); this.isURDFVisual = true; this.type = 'URDFVisual'; + this.meshPath = null; } @@ -81,6 +89,8 @@ this.isURDFLink = true; this.type = 'URDFLink'; + this.inertial = null; + } } @@ -111,7 +121,9 @@ break; case 'planar': - this.jointValue = new Array(2).fill(0); + // Planar joints are, 3dof: position XY and rotation Z. + this.jointValue = new Array(3).fill(0); + this.axis = new THREE.Vector3(0, 0, 1); break; case 'floating': @@ -138,7 +150,7 @@ this.jointValue = null; this.jointType = 'fixed'; this.axis = new THREE.Vector3(1, 0, 0); - this.limit = { lower: 0, upper: 0 }; + this.limit = { lower: 0, upper: 0, effort: null, velocity: null }; this.ignoreLimits = false; this.origPosition = null; @@ -157,6 +169,8 @@ this.axis = source.axis.clone(); this.limit.lower = source.limit.lower; this.limit.upper = source.limit.upper; + this.limit.effort = source.limit.effort; + this.limit.velocity = source.limit.velocity; this.ignoreLimits = false; this.jointValue = [...source.jointValue]; @@ -171,9 +185,14 @@ } /* Public Functions */ + /** + * @param {...number|null} values The joint value components to set, optionally null for no-op + * @returns {boolean} Whether the invocation of this function resulted in an actual change to the joint value + */ setJointValue(...values) { - values = values.map(v => parseFloat(v)); + // Parse all incoming values into numbers except null, which we treat as a no-op for that value component. + values = values.map(v => v === null ? null : parseFloat(v)); if (!this.origPosition || !this.origQuaternion) { @@ -243,7 +262,8 @@ } this.position.copy(this.origPosition); - this.position.addScaledVector(this.axis, pos); + _tempAxis.copy(this.axis).applyEuler(this.rotation); + this.position.addScaledVector(_tempAxis, pos); if (this.jointValue[0] !== pos) { @@ -259,10 +279,63 @@ } - case 'floating': - case 'planar': - // TODO: Support these joint types - console.warn(`'${ this.jointType }' joint not yet supported`); + case 'floating': { + + // no-op if all values are identical to existing value or are null + if (this.jointValue.every((value, index) => values[index] === value || values[index] === null)) return didUpdate; + // Floating joints have six degrees of freedom: X, Y, Z, R, P, Y. + this.jointValue[0] = values[0] !== null ? values[0] : this.jointValue[0]; + this.jointValue[1] = values[1] !== null ? values[1] : this.jointValue[1]; + this.jointValue[2] = values[2] !== null ? values[2] : this.jointValue[2]; + this.jointValue[3] = values[3] !== null ? values[3] : this.jointValue[3]; + this.jointValue[4] = values[4] !== null ? values[4] : this.jointValue[4]; + this.jointValue[5] = values[5] !== null ? values[5] : this.jointValue[5]; + + // Compose transform of joint origin and transform due to joint values + _tempOrigTransform.compose(this.origPosition, this.origQuaternion, _tempScale); + _tempQuat.setFromEuler( + _tempEuler.set( + this.jointValue[3], + this.jointValue[4], + this.jointValue[5], + 'XYZ', + ), + ); + _tempPosition.set(this.jointValue[0], this.jointValue[1], this.jointValue[2]); + _tempTransform.compose(_tempPosition, _tempQuat, _tempScale); + + // Calcualte new transform + _tempOrigTransform.premultiply(_tempTransform); + this.position.setFromMatrixPosition(_tempOrigTransform); + this.rotation.setFromRotationMatrix(_tempOrigTransform); + + this.matrixWorldNeedsUpdate = true; + return true; + } + + case 'planar': { + + // no-op if all values are identical to existing value or are null + if (this.jointValue.every((value, index) => values[index] === value || values[index] === null)) return didUpdate; + + this.jointValue[0] = values[0] !== null ? values[0] : this.jointValue[0]; + this.jointValue[1] = values[1] !== null ? values[1] : this.jointValue[1]; + this.jointValue[2] = values[2] !== null ? values[2] : this.jointValue[2]; + + // Compose transform of joint origin and transform due to joint values + _tempOrigTransform.compose(this.origPosition, this.origQuaternion, _tempScale); + _tempQuat.setFromAxisAngle(this.axis, this.jointValue[2]); + _tempPosition.set(this.jointValue[0], this.jointValue[1], 0.0); + _tempTransform.compose(_tempPosition, _tempQuat, _tempScale); + + // Calculate new transform + _tempOrigTransform.premultiply(_tempTransform); + this.position.setFromMatrixPosition(_tempOrigTransform); + this.rotation.setFromRotationMatrix(_tempOrigTransform); + + this.matrixWorldNeedsUpdate = true; + return true; + } } @@ -365,6 +438,11 @@ }); + // Repair mimic joint references once we've re-accumulated all our joint data + for (const joint in this.joints) { + this.joints[joint].mimicJoints = this.joints[joint].mimicJoints.map((mimicJoint) => this.joints[mimicJoint.name]); + } + this.frames = { ...this.colliders, ...this.visual, @@ -452,6 +530,14 @@ } + // take a vector "x y z" and process it into + // a THREE.Vector3 + function processVector(val) { + + return new THREE__namespace.Vector3(...processTuple(val)); + + } + // applies a rotation a threejs object in URDF order function applyRotation(obj, rpy, additive = false) { @@ -785,6 +871,8 @@ obj.limit.lower = parseFloat(n.getAttribute('lower') || obj.limit.lower); obj.limit.upper = parseFloat(n.getAttribute('upper') || obj.limit.upper); + obj.limit.effort = parseFloat(n.getAttribute('effort') || obj.limit.effort); + obj.limit.velocity = parseFloat(n.getAttribute('velocity') || obj.limit.velocity); } }); @@ -824,6 +912,36 @@ target.urdfName = target.name; target.urdfNode = link; + // Extract the attributes + children.forEach(n => { + + const type = n.nodeName.toLowerCase(); + if (type === 'inertial') { + const subNodes = [ ...n.children ]; + const origin = subNodes.find(sn => sn.nodeName.toLowerCase() === 'origin'); + const xyz = origin ? origin.getAttribute('xyz') : null; + const rpy = origin ? origin.getAttribute('rpy') : null; + const mass = subNodes.find(sn => sn.nodeName.toLowerCase() === 'mass'); + const inertia = subNodes.find(sn => sn.nodeName.toLowerCase() === 'inertia'); + target.inertial = origin || mass || inertia ? { + origin: xyz || rpy ? { + xyz: xyz ? processVector(xyz) : null, + rpy: rpy ? processVector(rpy) : null, + } : null, + mass: mass ? parseFloat(mass.getAttribute('value') || 0) : null, + inertia: inertia ? { + ixx: parseFloat(inertia.getAttribute('ixx') || 0), + ixy: parseFloat(inertia.getAttribute('ixy') || 0), + ixz: parseFloat(inertia.getAttribute('ixz') || 0), + iyy: parseFloat(inertia.getAttribute('iyy') || 0), + iyz: parseFloat(inertia.getAttribute('iyz') || 0), + izz: parseFloat(inertia.getAttribute('izz') || 0), + } : null, + } : null; + + } + }); + if (parseVisual) { const visualNodes = children.filter(n => n.nodeName.toLowerCase() === 'visual'); @@ -887,7 +1005,7 @@ .split(/\s/g) .map(v => parseFloat(v)); - material.color.setRGB(rgba[0], rgba[1], rgba[2]).convertSRGBToLinear(); + material.color.setRGB(rgba[0], rgba[1], rgba[2]); material.opacity = rgba[3]; material.transparent = rgba[3] < 1; material.depthWrite = !material.transparent; @@ -902,7 +1020,7 @@ const loader = new THREE__namespace.TextureLoader(manager); const filePath = resolvePath(filename); material.map = loader.load(filePath); - material.map.encoding = THREE__namespace.sRGBEncoding; + material.map.colorSpace = THREE__namespace.SRGBColorSpace; } @@ -958,6 +1076,7 @@ // file path is null if a package directory is not provided. if (filePath !== null) { + group.meshPath = filePath; const scaleAttr = n.children[0].getAttribute('scale'); if (scaleAttr) { @@ -1079,5 +1198,5 @@ return URDFLoader; -}))); +})); //# sourceMappingURL=URDFLoader.js.map diff --git a/javascript/umd/URDFLoader.js.map b/javascript/umd/URDFLoader.js.map index d72b93c3..30afe25b 100644 --- a/javascript/umd/URDFLoader.js.map +++ b/javascript/umd/URDFLoader.js.map @@ -1 +1 @@ -{"version":3,"file":"URDFLoader.js","sources":["../src/URDFClasses.js","../src/URDFLoader.js"],"sourcesContent":["import { Object3D, Vector3 } from 'three';\n\nclass URDFBase extends Object3D {\n\n constructor(...args) {\n\n super(...args);\n this.urdfNode = null;\n this.urdfName = '';\n\n }\n\n copy(source, recursive) {\n\n super.copy(source, recursive);\n\n this.urdfNode = source.urdfNode;\n this.urdfName = source.urdfName;\n\n return this;\n\n }\n\n}\n\nclass URDFCollider extends URDFBase {\n\n constructor(...args) {\n\n super(...args);\n this.isURDFCollider = true;\n this.type = 'URDFCollider';\n\n }\n\n}\n\nclass URDFVisual extends URDFBase {\n\n constructor(...args) {\n\n super(...args);\n this.isURDFVisual = true;\n this.type = 'URDFVisual';\n\n }\n\n}\n\nclass URDFLink extends URDFBase {\n\n constructor(...args) {\n\n super(...args);\n this.isURDFLink = true;\n this.type = 'URDFLink';\n\n }\n\n}\n\nclass URDFJoint extends URDFBase {\n\n get jointType() {\n\n return this._jointType;\n\n }\n\n set jointType(v) {\n\n if (this.jointType === v) return;\n this._jointType = v;\n this.matrixWorldNeedsUpdate = true;\n switch (v) {\n\n case 'fixed':\n this.jointValue = [];\n break;\n\n case 'continuous':\n case 'revolute':\n case 'prismatic':\n this.jointValue = new Array(1).fill(0);\n break;\n\n case 'planar':\n this.jointValue = new Array(2).fill(0);\n break;\n\n case 'floating':\n this.jointValue = new Array(6).fill(0);\n break;\n\n }\n\n }\n\n get angle() {\n\n return this.jointValue[0];\n\n }\n\n constructor(...args) {\n\n super(...args);\n\n this.isURDFJoint = true;\n this.type = 'URDFJoint';\n\n this.jointValue = null;\n this.jointType = 'fixed';\n this.axis = new Vector3(1, 0, 0);\n this.limit = { lower: 0, upper: 0 };\n this.ignoreLimits = false;\n\n this.origPosition = null;\n this.origQuaternion = null;\n\n this.mimicJoints = [];\n\n }\n\n /* Overrides */\n copy(source, recursive) {\n\n super.copy(source, recursive);\n\n this.jointType = source.jointType;\n this.axis = source.axis.clone();\n this.limit.lower = source.limit.lower;\n this.limit.upper = source.limit.upper;\n this.ignoreLimits = false;\n\n this.jointValue = [...source.jointValue];\n\n this.origPosition = source.origPosition ? source.origPosition.clone() : null;\n this.origQuaternion = source.origQuaternion ? source.origQuaternion.clone() : null;\n\n this.mimicJoints = [...source.mimicJoints];\n\n return this;\n\n }\n\n /* Public Functions */\n setJointValue(...values) {\n\n values = values.map(v => parseFloat(v));\n\n if (!this.origPosition || !this.origQuaternion) {\n\n this.origPosition = this.position.clone();\n this.origQuaternion = this.quaternion.clone();\n\n }\n\n let didUpdate = false;\n\n this.mimicJoints.forEach(joint => {\n\n didUpdate = joint.updateFromMimickedJoint(...values) || didUpdate;\n\n });\n\n switch (this.jointType) {\n\n case 'fixed': {\n\n return didUpdate;\n\n }\n case 'continuous':\n case 'revolute': {\n\n let angle = values[0];\n if (angle == null) return didUpdate;\n if (angle === this.jointValue[0]) return didUpdate;\n\n if (!this.ignoreLimits && this.jointType === 'revolute') {\n\n angle = Math.min(this.limit.upper, angle);\n angle = Math.max(this.limit.lower, angle);\n\n }\n\n this.quaternion\n .setFromAxisAngle(this.axis, angle)\n .premultiply(this.origQuaternion);\n\n if (this.jointValue[0] !== angle) {\n\n this.jointValue[0] = angle;\n this.matrixWorldNeedsUpdate = true;\n return true;\n\n } else {\n\n return didUpdate;\n\n }\n\n }\n\n case 'prismatic': {\n\n let pos = values[0];\n if (pos == null) return didUpdate;\n if (pos === this.jointValue[0]) return didUpdate;\n\n if (!this.ignoreLimits) {\n\n pos = Math.min(this.limit.upper, pos);\n pos = Math.max(this.limit.lower, pos);\n\n }\n\n this.position.copy(this.origPosition);\n this.position.addScaledVector(this.axis, pos);\n\n if (this.jointValue[0] !== pos) {\n\n this.jointValue[0] = pos;\n this.matrixWorldNeedsUpdate = true;\n return true;\n\n } else {\n\n return didUpdate;\n\n }\n\n }\n\n case 'floating':\n case 'planar':\n // TODO: Support these joint types\n console.warn(`'${ this.jointType }' joint not yet supported`);\n\n }\n\n return didUpdate;\n\n }\n\n}\n\nclass URDFMimicJoint extends URDFJoint {\n\n constructor(...args) {\n\n super(...args);\n this.type = 'URDFMimicJoint';\n this.mimicJoint = null;\n this.offset = 0;\n this.multiplier = 1;\n\n }\n\n updateFromMimickedJoint(...values) {\n\n const modifiedValues = values.map(x => x * this.multiplier + this.offset);\n return super.setJointValue(...modifiedValues);\n\n }\n\n /* Overrides */\n copy(source, recursive) {\n\n super.copy(source, recursive);\n\n this.mimicJoint = source.mimicJoint;\n this.offset = source.offset;\n this.multiplier = source.multiplier;\n\n return this;\n\n }\n\n}\n\nclass URDFRobot extends URDFLink {\n\n constructor(...args) {\n\n super(...args);\n this.isURDFRobot = true;\n this.urdfNode = null;\n\n this.urdfRobotNode = null;\n this.robotName = null;\n\n this.links = null;\n this.joints = null;\n this.colliders = null;\n this.visual = null;\n this.frames = null;\n\n }\n\n copy(source, recursive) {\n\n super.copy(source, recursive);\n\n this.urdfRobotNode = source.urdfRobotNode;\n this.robotName = source.robotName;\n\n this.links = {};\n this.joints = {};\n this.colliders = {};\n this.visual = {};\n\n this.traverse(c => {\n\n if (c.isURDFJoint && c.urdfName in source.joints) {\n\n this.joints[c.urdfName] = c;\n\n }\n\n if (c.isURDFLink && c.urdfName in source.links) {\n\n this.links[c.urdfName] = c;\n\n }\n\n if (c.isURDFCollider && c.urdfName in source.colliders) {\n\n this.colliders[c.urdfName] = c;\n\n }\n\n if (c.isURDFVisual && c.urdfName in source.visual) {\n\n this.visual[c.urdfName] = c;\n\n }\n\n });\n\n this.frames = {\n ...this.colliders,\n ...this.visual,\n ...this.links,\n ...this.joints,\n };\n\n return this;\n\n }\n\n getFrame(name) {\n\n return this.frames[name];\n\n }\n\n setJointValue(jointName, ...angle) {\n\n const joint = this.joints[jointName];\n if (joint) {\n\n return joint.setJointValue(...angle);\n\n }\n\n return false;\n }\n\n setJointValues(values) {\n\n let didChange = false;\n for (const name in values) {\n\n const value = values[name];\n if (Array.isArray(value)) {\n\n didChange = this.setJointValue(name, ...value) || didChange;\n\n } else {\n\n didChange = this.setJointValue(name, value) || didChange;\n\n }\n\n }\n\n return didChange;\n\n }\n\n}\n\nexport { URDFRobot, URDFLink, URDFJoint, URDFMimicJoint, URDFVisual, URDFCollider };\n","import * as THREE from 'three';\nimport { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js';\nimport { ColladaLoader } from 'three/examples/jsm/loaders/ColladaLoader.js';\nimport { URDFRobot, URDFJoint, URDFLink, URDFCollider, URDFVisual, URDFMimicJoint } from './URDFClasses.js';\n\n/*\nReference coordinate frames for THREE.js and ROS.\nBoth coordinate systems are right handed so the URDF is instantiated without\nframe transforms. The resulting model can be rotated to rectify the proper up,\nright, and forward directions\n\nTHREE.js\n Y\n |\n |\n .-----X\n /\nZ\n\nROS URDf\n Z\n | X\n | /\n Y-----.\n\n*/\n\nconst tempQuaternion = new THREE.Quaternion();\nconst tempEuler = new THREE.Euler();\n\n// take a vector \"x y z\" and process it into\n// an array [x, y, z]\nfunction processTuple(val) {\n\n if (!val) return [0, 0, 0];\n return val.trim().split(/\\s+/g).map(num => parseFloat(num));\n\n}\n\n// applies a rotation a threejs object in URDF order\nfunction applyRotation(obj, rpy, additive = false) {\n\n // if additive is true the rotation is applied in\n // addition to the existing rotation\n if (!additive) obj.rotation.set(0, 0, 0);\n\n tempEuler.set(rpy[0], rpy[1], rpy[2], 'ZYX');\n tempQuaternion.setFromEuler(tempEuler);\n tempQuaternion.multiply(obj.quaternion);\n obj.quaternion.copy(tempQuaternion);\n\n}\n\n/* URDFLoader Class */\n// Loads and reads a URDF file into a THREEjs Object3D format\nexport default\nclass URDFLoader {\n\n constructor(manager) {\n\n this.manager = manager || THREE.DefaultLoadingManager;\n this.loadMeshCb = this.defaultMeshLoader.bind(this);\n this.parseVisual = true;\n this.parseCollision = false;\n this.packages = '';\n this.workingPath = '';\n this.fetchOptions = {};\n\n }\n\n /* Public API */\n loadAsync(urdf) {\n\n return new Promise((resolve, reject) => {\n\n this.load(urdf, resolve, null, reject);\n\n });\n\n }\n\n // urdf: The path to the URDF within the package OR absolute\n // onComplete: Callback that is passed the model once loaded\n load(urdf, onComplete, onProgress, onError) {\n\n // Check if a full URI is specified before\n // prepending the package info\n const manager = this.manager;\n const workingPath = THREE.LoaderUtils.extractUrlBase(urdf);\n const urdfPath = this.manager.resolveURL(urdf);\n\n manager.itemStart(urdfPath);\n\n fetch(urdfPath, this.fetchOptions)\n .then(res => {\n\n if (res.ok) {\n\n if (onProgress) {\n\n onProgress(null);\n\n }\n return res.text();\n\n } else {\n\n throw new Error(`URDFLoader: Failed to load url '${ urdfPath }' with error code ${ res.status } : ${ res.statusText }.`);\n\n }\n\n })\n .then(data => {\n\n if (this.workingPath === '') {\n\n this.workingPath = workingPath;\n\n }\n\n const model = this.parse(data);\n onComplete(model);\n manager.itemEnd(urdfPath);\n\n })\n .catch(e => {\n\n if (onError) {\n\n onError(e);\n\n } else {\n\n console.error('URDFLoader: Error loading file.', e);\n\n }\n manager.itemError(urdfPath);\n manager.itemEnd(urdfPath);\n\n });\n\n }\n\n parse(content) {\n\n const packages = this.packages;\n const loadMeshCb = this.loadMeshCb;\n const parseVisual = this.parseVisual;\n const parseCollision = this.parseCollision;\n const workingPath = this.workingPath;\n const manager = this.manager;\n const linkMap = {};\n const jointMap = {};\n const materialMap = {};\n\n // Resolves the path of mesh files\n function resolvePath(path) {\n\n if (!/^package:\\/\\//.test(path)) {\n\n return workingPath ? workingPath + path : path;\n\n }\n\n // Remove \"package://\" keyword and split meshPath at the first slash\n const [targetPkg, relPath] = path.replace(/^package:\\/\\//, '').split(/\\/(.+)/);\n\n if (typeof packages === 'string') {\n\n // \"pkg\" is one single package\n if (packages.endsWith(targetPkg)) {\n\n // \"pkg\" is the target package\n return packages + '/' + relPath;\n\n } else {\n\n // Assume \"pkg\" is the target package's parent directory\n return packages + '/' + targetPkg + '/' + relPath;\n\n }\n\n } else if (packages instanceof Function) {\n\n return packages(targetPkg) + '/' + relPath;\n\n } else if (typeof packages === 'object') {\n\n // \"pkg\" is a map of packages\n if (targetPkg in packages) {\n\n return packages[targetPkg] + '/' + relPath;\n\n } else {\n\n console.error(`URDFLoader : ${ targetPkg } not found in provided package list.`);\n return null;\n\n }\n\n }\n\n }\n\n // Process the URDF text format\n function processUrdf(data) {\n\n let children;\n if (data instanceof Document) {\n\n children = [ ...data.children ];\n\n } else if (data instanceof Element) {\n\n children = [ data ];\n\n } else {\n\n const parser = new DOMParser();\n const urdf = parser.parseFromString(data, 'text/xml');\n children = [ ...urdf.children ];\n\n }\n\n const robotNode = children.filter(c => c.nodeName === 'robot').pop();\n return processRobot(robotNode);\n\n }\n\n // Process the node\n function processRobot(robot) {\n\n const robotNodes = [ ...robot.children ];\n const links = robotNodes.filter(c => c.nodeName.toLowerCase() === 'link');\n const joints = robotNodes.filter(c => c.nodeName.toLowerCase() === 'joint');\n const materials = robotNodes.filter(c => c.nodeName.toLowerCase() === 'material');\n const obj = new URDFRobot();\n\n obj.robotName = robot.getAttribute('name');\n obj.urdfRobotNode = robot;\n\n // Create the map\n materials.forEach(m => {\n\n const name = m.getAttribute('name');\n materialMap[name] = processMaterial(m);\n\n });\n\n // Create the map\n const visualMap = {};\n const colliderMap = {};\n links.forEach(l => {\n\n const name = l.getAttribute('name');\n const isRoot = robot.querySelector(`child[link=\"${ name }\"]`) === null;\n linkMap[name] = processLink(l, visualMap, colliderMap, isRoot ? obj : null);\n\n });\n\n // Create the map\n joints.forEach(j => {\n\n const name = j.getAttribute('name');\n jointMap[name] = processJoint(j);\n\n });\n\n obj.joints = jointMap;\n obj.links = linkMap;\n obj.colliders = colliderMap;\n obj.visual = visualMap;\n\n // Link up mimic joints\n const jointList = Object.values(jointMap);\n jointList.forEach(j => {\n\n if (j instanceof URDFMimicJoint) {\n\n jointMap[j.mimicJoint].mimicJoints.push(j);\n\n }\n\n });\n\n // Detect infinite loops of mimic joints\n jointList.forEach(j => {\n\n const uniqueJoints = new Set();\n const iterFunction = joint => {\n\n if (uniqueJoints.has(joint)) {\n\n throw new Error('URDFLoader: Detected an infinite loop of mimic joints.');\n\n }\n\n uniqueJoints.add(joint);\n joint.mimicJoints.forEach(j => {\n\n iterFunction(j);\n\n });\n\n };\n\n iterFunction(j);\n });\n\n obj.frames = {\n ...colliderMap,\n ...visualMap,\n ...linkMap,\n ...jointMap,\n };\n\n return obj;\n\n }\n\n // Process joint nodes and parent them\n function processJoint(joint) {\n\n const children = [ ...joint.children ];\n const jointType = joint.getAttribute('type');\n\n let obj;\n\n const mimicTag = children.find(n => n.nodeName.toLowerCase() === 'mimic');\n if (mimicTag) {\n\n obj = new URDFMimicJoint();\n obj.mimicJoint = mimicTag.getAttribute('joint');\n obj.multiplier = parseFloat(mimicTag.getAttribute('multiplier') || 1.0);\n obj.offset = parseFloat(mimicTag.getAttribute('offset') || 0.0);\n\n } else {\n\n obj = new URDFJoint();\n\n }\n\n obj.urdfNode = joint;\n obj.name = joint.getAttribute('name');\n obj.urdfName = obj.name;\n obj.jointType = jointType;\n\n let parent = null;\n let child = null;\n let xyz = [0, 0, 0];\n let rpy = [0, 0, 0];\n\n // Extract the attributes\n children.forEach(n => {\n\n const type = n.nodeName.toLowerCase();\n if (type === 'origin') {\n\n xyz = processTuple(n.getAttribute('xyz'));\n rpy = processTuple(n.getAttribute('rpy'));\n\n } else if (type === 'child') {\n\n child = linkMap[n.getAttribute('link')];\n\n } else if (type === 'parent') {\n\n parent = linkMap[n.getAttribute('link')];\n\n } else if (type === 'limit') {\n\n obj.limit.lower = parseFloat(n.getAttribute('lower') || obj.limit.lower);\n obj.limit.upper = parseFloat(n.getAttribute('upper') || obj.limit.upper);\n\n }\n });\n\n // Join the links\n parent.add(obj);\n obj.add(child);\n applyRotation(obj, rpy);\n obj.position.set(xyz[0], xyz[1], xyz[2]);\n\n // Set up the rotate function\n const axisNode = children.filter(n => n.nodeName.toLowerCase() === 'axis')[0];\n\n if (axisNode) {\n\n const axisXYZ = axisNode.getAttribute('xyz').split(/\\s+/g).map(num => parseFloat(num));\n obj.axis = new THREE.Vector3(axisXYZ[0], axisXYZ[1], axisXYZ[2]);\n obj.axis.normalize();\n\n }\n\n return obj;\n\n }\n\n // Process the nodes\n function processLink(link, visualMap, colliderMap, target = null) {\n\n if (target === null) {\n\n target = new URDFLink();\n\n }\n\n const children = [ ...link.children ];\n target.name = link.getAttribute('name');\n target.urdfName = target.name;\n target.urdfNode = link;\n\n if (parseVisual) {\n\n const visualNodes = children.filter(n => n.nodeName.toLowerCase() === 'visual');\n visualNodes.forEach(vn => {\n\n const v = processLinkElement(vn, materialMap);\n target.add(v);\n\n if (vn.hasAttribute('name')) {\n\n const name = vn.getAttribute('name');\n v.name = name;\n v.urdfName = name;\n visualMap[name] = v;\n\n }\n\n });\n\n }\n\n if (parseCollision) {\n\n const collisionNodes = children.filter(n => n.nodeName.toLowerCase() === 'collision');\n collisionNodes.forEach(cn => {\n\n const c = processLinkElement(cn);\n target.add(c);\n\n if (cn.hasAttribute('name')) {\n\n const name = cn.getAttribute('name');\n c.name = name;\n c.urdfName = name;\n colliderMap[name] = c;\n\n }\n\n });\n\n }\n\n return target;\n\n }\n\n function processMaterial(node) {\n\n const matNodes = [ ...node.children ];\n const material = new THREE.MeshPhongMaterial();\n\n material.name = node.getAttribute('name') || '';\n matNodes.forEach(n => {\n\n const type = n.nodeName.toLowerCase();\n if (type === 'color') {\n\n const rgba =\n n\n .getAttribute('rgba')\n .split(/\\s/g)\n .map(v => parseFloat(v));\n\n material.color.setRGB(rgba[0], rgba[1], rgba[2]).convertSRGBToLinear();\n material.opacity = rgba[3];\n material.transparent = rgba[3] < 1;\n material.depthWrite = !material.transparent;\n\n } else if (type === 'texture') {\n\n // The URDF spec does not require that the tag include\n // a filename attribute so skip loading the texture if not provided.\n const filename = n.getAttribute('filename');\n if (filename) {\n\n const loader = new THREE.TextureLoader(manager);\n const filePath = resolvePath(filename);\n material.map = loader.load(filePath);\n material.map.encoding = THREE.sRGBEncoding;\n\n }\n\n }\n });\n\n return material;\n\n }\n\n // Process the visual and collision nodes into meshes\n function processLinkElement(vn, materialMap = {}) {\n\n const isCollisionNode = vn.nodeName.toLowerCase() === 'collision';\n const children = [ ...vn.children ];\n let material = null;\n\n // get the material first\n const materialNode = children.filter(n => n.nodeName.toLowerCase() === 'material')[0];\n if (materialNode) {\n\n const name = materialNode.getAttribute('name');\n if (name && name in materialMap) {\n\n material = materialMap[name];\n\n } else {\n\n material = processMaterial(materialNode);\n\n }\n\n } else {\n\n material = new THREE.MeshPhongMaterial();\n\n }\n\n const group = isCollisionNode ? new URDFCollider() : new URDFVisual();\n group.urdfNode = vn;\n\n children.forEach(n => {\n\n const type = n.nodeName.toLowerCase();\n if (type === 'geometry') {\n\n const geoType = n.children[0].nodeName.toLowerCase();\n if (geoType === 'mesh') {\n\n const filename = n.children[0].getAttribute('filename');\n const filePath = resolvePath(filename);\n\n // file path is null if a package directory is not provided.\n if (filePath !== null) {\n\n const scaleAttr = n.children[0].getAttribute('scale');\n if (scaleAttr) {\n\n const scale = processTuple(scaleAttr);\n group.scale.set(scale[0], scale[1], scale[2]);\n\n }\n\n loadMeshCb(filePath, manager, (obj, err) => {\n\n if (err) {\n\n console.error('URDFLoader: Error loading mesh.', err);\n\n } else if (obj) {\n\n if (obj instanceof THREE.Mesh) {\n\n obj.material = material;\n\n }\n\n // We don't expect non identity rotations or positions. In the case of\n // COLLADA files the model might come in with a custom scale for unit\n // conversion.\n obj.position.set(0, 0, 0);\n obj.quaternion.identity();\n group.add(obj);\n\n }\n\n });\n\n }\n\n } else if (geoType === 'box') {\n\n const primitiveModel = new THREE.Mesh();\n primitiveModel.geometry = new THREE.BoxGeometry(1, 1, 1);\n primitiveModel.material = material;\n\n const size = processTuple(n.children[0].getAttribute('size'));\n primitiveModel.scale.set(size[0], size[1], size[2]);\n\n group.add(primitiveModel);\n\n } else if (geoType === 'sphere') {\n\n const primitiveModel = new THREE.Mesh();\n primitiveModel.geometry = new THREE.SphereGeometry(1, 30, 30);\n primitiveModel.material = material;\n\n const radius = parseFloat(n.children[0].getAttribute('radius')) || 0;\n primitiveModel.scale.set(radius, radius, radius);\n\n group.add(primitiveModel);\n\n } else if (geoType === 'cylinder') {\n\n const primitiveModel = new THREE.Mesh();\n primitiveModel.geometry = new THREE.CylinderGeometry(1, 1, 1, 30);\n primitiveModel.material = material;\n\n const radius = parseFloat(n.children[0].getAttribute('radius')) || 0;\n const length = parseFloat(n.children[0].getAttribute('length')) || 0;\n primitiveModel.scale.set(radius, length, radius);\n primitiveModel.rotation.set(Math.PI / 2, 0, 0);\n\n group.add(primitiveModel);\n\n }\n\n } else if (type === 'origin') {\n\n const xyz = processTuple(n.getAttribute('xyz'));\n const rpy = processTuple(n.getAttribute('rpy'));\n\n group.position.set(xyz[0], xyz[1], xyz[2]);\n group.rotation.set(0, 0, 0);\n applyRotation(group, rpy);\n\n }\n\n });\n\n return group;\n\n }\n\n return processUrdf(content);\n\n }\n\n // Default mesh loading function\n defaultMeshLoader(path, manager, done) {\n\n if (/\\.stl$/i.test(path)) {\n\n const loader = new STLLoader(manager);\n loader.load(path, geom => {\n const mesh = new THREE.Mesh(geom, new THREE.MeshPhongMaterial());\n done(mesh);\n });\n\n } else if (/\\.dae$/i.test(path)) {\n\n const loader = new ColladaLoader(manager);\n loader.load(path, dae => done(dae.scene));\n\n } else {\n\n console.warn(`URDFLoader: Could not load model at ${ path }.\\nNo loader available`);\n\n }\n\n }\n\n};\n"],"names":["Object3D","Vector3","THREE","STLLoader","ColladaLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEA,MAAM,QAAQ,SAASA,cAAQ,CAAC;AAChC;IACA,IAAI,WAAW,CAAC,GAAG,IAAI,EAAE;AACzB;IACA,QAAQ,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC7B,QAAQ,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;AAC3B;IACA,KAAK;AACL;IACA,IAAI,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE;AAC5B;IACA,QAAQ,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACtC;IACA,QAAQ,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACxC,QAAQ,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACxC;IACA,QAAQ,OAAO,IAAI,CAAC;AACpB;IACA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AI,EAAE,IAAI,IAAI;IACtC,gBAAgB,MAAM,IAAI,GAAG,IAAID,gBAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAIA,gBAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACjF,gBAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,aAAa,CAAC,CAAC;AACf;IACA,SAAS,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AACzC;IACA,YAAY,MAAM,MAAM,GAAG,IAAIE,8BAAa,CAAC,OAAO,CAAC,CAAC;IACtD,YAAY,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACtD;IACA,SAAS,MAAM;AACf;IACA,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC,oCAAoC,GAAG,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAChG;IACA,SAAS;AACT;IACA,KAAK;AACL;IACA,CAAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"URDFLoader.js","sources":["../src/URDFClasses.js","../src/URDFLoader.js"],"sourcesContent":["import { Euler, Object3D, Vector3, Quaternion, Matrix4 } from 'three';\n\nconst _tempAxis = new Vector3();\nconst _tempEuler = new Euler();\nconst _tempTransform = new Matrix4();\nconst _tempOrigTransform = new Matrix4();\nconst _tempQuat = new Quaternion();\nconst _tempScale = new Vector3(1.0, 1.0, 1.0);\nconst _tempPosition = new Vector3();\n\nclass URDFBase extends Object3D {\n\n constructor(...args) {\n\n super(...args);\n this.urdfNode = null;\n this.urdfName = '';\n\n }\n\n copy(source, recursive) {\n\n super.copy(source, recursive);\n\n this.urdfNode = source.urdfNode;\n this.urdfName = source.urdfName;\n\n return this;\n\n }\n\n}\n\nclass URDFCollider extends URDFBase {\n\n constructor(...args) {\n\n super(...args);\n this.isURDFCollider = true;\n this.type = 'URDFCollider';\n this.meshPath = null;\n\n }\n\n}\n\nclass URDFVisual extends URDFBase {\n\n constructor(...args) {\n\n super(...args);\n this.isURDFVisual = true;\n this.type = 'URDFVisual';\n this.meshPath = null;\n\n }\n\n}\n\nclass URDFLink extends URDFBase {\n\n constructor(...args) {\n\n super(...args);\n this.isURDFLink = true;\n this.type = 'URDFLink';\n\n this.inertial = null;\n\n }\n\n}\n\nclass URDFJoint extends URDFBase {\n\n get jointType() {\n\n return this._jointType;\n\n }\n\n set jointType(v) {\n\n if (this.jointType === v) return;\n this._jointType = v;\n this.matrixWorldNeedsUpdate = true;\n switch (v) {\n\n case 'fixed':\n this.jointValue = [];\n break;\n\n case 'continuous':\n case 'revolute':\n case 'prismatic':\n this.jointValue = new Array(1).fill(0);\n break;\n\n case 'planar':\n // Planar joints are, 3dof: position XY and rotation Z.\n this.jointValue = new Array(3).fill(0);\n this.axis = new Vector3(0, 0, 1);\n break;\n\n case 'floating':\n this.jointValue = new Array(6).fill(0);\n break;\n\n }\n\n }\n\n get angle() {\n\n return this.jointValue[0];\n\n }\n\n constructor(...args) {\n\n super(...args);\n\n this.isURDFJoint = true;\n this.type = 'URDFJoint';\n\n this.jointValue = null;\n this.jointType = 'fixed';\n this.axis = new Vector3(1, 0, 0);\n this.limit = { lower: 0, upper: 0, effort: null, velocity: null };\n this.ignoreLimits = false;\n\n this.origPosition = null;\n this.origQuaternion = null;\n\n this.mimicJoints = [];\n\n }\n\n /* Overrides */\n copy(source, recursive) {\n\n super.copy(source, recursive);\n\n this.jointType = source.jointType;\n this.axis = source.axis.clone();\n this.limit.lower = source.limit.lower;\n this.limit.upper = source.limit.upper;\n this.limit.effort = source.limit.effort;\n this.limit.velocity = source.limit.velocity;\n this.ignoreLimits = false;\n\n this.jointValue = [...source.jointValue];\n\n this.origPosition = source.origPosition ? source.origPosition.clone() : null;\n this.origQuaternion = source.origQuaternion ? source.origQuaternion.clone() : null;\n\n this.mimicJoints = [...source.mimicJoints];\n\n return this;\n\n }\n\n /* Public Functions */\n /**\n * @param {...number|null} values The joint value components to set, optionally null for no-op\n * @returns {boolean} Whether the invocation of this function resulted in an actual change to the joint value\n */\n setJointValue(...values) {\n\n // Parse all incoming values into numbers except null, which we treat as a no-op for that value component.\n values = values.map(v => v === null ? null : parseFloat(v));\n\n if (!this.origPosition || !this.origQuaternion) {\n\n this.origPosition = this.position.clone();\n this.origQuaternion = this.quaternion.clone();\n\n }\n\n let didUpdate = false;\n\n this.mimicJoints.forEach(joint => {\n\n didUpdate = joint.updateFromMimickedJoint(...values) || didUpdate;\n\n });\n\n switch (this.jointType) {\n\n case 'fixed': {\n\n return didUpdate;\n\n }\n case 'continuous':\n case 'revolute': {\n\n let angle = values[0];\n if (angle == null) return didUpdate;\n if (angle === this.jointValue[0]) return didUpdate;\n\n if (!this.ignoreLimits && this.jointType === 'revolute') {\n\n angle = Math.min(this.limit.upper, angle);\n angle = Math.max(this.limit.lower, angle);\n\n }\n\n this.quaternion\n .setFromAxisAngle(this.axis, angle)\n .premultiply(this.origQuaternion);\n\n if (this.jointValue[0] !== angle) {\n\n this.jointValue[0] = angle;\n this.matrixWorldNeedsUpdate = true;\n return true;\n\n } else {\n\n return didUpdate;\n\n }\n\n }\n\n case 'prismatic': {\n\n let pos = values[0];\n if (pos == null) return didUpdate;\n if (pos === this.jointValue[0]) return didUpdate;\n\n if (!this.ignoreLimits) {\n\n pos = Math.min(this.limit.upper, pos);\n pos = Math.max(this.limit.lower, pos);\n\n }\n\n this.position.copy(this.origPosition);\n _tempAxis.copy(this.axis).applyEuler(this.rotation);\n this.position.addScaledVector(_tempAxis, pos);\n\n if (this.jointValue[0] !== pos) {\n\n this.jointValue[0] = pos;\n this.matrixWorldNeedsUpdate = true;\n return true;\n\n } else {\n\n return didUpdate;\n\n }\n\n }\n\n case 'floating': {\n\n // no-op if all values are identical to existing value or are null\n if (this.jointValue.every((value, index) => values[index] === value || values[index] === null)) return didUpdate;\n // Floating joints have six degrees of freedom: X, Y, Z, R, P, Y.\n this.jointValue[0] = values[0] !== null ? values[0] : this.jointValue[0];\n this.jointValue[1] = values[1] !== null ? values[1] : this.jointValue[1];\n this.jointValue[2] = values[2] !== null ? values[2] : this.jointValue[2];\n this.jointValue[3] = values[3] !== null ? values[3] : this.jointValue[3];\n this.jointValue[4] = values[4] !== null ? values[4] : this.jointValue[4];\n this.jointValue[5] = values[5] !== null ? values[5] : this.jointValue[5];\n\n // Compose transform of joint origin and transform due to joint values\n _tempOrigTransform.compose(this.origPosition, this.origQuaternion, _tempScale);\n _tempQuat.setFromEuler(\n _tempEuler.set(\n this.jointValue[3],\n this.jointValue[4],\n this.jointValue[5],\n 'XYZ',\n ),\n );\n _tempPosition.set(this.jointValue[0], this.jointValue[1], this.jointValue[2]);\n _tempTransform.compose(_tempPosition, _tempQuat, _tempScale);\n\n // Calcualte new transform\n _tempOrigTransform.premultiply(_tempTransform);\n this.position.setFromMatrixPosition(_tempOrigTransform);\n this.rotation.setFromRotationMatrix(_tempOrigTransform);\n\n this.matrixWorldNeedsUpdate = true;\n return true;\n }\n\n case 'planar': {\n\n // no-op if all values are identical to existing value or are null\n if (this.jointValue.every((value, index) => values[index] === value || values[index] === null)) return didUpdate;\n\n this.jointValue[0] = values[0] !== null ? values[0] : this.jointValue[0];\n this.jointValue[1] = values[1] !== null ? values[1] : this.jointValue[1];\n this.jointValue[2] = values[2] !== null ? values[2] : this.jointValue[2];\n\n // Compose transform of joint origin and transform due to joint values\n _tempOrigTransform.compose(this.origPosition, this.origQuaternion, _tempScale);\n _tempQuat.setFromAxisAngle(this.axis, this.jointValue[2]);\n _tempPosition.set(this.jointValue[0], this.jointValue[1], 0.0);\n _tempTransform.compose(_tempPosition, _tempQuat, _tempScale);\n\n // Calculate new transform\n _tempOrigTransform.premultiply(_tempTransform);\n this.position.setFromMatrixPosition(_tempOrigTransform);\n this.rotation.setFromRotationMatrix(_tempOrigTransform);\n\n this.matrixWorldNeedsUpdate = true;\n return true;\n }\n\n }\n\n return didUpdate;\n\n }\n\n}\n\nclass URDFMimicJoint extends URDFJoint {\n\n constructor(...args) {\n\n super(...args);\n this.type = 'URDFMimicJoint';\n this.mimicJoint = null;\n this.offset = 0;\n this.multiplier = 1;\n\n }\n\n updateFromMimickedJoint(...values) {\n\n const modifiedValues = values.map(x => x * this.multiplier + this.offset);\n return super.setJointValue(...modifiedValues);\n\n }\n\n /* Overrides */\n copy(source, recursive) {\n\n super.copy(source, recursive);\n\n this.mimicJoint = source.mimicJoint;\n this.offset = source.offset;\n this.multiplier = source.multiplier;\n\n return this;\n\n }\n\n}\n\nclass URDFRobot extends URDFLink {\n\n constructor(...args) {\n\n super(...args);\n this.isURDFRobot = true;\n this.urdfNode = null;\n\n this.urdfRobotNode = null;\n this.robotName = null;\n\n this.links = null;\n this.joints = null;\n this.colliders = null;\n this.visual = null;\n this.frames = null;\n\n }\n\n copy(source, recursive) {\n\n super.copy(source, recursive);\n\n this.urdfRobotNode = source.urdfRobotNode;\n this.robotName = source.robotName;\n\n this.links = {};\n this.joints = {};\n this.colliders = {};\n this.visual = {};\n\n this.traverse(c => {\n\n if (c.isURDFJoint && c.urdfName in source.joints) {\n\n this.joints[c.urdfName] = c;\n\n }\n\n if (c.isURDFLink && c.urdfName in source.links) {\n\n this.links[c.urdfName] = c;\n\n }\n\n if (c.isURDFCollider && c.urdfName in source.colliders) {\n\n this.colliders[c.urdfName] = c;\n\n }\n\n if (c.isURDFVisual && c.urdfName in source.visual) {\n\n this.visual[c.urdfName] = c;\n\n }\n\n });\n\n // Repair mimic joint references once we've re-accumulated all our joint data\n for (const joint in this.joints) {\n this.joints[joint].mimicJoints = this.joints[joint].mimicJoints.map((mimicJoint) => this.joints[mimicJoint.name]);\n }\n\n this.frames = {\n ...this.colliders,\n ...this.visual,\n ...this.links,\n ...this.joints,\n };\n\n return this;\n\n }\n\n getFrame(name) {\n\n return this.frames[name];\n\n }\n\n setJointValue(jointName, ...angle) {\n\n const joint = this.joints[jointName];\n if (joint) {\n\n return joint.setJointValue(...angle);\n\n }\n\n return false;\n }\n\n setJointValues(values) {\n\n let didChange = false;\n for (const name in values) {\n\n const value = values[name];\n if (Array.isArray(value)) {\n\n didChange = this.setJointValue(name, ...value) || didChange;\n\n } else {\n\n didChange = this.setJointValue(name, value) || didChange;\n\n }\n\n }\n\n return didChange;\n\n }\n\n}\n\nexport { URDFRobot, URDFLink, URDFJoint, URDFMimicJoint, URDFVisual, URDFCollider };\n","import * as THREE from 'three';\nimport { ColladaLoader } from 'three/examples/jsm/loaders/ColladaLoader.js';\nimport { STLLoader } from 'three/examples/jsm/loaders/STLLoader.js';\nimport { URDFCollider, URDFJoint, URDFLink, URDFMimicJoint, URDFRobot, URDFVisual } from './URDFClasses.js';\n\n/*\nReference coordinate frames for THREE.js and ROS.\nBoth coordinate systems are right handed so the URDF is instantiated without\nframe transforms. The resulting model can be rotated to rectify the proper up,\nright, and forward directions\n\nTHREE.js\n Y\n |\n |\n .-----X\n /\nZ\n\nROS URDf\n Z\n | X\n | /\n Y-----.\n\n*/\n\nconst tempQuaternion = new THREE.Quaternion();\nconst tempEuler = new THREE.Euler();\n\n// take a vector \"x y z\" and process it into\n// an array [x, y, z]\nfunction processTuple(val) {\n\n if (!val) return [0, 0, 0];\n return val.trim().split(/\\s+/g).map(num => parseFloat(num));\n\n}\n\n// take a vector \"x y z\" and process it into\n// a THREE.Vector3\nfunction processVector(val) {\n\n return new THREE.Vector3(...processTuple(val));\n\n}\n\n// applies a rotation a threejs object in URDF order\nfunction applyRotation(obj, rpy, additive = false) {\n\n // if additive is true the rotation is applied in\n // addition to the existing rotation\n if (!additive) obj.rotation.set(0, 0, 0);\n\n tempEuler.set(rpy[0], rpy[1], rpy[2], 'ZYX');\n tempQuaternion.setFromEuler(tempEuler);\n tempQuaternion.multiply(obj.quaternion);\n obj.quaternion.copy(tempQuaternion);\n\n}\n\n/* URDFLoader Class */\n// Loads and reads a URDF file into a THREEjs Object3D format\nexport default\nclass URDFLoader {\n\n constructor(manager) {\n\n this.manager = manager || THREE.DefaultLoadingManager;\n this.loadMeshCb = this.defaultMeshLoader.bind(this);\n this.parseVisual = true;\n this.parseCollision = false;\n this.packages = '';\n this.workingPath = '';\n this.fetchOptions = {};\n\n }\n\n /* Public API */\n loadAsync(urdf) {\n\n return new Promise((resolve, reject) => {\n\n this.load(urdf, resolve, null, reject);\n\n });\n\n }\n\n // urdf: The path to the URDF within the package OR absolute\n // onComplete: Callback that is passed the model once loaded\n load(urdf, onComplete, onProgress, onError) {\n\n // Check if a full URI is specified before\n // prepending the package info\n const manager = this.manager;\n const workingPath = THREE.LoaderUtils.extractUrlBase(urdf);\n const urdfPath = this.manager.resolveURL(urdf);\n\n manager.itemStart(urdfPath);\n\n fetch(urdfPath, this.fetchOptions)\n .then(res => {\n\n if (res.ok) {\n\n if (onProgress) {\n\n onProgress(null);\n\n }\n return res.text();\n\n } else {\n\n throw new Error(`URDFLoader: Failed to load url '${ urdfPath }' with error code ${ res.status } : ${ res.statusText }.`);\n\n }\n\n })\n .then(data => {\n\n if (this.workingPath === '') {\n\n this.workingPath = workingPath;\n\n }\n\n const model = this.parse(data);\n onComplete(model);\n manager.itemEnd(urdfPath);\n\n })\n .catch(e => {\n\n if (onError) {\n\n onError(e);\n\n } else {\n\n console.error('URDFLoader: Error loading file.', e);\n\n }\n manager.itemError(urdfPath);\n manager.itemEnd(urdfPath);\n\n });\n\n }\n\n parse(content) {\n\n const packages = this.packages;\n const loadMeshCb = this.loadMeshCb;\n const parseVisual = this.parseVisual;\n const parseCollision = this.parseCollision;\n const workingPath = this.workingPath;\n const manager = this.manager;\n const linkMap = {};\n const jointMap = {};\n const materialMap = {};\n\n // Resolves the path of mesh files\n function resolvePath(path) {\n\n if (!/^package:\\/\\//.test(path)) {\n\n return workingPath ? workingPath + path : path;\n\n }\n\n // Remove \"package://\" keyword and split meshPath at the first slash\n const [targetPkg, relPath] = path.replace(/^package:\\/\\//, '').split(/\\/(.+)/);\n\n if (typeof packages === 'string') {\n\n // \"pkg\" is one single package\n if (packages.endsWith(targetPkg)) {\n\n // \"pkg\" is the target package\n return packages + '/' + relPath;\n\n } else {\n\n // Assume \"pkg\" is the target package's parent directory\n return packages + '/' + targetPkg + '/' + relPath;\n\n }\n\n } else if (packages instanceof Function) {\n\n return packages(targetPkg) + '/' + relPath;\n\n } else if (typeof packages === 'object') {\n\n // \"pkg\" is a map of packages\n if (targetPkg in packages) {\n\n return packages[targetPkg] + '/' + relPath;\n\n } else {\n\n console.error(`URDFLoader : ${ targetPkg } not found in provided package list.`);\n return null;\n\n }\n\n }\n\n }\n\n // Process the URDF text format\n function processUrdf(data) {\n\n let children;\n if (data instanceof Document) {\n\n children = [ ...data.children ];\n\n } else if (data instanceof Element) {\n\n children = [ data ];\n\n } else {\n\n const parser = new DOMParser();\n const urdf = parser.parseFromString(data, 'text/xml');\n children = [ ...urdf.children ];\n\n }\n\n const robotNode = children.filter(c => c.nodeName === 'robot').pop();\n return processRobot(robotNode);\n\n }\n\n // Process the node\n function processRobot(robot) {\n\n const robotNodes = [ ...robot.children ];\n const links = robotNodes.filter(c => c.nodeName.toLowerCase() === 'link');\n const joints = robotNodes.filter(c => c.nodeName.toLowerCase() === 'joint');\n const materials = robotNodes.filter(c => c.nodeName.toLowerCase() === 'material');\n const obj = new URDFRobot();\n\n obj.robotName = robot.getAttribute('name');\n obj.urdfRobotNode = robot;\n\n // Create the map\n materials.forEach(m => {\n\n const name = m.getAttribute('name');\n materialMap[name] = processMaterial(m);\n\n });\n\n // Create the map\n const visualMap = {};\n const colliderMap = {};\n links.forEach(l => {\n\n const name = l.getAttribute('name');\n const isRoot = robot.querySelector(`child[link=\"${ name }\"]`) === null;\n linkMap[name] = processLink(l, visualMap, colliderMap, isRoot ? obj : null);\n\n });\n\n // Create the map\n joints.forEach(j => {\n\n const name = j.getAttribute('name');\n jointMap[name] = processJoint(j);\n\n });\n\n obj.joints = jointMap;\n obj.links = linkMap;\n obj.colliders = colliderMap;\n obj.visual = visualMap;\n\n // Link up mimic joints\n const jointList = Object.values(jointMap);\n jointList.forEach(j => {\n\n if (j instanceof URDFMimicJoint) {\n\n jointMap[j.mimicJoint].mimicJoints.push(j);\n\n }\n\n });\n\n // Detect infinite loops of mimic joints\n jointList.forEach(j => {\n\n const uniqueJoints = new Set();\n const iterFunction = joint => {\n\n if (uniqueJoints.has(joint)) {\n\n throw new Error('URDFLoader: Detected an infinite loop of mimic joints.');\n\n }\n\n uniqueJoints.add(joint);\n joint.mimicJoints.forEach(j => {\n\n iterFunction(j);\n\n });\n\n };\n\n iterFunction(j);\n });\n\n obj.frames = {\n ...colliderMap,\n ...visualMap,\n ...linkMap,\n ...jointMap,\n };\n\n return obj;\n\n }\n\n // Process joint nodes and parent them\n function processJoint(joint) {\n\n const children = [ ...joint.children ];\n const jointType = joint.getAttribute('type');\n\n let obj;\n\n const mimicTag = children.find(n => n.nodeName.toLowerCase() === 'mimic');\n if (mimicTag) {\n\n obj = new URDFMimicJoint();\n obj.mimicJoint = mimicTag.getAttribute('joint');\n obj.multiplier = parseFloat(mimicTag.getAttribute('multiplier') || 1.0);\n obj.offset = parseFloat(mimicTag.getAttribute('offset') || 0.0);\n\n } else {\n\n obj = new URDFJoint();\n\n }\n\n obj.urdfNode = joint;\n obj.name = joint.getAttribute('name');\n obj.urdfName = obj.name;\n obj.jointType = jointType;\n\n let parent = null;\n let child = null;\n let xyz = [0, 0, 0];\n let rpy = [0, 0, 0];\n\n // Extract the attributes\n children.forEach(n => {\n\n const type = n.nodeName.toLowerCase();\n if (type === 'origin') {\n\n xyz = processTuple(n.getAttribute('xyz'));\n rpy = processTuple(n.getAttribute('rpy'));\n\n } else if (type === 'child') {\n\n child = linkMap[n.getAttribute('link')];\n\n } else if (type === 'parent') {\n\n parent = linkMap[n.getAttribute('link')];\n\n } else if (type === 'limit') {\n\n obj.limit.lower = parseFloat(n.getAttribute('lower') || obj.limit.lower);\n obj.limit.upper = parseFloat(n.getAttribute('upper') || obj.limit.upper);\n obj.limit.effort = parseFloat(n.getAttribute('effort') || obj.limit.effort);\n obj.limit.velocity = parseFloat(n.getAttribute('velocity') || obj.limit.velocity);\n\n }\n });\n\n // Join the links\n parent.add(obj);\n obj.add(child);\n applyRotation(obj, rpy);\n obj.position.set(xyz[0], xyz[1], xyz[2]);\n\n // Set up the rotate function\n const axisNode = children.filter(n => n.nodeName.toLowerCase() === 'axis')[0];\n\n if (axisNode) {\n\n const axisXYZ = axisNode.getAttribute('xyz').split(/\\s+/g).map(num => parseFloat(num));\n obj.axis = new THREE.Vector3(axisXYZ[0], axisXYZ[1], axisXYZ[2]);\n obj.axis.normalize();\n\n }\n\n return obj;\n\n }\n\n // Process the nodes\n function processLink(link, visualMap, colliderMap, target = null) {\n\n if (target === null) {\n\n target = new URDFLink();\n\n }\n\n const children = [ ...link.children ];\n target.name = link.getAttribute('name');\n target.urdfName = target.name;\n target.urdfNode = link;\n\n // Extract the attributes\n children.forEach(n => {\n\n const type = n.nodeName.toLowerCase();\n if (type === 'inertial') {\n const subNodes = [ ...n.children ];\n const origin = subNodes.find(sn => sn.nodeName.toLowerCase() === 'origin');\n const xyz = origin ? origin.getAttribute('xyz') : null;\n const rpy = origin ? origin.getAttribute('rpy') : null;\n const mass = subNodes.find(sn => sn.nodeName.toLowerCase() === 'mass');\n const inertia = subNodes.find(sn => sn.nodeName.toLowerCase() === 'inertia');\n target.inertial = origin || mass || inertia ? {\n origin: xyz || rpy ? {\n xyz: xyz ? processVector(xyz) : null,\n rpy: rpy ? processVector(rpy) : null,\n } : null,\n mass: mass ? parseFloat(mass.getAttribute('value') || 0) : null,\n inertia: inertia ? {\n ixx: parseFloat(inertia.getAttribute('ixx') || 0),\n ixy: parseFloat(inertia.getAttribute('ixy') || 0),\n ixz: parseFloat(inertia.getAttribute('ixz') || 0),\n iyy: parseFloat(inertia.getAttribute('iyy') || 0),\n iyz: parseFloat(inertia.getAttribute('iyz') || 0),\n izz: parseFloat(inertia.getAttribute('izz') || 0),\n } : null,\n } : null;\n\n }\n });\n\n if (parseVisual) {\n\n const visualNodes = children.filter(n => n.nodeName.toLowerCase() === 'visual');\n visualNodes.forEach(vn => {\n\n const v = processLinkElement(vn, materialMap);\n target.add(v);\n\n if (vn.hasAttribute('name')) {\n\n const name = vn.getAttribute('name');\n v.name = name;\n v.urdfName = name;\n visualMap[name] = v;\n\n }\n\n });\n\n }\n\n if (parseCollision) {\n\n const collisionNodes = children.filter(n => n.nodeName.toLowerCase() === 'collision');\n collisionNodes.forEach(cn => {\n\n const c = processLinkElement(cn);\n target.add(c);\n\n if (cn.hasAttribute('name')) {\n\n const name = cn.getAttribute('name');\n c.name = name;\n c.urdfName = name;\n colliderMap[name] = c;\n\n }\n\n });\n\n }\n\n return target;\n\n }\n\n function processMaterial(node) {\n\n const matNodes = [ ...node.children ];\n const material = new THREE.MeshPhongMaterial();\n\n material.name = node.getAttribute('name') || '';\n matNodes.forEach(n => {\n\n const type = n.nodeName.toLowerCase();\n if (type === 'color') {\n\n const rgba =\n n\n .getAttribute('rgba')\n .split(/\\s/g)\n .map(v => parseFloat(v));\n\n material.color.setRGB(rgba[0], rgba[1], rgba[2]);\n material.opacity = rgba[3];\n material.transparent = rgba[3] < 1;\n material.depthWrite = !material.transparent;\n\n } else if (type === 'texture') {\n\n // The URDF spec does not require that the tag include\n // a filename attribute so skip loading the texture if not provided.\n const filename = n.getAttribute('filename');\n if (filename) {\n\n const loader = new THREE.TextureLoader(manager);\n const filePath = resolvePath(filename);\n material.map = loader.load(filePath);\n material.map.colorSpace = THREE.SRGBColorSpace;\n\n }\n\n }\n });\n\n return material;\n\n }\n\n // Process the visual and collision nodes into meshes\n function processLinkElement(vn, materialMap = {}) {\n\n const isCollisionNode = vn.nodeName.toLowerCase() === 'collision';\n const children = [ ...vn.children ];\n let material = null;\n\n // get the material first\n const materialNode = children.filter(n => n.nodeName.toLowerCase() === 'material')[0];\n if (materialNode) {\n\n const name = materialNode.getAttribute('name');\n if (name && name in materialMap) {\n\n material = materialMap[name];\n\n } else {\n\n material = processMaterial(materialNode);\n\n }\n\n } else {\n\n material = new THREE.MeshPhongMaterial();\n\n }\n\n const group = isCollisionNode ? new URDFCollider() : new URDFVisual();\n group.urdfNode = vn;\n\n children.forEach(n => {\n\n const type = n.nodeName.toLowerCase();\n if (type === 'geometry') {\n\n const geoType = n.children[0].nodeName.toLowerCase();\n if (geoType === 'mesh') {\n\n const filename = n.children[0].getAttribute('filename');\n const filePath = resolvePath(filename);\n\n // file path is null if a package directory is not provided.\n if (filePath !== null) {\n\n group.meshPath = filePath;\n const scaleAttr = n.children[0].getAttribute('scale');\n if (scaleAttr) {\n\n const scale = processTuple(scaleAttr);\n group.scale.set(scale[0], scale[1], scale[2]);\n\n }\n\n loadMeshCb(filePath, manager, (obj, err) => {\n\n if (err) {\n\n console.error('URDFLoader: Error loading mesh.', err);\n\n } else if (obj) {\n\n if (obj instanceof THREE.Mesh) {\n\n obj.material = material;\n\n }\n\n // We don't expect non identity rotations or positions. In the case of\n // COLLADA files the model might come in with a custom scale for unit\n // conversion.\n obj.position.set(0, 0, 0);\n obj.quaternion.identity();\n group.add(obj);\n\n }\n\n });\n\n }\n\n } else if (geoType === 'box') {\n\n const primitiveModel = new THREE.Mesh();\n primitiveModel.geometry = new THREE.BoxGeometry(1, 1, 1);\n primitiveModel.material = material;\n\n const size = processTuple(n.children[0].getAttribute('size'));\n primitiveModel.scale.set(size[0], size[1], size[2]);\n\n group.add(primitiveModel);\n\n } else if (geoType === 'sphere') {\n\n const primitiveModel = new THREE.Mesh();\n primitiveModel.geometry = new THREE.SphereGeometry(1, 30, 30);\n primitiveModel.material = material;\n\n const radius = parseFloat(n.children[0].getAttribute('radius')) || 0;\n primitiveModel.scale.set(radius, radius, radius);\n\n group.add(primitiveModel);\n\n } else if (geoType === 'cylinder') {\n\n const primitiveModel = new THREE.Mesh();\n primitiveModel.geometry = new THREE.CylinderGeometry(1, 1, 1, 30);\n primitiveModel.material = material;\n\n const radius = parseFloat(n.children[0].getAttribute('radius')) || 0;\n const length = parseFloat(n.children[0].getAttribute('length')) || 0;\n primitiveModel.scale.set(radius, length, radius);\n primitiveModel.rotation.set(Math.PI / 2, 0, 0);\n\n group.add(primitiveModel);\n\n }\n\n } else if (type === 'origin') {\n\n const xyz = processTuple(n.getAttribute('xyz'));\n const rpy = processTuple(n.getAttribute('rpy'));\n\n group.position.set(xyz[0], xyz[1], xyz[2]);\n group.rotation.set(0, 0, 0);\n applyRotation(group, rpy);\n\n }\n\n });\n\n return group;\n\n }\n\n return processUrdf(content);\n\n }\n\n // Default mesh loading function\n defaultMeshLoader(path, manager, done) {\n\n if (/\\.stl$/i.test(path)) {\n\n const loader = new STLLoader(manager);\n loader.load(path, geom => {\n const mesh = new THREE.Mesh(geom, new THREE.MeshPhongMaterial());\n done(mesh);\n });\n\n } else if (/\\.dae$/i.test(path)) {\n\n const loader = new ColladaLoader(manager);\n loader.load(path, dae => done(dae.scene));\n\n } else {\n\n console.warn(`URDFLoader: Could not load model at ${ path }.\\nNo loader available`);\n\n }\n\n }\n\n};\n"],"names":["Vector3","Euler","Matrix4","Quaternion","Object3D","THREE","STLLoader","ColladaLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAEA,MAAM,SAAS,GAAG,IAAIA,aAAO,EAAE,CAAC;IAChC,MAAM,UAAU,GAAG,IAAIC,WAAK,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAG,IAAIC,aAAO,EAAE,CAAC;IACrC,MAAM,kBAAkB,GAAG,IAAIA,aAAO,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,IAAIC,gBAAU,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,IAAIH,aAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,IAAIA,aAAO,EAAE,CAAC;AACpC;IACA,MAAM,QAAQ,SAASI,cAAQ,CAAC;AAChC;IACA,IAAI,WAAW,CAAC,GAAG,IAAI,EAAE;AACzB;IACA,QAAQ,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,QAAQ,IAAI,CA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,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI;IACtC,gBAAgB,MAAM,IAAI,GAAG,IAAID,gBAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAIA,gBAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACjF,gBAAgB,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,aAAa,CAAC,CAAC;AACf;IACA,SAAS,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AACzC;IACA,YAAY,MAAM,MAAM,GAAG,IAAIE,8BAAa,CAAC,OAAO,CAAC,CAAC;IACtD,YAAY,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACtD;IACA,SAAS,MAAM;AACf;IACA,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC,oCAAoC,GAAG,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAChG;IACA,SAAS;AACT;IACA,KAAK;AACL;IACA,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/javascript/umd/urdf-manipulator-element.js b/javascript/umd/urdf-manipulator-element.js index d8ce8963..4eed3101 100644 --- a/javascript/umd/urdf-manipulator-element.js +++ b/javascript/umd/urdf-manipulator-element.js @@ -2,7 +2,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three'), require('./urdf-viewer-element.js')) : typeof define === 'function' && define.amd ? define(['three', './urdf-viewer-element'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.URDFManipulator = factory(global.THREE, global.URDFViewer)); -}(this, (function (THREE, URDFViewer) { 'use strict'; +})(this, (function (THREE, URDFViewer) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -15,14 +15,12 @@ var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { - return e[k]; - } + get: function () { return e[k]; } }); } }); } - n['default'] = e; + n["default"] = e; return Object.freeze(n); } @@ -365,7 +363,7 @@ // joint-mouseout: Fired when a joint is no longer hovered over // manipulate-start: Fires when a joint is manipulated // manipulate-end: Fires when a joint is done being manipulated - class URDFManipulator extends URDFViewer__default['default'] { + class URDFManipulator extends URDFViewer__default["default"] { static get observedAttributes() { @@ -510,5 +508,5 @@ return URDFManipulator; -}))); +})); //# sourceMappingURL=urdf-manipulator-element.js.map diff --git a/javascript/umd/urdf-manipulator-element.js.map b/javascript/umd/urdf-manipulator-element.js.map index 3ebe1696..7ed10293 100644 --- a/javascript/umd/urdf-manipulator-element.js.map +++ b/javascript/umd/urdf-manipulator-element.js.map @@ -1 +1 @@ -{"version":3,"file":"urdf-manipulator-element.js","sources":["../src/URDFDragControls.js","../src/urdf-manipulator-element.js"],"sourcesContent":["import { Raycaster, Vector3, Plane, Vector2 } from 'three';\n\n// Find the nearest parent that is a joint\nfunction isJoint(j) {\n\n return j.isURDFJoint && j.jointType !== 'fixed';\n\n};\n\nfunction findNearestJoint(child) {\n\n let curr = child;\n while (curr) {\n\n if (isJoint(curr)) {\n\n return curr;\n\n }\n\n curr = curr.parent;\n\n }\n\n return curr;\n\n};\n\nconst prevHitPoint = new Vector3();\nconst newHitPoint = new Vector3();\nconst pivotPoint = new Vector3();\nconst tempVector = new Vector3();\nconst tempVector2 = new Vector3();\nconst projectedStartPoint = new Vector3();\nconst projectedEndPoint = new Vector3();\nconst plane = new Plane();\nexport class URDFDragControls {\n\n constructor(scene) {\n\n this.enabled = true;\n this.scene = scene;\n this.raycaster = new Raycaster();\n this.initialGrabPoint = new Vector3();\n\n this.hitDistance = -1;\n this.hovered = null;\n this.manipulating = null;\n\n }\n\n update() {\n\n const {\n raycaster,\n hovered,\n manipulating,\n scene,\n } = this;\n\n if (manipulating) {\n\n return;\n\n }\n\n let hoveredJoint = null;\n const intersections = raycaster.intersectObject(scene, true);\n if (intersections.length !== 0) {\n\n const hit = intersections[0];\n this.hitDistance = hit.distance;\n hoveredJoint = findNearestJoint(hit.object);\n this.initialGrabPoint.copy(hit.point);\n\n }\n\n if (hoveredJoint !== hovered) {\n\n if (hovered) {\n\n this.onUnhover(hovered);\n\n }\n\n this.hovered = hoveredJoint;\n\n if (hoveredJoint) {\n\n this.onHover(hoveredJoint);\n\n }\n\n }\n\n }\n\n updateJoint(joint, angle) {\n\n joint.setJointValue(angle);\n\n }\n\n onDragStart(joint) {\n\n }\n\n onDragEnd(joint) {\n\n }\n\n onHover(joint) {\n\n }\n\n onUnhover(joint) {\n\n }\n\n getRevoluteDelta(joint, startPoint, endPoint) {\n\n // set up the plane\n tempVector\n .copy(joint.axis)\n .transformDirection(joint.matrixWorld)\n .normalize();\n pivotPoint\n .set(0, 0, 0)\n .applyMatrix4(joint.matrixWorld);\n plane\n .setFromNormalAndCoplanarPoint(tempVector, pivotPoint);\n\n // project the drag points onto the plane\n plane.projectPoint(startPoint, projectedStartPoint);\n plane.projectPoint(endPoint, projectedEndPoint);\n\n // get the directions relative to the pivot\n projectedStartPoint.sub(pivotPoint);\n projectedEndPoint.sub(pivotPoint);\n\n tempVector.crossVectors(projectedStartPoint, projectedEndPoint);\n\n const direction = Math.sign(tempVector.dot(plane.normal));\n return direction * projectedEndPoint.angleTo(projectedStartPoint);\n\n }\n\n getPrismaticDelta(joint, startPoint, endPoint) {\n\n tempVector.subVectors(endPoint, startPoint);\n plane\n .normal\n .copy(joint.axis)\n .transformDirection(joint.parent.matrixWorld)\n .normalize();\n\n return tempVector.dot(plane.normal);\n\n }\n\n moveRay(toRay) {\n\n const { raycaster, hitDistance, manipulating } = this;\n const { ray } = raycaster;\n\n if (manipulating) {\n\n ray.at(hitDistance, prevHitPoint);\n toRay.at(hitDistance, newHitPoint);\n\n let delta = 0;\n if (manipulating.jointType === 'revolute' || manipulating.jointType === 'continuous') {\n\n delta = this.getRevoluteDelta(manipulating, prevHitPoint, newHitPoint);\n\n } else if (manipulating.jointType === 'prismatic') {\n\n delta = this.getPrismaticDelta(manipulating, prevHitPoint, newHitPoint);\n\n }\n\n if (delta) {\n\n this.updateJoint(manipulating, manipulating.angle + delta);\n\n }\n\n }\n\n this.raycaster.ray.copy(toRay);\n this.update();\n\n }\n\n setGrabbed(grabbed) {\n\n const { hovered, manipulating } = this;\n\n if (grabbed) {\n\n if (manipulating !== null || hovered === null) {\n\n return;\n\n }\n\n this.manipulating = hovered;\n this.onDragStart(hovered);\n\n } else {\n\n if (this.manipulating === null) {\n return;\n }\n\n this.onDragEnd(this.manipulating);\n this.manipulating = null;\n this.update();\n\n }\n\n }\n\n}\n\nexport class PointerURDFDragControls extends URDFDragControls {\n\n constructor(scene, camera, domElement) {\n\n super(scene);\n this.camera = camera;\n this.domElement = domElement;\n\n const raycaster = new Raycaster();\n const mouse = new Vector2();\n\n function updateMouse(e) {\n\n mouse.x = ((e.pageX - domElement.offsetLeft) / domElement.offsetWidth) * 2 - 1;\n mouse.y = -((e.pageY - domElement.offsetTop) / domElement.offsetHeight) * 2 + 1;\n\n }\n\n this._mouseDown = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n this.setGrabbed(true);\n\n };\n\n this._mouseMove = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n\n };\n\n this._mouseUp = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n this.setGrabbed(false);\n\n };\n\n domElement.addEventListener('mousedown', this._mouseDown);\n domElement.addEventListener('mousemove', this._mouseMove);\n domElement.addEventListener('mouseup', this._mouseUp);\n\n }\n\n getRevoluteDelta(joint, startPoint, endPoint) {\n\n const { camera, initialGrabPoint } = this;\n\n // set up the plane\n tempVector\n .copy(joint.axis)\n .transformDirection(joint.matrixWorld)\n .normalize();\n pivotPoint\n .set(0, 0, 0)\n .applyMatrix4(joint.matrixWorld);\n plane\n .setFromNormalAndCoplanarPoint(tempVector, pivotPoint);\n\n tempVector\n .copy(camera.position)\n .sub(initialGrabPoint)\n .normalize();\n\n // if looking into the plane of rotation\n if (Math.abs(tempVector.dot(plane.normal)) > 0.3) {\n\n return super.getRevoluteDelta(joint, startPoint, endPoint);\n\n } else {\n\n // get the up direction\n tempVector.set(0, 1, 0).transformDirection(camera.matrixWorld);\n\n // get points projected onto the plane of rotation\n plane.projectPoint(startPoint, projectedStartPoint);\n plane.projectPoint(endPoint, projectedEndPoint);\n\n tempVector.set(0, 0, -1).transformDirection(camera.matrixWorld);\n tempVector.cross(plane.normal);\n tempVector2.subVectors(endPoint, startPoint);\n\n return tempVector.dot(tempVector2);\n\n }\n\n }\n\n dispose() {\n\n const { domElement } = this;\n domElement.removeEventListener('mousedown', this._mouseDown);\n domElement.removeEventListener('mousemove', this._mouseMove);\n domElement.removeEventListener('mouseup', this._mouseUp);\n\n }\n\n}\n","import * as THREE from 'three';\nimport URDFViewer from './urdf-viewer-element.js';\nimport { PointerURDFDragControls } from './URDFDragControls.js';\n\n// urdf-manipulator element\n// Displays a URDF model that can be manipulated with the mouse\n\n// Events\n// joint-mouseover: Fired when a joint is hovered over\n// joint-mouseout: Fired when a joint is no longer hovered over\n// manipulate-start: Fires when a joint is manipulated\n// manipulate-end: Fires when a joint is done being manipulated\nexport default\nclass URDFManipulator extends URDFViewer {\n\n static get observedAttributes() {\n\n return ['highlight-color', ...super.observedAttributes];\n\n }\n\n get disableDragging() { return this.hasAttribute('disable-dragging'); }\n set disableDragging(val) { val ? this.setAttribute('disable-dragging', !!val) : this.removeAttribute('disable-dragging'); }\n\n get highlightColor() { return this.getAttribute('highlight-color') || '#FFFFFF'; }\n set highlightColor(val) { val ? this.setAttribute('highlight-color', val) : this.removeAttribute('highlight-color'); }\n\n constructor(...args) {\n\n super(...args);\n\n // The highlight material\n this.highlightMaterial =\n new THREE.MeshPhongMaterial({\n shininess: 10,\n color: this.highlightColor,\n emissive: this.highlightColor,\n emissiveIntensity: 0.25,\n });\n\n const isJoint = j => {\n\n return j.isURDFJoint && j.jointType !== 'fixed';\n\n };\n\n // Highlight the link geometry under a joint\n const highlightLinkGeometry = (m, revert) => {\n\n const traverse = c => {\n\n // Set or revert the highlight color\n if (c.type === 'Mesh') {\n\n if (revert) {\n\n c.material = c.__origMaterial;\n delete c.__origMaterial;\n\n } else {\n\n c.__origMaterial = c.material;\n c.material = this.highlightMaterial;\n\n }\n\n }\n\n // Look into the children and stop if the next child is\n // another joint\n if (c === m || !isJoint(c)) {\n\n for (let i = 0; i < c.children.length; i++) {\n\n const child = c.children[i];\n if (!child.isURDFCollider) {\n\n traverse(c.children[i]);\n\n }\n\n }\n\n }\n\n };\n\n traverse(m);\n\n };\n\n const el = this.renderer.domElement;\n\n const dragControls = new PointerURDFDragControls(this.scene, this.camera, el);\n dragControls.onDragStart = joint => {\n\n this.dispatchEvent(new CustomEvent('manipulate-start', { bubbles: true, cancelable: true, detail: joint.name }));\n this.controls.enabled = false;\n this.redraw();\n\n };\n dragControls.onDragEnd = joint => {\n\n this.dispatchEvent(new CustomEvent('manipulate-end', { bubbles: true, cancelable: true, detail: joint.name }));\n this.controls.enabled = true;\n this.redraw();\n\n };\n dragControls.updateJoint = (joint, angle) => {\n\n this.setJointValue(joint.name, angle);\n\n };\n dragControls.onHover = joint => {\n\n highlightLinkGeometry(joint, false);\n this.dispatchEvent(new CustomEvent('joint-mouseover', { bubbles: true, cancelable: true, detail: joint.name }));\n this.redraw();\n\n };\n dragControls.onUnhover = joint => {\n\n highlightLinkGeometry(joint, true);\n this.dispatchEvent(new CustomEvent('joint-mouseout', { bubbles: true, cancelable: true, detail: joint.name }));\n this.redraw();\n\n };\n\n this.dragControls = dragControls;\n\n }\n\n disconnectedCallback() {\n\n super.disconnectedCallback();\n this.dragControls.dispose();\n\n }\n\n attributeChangedCallback(attr, oldval, newval) {\n\n super.attributeChangedCallback(attr, oldval, newval);\n\n switch (attr) {\n\n case 'highlight-color':\n this.highlightMaterial.color.set(this.highlightColor);\n this.highlightMaterial.emissive.set(this.highlightColor);\n break;\n\n }\n\n }\n\n};\n"],"names":["Vector3","Plane","Raycaster","Vector2","URDFViewer","THREE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEA;IACA,SAAS,OAAO,CAAC,CAAC,EAAE;AACpB;IACA,IAAI,OAAO,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC;AACpD;IACA,CAAC,CAAC;AACF;IACA,SAAS,gBAAgB,CAAC,KAAK,EAAE;AACjC;IACA,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC;IACrB,IAAI,OAAO,IAAI,EAAE;AACjB;IACA,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;AAC3B;IACA,YAAY,OAAO,IAAI,CAAC;AACxB;IACA,SAAS;AACT;IACA,QAAQ,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B;IACA,KAAK;AACL;IACA,IAAI,OAAO,IAAI,CAAC;AAChB;IACA,CAAC,CAAC;AACF;IACA,MAAM,YAAY,GAAG,IAAIA,aAAO,EAAE,CAAC;IACnC,MAAM,WAAW,GAAG,IAAIA,aAAO,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,IAAIA,aAAO,EAAE,CAAC;IACjC,MAAM,UAAU,GAAG,IAAIA,aAAO,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAIA,aAAO,EAAE,CAAC;IAClC,MAAM,mBAAmB,GAAG,IAAIA,aAAO,EAAE,CAAC;IAC1C,MAAM,iBAAiB,GAAG,IAAIA,aAAO,EAAE,CAAC;IACxC,MAAM,KAAK,GAAG,IAAIC,WAAK,EAAE,CAAC;IACnB,MAAM,gBAAgB,CAAC;AAC9B;IACA,IAAI,WAAW,CAAC,KAAK,EAAE;AACvB;IACA,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IAC5B,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3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C,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACzE,gBAAgB,MAAM;AACtB;IACA,SAAS;AACT;IACA,KAAK;AACL;IACA,CAAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"urdf-manipulator-element.js","sources":["../src/URDFDragControls.js","../src/urdf-manipulator-element.js"],"sourcesContent":["import { Raycaster, Vector3, Plane, Vector2 } from 'three';\n\n// Find the nearest parent that is a joint\nfunction isJoint(j) {\n\n return j.isURDFJoint && j.jointType !== 'fixed';\n\n};\n\nfunction findNearestJoint(child) {\n\n let curr = child;\n while (curr) {\n\n if (isJoint(curr)) {\n\n return curr;\n\n }\n\n curr = curr.parent;\n\n }\n\n return curr;\n\n};\n\nconst prevHitPoint = new Vector3();\nconst newHitPoint = new Vector3();\nconst pivotPoint = new Vector3();\nconst tempVector = new Vector3();\nconst tempVector2 = new Vector3();\nconst projectedStartPoint = new Vector3();\nconst projectedEndPoint = new Vector3();\nconst plane = new Plane();\nexport class URDFDragControls {\n\n constructor(scene) {\n\n this.enabled = true;\n this.scene = scene;\n this.raycaster = new Raycaster();\n this.initialGrabPoint = new Vector3();\n\n this.hitDistance = -1;\n this.hovered = null;\n this.manipulating = null;\n\n }\n\n update() {\n\n const {\n raycaster,\n hovered,\n manipulating,\n scene,\n } = this;\n\n if (manipulating) {\n\n return;\n\n }\n\n let hoveredJoint = null;\n const intersections = raycaster.intersectObject(scene, true);\n if (intersections.length !== 0) {\n\n const hit = intersections[0];\n this.hitDistance = hit.distance;\n hoveredJoint = findNearestJoint(hit.object);\n this.initialGrabPoint.copy(hit.point);\n\n }\n\n if (hoveredJoint !== hovered) {\n\n if (hovered) {\n\n this.onUnhover(hovered);\n\n }\n\n this.hovered = hoveredJoint;\n\n if (hoveredJoint) {\n\n this.onHover(hoveredJoint);\n\n }\n\n }\n\n }\n\n updateJoint(joint, angle) {\n\n joint.setJointValue(angle);\n\n }\n\n onDragStart(joint) {\n\n }\n\n onDragEnd(joint) {\n\n }\n\n onHover(joint) {\n\n }\n\n onUnhover(joint) {\n\n }\n\n getRevoluteDelta(joint, startPoint, endPoint) {\n\n // set up the plane\n tempVector\n .copy(joint.axis)\n .transformDirection(joint.matrixWorld)\n .normalize();\n pivotPoint\n .set(0, 0, 0)\n .applyMatrix4(joint.matrixWorld);\n plane\n .setFromNormalAndCoplanarPoint(tempVector, pivotPoint);\n\n // project the drag points onto the plane\n plane.projectPoint(startPoint, projectedStartPoint);\n plane.projectPoint(endPoint, projectedEndPoint);\n\n // get the directions relative to the pivot\n projectedStartPoint.sub(pivotPoint);\n projectedEndPoint.sub(pivotPoint);\n\n tempVector.crossVectors(projectedStartPoint, projectedEndPoint);\n\n const direction = Math.sign(tempVector.dot(plane.normal));\n return direction * projectedEndPoint.angleTo(projectedStartPoint);\n\n }\n\n getPrismaticDelta(joint, startPoint, endPoint) {\n\n tempVector.subVectors(endPoint, startPoint);\n plane\n .normal\n .copy(joint.axis)\n .transformDirection(joint.parent.matrixWorld)\n .normalize();\n\n return tempVector.dot(plane.normal);\n\n }\n\n moveRay(toRay) {\n\n const { raycaster, hitDistance, manipulating } = this;\n const { ray } = raycaster;\n\n if (manipulating) {\n\n ray.at(hitDistance, prevHitPoint);\n toRay.at(hitDistance, newHitPoint);\n\n let delta = 0;\n if (manipulating.jointType === 'revolute' || manipulating.jointType === 'continuous') {\n\n delta = this.getRevoluteDelta(manipulating, prevHitPoint, newHitPoint);\n\n } else if (manipulating.jointType === 'prismatic') {\n\n delta = this.getPrismaticDelta(manipulating, prevHitPoint, newHitPoint);\n\n }\n\n if (delta) {\n\n this.updateJoint(manipulating, manipulating.angle + delta);\n\n }\n\n }\n\n this.raycaster.ray.copy(toRay);\n this.update();\n\n }\n\n setGrabbed(grabbed) {\n\n const { hovered, manipulating } = this;\n\n if (grabbed) {\n\n if (manipulating !== null || hovered === null) {\n\n return;\n\n }\n\n this.manipulating = hovered;\n this.onDragStart(hovered);\n\n } else {\n\n if (this.manipulating === null) {\n return;\n }\n\n this.onDragEnd(this.manipulating);\n this.manipulating = null;\n this.update();\n\n }\n\n }\n\n}\n\nexport class PointerURDFDragControls extends URDFDragControls {\n\n constructor(scene, camera, domElement) {\n\n super(scene);\n this.camera = camera;\n this.domElement = domElement;\n\n const raycaster = new Raycaster();\n const mouse = new Vector2();\n\n function updateMouse(e) {\n\n mouse.x = ((e.pageX - domElement.offsetLeft) / domElement.offsetWidth) * 2 - 1;\n mouse.y = -((e.pageY - domElement.offsetTop) / domElement.offsetHeight) * 2 + 1;\n\n }\n\n this._mouseDown = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n this.setGrabbed(true);\n\n };\n\n this._mouseMove = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n\n };\n\n this._mouseUp = e => {\n\n updateMouse(e);\n raycaster.setFromCamera(mouse, this.camera);\n this.moveRay(raycaster.ray);\n this.setGrabbed(false);\n\n };\n\n domElement.addEventListener('mousedown', this._mouseDown);\n domElement.addEventListener('mousemove', this._mouseMove);\n domElement.addEventListener('mouseup', this._mouseUp);\n\n }\n\n getRevoluteDelta(joint, startPoint, endPoint) {\n\n const { camera, initialGrabPoint } = this;\n\n // set up the plane\n tempVector\n .copy(joint.axis)\n .transformDirection(joint.matrixWorld)\n .normalize();\n pivotPoint\n .set(0, 0, 0)\n .applyMatrix4(joint.matrixWorld);\n plane\n .setFromNormalAndCoplanarPoint(tempVector, pivotPoint);\n\n tempVector\n .copy(camera.position)\n .sub(initialGrabPoint)\n .normalize();\n\n // if looking into the plane of rotation\n if (Math.abs(tempVector.dot(plane.normal)) > 0.3) {\n\n return super.getRevoluteDelta(joint, startPoint, endPoint);\n\n } else {\n\n // get the up direction\n tempVector.set(0, 1, 0).transformDirection(camera.matrixWorld);\n\n // get points projected onto the plane of rotation\n plane.projectPoint(startPoint, projectedStartPoint);\n plane.projectPoint(endPoint, projectedEndPoint);\n\n tempVector.set(0, 0, -1).transformDirection(camera.matrixWorld);\n tempVector.cross(plane.normal);\n tempVector2.subVectors(endPoint, startPoint);\n\n return tempVector.dot(tempVector2);\n\n }\n\n }\n\n dispose() {\n\n const { domElement } = this;\n domElement.removeEventListener('mousedown', this._mouseDown);\n domElement.removeEventListener('mousemove', this._mouseMove);\n domElement.removeEventListener('mouseup', this._mouseUp);\n\n }\n\n}\n","import * as THREE from 'three';\nimport URDFViewer from './urdf-viewer-element.js';\nimport { PointerURDFDragControls } from './URDFDragControls.js';\n\n// urdf-manipulator element\n// Displays a URDF model that can be manipulated with the mouse\n\n// Events\n// joint-mouseover: Fired when a joint is hovered over\n// joint-mouseout: Fired when a joint is no longer hovered over\n// manipulate-start: Fires when a joint is manipulated\n// manipulate-end: Fires when a joint is done being manipulated\nexport default\nclass URDFManipulator extends URDFViewer {\n\n static get observedAttributes() {\n\n return ['highlight-color', ...super.observedAttributes];\n\n }\n\n get disableDragging() { return this.hasAttribute('disable-dragging'); }\n set disableDragging(val) { val ? this.setAttribute('disable-dragging', !!val) : this.removeAttribute('disable-dragging'); }\n\n get highlightColor() { return this.getAttribute('highlight-color') || '#FFFFFF'; }\n set highlightColor(val) { val ? this.setAttribute('highlight-color', val) : this.removeAttribute('highlight-color'); }\n\n constructor(...args) {\n\n super(...args);\n\n // The highlight material\n this.highlightMaterial =\n new THREE.MeshPhongMaterial({\n shininess: 10,\n color: this.highlightColor,\n emissive: this.highlightColor,\n emissiveIntensity: 0.25,\n });\n\n const isJoint = j => {\n\n return j.isURDFJoint && j.jointType !== 'fixed';\n\n };\n\n // Highlight the link geometry under a joint\n const highlightLinkGeometry = (m, revert) => {\n\n const traverse = c => {\n\n // Set or revert the highlight color\n if (c.type === 'Mesh') {\n\n if (revert) {\n\n c.material = c.__origMaterial;\n delete c.__origMaterial;\n\n } else {\n\n c.__origMaterial = c.material;\n c.material = this.highlightMaterial;\n\n }\n\n }\n\n // Look into the children and stop if the next child is\n // another joint\n if (c === m || !isJoint(c)) {\n\n for (let i = 0; i < c.children.length; i++) {\n\n const child = c.children[i];\n if (!child.isURDFCollider) {\n\n traverse(c.children[i]);\n\n }\n\n }\n\n }\n\n };\n\n traverse(m);\n\n };\n\n const el = this.renderer.domElement;\n\n const dragControls = new PointerURDFDragControls(this.scene, this.camera, el);\n dragControls.onDragStart = joint => {\n\n this.dispatchEvent(new CustomEvent('manipulate-start', { bubbles: true, cancelable: true, detail: joint.name }));\n this.controls.enabled = false;\n this.redraw();\n\n };\n dragControls.onDragEnd = joint => {\n\n this.dispatchEvent(new CustomEvent('manipulate-end', { bubbles: true, cancelable: true, detail: joint.name }));\n this.controls.enabled = true;\n this.redraw();\n\n };\n dragControls.updateJoint = (joint, angle) => {\n\n this.setJointValue(joint.name, angle);\n\n };\n dragControls.onHover = joint => {\n\n highlightLinkGeometry(joint, false);\n this.dispatchEvent(new CustomEvent('joint-mouseover', { bubbles: true, cancelable: true, detail: joint.name }));\n this.redraw();\n\n };\n dragControls.onUnhover = joint => {\n\n highlightLinkGeometry(joint, true);\n this.dispatchEvent(new CustomEvent('joint-mouseout', { bubbles: true, cancelable: true, detail: joint.name }));\n this.redraw();\n\n };\n\n this.dragControls = dragControls;\n\n }\n\n disconnectedCallback() {\n\n super.disconnectedCallback();\n this.dragControls.dispose();\n\n }\n\n attributeChangedCallback(attr, oldval, newval) {\n\n super.attributeChangedCallback(attr, oldval, newval);\n\n switch (attr) {\n\n case 'highlight-color':\n this.highlightMaterial.color.set(this.highlightColor);\n this.highlightMaterial.emissive.set(this.highlightColor);\n break;\n\n }\n\n }\n\n};\n"],"names":["Vector3","Plane","Raycaster","Vector2","URDFViewer","THREE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEA;IACA,SAAS,OAAO,CAAC,CAAC,EAAE;AACpB;IACA,IAAI,OAAO,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC;AACpD;IACA,CAAC,CAAC;AACF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IACA,SAAS,CAAC;IACV,QAAQ,YAAY,CAAC,SAAS,GAAG,KAAK,IAAI;AAC1C;IACA,YAAY,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/C,YAAY,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3H,YAAY,IAAI,CAAC,MAAM,EAAE,CAAC;AAC1B;IACA,SAAS,CAAC;AACV;IACA,QAAQ,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;AACzC;IACA,KAAK;AACL;IACA,IAAI,oBAAoB,GAAG;AAC3B;IACA,QAAQ,KAAK,CAAC,oBAAoB,EAAE,CAAC;IACrC,QAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;AACpC;IACA,KAAK;AACL;IACA,IAAI,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACnD;IACA,QAAQ,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7D;IACA,QAAQ,QAAQ,IAAI;AACpB;IACA,YAAY,KAAK,iBAAiB;IAClC,gBAAgB,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACtE,gBAAgB,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACzE,gBAAgB,MAAM;AACtB;IACA,SAAS;AACT;IACA,KAAK;AACL;IACA,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/javascript/umd/urdf-viewer-element.js b/javascript/umd/urdf-viewer-element.js index 3558612f..e3e67f59 100644 --- a/javascript/umd/urdf-viewer-element.js +++ b/javascript/umd/urdf-viewer-element.js @@ -2,7 +2,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three'), require('three/examples/jsm/controls/OrbitControls.js'), require('./URDFLoader.js')) : typeof define === 'function' && define.amd ? define(['three', 'three/examples/jsm/controls/OrbitControls.js', './URDFLoader'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.URDFViewer = factory(global.THREE, global.THREE, global.URDFLoader)); -}(this, (function (THREE, OrbitControls_js, URDFLoader) { 'use strict'; +})(this, (function (THREE, OrbitControls_js, URDFLoader) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -15,14 +15,12 @@ var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { - return e[k]; - } + get: function () { return e[k]; } }); } }); } - n['default'] = e; + n["default"] = e; return Object.freeze(n); } @@ -64,7 +62,7 @@ get displayShadow() { return this.hasAttribute('display-shadow') || false; } set displayShadow(val) { val ? this.setAttribute('display-shadow', '') : this.removeAttribute('display-shadow'); } - get ambientColor() { return this.getAttribute('ambient-color') || '#455A64'; } + get ambientColor() { return this.getAttribute('ambient-color') || '#8ea0a8'; } set ambientColor(val) { val ? this.setAttribute('ambient-color', val) : this.removeAttribute('ambient-color'); } get autoRedraw() { return this.hasAttribute('auto-redraw') || false; } @@ -122,13 +120,13 @@ const scene = new THREE__namespace.Scene(); const ambientLight = new THREE__namespace.HemisphereLight(this.ambientColor, '#000'); - ambientLight.groundColor.lerp(ambientLight.color, 0.5); + ambientLight.groundColor.lerp(ambientLight.color, 0.5 * Math.PI); ambientLight.intensity = 0.5; ambientLight.position.set(0, 1, 0); scene.add(ambientLight); // Light setup - const dirLight = new THREE__namespace.DirectionalLight(0xffffff); + const dirLight = new THREE__namespace.DirectionalLight(0xffffff, Math.PI); dirLight.position.set(4, 10, 1); dirLight.shadow.mapSize.width = 2048; dirLight.shadow.mapSize.height = 2048; @@ -143,7 +141,7 @@ renderer.setClearAlpha(0); renderer.shadowMap.enabled = true; renderer.shadowMap.type = THREE__namespace.PCFSoftShadowMap; - renderer.outputEncoding = THREE__namespace.sRGBEncoding; + renderer.outputColorSpace = THREE__namespace.SRGBColorSpace; // Camera setup const camera = new THREE__namespace.PerspectiveCamera(75, 1, 0.1, 1000); @@ -154,8 +152,8 @@ scene.add(world); const plane = new THREE__namespace.Mesh( - new THREE__namespace.PlaneBufferGeometry(40, 40), - new THREE__namespace.ShadowMaterial({ side: THREE__namespace.DoubleSide, transparent: true, opacity: 0.5 }), + new THREE__namespace.PlaneGeometry(40, 40), + new THREE__namespace.ShadowMaterial({ side: THREE__namespace.DoubleSide, transparent: true, opacity: 0.25 }), ); plane.rotation.x = -Math.PI / 2; plane.position.y = -0.5; @@ -478,7 +476,7 @@ if (m.map) { - m.map.encoding = THREE__namespace.GammaEncoding; + m.map.colorSpace = THREE__namespace.SRGBColorSpace; } @@ -547,7 +545,7 @@ } - const loader = new URDFLoader__default['default'](manager); + const loader = new URDFLoader__default["default"](manager); loader.packages = pkg; loader.loadMeshCb = this.loadMeshFunc; loader.fetchOptions = { mode: 'cors', credentials: 'same-origin' }; @@ -642,5 +640,5 @@ return URDFViewer; -}))); +})); //# sourceMappingURL=urdf-viewer-element.js.map diff --git a/javascript/umd/urdf-viewer-element.js.map b/javascript/umd/urdf-viewer-element.js.map index ec6e24c0..2dabd26e 100644 --- a/javascript/umd/urdf-viewer-element.js.map +++ b/javascript/umd/urdf-viewer-element.js.map @@ -1 +1 @@ -{"version":3,"file":"urdf-viewer-element.js","sources":["../src/urdf-viewer-element.js"],"sourcesContent":["import * as THREE from 'three';\nimport { MeshPhongMaterial } from 'three';\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';\nimport URDFLoader from './URDFLoader.js';\n\nconst tempVec2 = new THREE.Vector2();\nconst emptyRaycast = () => {};\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\nclass URDFViewer extends HTMLElement {\n\n static get observedAttributes() {\n\n return ['package', 'urdf', 'up', 'display-shadow', 'ambient-color', 'ignore-limits', 'show-collision'];\n\n }\n\n get package() { return this.getAttribute('package') || ''; }\n set package(val) { this.setAttribute('package', val); }\n\n get urdf() { return this.getAttribute('urdf') || ''; }\n set urdf(val) { this.setAttribute('urdf', val); }\n\n get ignoreLimits() { return this.hasAttribute('ignore-limits') || false; }\n set ignoreLimits(val) { val ? this.setAttribute('ignore-limits', val) : this.removeAttribute('ignore-limits'); }\n\n get up() { return this.getAttribute('up') || '+Z'; }\n set up(val) { this.setAttribute('up', val); }\n\n get displayShadow() { return this.hasAttribute('display-shadow') || false; }\n set displayShadow(val) { val ? this.setAttribute('display-shadow', '') : this.removeAttribute('display-shadow'); }\n\n get ambientColor() { return this.getAttribute('ambient-color') || '#455A64'; }\n set ambientColor(val) { val ? this.setAttribute('ambient-color', val) : this.removeAttribute('ambient-color'); }\n\n get autoRedraw() { return this.hasAttribute('auto-redraw') || false; }\n set autoRedraw(val) { val ? this.setAttribute('auto-redraw', true) : this.removeAttribute('auto-redraw'); }\n\n get noAutoRecenter() { return this.hasAttribute('no-auto-recenter') || false; }\n set noAutoRecenter(val) { val ? this.setAttribute('no-auto-recenter', true) : this.removeAttribute('no-auto-recenter'); }\n\n get showCollision() { return this.hasAttribute('show-collision') || false; }\n set showCollision(val) { val ? this.setAttribute('show-collision', true) : this.removeAttribute('show-collision'); }\n\n get jointValues() {\n\n const values = {};\n if (this.robot) {\n\n for (const name in this.robot.joints) {\n\n const joint = this.robot.joints[name];\n values[name] = joint.jointValue.length === 1 ? joint.angle : [...joint.jointValue];\n\n }\n\n }\n\n return values;\n\n }\n set jointValues(val) { this.setJointValues(val); }\n\n get angles() {\n\n return this.jointValues;\n\n }\n set angles(v) {\n\n this.jointValues = v;\n\n }\n\n /* Lifecycle Functions */\n constructor() {\n\n super();\n\n this._requestId = 0;\n this._dirty = false;\n this._loadScheduled = false;\n this.robot = null;\n this.loadMeshFunc = null;\n this.urlModifierFunc = null;\n\n // Scene setup\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 this._collisionMaterial = new MeshPhongMaterial({\n transparent: true,\n opacity: 0.35,\n shininess: 2.5,\n premultipliedAlpha: true,\n color: 0xffbe38,\n polygonOffset: true,\n polygonOffsetFactor: -1,\n polygonOffsetUnits: -1,\n });\n\n const _renderLoop = () => {\n\n if (this.parentNode) {\n\n this.updateSize();\n\n if (this._dirty || this.autoRedraw) {\n\n if (!this.noAutoRecenter) {\n\n this._updateEnvironment();\n }\n\n this.renderer.render(scene, camera);\n this._dirty = false;\n\n }\n\n // update controls after the environment in\n // case the controls are retargeted\n this.controls.update();\n\n }\n this._renderLoopId = requestAnimationFrame(_renderLoop);\n\n };\n _renderLoop();\n\n }\n\n connectedCallback() {\n\n // Add our initialize styles for the element if they haven't\n // been added yet\n if (!this.constructor._styletag) {\n\n const styletag = document.createElement('style');\n styletag.innerHTML =\n `\n ${ this.tagName } { display: block; }\n ${ this.tagName } canvas {\n width: 100%;\n height: 100%;\n }\n `;\n document.head.appendChild(styletag);\n this.constructor._styletag = styletag;\n\n }\n\n // add the renderer\n if (this.childElementCount === 0) {\n\n this.appendChild(this.renderer.domElement);\n\n }\n\n this.updateSize();\n requestAnimationFrame(() => this.updateSize());\n\n }\n\n disconnectedCallback() {\n\n cancelAnimationFrame(this._renderLoopId);\n\n }\n\n attributeChangedCallback(attr, oldval, newval) {\n\n this._updateCollisionVisibility();\n if (!this.noAutoRecenter) {\n this.recenter();\n }\n\n switch (attr) {\n\n case 'package':\n case 'urdf': {\n\n this._scheduleLoad();\n break;\n\n }\n\n case 'up': {\n\n this._setUp(this.up);\n break;\n\n }\n\n case 'ambient-color': {\n\n this.ambientLight.color.set(this.ambientColor);\n this.ambientLight.groundColor.set('#000').lerp(this.ambientLight.color, 0.5);\n break;\n\n }\n\n case 'ignore-limits': {\n\n this._setIgnoreLimits(this.ignoreLimits, true);\n break;\n\n }\n\n }\n\n }\n\n /* Public API */\n updateSize() {\n\n const r = this.renderer;\n const w = this.clientWidth;\n const h = this.clientHeight;\n const currSize = r.getSize(tempVec2);\n\n if (currSize.width !== w || currSize.height !== h) {\n\n this.recenter();\n\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\n redraw() {\n\n this._dirty = true;\n }\n\n recenter() {\n\n this._updateEnvironment();\n this.redraw();\n\n }\n\n // Set the joint with jointName to\n // angle in degrees\n setJointValue(jointName, ...values) {\n\n if (!this.robot) return;\n if (!this.robot.joints[jointName]) return;\n\n if (this.robot.joints[jointName].setJointValue(...values)) {\n\n this.redraw();\n this.dispatchEvent(new CustomEvent('angle-change', { bubbles: true, cancelable: true, detail: jointName }));\n\n }\n\n }\n\n setJointValues(values) {\n\n for (const name in values) this.setJointValue(name, values[name]);\n\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\n const robot = this.robot;\n if (!robot) return;\n\n this.world.updateMatrixWorld();\n\n const bbox = new THREE.Box3();\n bbox.makeEmpty();\n robot.traverse(c => {\n if (c.isURDFVisual) {\n bbox.expandByObject(c);\n }\n });\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\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 }\n\n _scheduleLoad() {\n\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\n this.robot.traverse(c => c.dispose && c.dispose());\n this.robot.parent.remove(this.robot);\n this.robot = null;\n\n }\n\n requestAnimationFrame(() => {\n\n this._loadUrdf(this.package, this.urdf);\n this._loadScheduled = false;\n\n });\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, urdf) {\n\n this.dispatchEvent(new CustomEvent('urdf-change', { bubbles: true, cancelable: true, composed: true }));\n\n if (urdf) {\n\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 => {\n\n mesh.traverse(c => {\n\n if (c.isMesh) {\n\n c.castShadow = true;\n c.receiveShadow = true;\n\n if (c.material) {\n\n const mats =\n (Array.isArray(c.material) ? c.material : [c.material])\n .map(m => {\n\n if (m instanceof THREE.MeshBasicMaterial) {\n\n m = new THREE.MeshPhongMaterial();\n\n }\n\n if (m.map) {\n\n m.map.encoding = THREE.GammaEncoding;\n\n }\n\n return m;\n\n });\n c.material = mats.length === 1 ? mats[0] : mats;\n\n }\n\n }\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, value) => {\n\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\n }, {});\n }\n\n let robot = null;\n const manager = new THREE.LoadingManager();\n manager.onLoad = () => {\n\n // If another request has come in to load a new\n // robot, then ignore this one\n if (this._requestId !== requestId) {\n\n robot.traverse(c => c.dispose && c.dispose());\n return;\n\n }\n\n this.robot = robot;\n this.world.add(robot);\n updateMaterials(robot);\n\n this._setIgnoreLimits(this.ignoreLimits);\n this._updateCollisionVisibility();\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\n if (this.urlModifierFunc) {\n\n manager.setURLModifier(this.urlModifierFunc);\n\n }\n\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.parseCollision = true;\n loader.load(urdf, model => robot = model);\n\n }\n\n }\n\n _updateCollisionVisibility() {\n\n const showCollision = this.showCollision;\n const collisionMaterial = this._collisionMaterial;\n const robot = this.robot;\n\n if (robot === null) return;\n\n const colliders = [];\n robot.traverse(c => {\n\n if (c.isURDFCollider) {\n\n c.visible = showCollision;\n colliders.push(c);\n\n }\n\n });\n\n colliders.forEach(coll => {\n\n coll.traverse(c => {\n\n if (c.isMesh) {\n\n c.raycast = emptyRaycast;\n c.material = collisionMaterial;\n c.castShadow = false;\n\n }\n\n });\n\n });\n\n }\n\n // Watch the coordinate frame and update the\n // rotation of the scene to match\n _setUp(up) {\n\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\n // Updates the current robot's angles to ignore\n // joint limits or not\n _setIgnoreLimits(ignore, dispatch = false) {\n\n if (this.robot) {\n\n Object\n .values(this.robot.joints)\n .forEach(joint => {\n\n joint.ignoreLimits = ignore;\n joint.setJointValue(...joint.jointValue);\n\n });\n\n }\n\n if (dispatch) {\n\n this.dispatchEvent(new CustomEvent('ignore-limits-change', { bubbles: true, cancelable: true, composed: true }));\n\n }\n\n }\n\n};\n"],"names":["THREE","OrbitControls","MeshPhongMaterial","URDFLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKA,MAAM,QAAQ,GAAG,IAAIA,gBAAK,CAAC,OAAO,EAAE,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC;AAC9B;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA,MAAM,UAAU,SAAS,WAAW,CAAC;AACrC;IACA,IAAI,WAAW,kBAAkB,GAAG;AACpC;IACA,QAAQ,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAC/G;IACA,KAAK;AACL;IACA,IAAI,IAAI,OAAO,GAAG,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE;IAChE,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,EAAE;AAC3D;IACA,IAAI,IAAI,IAAI,GAAG,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE;IAC1D,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,CAA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AAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"urdf-viewer-element.js","sources":["../src/urdf-viewer-element.js"],"sourcesContent":["import * as THREE from 'three';\nimport { MeshPhongMaterial } from 'three';\nimport { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';\nimport URDFLoader from './URDFLoader.js';\n\nconst tempVec2 = new THREE.Vector2();\nconst emptyRaycast = () => {};\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\nclass URDFViewer extends HTMLElement {\n\n static get observedAttributes() {\n\n return ['package', 'urdf', 'up', 'display-shadow', 'ambient-color', 'ignore-limits', 'show-collision'];\n\n }\n\n get package() { return this.getAttribute('package') || ''; }\n set package(val) { this.setAttribute('package', val); }\n\n get urdf() { return this.getAttribute('urdf') || ''; }\n set urdf(val) { this.setAttribute('urdf', val); }\n\n get ignoreLimits() { return this.hasAttribute('ignore-limits') || false; }\n set ignoreLimits(val) { val ? this.setAttribute('ignore-limits', val) : this.removeAttribute('ignore-limits'); }\n\n get up() { return this.getAttribute('up') || '+Z'; }\n set up(val) { this.setAttribute('up', val); }\n\n get displayShadow() { return this.hasAttribute('display-shadow') || false; }\n set displayShadow(val) { val ? this.setAttribute('display-shadow', '') : this.removeAttribute('display-shadow'); }\n\n get ambientColor() { return this.getAttribute('ambient-color') || '#8ea0a8'; }\n set ambientColor(val) { val ? this.setAttribute('ambient-color', val) : this.removeAttribute('ambient-color'); }\n\n get autoRedraw() { return this.hasAttribute('auto-redraw') || false; }\n set autoRedraw(val) { val ? this.setAttribute('auto-redraw', true) : this.removeAttribute('auto-redraw'); }\n\n get noAutoRecenter() { return this.hasAttribute('no-auto-recenter') || false; }\n set noAutoRecenter(val) { val ? this.setAttribute('no-auto-recenter', true) : this.removeAttribute('no-auto-recenter'); }\n\n get showCollision() { return this.hasAttribute('show-collision') || false; }\n set showCollision(val) { val ? this.setAttribute('show-collision', true) : this.removeAttribute('show-collision'); }\n\n get jointValues() {\n\n const values = {};\n if (this.robot) {\n\n for (const name in this.robot.joints) {\n\n const joint = this.robot.joints[name];\n values[name] = joint.jointValue.length === 1 ? joint.angle : [...joint.jointValue];\n\n }\n\n }\n\n return values;\n\n }\n set jointValues(val) { this.setJointValues(val); }\n\n get angles() {\n\n return this.jointValues;\n\n }\n set angles(v) {\n\n this.jointValues = v;\n\n }\n\n /* Lifecycle Functions */\n constructor() {\n\n super();\n\n this._requestId = 0;\n this._dirty = false;\n this._loadScheduled = false;\n this.robot = null;\n this.loadMeshFunc = null;\n this.urlModifierFunc = null;\n\n // Scene setup\n const scene = new THREE.Scene();\n\n const ambientLight = new THREE.HemisphereLight(this.ambientColor, '#000');\n ambientLight.groundColor.lerp(ambientLight.color, 0.5 * Math.PI);\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, Math.PI);\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.outputColorSpace = THREE.SRGBColorSpace;\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.PlaneGeometry(40, 40),\n new THREE.ShadowMaterial({ side: THREE.DoubleSide, transparent: true, opacity: 0.25 }),\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 this._collisionMaterial = new MeshPhongMaterial({\n transparent: true,\n opacity: 0.35,\n shininess: 2.5,\n premultipliedAlpha: true,\n color: 0xffbe38,\n polygonOffset: true,\n polygonOffsetFactor: -1,\n polygonOffsetUnits: -1,\n });\n\n const _renderLoop = () => {\n\n if (this.parentNode) {\n\n this.updateSize();\n\n if (this._dirty || this.autoRedraw) {\n\n if (!this.noAutoRecenter) {\n\n this._updateEnvironment();\n }\n\n this.renderer.render(scene, camera);\n this._dirty = false;\n\n }\n\n // update controls after the environment in\n // case the controls are retargeted\n this.controls.update();\n\n }\n this._renderLoopId = requestAnimationFrame(_renderLoop);\n\n };\n _renderLoop();\n\n }\n\n connectedCallback() {\n\n // Add our initialize styles for the element if they haven't\n // been added yet\n if (!this.constructor._styletag) {\n\n const styletag = document.createElement('style');\n styletag.innerHTML =\n `\n ${ this.tagName } { display: block; }\n ${ this.tagName } canvas {\n width: 100%;\n height: 100%;\n }\n `;\n document.head.appendChild(styletag);\n this.constructor._styletag = styletag;\n\n }\n\n // add the renderer\n if (this.childElementCount === 0) {\n\n this.appendChild(this.renderer.domElement);\n\n }\n\n this.updateSize();\n requestAnimationFrame(() => this.updateSize());\n\n }\n\n disconnectedCallback() {\n\n cancelAnimationFrame(this._renderLoopId);\n\n }\n\n attributeChangedCallback(attr, oldval, newval) {\n\n this._updateCollisionVisibility();\n if (!this.noAutoRecenter) {\n this.recenter();\n }\n\n switch (attr) {\n\n case 'package':\n case 'urdf': {\n\n this._scheduleLoad();\n break;\n\n }\n\n case 'up': {\n\n this._setUp(this.up);\n break;\n\n }\n\n case 'ambient-color': {\n\n this.ambientLight.color.set(this.ambientColor);\n this.ambientLight.groundColor.set('#000').lerp(this.ambientLight.color, 0.5);\n break;\n\n }\n\n case 'ignore-limits': {\n\n this._setIgnoreLimits(this.ignoreLimits, true);\n break;\n\n }\n\n }\n\n }\n\n /* Public API */\n updateSize() {\n\n const r = this.renderer;\n const w = this.clientWidth;\n const h = this.clientHeight;\n const currSize = r.getSize(tempVec2);\n\n if (currSize.width !== w || currSize.height !== h) {\n\n this.recenter();\n\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\n redraw() {\n\n this._dirty = true;\n }\n\n recenter() {\n\n this._updateEnvironment();\n this.redraw();\n\n }\n\n // Set the joint with jointName to\n // angle in degrees\n setJointValue(jointName, ...values) {\n\n if (!this.robot) return;\n if (!this.robot.joints[jointName]) return;\n\n if (this.robot.joints[jointName].setJointValue(...values)) {\n\n this.redraw();\n this.dispatchEvent(new CustomEvent('angle-change', { bubbles: true, cancelable: true, detail: jointName }));\n\n }\n\n }\n\n setJointValues(values) {\n\n for (const name in values) this.setJointValue(name, values[name]);\n\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\n const robot = this.robot;\n if (!robot) return;\n\n this.world.updateMatrixWorld();\n\n const bbox = new THREE.Box3();\n bbox.makeEmpty();\n robot.traverse(c => {\n if (c.isURDFVisual) {\n bbox.expandByObject(c);\n }\n });\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\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 }\n\n _scheduleLoad() {\n\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\n this.robot.traverse(c => c.dispose && c.dispose());\n this.robot.parent.remove(this.robot);\n this.robot = null;\n\n }\n\n requestAnimationFrame(() => {\n\n this._loadUrdf(this.package, this.urdf);\n this._loadScheduled = false;\n\n });\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, urdf) {\n\n this.dispatchEvent(new CustomEvent('urdf-change', { bubbles: true, cancelable: true, composed: true }));\n\n if (urdf) {\n\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 => {\n\n mesh.traverse(c => {\n\n if (c.isMesh) {\n\n c.castShadow = true;\n c.receiveShadow = true;\n\n if (c.material) {\n\n const mats =\n (Array.isArray(c.material) ? c.material : [c.material])\n .map(m => {\n\n if (m instanceof THREE.MeshBasicMaterial) {\n\n m = new THREE.MeshPhongMaterial();\n\n }\n\n if (m.map) {\n\n m.map.colorSpace = THREE.SRGBColorSpace;\n\n }\n\n return m;\n\n });\n c.material = mats.length === 1 ? mats[0] : mats;\n\n }\n\n }\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, value) => {\n\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\n }, {});\n }\n\n let robot = null;\n const manager = new THREE.LoadingManager();\n manager.onLoad = () => {\n\n // If another request has come in to load a new\n // robot, then ignore this one\n if (this._requestId !== requestId) {\n\n robot.traverse(c => c.dispose && c.dispose());\n return;\n\n }\n\n this.robot = robot;\n this.world.add(robot);\n updateMaterials(robot);\n\n this._setIgnoreLimits(this.ignoreLimits);\n this._updateCollisionVisibility();\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\n if (this.urlModifierFunc) {\n\n manager.setURLModifier(this.urlModifierFunc);\n\n }\n\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.parseCollision = true;\n loader.load(urdf, model => robot = model);\n\n }\n\n }\n\n _updateCollisionVisibility() {\n\n const showCollision = this.showCollision;\n const collisionMaterial = this._collisionMaterial;\n const robot = this.robot;\n\n if (robot === null) return;\n\n const colliders = [];\n robot.traverse(c => {\n\n if (c.isURDFCollider) {\n\n c.visible = showCollision;\n colliders.push(c);\n\n }\n\n });\n\n colliders.forEach(coll => {\n\n coll.traverse(c => {\n\n if (c.isMesh) {\n\n c.raycast = emptyRaycast;\n c.material = collisionMaterial;\n c.castShadow = false;\n\n }\n\n });\n\n });\n\n }\n\n // Watch the coordinate frame and update the\n // rotation of the scene to match\n _setUp(up) {\n\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\n // Updates the current robot's angles to ignore\n // joint limits or not\n _setIgnoreLimits(ignore, dispatch = false) {\n\n if (this.robot) {\n\n Object\n .values(this.robot.joints)\n .forEach(joint => {\n\n joint.ignoreLimits = ignore;\n joint.setJointValue(...joint.jointValue);\n\n });\n\n }\n\n if (dispatch) {\n\n this.dispatchEvent(new CustomEvent('ignore-limits-change', { bubbles: true, cancelable: true, composed: true }));\n\n }\n\n }\n\n};\n"],"names":["THREE","OrbitControls","MeshPhongMaterial","URDFLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKA,MAAM,QAAQ,GAAG,IAAIA,gBAAK,CAAC,OAAO,EAAE,CAAC;IACrC,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC;AAC9B;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA,MAAM,UAAU,SAAS,WAAW,CAAC;AACrC;IACA,IAAI,WAAW,kBAAkB,GAAG;AACpC;IACA,QAAQ,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC;AAC/G;IACA,KAAK;AACL;IACA,IAAI,IAAI,OAAO,GAAG,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GAAG,MAAM,CAAC;IAChD,oBAAoB,KAAK,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAC7D;IACA,iBAAiB,CAAC,CAAC;AACnB;IACA,SAAS;AACT;IACA,QAAQ,IAAI,QAAQ,EAAE;AACtB;IACA,YAAY,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,sBAAsB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7H;IACA,SAAS;AACT;IACA,KAAK;AACL;IACA,CAAC;;;;;;;;"} \ No newline at end of file From 5bee231dfe78d5002d37dfca78e95d2d8e44943c Mon Sep 17 00:00:00 2001 From: Dave Kozma Date: Thu, 21 Nov 2024 16:53:34 -0500 Subject: [PATCH 3/3] Add tests --- javascript/test/URDFRobot.test.js | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/javascript/test/URDFRobot.test.js b/javascript/test/URDFRobot.test.js index 871e0c0c..ea071e87 100644 --- a/javascript/test/URDFRobot.test.js +++ b/javascript/test/URDFRobot.test.js @@ -1,4 +1,5 @@ import { JSDOM } from 'jsdom'; +import { Vector3 } from 'three'; import URDFLoader from '../src/URDFLoader.js'; const jsdom = new JSDOM(); @@ -35,6 +36,77 @@ describe('URDFRobot', () => { expect(robot.joints.JOINT2.angle).toEqual(2); }); + it('should correctly parse joint efforts and velocities.', () => { + const loader = new URDFLoader(); + const robot = loader.parse(` + + + + + + + + + + + + + + + + + `); + + expect(robot.joints.JOINT1.limit.effort).toEqual(150); + expect(robot.joints.JOINT1.limit.lower).toEqual(-3.14); + expect(robot.joints.JOINT1.limit.upper).toEqual(3.14); + expect(robot.joints.JOINT1.limit.velocity).toEqual(5.20); + + expect(robot.joints.JOINT2.limit.effort).toEqual(null); + expect(robot.joints.JOINT2.limit.lower).toEqual(0); + expect(robot.joints.JOINT2.limit.upper).toEqual(0); + expect(robot.joints.JOINT2.limit.velocity).toEqual(null); + }); + + it('should correctly parse joint inertial data.', () => { + const loader = new URDFLoader(); + const robot = loader.parse(` + + + + + + + + + + + + + + + + + + + + + + `); + + expect(robot.links.LINK1.inertial.origin.rpy).toEqual(new Vector3(0, 0, -1.5707963267948966)); + expect(robot.links.LINK1.inertial.origin.xyz).toEqual(new Vector3(0.14635000035763, 0, 0)); + expect(robot.links.LINK1.inertial.mass).toEqual(2.5076); + expect(robot.links.LINK1.inertial.inertia.ixx).toEqual(0.00443333156); + expect(robot.links.LINK1.inertial.inertia.iyy).toEqual(0.00443333156); + expect(robot.links.LINK1.inertial.inertia.izz).toEqual(0.0072); + expect(robot.links.LINK1.inertial.inertia.ixy).toEqual(0); + expect(robot.links.LINK1.inertial.inertia.ixz).toEqual(0); + expect(robot.links.LINK1.inertial.inertia.iyz).toEqual(0); + + expect(robot.links.LINK2.inertial).toEqual(null); + }); + it('should parse material colors and name.', () => { const loader = new URDFLoader(); const res = loader.parse(`