pubo-web 1.0.13 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pubo-web.js +1 -13
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -3
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -19
- package/package.json +3 -3
- package/es/ros/factory/configure.d.ts +0 -14
- package/es/ros/factory/configure.js +0 -230
- package/es/ros/factory/index.d.ts +0 -32
- package/es/ros/factory/index.js +0 -116
- package/es/ros/factory/super.d.ts +0 -11
- package/es/ros/factory/super.js +0 -43
- package/es/ros/index.d.ts +0 -7
- package/es/ros/index.js +0 -10
- package/es/ros/ros3d/inject.d.ts +0 -6
- package/es/ros/ros3d/inject.js +0 -39
- package/es/ros/ros3d/utils.d.ts +0 -11
- package/es/ros/ros3d/utils.js +0 -249
- package/es/ros/ros3d/viewer.d.ts +0 -19
- package/es/ros/ros3d/viewer.js +0 -244
- package/lib/ros/factory/configure.d.ts +0 -14
- package/lib/ros/factory/configure.js +0 -243
- package/lib/ros/factory/index.d.ts +0 -32
- package/lib/ros/factory/index.js +0 -130
- package/lib/ros/factory/super.d.ts +0 -11
- package/lib/ros/factory/super.js +0 -50
- package/lib/ros/index.d.ts +0 -7
- package/lib/ros/index.js +0 -19
- package/lib/ros/ros3d/inject.d.ts +0 -6
- package/lib/ros/ros3d/inject.js +0 -46
- package/lib/ros/ros3d/utils.d.ts +0 -11
- package/lib/ros/ros3d/utils.js +0 -272
- package/lib/ros/ros3d/viewer.d.ts +0 -19
- package/lib/ros/ros3d/viewer.js +0 -259
package/dist/pubo-web.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["pubo-web"]=e():t["pubo-web"]=e()}(this,(function(){return function(t){var e={};function n(
|
|
2
|
-
/*
|
|
3
|
-
object-assign
|
|
4
|
-
(c) Sindre Sorhus
|
|
5
|
-
@license MIT
|
|
6
|
-
*/var i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(t){i[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,a,c=o(t),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))r.call(n,l)&&(c[l]=n[l]);if(i){a=i(n);for(var h=0;h<a.length;h++)s.call(n,a[h])&&(c[a[h]]=n[a[h]])}}return c}},function(t,e,n){(function(i,r){var s;
|
|
7
|
-
/*!
|
|
8
|
-
* EventEmitter2
|
|
9
|
-
* https://github.com/hij1nx/EventEmitter2
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2013 hij1nx
|
|
12
|
-
* Licensed under the MIT license.
|
|
13
|
-
*/!function(o){var a=Object.hasOwnProperty,c=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},u="object"==typeof i&&"function"==typeof i.nextTick,l="function"==typeof Symbol,h="object"==typeof Reflect,f="function"==typeof r?r:setTimeout,p=l?h&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(t){var e=Object.getOwnPropertyNames(t);return e.push.apply(e,Object.getOwnPropertySymbols(t)),e}:Object.keys;function v(){this._events={},this._conf&&m.call(this,this._conf)}function m(t){t&&(this._conf=t,t.delimiter&&(this.delimiter=t.delimiter),void 0!==t.maxListeners&&(this._maxListeners=t.maxListeners),t.wildcard&&(this.wildcard=t.wildcard),t.newListener&&(this._newListener=t.newListener),t.removeListener&&(this._removeListener=t.removeListener),t.verboseMemoryLeak&&(this.verboseMemoryLeak=t.verboseMemoryLeak),t.ignoreErrors&&(this.ignoreErrors=t.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function y(t,e){var n="(node) warning: possible EventEmitter memory leak detected. "+t+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(n+=" Event name: "+e+"."),void 0!==i&&i.emitWarning){var r=new Error(n);r.name="MaxListenersExceededWarning",r.emitter=this,r.count=t,i.emitWarning(r)}else console.error(n),console.trace&&console.trace()}var d=function(t,e,n){var i=arguments.length;switch(i){case 0:return[];case 1:return[t];case 2:return[t,e];case 3:return[t,e,n];default:for(var r=new Array(i);i--;)r[i]=arguments[i];return r}};function b(t,e){for(var n={},i=t.length,r=e?value.length:0,s=0;s<i;s++)n[t[s]]=s<r?e[s]:void 0;return n}function g(t,e,n){var i,r;if(this._emitter=t,this._target=e,this._listeners={},this._listenersCount=0,(n.on||n.off)&&(i=n.on,r=n.off),e.addEventListener?(i=e.addEventListener,r=e.removeEventListener):e.addListener?(i=e.addListener,r=e.removeListener):e.on&&(i=e.on,r=e.off),!i&&!r)throw Error("target does not implement any known event API");if("function"!=typeof i)throw TypeError("on method must be a function");if("function"!=typeof r)throw TypeError("off method must be a function");this._on=i,this._off=r;var s=t._observers;s?s.push(this):t._observers=[this]}function w(t,e,n,i){var r=Object.assign({},e);if(!t)return r;if("object"!=typeof t)throw TypeError("options must be an object");var s,o,c,u=Object.keys(t),l=u.length;function h(t){throw Error('Invalid "'+s+'" option value'+(t?". Reason: "+t:""))}for(var f=0;f<l;f++){if(s=u[f],!i&&!a.call(e,s))throw Error('Unknown "'+s+'" option');void 0!==(o=t[s])&&(c=n[s],r[s]=c?c(o,h):o)}return r}function _(t,e){return"function"==typeof t&&t.hasOwnProperty("prototype")||e("value must be a constructor"),t}function x(t){var e="value must be type of "+t.join("|"),n=t.length,i=t[0],r=t[1];return 1===n?function(t,n){if(typeof t===i)return t;n(e)}:2===n?function(t,n){var s=typeof t;if(s===i||s===r)return t;n(e)}:function(i,r){for(var s=typeof i,o=n;o-- >0;)if(s===t[o])return i;r(e)}}Object.assign(g.prototype,{subscribe:function(t,e,n){var i=this,r=this._target,s=this._emitter,o=this._listeners,a=function(){var i=d.apply(null,arguments),o={data:i,name:e,original:t};if(n){var a=n.call(r,o);!1!==a&&s.emit.apply(s,[o.name].concat(i))}else s.emit.apply(s,[e].concat(i))};if(o[t])throw Error("Event '"+t+"' is already listening");this._listenersCount++,s._newListener&&s._removeListener&&!i._onNewListener?(this._onNewListener=function(n){n===e&&null===o[t]&&(o[t]=a,i._on.call(r,t,a))},s.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===e&&!s.hasListeners(n)&&o[t]&&(o[t]=null,i._off.call(r,t,a))},o[t]=null,s.on("removeListener",this._onRemoveListener)):(o[t]=a,i._on.call(r,t,a))},unsubscribe:function(t){var e,n,i,r=this,s=this._listeners,o=this._emitter,a=this._off,c=this._target;if(t&&"string"!=typeof t)throw TypeError("event must be a string");function u(){r._onNewListener&&(o.off("newListener",r._onNewListener),o.off("removeListener",r._onRemoveListener),r._onNewListener=null,r._onRemoveListener=null);var t=L.call(o,r);o._observers.splice(t,1)}if(t){if(!(e=s[t]))return;a.call(c,t,e),delete s[t],--this._listenersCount||u()}else{for(i=(n=p(s)).length;i-- >0;)t=n[i],a.call(c,t,s[t]);this._listeners={},this._listenersCount=0,u()}}});var T=x(["function"]),k=x(["object","function"]);function S(t,e,n){var i,r,s,o=0,a=new t((function(c,u,l){function h(){r&&(r=null),o&&(clearTimeout(o),o=0)}n=w(n,{timeout:0,overload:!1},{timeout:function(t,e){return("number"!=typeof(t*=1)||t<0||!Number.isFinite(t))&&e("timeout must be a positive number"),t}}),i=!n.overload&&"function"==typeof t.prototype.cancel&&"function"==typeof l;var f=function(t){h(),c(t)},p=function(t){h(),u(t)};i?e(f,p,l):(r=[function(t){p(t||Error("canceled"))}],e(f,p,(function(t){if(s)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof t)throw TypeError("onCancel callback must be a function");r.push(t)})),s=!0),n.timeout>0&&(o=setTimeout((function(){var t=Error("timeout");t.code="ETIMEDOUT",o=0,a.cancel(t),u(t)}),n.timeout))}));return i||(a.cancel=function(t){if(r){for(var e=r.length,n=1;n<e;n++)r[n](t);r[0](t),r=null}}),a}function L(t){var e=this._observers;if(!e)return-1;for(var n=e.length,i=0;i<n;i++)if(e[i]._target===t)return i;return-1}function M(t,e,n,i,r){if(!n)return null;if(0===i){var s=typeof e;if("string"===s){var o,a,c=0,u=0,l=this.delimiter,h=l.length;if(-1!==(a=e.indexOf(l))){o=new Array(5);do{o[c++]=e.slice(u,a),u=a+h}while(-1!==(a=e.indexOf(l,u)));o[c++]=e.slice(u),e=o,r=c}else e=[e],r=1}else"object"===s?r=e.length:(e=[e],r=1)}var f,v,m,y,d,b,g,w=null,_=e[i],x=e[i+1];if(i===r)n._listeners&&("function"==typeof n._listeners?(t&&t.push(n._listeners),w=[n]):(t&&t.push.apply(t,n._listeners),w=[n]));else{if("*"===_){for(a=(b=p(n)).length;a-- >0;)"_listeners"!==(f=b[a])&&(g=M(t,e,n[f],i+1,r))&&(w?w.push.apply(w,g):w=g);return w}if("**"===_){for((d=i+1===r||i+2===r&&"*"===x)&&n._listeners&&(w=M(t,e,n,r,r)),a=(b=p(n)).length;a-- >0;)"_listeners"!==(f=b[a])&&("*"===f||"**"===f?(n[f]._listeners&&!d&&(g=M(t,e,n[f],r,r))&&(w?w.push.apply(w,g):w=g),g=M(t,e,n[f],i,r)):g=M(t,e,n[f],f===x?i+2:i,r),g&&(w?w.push.apply(w,g):w=g));return w}n[_]&&(w=M(t,e,n[_],i+1,r))}if((v=n["*"])&&M(t,e,v,i+1,r),m=n["**"])if(i<r)for(m._listeners&&M(t,e,m,r,r),a=(b=p(m)).length;a-- >0;)"_listeners"!==(f=b[a])&&(f===x?M(t,e,m[f],i+2,r):f===_?M(t,e,m[f],i+1,r):((y={})[f]=m[f],M(t,e,{"**":y},i+1,r)));else m._listeners?M(t,e,m,r,r):m["*"]&&m["*"]._listeners&&M(t,e,m["*"],r,r);return w}function O(t,e,n){var i,r,s=0,o=0,a=this.delimiter,c=a.length;if("string"==typeof t)if(-1!==(i=t.indexOf(a))){r=new Array(5);do{r[s++]=t.slice(o,i),o=i+c}while(-1!==(i=t.indexOf(a,o)));r[s++]=t.slice(o)}else r=[t],s=1;else r=t,s=t.length;if(s>1)for(i=0;i+1<s;i++)if("**"===r[i]&&"**"===r[i+1])return;var u,l=this.listenerTree;for(i=0;i<s;i++)if(l=l[u=r[i]]||(l[u]={}),i===s-1)return l._listeners?("function"==typeof l._listeners&&(l._listeners=[l._listeners]),n?l._listeners.unshift(e):l._listeners.push(e),!l._listeners.warned&&this._maxListeners>0&&l._listeners.length>this._maxListeners&&(l._listeners.warned=!0,y.call(this,l._listeners.length,u))):l._listeners=e,!0;return!0}function A(t,e,n,i){for(var r,s,o,a,c=p(t),u=c.length,l=t._listeners;u-- >0;)r=t[s=c[u]],o="_listeners"===s?n:n?n.concat(s):[s],a=i||"symbol"==typeof s,l&&e.push(a?o:o.join(this.delimiter)),"object"==typeof r&&A.call(this,r,e,o,a);return e}function E(t){for(var e,n,i,r=p(t),s=r.length;s-- >0;)(e=t[n=r[s]])&&(i=!0,"_listeners"===n||E(e)||delete t[n]);return i}function F(t,e,n){this.emitter=t,this.event=e,this.listener=n}function j(t,e,n){if(!0===n)s=!0;else if(!1===n)r=!0;else{if(!n||"object"!=typeof n)throw TypeError("options should be an object or true");var r=n.async,s=n.promisify,o=n.nextTick,a=n.objectify}if(r||o||s){var c=e,l=e._origin||e;if(o&&!u)throw Error("process.nextTick is not supported");void 0===s&&(s="AsyncFunction"===e.constructor.name),(e=function(){var t=arguments,e=this,n=this.event;return s?o?Promise.resolve():new Promise((function(t){f(t)})).then((function(){return e.event=n,c.apply(e,t)})):(o?i.nextTick:f)((function(){e.event=n,c.apply(e,t)}))})._async=!0,e._origin=l}return[e,a?new F(this,t,e):this]}function C(t){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,m.call(this,t)}F.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},C.EventEmitter2=C,C.prototype.listenTo=function(t,e,n){if("object"!=typeof t)throw TypeError("target musts be an object");var i=this;function r(e){if("object"!=typeof e)throw TypeError("events must be an object");var r,s=n.reducers,o=L.call(i,t);r=-1===o?new g(i,t,n):i._observers[o];for(var a,c=p(e),u=c.length,l="function"==typeof s,h=0;h<u;h++)a=c[h],r.subscribe(a,e[a]||a,l?s:s&&s[a])}return n=w(n,{on:void 0,off:void 0,reducers:void 0},{on:T,off:T,reducers:k}),c(e)?r(b(e)):r("string"==typeof e?b(e.split(/\s+/)):e),this},C.prototype.stopListeningTo=function(t,e){var n=this._observers;if(!n)return!1;var i,r=n.length,s=!1;if(t&&"object"!=typeof t)throw TypeError("target should be an object");for(;r-- >0;)i=n[r],t&&i._target!==t||(i.unsubscribe(e),s=!0);return s},C.prototype.delimiter=".",C.prototype.setMaxListeners=function(t){void 0!==t&&(this._maxListeners=t,this._conf||(this._conf={}),this._conf.maxListeners=t)},C.prototype.getMaxListeners=function(){return this._maxListeners},C.prototype.event="",C.prototype.once=function(t,e,n){return this._once(t,e,!1,n)},C.prototype.prependOnceListener=function(t,e,n){return this._once(t,e,!0,n)},C.prototype._once=function(t,e,n,i){return this._many(t,1,e,n,i)},C.prototype.many=function(t,e,n,i){return this._many(t,e,n,!1,i)},C.prototype.prependMany=function(t,e,n,i){return this._many(t,e,n,!0,i)},C.prototype._many=function(t,e,n,i,r){var s=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");function o(){return 0==--e&&s.off(t,o),n.apply(this,arguments)}return o._origin=n,this._on(t,o,i,r)},C.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||v.call(this);var t,e,n,i,r,s,o=arguments[0],a=this.wildcard;if("newListener"===o&&!this._newListener&&!this._events.newListener)return!1;if(a&&(t=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){if(n=o.length,l)for(i=0;i<n;i++)if("symbol"==typeof o[i]){s=!0;break}s||(o=o.join(this.delimiter))}var c,u=arguments.length;if(this._all&&this._all.length)for(i=0,n=(c=this._all.slice()).length;i<n;i++)switch(this.event=o,u){case 1:c[i].call(this,o);break;case 2:c[i].call(this,o,arguments[1]);break;case 3:c[i].call(this,o,arguments[1],arguments[2]);break;default:c[i].apply(this,arguments)}if(a)c=[],M.call(this,c,t,this.listenerTree,0,n);else{if("function"==typeof(c=this._events[o])){switch(this.event=o,u){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(e=new Array(u-1),r=1;r<u;r++)e[r-1]=arguments[r];c.apply(this,e)}return!0}c&&(c=c.slice())}if(c&&c.length){if(u>3)for(e=new Array(u-1),r=1;r<u;r++)e[r-1]=arguments[r];for(i=0,n=c.length;i<n;i++)switch(this.event=o,u){case 1:c[i].call(this);break;case 2:c[i].call(this,arguments[1]);break;case 3:c[i].call(this,arguments[1],arguments[2]);break;default:c[i].apply(this,e)}return!0}if(!this.ignoreErrors&&!this._all&&"error"===o)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},C.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||v.call(this);var t,e,n,i,r,s,o=arguments[0],a=this.wildcard;if("newListener"===o&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(a&&(t=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){if(i=o.length,l)for(r=0;r<i;r++)if("symbol"==typeof o[r]){e=!0;break}e||(o=o.join(this.delimiter))}var c,u=[],h=arguments.length;if(this._all)for(r=0,i=this._all.length;r<i;r++)switch(this.event=o,h){case 1:u.push(this._all[r].call(this,o));break;case 2:u.push(this._all[r].call(this,o,arguments[1]));break;case 3:u.push(this._all[r].call(this,o,arguments[1],arguments[2]));break;default:u.push(this._all[r].apply(this,arguments))}if(a?(c=[],M.call(this,c,t,this.listenerTree,0)):c=this._events[o],"function"==typeof c)switch(this.event=o,h){case 1:u.push(c.call(this));break;case 2:u.push(c.call(this,arguments[1]));break;case 3:u.push(c.call(this,arguments[1],arguments[2]));break;default:for(n=new Array(h-1),s=1;s<h;s++)n[s-1]=arguments[s];u.push(c.apply(this,n))}else if(c&&c.length){if(c=c.slice(),h>3)for(n=new Array(h-1),s=1;s<h;s++)n[s-1]=arguments[s];for(r=0,i=c.length;r<i;r++)switch(this.event=o,h){case 1:u.push(c[r].call(this));break;case 2:u.push(c[r].call(this,arguments[1]));break;case 3:u.push(c[r].call(this,arguments[1],arguments[2]));break;default:u.push(c[r].apply(this,n))}}else if(!this.ignoreErrors&&!this._all&&"error"===o)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(u)},C.prototype.on=function(t,e,n){return this._on(t,e,!1,n)},C.prototype.prependListener=function(t,e,n){return this._on(t,e,!0,n)},C.prototype.onAny=function(t){return this._onAny(t,!1)},C.prototype.prependAny=function(t){return this._onAny(t,!0)},C.prototype.addListener=C.prototype.on,C.prototype._onAny=function(t,e){if("function"!=typeof t)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),e?this._all.unshift(t):this._all.push(t),this},C.prototype._on=function(t,e,n,i){if("function"==typeof t)return this._onAny(t,e),this;if("function"!=typeof e)throw new Error("on only accepts instances of Function");this._events||v.call(this);var r,s=this;return void 0!==i&&(e=(r=j.call(this,t,e,i))[0],s=r[1]),this._newListener&&this.emit("newListener",t,e),this.wildcard?(O.call(this,t,e,n),s):(this._events[t]?("function"==typeof this._events[t]&&(this._events[t]=[this._events[t]]),n?this._events[t].unshift(e):this._events[t].push(e),!this._events[t].warned&&this._maxListeners>0&&this._events[t].length>this._maxListeners&&(this._events[t].warned=!0,y.call(this,this._events[t].length,t))):this._events[t]=e,s)},C.prototype.off=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");var n,i=[];if(this.wildcard){var r="string"==typeof t?t.split(this.delimiter):t.slice();if(!(i=M.call(this,null,r,this.listenerTree,0)))return this}else{if(!this._events[t])return this;n=this._events[t],i.push({_listeners:n})}for(var s=0;s<i.length;s++){var o=i[s];if(n=o._listeners,c(n)){for(var a=-1,u=0,l=n.length;u<l;u++)if(n[u]===e||n[u].listener&&n[u].listener===e||n[u]._origin&&n[u]._origin===e){a=u;break}if(a<0)continue;return this.wildcard?o._listeners.splice(a,1):this._events[t].splice(a,1),0===n.length&&(this.wildcard?delete o._listeners:delete this._events[t]),this._removeListener&&this.emit("removeListener",t,e),this}(n===e||n.listener&&n.listener===e||n._origin&&n._origin===e)&&(this.wildcard?delete o._listeners:delete this._events[t],this._removeListener&&this.emit("removeListener",t,e))}return this.listenerTree&&E(this.listenerTree),this},C.prototype.offAny=function(t){var e,n=0,i=0;if(t&&this._all&&this._all.length>0){for(n=0,i=(e=this._all).length;n<i;n++)if(t===e[n])return e.splice(n,1),this._removeListener&&this.emit("removeListenerAny",t),this}else{if(e=this._all,this._removeListener)for(n=0,i=e.length;n<i;n++)this.emit("removeListenerAny",e[n]);this._all=[]}return this},C.prototype.removeListener=C.prototype.off,C.prototype.removeAllListeners=function(t){if(void 0===t)return!this._events||v.call(this),this;if(this.wildcard){var e,n=M.call(this,null,t,this.listenerTree,0);if(!n)return this;for(e=0;e<n.length;e++)n[e]._listeners=null;this.listenerTree&&E(this.listenerTree)}else this._events&&(this._events[t]=null);return this},C.prototype.listeners=function(t){var e,n,i,r,s,o=this._events;if(void 0===t){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!o)return[];for(r=(e=p(o)).length,i=[];r-- >0;)"function"==typeof(n=o[e[r]])?i.push(n):i.push.apply(i,n);return i}if(this.wildcard){if(!(s=this.listenerTree))return[];var a=[],c="string"==typeof t?t.split(this.delimiter):t.slice();return M.call(this,a,c,s,0),a}return o&&(n=o[t])?"function"==typeof n?[n]:n:[]},C.prototype.eventNames=function(t){var e=this._events;return this.wildcard?A.call(this,this.listenerTree,[],null,t):e?p(e):[]},C.prototype.listenerCount=function(t){return this.listeners(t).length},C.prototype.hasListeners=function(t){if(this.wildcard){var e=[],n="string"==typeof t?t.split(this.delimiter):t.slice();return M.call(this,e,n,this.listenerTree,0),e.length>0}var i=this._events,r=this._all;return!!(r&&r.length||i&&(void 0===t?p(i).length:i[t]))},C.prototype.listenersAny=function(){return this._all?this._all:[]},C.prototype.waitFor=function(t,e){var n=this,i=typeof e;return"number"===i?e={timeout:e}:"function"===i&&(e={filter:e}),S((e=w(e,{timeout:0,filter:void 0,handleError:!1,Promise:Promise,overload:!1},{filter:T,Promise:_})).Promise,(function(i,r,s){function o(){var s=e.filter;if(!s||s.apply(n,arguments))if(n.off(t,o),e.handleError){var a=arguments[0];a?r(a):i(d.apply(null,arguments).slice(1))}else i(d.apply(null,arguments))}s((function(){n.off(t,o)})),n._on(t,o,!1)}),{timeout:e.timeout,overload:e.overload})};var N=C.prototype;Object.defineProperties(C,{defaultMaxListeners:{get:function(){return N._maxListeners},set:function(t){if("number"!=typeof t||t<0||Number.isNaN(t))throw TypeError("n must be a non-negative number");N._maxListeners=t},enumerable:!0},once:{value:function(t,e,n){return S((n=w(n,{Promise:Promise,timeout:0,overload:!1},{Promise:_})).Promise,(function(n,i,r){var s;if("function"==typeof t.addEventListener)return s=function(){n(d.apply(null,arguments))},r((function(){t.removeEventListener(e,s)})),void t.addEventListener(e,s,{once:!0});var o,a=function(){o&&t.removeListener("error",o),n(d.apply(null,arguments))};"error"!==e&&(o=function(n){t.removeListener(e,a),i(n)},t.once("error",o)),r((function(){o&&t.removeListener("error",o),t.removeListener(e,a)})),t.once(e,a)}),{timeout:n.timeout,overload:n.overload})},writable:!0,configurable:!0}}),Object.defineProperties(N,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),void 0===(s=function(){return C}.call(e,n,e,t))||(t.exports=s)}()}).call(this,n(16),n(37).setImmediate)},function(t,e){function n(t){t=t||{},this.x=t.x||0,this.y=t.y||0,this.z=t.z||0}n.prototype.add=function(t){this.x+=t.x,this.y+=t.y,this.z+=t.z},n.prototype.subtract=function(t){this.x-=t.x,this.y-=t.y,this.z-=t.z},n.prototype.multiplyQuaternion=function(t){var e=t.w*this.x+t.y*this.z-t.z*this.y,n=t.w*this.y+t.z*this.x-t.x*this.z,i=t.w*this.z+t.x*this.y-t.y*this.x,r=-t.x*this.x-t.y*this.y-t.z*this.z;this.x=e*t.w+r*-t.x+n*-t.z-i*-t.y,this.y=n*t.w+r*-t.y+i*-t.x-e*-t.z,this.z=i*t.w+r*-t.z+e*-t.y-n*-t.x},n.prototype.clone=function(){return new n(this)},t.exports=n},function(t,e,n){var i=n(1);t.exports=function(t){i(this,t)}},function(t,e,n){var i=n(1);t.exports=function(t){i(this,t)}},function(t,e,n){var i=n(2).EventEmitter2,r=n(4);function s(t){t=t||{},this.ros=t.ros,this.name=t.name,this.messageType=t.messageType,this.isAdvertised=!1,this.compression=t.compression||"none",this.throttle_rate=t.throttle_rate||0,this.latch=t.latch||!1,this.queue_size=t.queue_size||100,this.queue_length=t.queue_length||0,this.reconnect_on_close=void 0===t.reconnect_on_close||t.reconnect_on_close,this.compression&&"png"!==this.compression&&"cbor"!==this.compression&&"cbor-raw"!==this.compression&&"none"!==this.compression&&(this.emit("warning",this.compression+" compression is not supported. No compression will be used."),this.compression="none"),this.throttle_rate<0&&(this.emit("warning",this.throttle_rate+" is not allowed. Set to 0"),this.throttle_rate=0);var e=this;this.reconnect_on_close?this.callForSubscribeAndAdvertise=function(t){e.ros.callOnConnection(t),e.waitForReconnect=!1,e.reconnectFunc=function(){e.waitForReconnect||(e.waitForReconnect=!0,e.ros.callOnConnection(t),e.ros.once("connection",(function(){e.waitForReconnect=!1})))},e.ros.on("close",e.reconnectFunc)}:this.callForSubscribeAndAdvertise=this.ros.callOnConnection,this._messageCallback=function(t){e.emit("message",new r(t))}}s.prototype.__proto__=i.prototype,s.prototype.subscribe=function(t){"function"==typeof t&&this.on("message",t),this.subscribeId||(this.ros.on(this.name,this._messageCallback),this.subscribeId="subscribe:"+this.name+":"+ ++this.ros.idCounter,this.callForSubscribeAndAdvertise({op:"subscribe",id:this.subscribeId,type:this.messageType,topic:this.name,compression:this.compression,throttle_rate:this.throttle_rate,queue_length:this.queue_length}))},s.prototype.unsubscribe=function(t){t&&(this.off("message",t),this.listeners("message").length)||this.subscribeId&&(this.ros.off(this.name,this._messageCallback),this.reconnect_on_close&&this.ros.off("close",this.reconnectFunc),this.emit("unsubscribe"),this.ros.callOnConnection({op:"unsubscribe",id:this.subscribeId,topic:this.name}),this.subscribeId=null)},s.prototype.advertise=function(){if(!this.isAdvertised&&(this.advertiseId="advertise:"+this.name+":"+ ++this.ros.idCounter,this.callForSubscribeAndAdvertise({op:"advertise",id:this.advertiseId,type:this.messageType,topic:this.name,latch:this.latch,queue_size:this.queue_size}),this.isAdvertised=!0,!this.reconnect_on_close)){var t=this;this.ros.on("close",(function(){t.isAdvertised=!1}))}},s.prototype.unadvertise=function(){this.isAdvertised&&(this.reconnect_on_close&&this.ros.off("close",this.reconnectFunc),this.emit("unadvertise"),this.ros.callOnConnection({op:"unadvertise",id:this.advertiseId,topic:this.name}),this.isAdvertised=!1)},s.prototype.publish=function(t){this.isAdvertised||this.advertise(),this.ros.idCounter++;var e={op:"publish",id:"publish:"+this.name+":"+this.ros.idCounter,topic:this.name,msg:t,latch:this.latch};this.ros.callOnConnection(e)},t.exports=s},function(t,e){function n(t){t=t||{},this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w="number"==typeof t.w?t.w:1}n.prototype.conjugate=function(){this.x*=-1,this.y*=-1,this.z*=-1},n.prototype.norm=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},n.prototype.normalize=function(){var t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x=this.x*t,this.y=this.y*t,this.z=this.z*t,this.w=this.w*t)},n.prototype.invert=function(){this.conjugate(),this.normalize()},n.prototype.multiply=function(t){var e=this.x*t.w+this.y*t.z-this.z*t.y+this.w*t.x,n=-this.x*t.z+this.y*t.w+this.z*t.x+this.w*t.y,i=this.x*t.y-this.y*t.x+this.z*t.w+this.w*t.z,r=-this.x*t.x-this.y*t.y-this.z*t.z+this.w*t.w;this.x=e,this.y=n,this.z=i,this.w=r},n.prototype.clone=function(){return new n(this)},t.exports=n},function(t,e){t.exports={URDF_SPHERE:0,URDF_BOX:1,URDF_CYLINDER:2,URDF_MESH:3}},function(t,e,n){var i=n(15),r=(n(5),n(2).EventEmitter2);function s(t){t=t||{},this.ros=t.ros,this.name=t.name,this.serviceType=t.serviceType,this.isAdvertised=!1,this._serviceCallback=null}s.prototype.__proto__=r.prototype,s.prototype.callService=function(t,e,n){if(!this.isAdvertised){var r="call_service:"+this.name+":"+ ++this.ros.idCounter;(e||n)&&this.ros.once(r,(function(t){void 0!==t.result&&!1===t.result?"function"==typeof n&&n(t.values):"function"==typeof e&&e(new i(t.values))}));var s={op:"call_service",id:r,service:this.name,type:this.serviceType,args:t};this.ros.callOnConnection(s)}},s.prototype.advertise=function(t){this.isAdvertised||"function"!=typeof t||(this._serviceCallback=t,this.ros.on(this.name,this._serviceResponse.bind(this)),this.ros.callOnConnection({op:"advertise_service",type:this.serviceType,service:this.name}),this.isAdvertised=!0)},s.prototype.unadvertise=function(){this.isAdvertised&&(this.ros.callOnConnection({op:"unadvertise_service",service:this.name}),this.isAdvertised=!1)},s.prototype._serviceResponse=function(t){var e={},n=this._serviceCallback(t.args,e),r={op:"service_response",service:this.name,values:new i(e),result:n};t.id&&(r.id=t.id),this.ros.callOnConnection(r)},t.exports=s},function(t,e){t.exports=function(t,e,n){e.forEach((function(e){var i=n[e];t.prototype[e]=function(t){return t.ros=this,new i(t)}}))}},function(t,e,n){var i=n(14),r=n(29),s=n(32),o=n(9),a=n(5),c=n(1),u=n(2).EventEmitter2;function l(t){t=t||{};var e=this;this.socket=null,this.idCounter=0,this.isConnected=!1,this.transportLibrary=t.transportLibrary||"websocket",this.transportOptions=t.transportOptions||{},this._sendFunc=function(t){e.sendEncodedMessage(t)},void 0===t.groovyCompatibility?this.groovyCompatibility=!0:this.groovyCompatibility=t.groovyCompatibility,this.setMaxListeners(0),t.url&&this.connect(t.url)}l.prototype.__proto__=u.prototype,l.prototype.connect=function(t){if("socket.io"===this.transportLibrary)this.socket=c(io(t,{"force new connection":!0}),s(this)),this.socket.on("connect",this.socket.onopen),this.socket.on("data",this.socket.onmessage),this.socket.on("close",this.socket.onclose),this.socket.on("error",this.socket.onerror);else if("RTCPeerConnection"===this.transportLibrary.constructor.name)this.socket=c(this.transportLibrary.createDataChannel(t,this.transportOptions),s(this));else if("websocket"===this.transportLibrary){if(!this.socket||this.socket.readyState===i.CLOSED){var e=new i(t);e.binaryType="arraybuffer",this.socket=c(e,s(this))}}else{if("workersocket"!==this.transportLibrary)throw"Unknown transportLibrary: "+this.transportLibrary.toString();this.socket=c(new r(t),s(this))}},l.prototype.close=function(){this.socket&&this.socket.close()},l.prototype.authenticate=function(t,e,n,i,r,s,o){var a={op:"auth",mac:t,client:e,dest:n,rand:i,t:r,level:s,end:o};this.callOnConnection(a)},l.prototype.sendEncodedMessage=function(t){var e=null,n=this;e="socket.io"===this.transportLibrary?function(t){n.socket.emit("operation",t)}:function(t){n.socket.send(t)},this.isConnected?e(t):n.once("connection",(function(){e(t)}))},l.prototype.callOnConnection=function(t){this.transportOptions.encoder?this.transportOptions.encoder(t,this._sendFunc):this._sendFunc(JSON.stringify(t))},l.prototype.setStatusLevel=function(t,e){var n={op:"set_level",level:t,id:e};this.callOnConnection(n)},l.prototype.getActionServers=function(t,e){var n=new o({ros:this,name:"/rosapi/action_servers",serviceType:"rosapi/GetActionServers"}),i=new a({});"function"==typeof e?n.callService(i,(function(e){t(e.action_servers)}),(function(t){e(t)})):n.callService(i,(function(e){t(e.action_servers)}))},l.prototype.getTopics=function(t,e){var n=new o({ros:this,name:"/rosapi/topics",serviceType:"rosapi/Topics"}),i=new a;"function"==typeof e?n.callService(i,(function(e){t(e)}),(function(t){e(t)})):n.callService(i,(function(e){t(e)}))},l.prototype.getTopicsForType=function(t,e,n){var i=new o({ros:this,name:"/rosapi/topics_for_type",serviceType:"rosapi/TopicsForType"}),r=new a({type:t});"function"==typeof n?i.callService(r,(function(t){e(t.topics)}),(function(t){n(t)})):i.callService(r,(function(t){e(t.topics)}))},l.prototype.getServices=function(t,e){var n=new o({ros:this,name:"/rosapi/services",serviceType:"rosapi/Services"}),i=new a;"function"==typeof e?n.callService(i,(function(e){t(e.services)}),(function(t){e(t)})):n.callService(i,(function(e){t(e.services)}))},l.prototype.getServicesForType=function(t,e,n){var i=new o({ros:this,name:"/rosapi/services_for_type",serviceType:"rosapi/ServicesForType"}),r=new a({type:t});"function"==typeof n?i.callService(r,(function(t){e(t.services)}),(function(t){n(t)})):i.callService(r,(function(t){e(t.services)}))},l.prototype.getServiceRequestDetails=function(t,e,n){var i=new o({ros:this,name:"/rosapi/service_request_details",serviceType:"rosapi/ServiceRequestDetails"}),r=new a({type:t});"function"==typeof n?i.callService(r,(function(t){e(t)}),(function(t){n(t)})):i.callService(r,(function(t){e(t)}))},l.prototype.getServiceResponseDetails=function(t,e,n){var i=new o({ros:this,name:"/rosapi/service_response_details",serviceType:"rosapi/ServiceResponseDetails"}),r=new a({type:t});"function"==typeof n?i.callService(r,(function(t){e(t)}),(function(t){n(t)})):i.callService(r,(function(t){e(t)}))},l.prototype.getNodes=function(t,e){var n=new o({ros:this,name:"/rosapi/nodes",serviceType:"rosapi/Nodes"}),i=new a;"function"==typeof e?n.callService(i,(function(e){t(e.nodes)}),(function(t){e(t)})):n.callService(i,(function(e){t(e.nodes)}))},l.prototype.getNodeDetails=function(t,e,n){var i=new o({ros:this,name:"/rosapi/node_details",serviceType:"rosapi/NodeDetails"}),r=new a({node:t});"function"==typeof n?i.callService(r,(function(t){e(t.subscribing,t.publishing,t.services)}),(function(t){n(t)})):i.callService(r,(function(t){e(t)}))},l.prototype.getParams=function(t,e){var n=new o({ros:this,name:"/rosapi/get_param_names",serviceType:"rosapi/GetParamNames"}),i=new a;"function"==typeof e?n.callService(i,(function(e){t(e.names)}),(function(t){e(t)})):n.callService(i,(function(e){t(e.names)}))},l.prototype.getTopicType=function(t,e,n){var i=new o({ros:this,name:"/rosapi/topic_type",serviceType:"rosapi/TopicType"}),r=new a({topic:t});"function"==typeof n?i.callService(r,(function(t){e(t.type)}),(function(t){n(t)})):i.callService(r,(function(t){e(t.type)}))},l.prototype.getServiceType=function(t,e,n){var i=new o({ros:this,name:"/rosapi/service_type",serviceType:"rosapi/ServiceType"}),r=new a({service:t});"function"==typeof n?i.callService(r,(function(t){e(t.type)}),(function(t){n(t)})):i.callService(r,(function(t){e(t.type)}))},l.prototype.getMessageDetails=function(t,e,n){var i=new o({ros:this,name:"/rosapi/message_details",serviceType:"rosapi/MessageDetails"}),r=new a({type:t});"function"==typeof n?i.callService(r,(function(t){e(t.typedefs)}),(function(t){n(t)})):i.callService(r,(function(t){e(t.typedefs)}))},l.prototype.decodeTypeDefs=function(t){var e=this,n=function(t,i){for(var r={},s=0;s<t.fieldnames.length;s++){var o=t.fieldarraylen[s],a=t.fieldnames[s],c=t.fieldtypes[s];if(-1===c.indexOf("/"))r[a]=-1===o?c:[c];else{for(var u=!1,l=0;l<i.length;l++)if(i[l].type.toString()===c.toString()){u=i[l];break}if(u){var h=n(u,i);-1===o||(r[a]=[h])}else e.emit("error","Cannot find "+c+" in decodeTypeDefs")}}return r};return n(t[0],t)},l.prototype.getTopicsAndRawTypes=function(t,e){var n=new o({ros:this,name:"/rosapi/topics_and_raw_types",serviceType:"rosapi/TopicsAndRawTypes"}),i=new a;"function"==typeof e?n.callService(i,(function(e){t(e)}),(function(t){e(t)})):n.callService(i,(function(e){t(e)}))},t.exports=l},function(t,e,n){var i=n(3),r=n(7);function s(t){t=t||{},this.position=new i(t.position),this.orientation=new r(t.orientation)}s.prototype.applyTransform=function(t){this.position.multiplyQuaternion(t.rotation),this.position.add(t.translation);var e=t.rotation.clone();e.multiply(this.orientation),this.orientation=e},s.prototype.clone=function(){return new s(this)},s.prototype.multiply=function(t){var e=t.clone();return e.applyTransform({rotation:this.orientation,translation:this.position}),e},s.prototype.getInverse=function(){var t=this.clone();return t.orientation.invert(),t.position.multiplyQuaternion(t.orientation),t.position.x*=-1,t.position.y*=-1,t.position.z*=-1,t},t.exports=s},function(t,e,n){var i=n(22);function r(t){this.textureFilename=null,this.color=null,this.name=t.xml.getAttribute("name");var e=t.xml.getElementsByTagName("texture");e.length>0&&(this.textureFilename=e[0].getAttribute("filename"));var n=t.xml.getElementsByTagName("color");n.length>0&&(this.color=new i({xml:n[0]}))}r.prototype.isLink=function(){return null===this.color&&null===this.textureFilename};var s=n(1);r.prototype.assign=function(t){return s(this,t)},t.exports=r},function(t,e){t.exports="undefined"!=typeof window?window.WebSocket:WebSocket},function(t,e,n){var i=n(1);t.exports=function(t){i(this,t)}},function(t,e){var n,i,r=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var c,u=[],l=!1,h=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):h=-1,u.length&&p())}function p(){if(!l){var t=a(f);l=!0;for(var e=u.length;e;){for(c=u,u=[];++h<e;)c&&c[h].run();h=-1,e=u.length}c=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function v(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new v(t,e)),1!==u.length||l||a(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var i=n(6),r=n(4),s=n(2).EventEmitter2;function o(t){var e=this;t=t||{},this.ros=t.ros,this.serverName=t.serverName,this.actionName=t.actionName,this.timeout=t.timeout,this.omitFeedback=t.omitFeedback,this.omitStatus=t.omitStatus,this.omitResult=t.omitResult,this.goals={};var n=!1;this.feedbackListener=new i({ros:this.ros,name:this.serverName+"/feedback",messageType:this.actionName+"Feedback"}),this.statusListener=new i({ros:this.ros,name:this.serverName+"/status",messageType:"actionlib_msgs/GoalStatusArray"}),this.resultListener=new i({ros:this.ros,name:this.serverName+"/result",messageType:this.actionName+"Result"}),this.goalTopic=new i({ros:this.ros,name:this.serverName+"/goal",messageType:this.actionName+"Goal"}),this.cancelTopic=new i({ros:this.ros,name:this.serverName+"/cancel",messageType:"actionlib_msgs/GoalID"}),this.goalTopic.advertise(),this.cancelTopic.advertise(),this.omitStatus||this.statusListener.subscribe((function(t){n=!0,t.status_list.forEach((function(t){var n=e.goals[t.goal_id.id];n&&n.emit("status",t)}))})),this.omitFeedback||this.feedbackListener.subscribe((function(t){var n=e.goals[t.status.goal_id.id];n&&(n.emit("status",t.status),n.emit("feedback",t.feedback))})),this.omitResult||this.resultListener.subscribe((function(t){var n=e.goals[t.status.goal_id.id];n&&(n.emit("status",t.status),n.emit("result",t.result))})),this.timeout&&setTimeout((function(){n||e.emit("timeout")}),this.timeout)}o.prototype.__proto__=s.prototype,o.prototype.cancel=function(){var t=new r;this.cancelTopic.publish(t)},o.prototype.dispose=function(){this.goalTopic.unadvertise(),this.cancelTopic.unadvertise(),this.omitStatus||this.statusListener.unsubscribe(),this.omitFeedback||this.feedbackListener.unsubscribe(),this.omitResult||this.resultListener.unsubscribe()},t.exports=o},function(t,e,n){var i=n(4),r=n(2).EventEmitter2;function s(t){var e=this;this.actionClient=t.actionClient,this.goalMessage=t.goalMessage,this.isFinished=!1;var n=new Date;this.goalID="goal_"+Math.random()+"_"+n.getTime(),this.goalMessage=new i({goal_id:{stamp:{secs:0,nsecs:0},id:this.goalID},goal:this.goalMessage}),this.on("status",(function(t){e.status=t})),this.on("result",(function(t){e.isFinished=!0,e.result=t})),this.on("feedback",(function(t){e.feedback=t})),this.actionClient.goals[this.goalID]=this}s.prototype.__proto__=r.prototype,s.prototype.send=function(t){var e=this;e.actionClient.goalTopic.publish(e.goalMessage),t&&setTimeout((function(){e.isFinished||e.emit("timeout")}),t)},s.prototype.cancel=function(){var t=new i({id:this.goalID});this.actionClient.cancelTopic.publish(t)},t.exports=s},function(t,e,n){var i=n(3),r=n(7);function s(t){t=t||{},this.translation=new i(t.translation),this.rotation=new r(t.rotation)}s.prototype.clone=function(){return new s(this)},t.exports=s},function(t,e,n){var i=n(3),r=n(8);t.exports=function(t){this.dimension=null,this.type=r.URDF_BOX;var e=t.xml.getAttribute("size").split(" ");this.dimension=new i({x:parseFloat(e[0]),y:parseFloat(e[1]),z:parseFloat(e[2])})}},function(t,e){t.exports=function(t){var e=t.xml.getAttribute("rgba").split(" ");this.r=parseFloat(e[0]),this.g=parseFloat(e[1]),this.b=parseFloat(e[2]),this.a=parseFloat(e[3])}},function(t,e,n){var i=n(8);t.exports=function(t){this.type=i.URDF_CYLINDER,this.length=parseFloat(t.xml.getAttribute("length")),this.radius=parseFloat(t.xml.getAttribute("radius"))}},function(t,e,n){var i=n(25);t.exports=function(t){this.name=t.xml.getAttribute("name"),this.visuals=[];for(var e=t.xml.getElementsByTagName("visual"),n=0;n<e.length;n++)this.visuals.push(new i({xml:e[n]}))}},function(t,e,n){var i=n(12),r=n(3),s=n(7),o=n(23),a=n(21),c=n(13),u=n(26),l=n(27);t.exports=function(t){var e=t.xml;this.origin=null,this.geometry=null,this.material=null,this.name=t.xml.getAttribute("name");var n=e.getElementsByTagName("origin");if(0===n.length)this.origin=new i;else{var h=n[0].getAttribute("xyz"),f=new r;h&&(h=h.split(" "),f=new r({x:parseFloat(h[0]),y:parseFloat(h[1]),z:parseFloat(h[2])}));var p=n[0].getAttribute("rpy"),v=new s;if(p){p=p.split(" ");var m=parseFloat(p[0])/2,y=parseFloat(p[1])/2,d=parseFloat(p[2])/2,b=Math.sin(m)*Math.cos(y)*Math.cos(d)-Math.cos(m)*Math.sin(y)*Math.sin(d),g=Math.cos(m)*Math.sin(y)*Math.cos(d)+Math.sin(m)*Math.cos(y)*Math.sin(d),w=Math.cos(m)*Math.cos(y)*Math.sin(d)-Math.sin(m)*Math.sin(y)*Math.cos(d),_=Math.cos(m)*Math.cos(y)*Math.cos(d)+Math.sin(m)*Math.sin(y)*Math.sin(d);(v=new s({x:b,y:g,z:w,w:_})).normalize()}this.origin=new i({position:f,orientation:v})}var x=e.getElementsByTagName("geometry");if(x.length>0){for(var T=x[0],k=null,S=0;S<T.childNodes.length;S++){var L=T.childNodes[S];if(1===L.nodeType){k=L;break}}var M=k.nodeName;"sphere"===M?this.geometry=new l({xml:k}):"box"===M?this.geometry=new a({xml:k}):"cylinder"===M?this.geometry=new o({xml:k}):"mesh"===M?this.geometry=new u({xml:k}):console.warn("Unknown geometry type "+M)}var O=e.getElementsByTagName("material");O.length>0&&(this.material=new c({xml:O[0]}))}},function(t,e,n){var i=n(3),r=n(8);t.exports=function(t){this.scale=null,this.type=r.URDF_MESH,this.filename=t.xml.getAttribute("filename");var e=t.xml.getAttribute("scale");if(e){var n=e.split(" ");this.scale=new i({x:parseFloat(n[0]),y:parseFloat(n[1]),z:parseFloat(n[2])})}}},function(t,e,n){var i=n(8);t.exports=function(t){this.type=i.URDF_SPHERE,this.radius=parseFloat(t.xml.getAttribute("radius"))}},function(t,e,n){var i=n(10),r=t.exports={Ros:n(11),Topic:n(6),Message:n(4),Param:n(39),Service:n(9),ServiceRequest:n(5),ServiceResponse:n(15)};i(r.Ros,["Param","Service","Topic"],r)},function(t,e,n){var i=n(30),r=n(31);function s(t){this.socket_=i(r),this.socket_.addEventListener("message",this.handleWorkerMessage_.bind(this)),this.socket_.postMessage({uri:t})}s.prototype.handleWorkerMessage_=function(t){var e=t.data;if(e instanceof ArrayBuffer||"string"==typeof e)this.onmessage(t);else{var n=e.type;if("close"===n)this.onclose(null);else if("open"===n)this.onopen(null);else{if("error"!==n)throw"Unknown message from workersocket";this.onerror(null)}}},s.prototype.send=function(t){this.socket_.postMessage(t)},s.prototype.close=function(){this.socket_.postMessage({close:!0})},t.exports=s},function(t,e){var n=arguments[3],i=arguments[4],r=arguments[5],s=JSON.stringify;t.exports=function(t,e){for(var o,a=Object.keys(r),c=0,u=a.length;c<u;c++){var l=a[c],h=r[l].exports;if(h===t||h&&h.default===t){o=l;break}}if(!o){o=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var f={};for(c=0,u=a.length;c<u;c++){f[l=a[c]]=l}i[o]=["function(require,module,exports){"+t+"(self); }",f]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),v={};v[o]=o,i[p]=["function(require,module,exports){var f = require("+s(o)+");(f.default ? f.default : f)(self);}",v];var m={};!function t(e){for(var n in m[e]=!0,i[e][1]){var r=i[e][1][n];m[r]||t(r)}}(p);var y="("+n+")({"+Object.keys(m).map((function(t){return s(t)+":["+i[t][0]+","+s(i[t][1])+"]"})).join(",")+"},{},["+s(p)+"])",d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=new Blob([y],{type:"text/javascript"});if(e&&e.bare)return b;var g=d.createObjectURL(b),w=new Worker(g);return w.objectURL=g,w}},function(t,e,n){var i=i||n(14);t.exports=function(t){var e=null;function n(e){var n=e.data;n instanceof ArrayBuffer?t.postMessage(n,[n]):t.postMessage(n)}function r(e){t.postMessage({type:e.type})}t.addEventListener("message",(function(t){var s=t.data;if("string"==typeof s)e.send(s);else if(s.hasOwnProperty("close"))e.close(),e=null;else{if(!s.hasOwnProperty("uri"))throw"Unknown message to WorkerSocket";var o=s.uri;(e=new i(o)).binaryType="arraybuffer",e.onmessage=n,e.onclose=r,e.onopen=r,e.onerror=r}}))}},function(t,e,n){"use strict";var i=n(33),r=n(35),s=n(36),o=null;"undefined"!=typeof bson&&(o=bson().BSON),t.exports=function(t){var e=null;function n(e){"publish"===e.op?t.emit(e.topic,e.msg):"service_response"===e.op?t.emit(e.id,e):"call_service"===e.op?t.emit(e.service,e):"status"===e.op&&(e.id?t.emit("status:"+e.id,e):t.emit("status",e))}function a(t,e){"png"===t.op?i(t.data,e):e(t)}return t.transportOptions.decoder&&(e=t.transportOptions.decoder),{onopen:function(e){t.isConnected=!0,t.emit("connection",e)},onclose:function(e){t.isConnected=!1,t.emit("close",e)},onerror:function(e){t.emit("error",e)},onmessage:function(t){if(e)e(t.data,(function(t){n(t)}));else if("undefined"!=typeof Blob&&t.data instanceof Blob)!function(t,e){if(!o)throw"Cannot process BSON encoded message without BSON header.";var n=new FileReader;n.onload=function(){var t=new Uint8Array(this.result),n=o.deserialize(t);e(n)},n.readAsArrayBuffer(t)}(t.data,(function(t){a(t,n)}));else if(t.data instanceof ArrayBuffer){n(r.decode(t.data,s))}else{a(JSON.parse("string"==typeof t?t:t.data),n)}}}}},function(t,e,n){"use strict";var i=n(34),r=i.Image||window.Image;t.exports=function(t,e){var n=new r;n.onload=function(){var t=new i,r=t.getContext("2d");t.width=n.width,t.height=n.height,r.imageSmoothingEnabled=!1,r.webkitImageSmoothingEnabled=!1,r.mozImageSmoothingEnabled=!1,r.drawImage(n,0,0);for(var s=r.getImageData(0,0,n.width,n.height).data,o="",a=0;a<s.length;a+=4)o+=String.fromCharCode(s[a],s[a+1],s[a+2]);e(JSON.parse(o))},n.src="data:image/png;base64,"+t}},function(t,e){t.exports=function(){return document.createElement("canvas")}},function(t,e,n){var i,r;!function(s,o){"use strict";var a=Math.pow(2,-24),c=Math.pow(2,32),u=Math.pow(2,53);void 0===(r="function"==typeof(i={encode:function(t){var e,n=new ArrayBuffer(256),i=new DataView(n),r=0;function s(t){for(var s=n.byteLength,o=r+t;s<o;)s*=2;if(s!==n.byteLength){var a=i;n=new ArrayBuffer(s),i=new DataView(n);for(var c=r+3>>2,u=0;u<c;++u)i.setUint32(4*u,a.getUint32(4*u))}return e=t,i}function o(){r+=e}function a(t){o(s(1).setUint8(r,t))}function l(t){for(var e=s(t.length),n=0;n<t.length;++n)e.setUint8(r+n,t[n]);o()}function h(t,e){e<24?a(t<<5|e):e<256?(a(t<<5|24),a(e)):e<65536?(a(t<<5|25),function(t){o(s(2).setUint16(r,t))}(e)):e<4294967296?(a(t<<5|26),function(t){o(s(4).setUint32(r,t))}(e)):(a(t<<5|27),function(t){var e=t%c,n=(t-e)/c,i=s(8);i.setUint32(r,n),i.setUint32(r+4,e),o()}(e))}if(function t(e){var n;if(!1===e)return a(244);if(!0===e)return a(245);if(null===e)return a(246);if(void 0===e)return a(247);switch(typeof e){case"number":if(Math.floor(e)===e){if(0<=e&&e<=u)return h(0,e);if(-u<=e&&e<0)return h(1,-(e+1))}return a(251),function(t){o(s(8).setFloat64(r,t))}(e);case"string":var i=[];for(n=0;n<e.length;++n){var c=e.charCodeAt(n);c<128?i.push(c):c<2048?(i.push(192|c>>6),i.push(128|63&c)):c<55296?(i.push(224|c>>12),i.push(128|c>>6&63),i.push(128|63&c)):(c=(1023&c)<<10,c|=1023&e.charCodeAt(++n),c+=65536,i.push(240|c>>18),i.push(128|c>>12&63),i.push(128|c>>6&63),i.push(128|63&c))}return h(3,i.length),l(i);default:var f;if(Array.isArray(e))for(h(4,f=e.length),n=0;n<f;++n)t(e[n]);else if(e instanceof Uint8Array)h(2,e.length),l(e);else{var p=Object.keys(e);for(h(5,f=p.length),n=0;n<f;++n){var v=p[n];t(v),t(e[v])}}}}(t),"slice"in n)return n.slice(0,r);for(var f=new ArrayBuffer(r),p=new DataView(f),v=0;v<r;++v)p.setUint8(v,i.getUint8(v));return f},decode:function(t,e,n){var i=new DataView(t),r=0;function s(t,e){return r+=e,t}function o(e){return s(new Uint8Array(t,r,e),e)}function u(){return s(i.getUint8(r),1)}function l(){return s(i.getUint16(r),2)}function h(){return s(i.getUint32(r),4)}function f(){return 255===i.getUint8(r)&&(r+=1,!0)}function p(t){if(t<24)return t;if(24===t)return u();if(25===t)return l();if(26===t)return h();if(27===t)return h()*c+h();if(31===t)return-1;throw"Invalid length encoding"}function v(t){var e=u();if(255===e)return-1;var n=p(31&e);if(n<0||e>>5!==t)throw"Invalid indefinite length element";return n}function m(t,e){for(var n=0;n<e;++n){var i=u();128&i&&(i<224?(i=(31&i)<<6|63&u(),e-=1):i<240?(i=(15&i)<<12|(63&u())<<6|63&u(),e-=2):(i=(15&i)<<18|(63&u())<<12|(63&u())<<6|63&u(),e-=3)),i<65536?t.push(i):(i-=65536,t.push(55296|i>>10),t.push(56320|1023&i))}}"function"!=typeof e&&(e=function(t){return t}),"function"!=typeof n&&(n=function(){});var y=function t(){var c,h,y=u(),d=y>>5,b=31&y;if(7===d)switch(b){case 25:return function(){var t=new ArrayBuffer(4),e=new DataView(t),n=l(),i=32768&n,r=31744&n,s=1023&n;if(31744===r)r=261120;else if(0!==r)r+=114688;else if(0!==s)return s*a;return e.setUint32(0,i<<16|r<<13|s<<13),e.getFloat32(0)}();case 26:return s(i.getFloat32(r),4);case 27:return s(i.getFloat64(r),8)}if((h=p(b))<0&&(d<2||6<d))throw"Invalid length";switch(d){case 0:return h;case 1:return-1-h;case 2:if(h<0){for(var g=[],w=0;(h=v(d))>=0;)w+=h,g.push(o(h));var _=new Uint8Array(w),x=0;for(c=0;c<g.length;++c)_.set(g[c],x),x+=g[c].length;return _}return o(h);case 3:var T=[];if(h<0)for(;(h=v(d))>=0;)m(T,h);else m(T,h);return String.fromCharCode.apply(null,T);case 4:var k;if(h<0)for(k=[];!f();)k.push(t());else for(k=new Array(h),c=0;c<h;++c)k[c]=t();return k;case 5:var S={};for(c=0;c<h||h<0&&!f();++c){S[t()]=t()}return S;case 6:return e(t(),h);case 7:switch(h){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;default:return n(h)}}}();if(r!==t.byteLength)throw"Remaining bytes";return y}})?i.call(e,n,e,t):i)||(t.exports=r)}()},function(t,e,n){"use strict";var i=Math.pow(2,32),r=!1;function s(){r||(r=!0,console.warn("CBOR 64-bit integer array values may lose precision. No further warnings."))}var o={64:Uint8Array,69:Uint16Array,70:Uint32Array,72:Int8Array,77:Int16Array,78:Int32Array,85:Float32Array,86:Float64Array},a={71:function(t){s();for(var e=t.byteLength,n=t.byteOffset,r=e/8,o=t.buffer.slice(n,n+e),a=new Uint32Array(o),c=new Array(r),u=0;u<r;u++){var l=2*u,h=a[l],f=a[l+1];c[u]=h+i*f}return c},79:function(t){s();for(var e=t.byteLength,n=t.byteOffset,r=e/8,o=t.buffer.slice(n,n+e),a=new Uint32Array(o),c=new Int32Array(o),u=new Array(r),l=0;l<r;l++){var h=2*l,f=a[h],p=c[h+1];u[l]=f+i*p}return u}};t.exports&&(t.exports=function(t,e){var n,i,r,s;return e in o?(i=o[e],r=(n=t).byteLength,s=n.byteOffset,new i(n.buffer.slice(s,s+r))):e in a?a[e](t):t})},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function s(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new s(r.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new s(r.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(38),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(17))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,s,o,a,c=1,u={},l=!1,h=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){v(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){v(t.data)},i=function(t){s.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(r=h.documentElement,i=function(t){var e=h.createElement("script");e.onreadystatechange=function(){v(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(v,0,t)}:(o="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&v(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(o+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return u[c]=r,i(c),c++},f.clearImmediate=p}function p(t){delete u[t]}function v(t){if(l)setTimeout(v,0,t);else{var e=u[t];if(e){l=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{p(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(17),n(16))},function(t,e,n){var i=n(9),r=n(5);function s(t){t=t||{},this.ros=t.ros,this.name=t.name}s.prototype.get=function(t){var e=new i({ros:this.ros,name:"/rosapi/get_param",serviceType:"rosapi/GetParam"}),n=new r({name:this.name});e.callService(n,(function(e){var n=JSON.parse(e.value);t(n)}))},s.prototype.set=function(t,e){var n=new i({ros:this.ros,name:"/rosapi/set_param",serviceType:"rosapi/SetParam"}),s=new r({name:this.name,value:JSON.stringify(t)});n.callService(s,e)},s.prototype.delete=function(t){var e=new i({ros:this.ros,name:"/rosapi/delete_param",serviceType:"rosapi/DeleteParam"}),n=new r({name:this.name});e.callService(n,t)},t.exports=s},function(t,e,n){var i=n(11);n(10)(i,["ActionClient","SimpleActionServer"],t.exports={ActionClient:n(18),ActionListener:n(41),Goal:n(19),SimpleActionServer:n(42)})},function(t,e,n){var i=n(6),r=(n(4),n(2).EventEmitter2);function s(t){var e=this;t=t||{},this.ros=t.ros,this.serverName=t.serverName,this.actionName=t.actionName,this.timeout=t.timeout,this.omitFeedback=t.omitFeedback,this.omitStatus=t.omitStatus,this.omitResult=t.omitResult;var n=new i({ros:this.ros,name:this.serverName+"/goal",messageType:this.actionName+"Goal"}),r=new i({ros:this.ros,name:this.serverName+"/feedback",messageType:this.actionName+"Feedback"}),s=new i({ros:this.ros,name:this.serverName+"/status",messageType:"actionlib_msgs/GoalStatusArray"}),o=new i({ros:this.ros,name:this.serverName+"/result",messageType:this.actionName+"Result"});n.subscribe((function(t){e.emit("goal",t)})),s.subscribe((function(t){t.status_list.forEach((function(t){e.emit("status",t)}))})),r.subscribe((function(t){e.emit("status",t.status),e.emit("feedback",t.feedback)})),o.subscribe((function(t){e.emit("status",t.status),e.emit("result",t.result)}))}s.prototype.__proto__=r.prototype,t.exports=s},function(t,e,n){var i=n(6),r=n(4),s=n(2).EventEmitter2;function o(t){var e=this;t=t||{},this.ros=t.ros,this.serverName=t.serverName,this.actionName=t.actionName,this.feedbackPublisher=new i({ros:this.ros,name:this.serverName+"/feedback",messageType:this.actionName+"Feedback"}),this.feedbackPublisher.advertise();var n=new i({ros:this.ros,name:this.serverName+"/status",messageType:"actionlib_msgs/GoalStatusArray"});n.advertise(),this.resultPublisher=new i({ros:this.ros,name:this.serverName+"/result",messageType:this.actionName+"Result"}),this.resultPublisher.advertise();var s=new i({ros:this.ros,name:this.serverName+"/goal",messageType:this.actionName+"Goal"}),o=new i({ros:this.ros,name:this.serverName+"/cancel",messageType:"actionlib_msgs/GoalID"});this.statusMessage=new r({header:{stamp:{secs:0,nsecs:100},frame_id:""},status_list:[]}),this.currentGoal=null,this.nextGoal=null,s.subscribe((function(t){e.currentGoal?(e.nextGoal=t,e.emit("cancel")):(e.statusMessage.status_list=[{goal_id:t.goal_id,status:1}],e.currentGoal=t,e.emit("goal",t.goal))}));var a=function(t,e){return!(t.secs>e.secs)&&(t.secs<e.secs||t.nsecs<e.nsecs)};o.subscribe((function(t){0===t.stamp.secs&&0===t.stamp.secs&&""===t.id?(e.nextGoal=null,e.currentGoal&&e.emit("cancel")):(e.currentGoal&&t.id===e.currentGoal.goal_id.id?e.emit("cancel"):e.nextGoal&&t.id===e.nextGoal.goal_id.id&&(e.nextGoal=null),e.nextGoal&&a(e.nextGoal.goal_id.stamp,t.stamp)&&(e.nextGoal=null),e.currentGoal&&a(e.currentGoal.goal_id.stamp,t.stamp)&&e.emit("cancel"))}));setInterval((function(){var t=new Date,i=Math.floor(t.getTime()/1e3),r=Math.round(1e9*(t.getTime()/1e3-i));e.statusMessage.header.stamp.secs=i,e.statusMessage.header.stamp.nsecs=r,n.publish(e.statusMessage)}),500)}o.prototype.__proto__=s.prototype,o.prototype.setSucceeded=function(t){var e=new r({status:{goal_id:this.currentGoal.goal_id,status:3},result:t});this.resultPublisher.publish(e),this.statusMessage.status_list=[],this.nextGoal?(this.currentGoal=this.nextGoal,this.nextGoal=null,this.emit("goal",this.currentGoal.goal)):this.currentGoal=null},o.prototype.setAborted=function(t){var e=new r({status:{goal_id:this.currentGoal.goal_id,status:4},result:t});this.resultPublisher.publish(e),this.statusMessage.status_list=[],this.nextGoal?(this.currentGoal=this.nextGoal,this.nextGoal=null,this.emit("goal",this.currentGoal.goal)):this.currentGoal=null},o.prototype.sendFeedback=function(t){var e=new r({status:{goal_id:this.currentGoal.goal_id,status:1},feedback:t});this.feedbackPublisher.publish(e)},o.prototype.setPreempted=function(){this.statusMessage.status_list=[];var t=new r({status:{goal_id:this.currentGoal.goal_id,status:2}});this.resultPublisher.publish(t),this.nextGoal?(this.currentGoal=this.nextGoal,this.nextGoal=null,this.emit("goal",this.currentGoal.goal)):this.currentGoal=null},t.exports=o},function(t,e,n){t.exports={Pose:n(12),Quaternion:n(7),Transform:n(20),Vector3:n(3)}},function(t,e,n){var i=n(11);n(10)(i,["TFClient"],t.exports={TFClient:n(45)})},function(t,e,n){var i=n(18),r=n(19),s=n(9),o=n(5),a=n(6),c=n(20);function u(t){t=t||{},this.ros=t.ros,this.fixedFrame=t.fixedFrame||"/base_link",this.angularThres=t.angularThres||2,this.transThres=t.transThres||.01,this.rate=t.rate||10,this.updateDelay=t.updateDelay||50;var e=t.topicTimeout||2,n=Math.floor(e),r=Math.floor(1e9*(e-n));this.topicTimeout={secs:n,nsecs:r},this.serverName=t.serverName||"/tf2_web_republisher",this.repubServiceName=t.repubServiceName||"/republish_tfs",this.currentGoal=!1,this.currentTopic=!1,this.frameInfos={},this.republisherUpdateRequested=!1,this._subscribeCB=null,this._isDisposed=!1,this.actionClient=new i({ros:t.ros,serverName:this.serverName,actionName:"tf2_web_republisher/TFSubscriptionAction",omitStatus:!0,omitResult:!0}),this.serviceClient=new s({ros:t.ros,name:this.repubServiceName,serviceType:"tf2_web_republisher/RepublishTFs"})}u.prototype.processTFArray=function(t){t.transforms.forEach((function(t){var e=t.child_frame_id;"/"===e[0]&&(e=e.substring(1));var n=this.frameInfos[e];n&&(n.transform=new c({translation:t.transform.translation,rotation:t.transform.rotation}),n.cbs.forEach((function(t){t(n.transform)})))}),this)},u.prototype.updateGoal=function(){var t={source_frames:Object.keys(this.frameInfos),target_frame:this.fixedFrame,angular_thres:this.angularThres,trans_thres:this.transThres,rate:this.rate};if(this.ros.groovyCompatibility)this.currentGoal&&this.currentGoal.cancel(),this.currentGoal=new r({actionClient:this.actionClient,goalMessage:t}),this.currentGoal.on("feedback",this.processTFArray.bind(this)),this.currentGoal.send();else{t.timeout=this.topicTimeout;var e=new o(t);this.serviceClient.callService(e,this.processResponse.bind(this))}this.republisherUpdateRequested=!1},u.prototype.processResponse=function(t){this._isDisposed||(this.currentTopic&&this.currentTopic.unsubscribe(this._subscribeCB),this.currentTopic=new a({ros:this.ros,name:t.topic_name,messageType:"tf2_web_republisher/TFArray"}),this._subscribeCB=this.processTFArray.bind(this),this.currentTopic.subscribe(this._subscribeCB))},u.prototype.subscribe=function(t,e){"/"===t[0]&&(t=t.substring(1)),this.frameInfos[t]?this.frameInfos[t].transform&&e(this.frameInfos[t].transform):(this.frameInfos[t]={cbs:[]},this.republisherUpdateRequested||(setTimeout(this.updateGoal.bind(this),this.updateDelay),this.republisherUpdateRequested=!0)),this.frameInfos[t].cbs.push(e)},u.prototype.unsubscribe=function(t,e){"/"===t[0]&&(t=t.substring(1));for(var n=this.frameInfos[t],i=n&&n.cbs||[],r=i.length;r--;)i[r]===e&&i.splice(r,1);e&&0!==i.length||delete this.frameInfos[t]},u.prototype.dispose=function(){this._isDisposed=!0,this.actionClient.dispose(),this.currentTopic&&this.currentTopic.unsubscribe(this._subscribeCB)},t.exports=u},function(t,e,n){t.exports=n(1)({UrdfBox:n(21),UrdfColor:n(22),UrdfCylinder:n(23),UrdfLink:n(24),UrdfMaterial:n(13),UrdfMesh:n(26),UrdfModel:n(47),UrdfSphere:n(27),UrdfVisual:n(25)},n(8))},function(t,e,n){var i=n(13),r=n(24),s=n(48),o=n(49).DOMParser;t.exports=function(t){var e=(t=t||{}).xml,n=t.string;this.materials={},this.links={},this.joints={},n&&(e=(new o).parseFromString(n,"text/xml"));var a=e.documentElement;this.name=a.getAttribute("name");for(var c=a.childNodes,u=0;u<c.length;u++){var l=c[u];if("material"===l.tagName){var h=new i({xml:l});void 0!==this.materials[h.name]?this.materials[h.name].isLink()?this.materials[h.name].assign(h):console.warn("Material "+h.name+"is not unique."):this.materials[h.name]=h}else if("link"===l.tagName){var f=new r({xml:l});if(void 0!==this.links[f.name])console.warn("Link "+f.name+" is not unique.");else{for(var p=0;p<f.visuals.length;p++){var v=f.visuals[p].material;null!==v&&v.name&&(void 0!==this.materials[v.name]?f.visuals[p].material=this.materials[v.name]:this.materials[v.name]=v)}this.links[f.name]=f}}else if("joint"===l.tagName){var m=new s({xml:l});this.joints[m.name]=m}}}},function(t,e,n){var i=n(12),r=n(3),s=n(7);t.exports=function(t){this.name=t.xml.getAttribute("name"),this.type=t.xml.getAttribute("type");var e=t.xml.getElementsByTagName("parent");e.length>0&&(this.parent=e[0].getAttribute("link"));var n=t.xml.getElementsByTagName("child");n.length>0&&(this.child=n[0].getAttribute("link"));var o=t.xml.getElementsByTagName("limit");o.length>0&&(this.minval=parseFloat(o[0].getAttribute("lower")),this.maxval=parseFloat(o[0].getAttribute("upper")));var a=t.xml.getElementsByTagName("origin");if(0===a.length)this.origin=new i;else{var c=a[0].getAttribute("xyz"),u=new r;c&&(c=c.split(" "),u=new r({x:parseFloat(c[0]),y:parseFloat(c[1]),z:parseFloat(c[2])}));var l=a[0].getAttribute("rpy"),h=new s;if(l){l=l.split(" ");var f=parseFloat(l[0])/2,p=parseFloat(l[1])/2,v=parseFloat(l[2])/2,m=Math.sin(f)*Math.cos(p)*Math.cos(v)-Math.cos(f)*Math.sin(p)*Math.sin(v),y=Math.cos(f)*Math.sin(p)*Math.cos(v)+Math.sin(f)*Math.cos(p)*Math.sin(v),d=Math.cos(f)*Math.cos(p)*Math.sin(v)-Math.sin(f)*Math.sin(p)*Math.cos(v),b=Math.cos(f)*Math.cos(p)*Math.cos(v)+Math.sin(f)*Math.sin(p)*Math.sin(v);(h=new s({x:m,y:y,z:d,w:b})).normalize()}this.origin=new i({position:u,orientation:h})}}},function(t,e){e.DOMImplementation=window.DOMImplementation,e.XMLSerializer=window.XMLSerializer,e.DOMParser=window.DOMParser},function(t,e,n){"use strict";n.r(e),n.d(e,"loadScript",(function(){return r})),n.d(e,"blob2text",(function(){return s})),n.d(e,"blob2base64",(function(){return o})),n.d(e,"blob2file",(function(){return a})),n.d(e,"downloadFile",(function(){return c})),n.d(e,"WebStorage",(function(){return l})),n.d(e,"createConfigureRos",(function(){return O})),n.d(e,"RosConfigure",(function(){return j})),n.d(e,"WebsocketClient",(function(){return U}));var i=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r=function(t,e){void 0===e&&(e={});return new Promise((function(n){var r,s;if(function(){var e,n,r=document.getElementsByTagName("script");try{for(var s=i(r),o=s.next();!o.done;o=s.next()){var a=o.value;if(a.src===t)return a}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return null}())return n(t);var o=document.createElement("script");try{for(var a=i(Object.keys(e)),c=a.next();!c.done;c=a.next()){var u=c.value;o[u]=e[u]}}catch(t){r={error:t}}finally{try{c&&!c.done&&(s=a.return)&&s.call(a)}finally{if(r)throw r.error}}return o.src=t,o.onload=function(){return n(t)},document.body.appendChild(o),"success"}))},s=function(t){return new Promise((function(e){var n=new FileReader;n.onload=function(t){return e(t.target.result)},n.readAsText(t)}))},o=function(t){return new Promise((function(e,n){var i=new FileReader;t?(i.onload=function(t){return e(t.target.result)},i.onabort=function(){return n()},i.readAsDataURL(t)):n("文件爲空!")}))},a=function(t,e,n){return new File(t,e,{type:n})},c=function(t,e){var n=document.createElement("a");n.href=t,e&&(n.download=e),n.style.position="fixed",n.style.visibility="hidden",document.body.appendChild(n),n.click(),document.body.removeChild(n)},u=function(){return(u=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},l=function(){function t(t){var e=t.type,n=void 0===e?"sessionStorage":e,i=t.key;this._key=i,this.storage=window[n]}return Object.defineProperty(t.prototype,"state",{get:function(){var t=this.storage.getItem(this._key);return t?JSON.parse(t):null},set:function(t){var e=JSON.stringify(t);this.storage.setItem(this._key,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this._key},enumerable:!1,configurable:!0}),t.prototype.merge=function(t){var e=this.state;this.state=u(u({},e),t)},t.prototype.clear=function(){this.storage.removeItem(this._key)},t}(),h=n(0),f=n.n(h),p=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},v=function(t){return function(e){var n,i,r={};try{for(var s=p(Object.keys(e)),o=s.next();!o.done;o=s.next()){var a=o.value;r[a]=t(e[a])}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return r}},m=function(){return(m=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},y=function(t){var e=this;this.configure=null,this.publishService=function(t){var n=t.name,i=t.serviceType,r=t.payload;return new Promise((function(t,s){var o=new f.a.Service({ros:e.configure.ros,name:n,serviceType:i}),a=new f.a.ServiceRequest(r);o.callService(a,t,s)}))},this.publishAction=function(t){var n=t.serverName,i=t.actionName,r=t.goalMessage;return new Promise((function(t,s){var o=new f.a.ActionClient({ros:e.configure.ros,serverName:n,actionName:i,timeout:0}),a=new f.a.Goal({actionClient:o,goalMessage:r});a.on("result",(function(e){return t(e)})),a.on("error",(function(t){return s(t)})),a.send()}))},this.rosTopic=function(t){var n=new f.a.Topic(m({ros:e.configure.ros},t));return n.publishMessage=function(t){"function"==typeof n.publish&&n.publish(new f.a.Message(t))},n},this.createRosService=function(t){return v((function(t){return function(n){return e.publishService(m(m({},t),{payload:n}))}}))(t)},this.createRosAction=function(t){return v((function(t){return function(n){return e.publishAction(m(m({},t),{goalMessage:n}))}}))(t)},this.createRosTopic=function(t){return v((function(t){return function(){return e.rosTopic(t)}}))(t)},this.configure=t},d=function(){return(d=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},b=function(){function t(){this.state={}}return t.prototype.inject=function(t,e){return new t(d(d({},this.state),e))},t.prototype.install=function(t,e){this.state[t]=e},t.prototype.remove=function(t){delete this.state[t]},t}(),g=function(){return(g=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},w=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(o,a)}c((i=i.apply(t,e||[])).next())}))},_=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}};function x(t){return w(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return window.ROSLIB||(window.ROSLIB=f.a),window.ROS3D?[2,window.ROS3D]:[4,r(t)];case 1:return e.sent(),[2,window.ROS3D]}}))}))}var T={colorsrc:"intensity",material:{size:.1},max_pts:1e7,colormap:function(t){return function(t){var e=5*(1-t)+1,n=Math.floor(e),i=e%1;0==(1&n)&&(i=1-i);var r=1-i,s=[{r:r,g:0,b:1},{r:0,g:r,b:1},{r:0,g:1,b:r},{r:r,g:1,b:0},{r:1,g:r,b:0}];n<1&&(n=1);var o=s[n-1]||s[4];return Object.keys(o).forEach((function(t){return o[t]=255*o[t]})),g(g({},o),{a:1})}(Math.max(0,Math.min((Math.pow(t,4)-0)/134217728,1)))}},k=function(){return(k=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},S=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(o,a)}c((i=i.apply(t,e||[])).next())}))},L=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},M=function(){function t(t){this.iu=new b,this.configure=t}return t.prototype.init=function(t){var e=t.elem,n=t.view,i=void 0===n?{}:n,r=t.tf,s=void 0===r?{}:r;return S(this,void 0,void 0,(function(){var t,n;return L(this,(function(r){switch(r.label){case 0:if(!this.configure.conf.ros3d_lib_url)throw new Error("ros3djs lib not found");return t=this,[4,x(this.configure.conf.ros3d_lib_url)];case 1:return t.ROS3D=r.sent(),this.elem=e,this.iu.install("ros",this.configure.ros),this.viewer=new this.ROS3D.Viewer(k({elem:e,width:e.clientWidth,height:e.clientHeight,antialias:!0,cameraPose:{x:100,y:100,z:100},displayPanAndZoomFrame:!1,background:"#000000"},i)),this.iu.install("rootObject",this.viewer.scene),n=this.iu.inject(f.a.TFClient,k({angularThres:.01,transThres:.01,fixedFrame:"/base_link"},s)),this.iu.install("tfClient",n),[2]}}))}))},t.prototype.destroy=function(){this.viewer&&"function"==typeof this.viewer.stop&&this.viewer.stop(),this.elem.innerHTML=""},t.prototype.initPointClouds=function(t){var e=this;return t.map((function(t){return e.iu.inject(e.ROS3D.PointCloud2,k(k({},T),t))}))},t}(),O=function(t){return{rosUtils:new y(t),createRosViewer:function(){return new M(t)}}},A=function(){return(A=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},E=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(o,a)}c((i=i.apply(t,e||[])).next())}))},F=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},j=function(){function t(t){this._conf=null,this._ros=null,this.getConfig=t}return Object.defineProperty(t.prototype,"conf",{get:function(){return this._conf?A({},this._conf):{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ros",{get:function(){if(!this._ros)throw Error("please init first!");return this._ros},enumerable:!1,configurable:!0}),t.prototype.init=function(){return E(this,void 0,void 0,(function(){var t;return F(this,(function(e){switch(e.label){case 0:return this._conf?[2]:(t=this,[4,this.getConfig()]);case 1:return t._conf=e.sent(),this._ros=new f.a.Ros({url:this._conf.ros_bridge_url}),[2]}}))}))},t}(),C=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{c(i.next(t))}catch(t){s(t)}}function a(t){try{c(i.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(o,a)}c((i=i.apply(t,e||[])).next())}))},N=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},R=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},P=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o},I=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(P(arguments[e]));return t},G=function(){function t(){this.state={},this.ids={}}return t.prototype.on=function(t,e){if(this.state[t]||(this.state[t]=[]),"function"!=typeof e)throw new Error("第二个参数必须为function!");var n=this.state[t].push(e)-1,i=function(t){void 0===t&&(t=8);var e=function(t){return Math.random().toString(32).slice(2,2+t)};if(t<=8)return e(t);for(var n="",i=8;i<=t;i+=8)n+=e(t-i>8?8:t-i);return n}(40);return this.ids[i]={event:t,index:n},i},t.prototype.cancel=function(t){if(t){var e=this.ids[t]||{},n=e.event,i=e.index;n&&Array.isArray(this.state[n])&&this.state[n].splice(i,1)}else this.clear()},t.prototype.clear=function(){this.state.length=0},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return C(this,void 0,void 0,(function(){var n,i,r,s,o,a;return N(this,(function(c){switch(c.label){case 0:if(!Array.isArray(this.state[t]))return[3,8];c.label=1;case 1:c.trys.push([1,6,7,8]),n=R(this.state[t]),i=n.next(),c.label=2;case 2:return i.done?[3,5]:"function"!=typeof(r=i.value)?[3,4]:[4,r.apply(void 0,I(e))];case 3:c.sent(),c.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return s=c.sent(),o={error:s},[3,8];case 7:try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}return[7];case 8:return[2]}}))}))},t}(),U=function(){function t(t){var e=t.url;this._status=0,this.url="",this.emitter=new G,this.url=e,this.connect()}return t.prototype.reconnect=function(){var t=this;3===this._status&&setTimeout((function(){t.connect()}),1e3)},t.prototype.onClose=function(){2!==this._status&&(this._status=3),this.reconnect()},t.prototype.onMessage=function(t){this.emitter.emit("message",t.data)},t.prototype.connect=function(){var t=this;this.client=new WebSocket(this.url),this.client.onclose=this.onClose.bind(this),this.client.onmessage=this.onMessage.bind(this),this.client.onopen=function(){t._status=1}},t.prototype.close=function(){this.client&&(this.client.close(),this.client=null,this._status=2)},t}()}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["pubo-web"]=e():t["pubo-web"]=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"loadScript",(function(){return o})),n.d(e,"blob2text",(function(){return i})),n.d(e,"blob2base64",(function(){return u})),n.d(e,"blob2file",(function(){return a})),n.d(e,"downloadFile",(function(){return c})),n.d(e,"WebStorage",(function(){return l})),n.d(e,"WebsocketClient",(function(){return v}));var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(t,e){void 0===e&&(e={});return new Promise((function(n){var o,i;if(function(){var e,n,o=document.getElementsByTagName("script");try{for(var i=r(o),u=i.next();!u.done;u=i.next()){var a=u.value;if(a.src===t)return a}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return null}())return n(t);var u=document.createElement("script");try{for(var a=r(Object.keys(e)),c=a.next();!c.done;c=a.next()){var s=c.value;u[s]=e[s]}}catch(t){o={error:t}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return u.src=t,u.onload=function(){return n(t)},document.body.appendChild(u),"success"}))},i=function(t){return new Promise((function(e){var n=new FileReader;n.onload=function(t){return e(t.target.result)},n.readAsText(t)}))},u=function(t){return new Promise((function(e,n){var r=new FileReader;t?(r.onload=function(t){return e(t.target.result)},r.onabort=function(){return n()},r.readAsDataURL(t)):n("文件爲空!")}))},a=function(t,e,n){return new File(t,e,{type:n})},c=function(t,e){var n=document.createElement("a");n.href=t,e&&(n.download=e),n.style.position="fixed",n.style.visibility="hidden",document.body.appendChild(n),n.click(),document.body.removeChild(n)},s=function(){return(s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=function(){function t(t){var e=t.type,n=void 0===e?"sessionStorage":e,r=t.key;this._key=r,this.storage=window[n]}return Object.defineProperty(t.prototype,"state",{get:function(){var t=this.storage.getItem(this._key);return t?JSON.parse(t):null},set:function(t){var e=JSON.stringify(t);this.storage.setItem(this._key,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this._key},enumerable:!1,configurable:!0}),t.prototype.merge=function(t){var e=this.state;this.state=s(s({},e),t)},t.prototype.clear=function(){this.storage.removeItem(this._key)},t}(),f=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,a)}c((r=r.apply(t,e||[])).next())}))},p=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},y=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t},b=function(){function t(){this.state={},this.ids={}}return t.prototype.on=function(t,e){if(this.state[t]||(this.state[t]=[]),"function"!=typeof e)throw new Error("第二个参数必须为function!");var n=this.state[t].push(e)-1,r=function(t){void 0===t&&(t=8);var e=function(t){return Math.random().toString(32).slice(2,2+t)};if(t<=8)return e(t);for(var n="",r=8;r<=t;r+=8)n+=e(t-r>8?8:t-r);return n}(40);return this.ids[r]={event:t,index:n},r},t.prototype.cancel=function(t){if(t){var e=this.ids[t]||{},n=e.event,r=e.index;n&&Array.isArray(this.state[n])&&this.state[n].splice(r,1)}else this.clear()},t.prototype.clear=function(){this.state.length=0},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return f(this,void 0,void 0,(function(){var n,r,o,i,u,a;return p(this,(function(c){switch(c.label){case 0:if(!Array.isArray(this.state[t]))return[3,8];c.label=1;case 1:c.trys.push([1,6,7,8]),n=y(this.state[t]),r=n.next(),c.label=2;case 2:return r.done?[3,5]:"function"!=typeof(o=r.value)?[3,4]:[4,o.apply(void 0,h(e))];case 3:c.sent(),c.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return i=c.sent(),u={error:i},[3,8];case 7:try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(u)throw u.error}return[7];case 8:return[2]}}))}))},t}(),v=function(){function t(t){var e=t.url;this._status=0,this.url="",this.emitter=new b,this.url=e,this.connect()}return t.prototype.reconnect=function(){var t=this;3===this._status&&setTimeout((function(){t.connect()}),1e3)},t.prototype.onClose=function(){2!==this._status&&(this._status=3),this.reconnect()},t.prototype.onMessage=function(t){this.emitter.emit("message",t.data)},t.prototype.connect=function(){var t=this;this.client=new WebSocket(this.url),this.client.onclose=this.onClose.bind(this),this.client.onmessage=this.onMessage.bind(this),this.client.onopen=function(){t._status=1}},t.prototype.close=function(){this.client&&(this.client.close(),this.client=null,this._status=2)},t}()}])}));
|
package/es/index.d.ts
CHANGED
|
@@ -2,7 +2,5 @@ import { loadScript } from './load-script';
|
|
|
2
2
|
import { blob2text, blob2base64, blob2file } from './file/parser';
|
|
3
3
|
import { downloadFile } from './file/download';
|
|
4
4
|
import { WebStorage } from './storage';
|
|
5
|
-
import { createConfigureRos } from './ros';
|
|
6
|
-
import { RosConfigure } from './ros/factory/configure';
|
|
7
5
|
import WebsocketClient from './websocket/client';
|
|
8
|
-
export { loadScript, blob2text, blob2base64, blob2file, downloadFile, WebStorage,
|
|
6
|
+
export { loadScript, blob2text, blob2base64, blob2file, downloadFile, WebStorage, WebsocketClient };
|
package/es/index.js
CHANGED
|
@@ -2,7 +2,5 @@ import { loadScript } from './load-script';
|
|
|
2
2
|
import { blob2text, blob2base64, blob2file } from './file/parser';
|
|
3
3
|
import { downloadFile } from './file/download';
|
|
4
4
|
import { WebStorage } from './storage';
|
|
5
|
-
import { createConfigureRos } from './ros';
|
|
6
|
-
import { RosConfigure } from './ros/factory/configure';
|
|
7
5
|
import WebsocketClient from './websocket/client';
|
|
8
|
-
export { loadScript, blob2text, blob2base64, blob2file, downloadFile, WebStorage,
|
|
6
|
+
export { loadScript, blob2text, blob2base64, blob2file, downloadFile, WebStorage, WebsocketClient };
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,5 @@ import { loadScript } from './load-script';
|
|
|
2
2
|
import { blob2text, blob2base64, blob2file } from './file/parser';
|
|
3
3
|
import { downloadFile } from './file/download';
|
|
4
4
|
import { WebStorage } from './storage';
|
|
5
|
-
import { createConfigureRos } from './ros';
|
|
6
|
-
import { RosConfigure } from './ros/factory/configure';
|
|
7
5
|
import WebsocketClient from './websocket/client';
|
|
8
|
-
export { loadScript, blob2text, blob2base64, blob2file, downloadFile, WebStorage,
|
|
6
|
+
export { loadScript, blob2text, blob2base64, blob2file, downloadFile, WebStorage, WebsocketClient };
|
package/lib/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", {
|
|
10
10
|
value: true
|
|
11
11
|
});
|
|
12
|
-
exports.WebsocketClient = exports.
|
|
12
|
+
exports.WebsocketClient = exports.WebStorage = exports.downloadFile = exports.blob2file = exports.blob2base64 = exports.blob2text = exports.loadScript = void 0;
|
|
13
13
|
|
|
14
14
|
var load_script_1 = require("./load-script");
|
|
15
15
|
|
|
@@ -59,24 +59,6 @@ Object.defineProperty(exports, "WebStorage", {
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
var ros_1 = require("./ros");
|
|
63
|
-
|
|
64
|
-
Object.defineProperty(exports, "createConfigureRos", {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function get() {
|
|
67
|
-
return ros_1.createConfigureRos;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
var configure_1 = require("./ros/factory/configure");
|
|
72
|
-
|
|
73
|
-
Object.defineProperty(exports, "RosConfigure", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function get() {
|
|
76
|
-
return configure_1.RosConfigure;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
62
|
var client_1 = __importDefault(require("./websocket/client"));
|
|
81
63
|
|
|
82
64
|
exports.WebsocketClient = client_1["default"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pubo-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"node": ">=8.0.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"pubo-utils": "^1.0.
|
|
22
|
+
"pubo-utils": "^1.0.17",
|
|
23
23
|
"roslib": "^1.2.0"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "9b3ea07fafc516d4b3330a402820eb80d4b76092"
|
|
26
26
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface RosConfig {
|
|
2
|
-
ros_bridge_url: string;
|
|
3
|
-
ros3d_lib_url?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare class RosConfigure {
|
|
6
|
-
private _conf;
|
|
7
|
-
private readonly getConfig;
|
|
8
|
-
private _ros;
|
|
9
|
-
constructor(getConfig: () => Promise<RosConfig>);
|
|
10
|
-
get conf(): RosConfig;
|
|
11
|
-
get ros(): any;
|
|
12
|
-
init(): Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
var __assign = this && this.__assign || function () {
|
|
2
|
-
__assign = Object.assign || function (t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
|
|
6
|
-
for (var p in s) {
|
|
7
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) {
|
|
19
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
20
|
-
resolve(value);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
25
|
-
function fulfilled(value) {
|
|
26
|
-
try {
|
|
27
|
-
step(generator.next(value));
|
|
28
|
-
} catch (e) {
|
|
29
|
-
reject(e);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function rejected(value) {
|
|
34
|
-
try {
|
|
35
|
-
step(generator["throw"](value));
|
|
36
|
-
} catch (e) {
|
|
37
|
-
reject(e);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function step(result) {
|
|
42
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
var __generator = this && this.__generator || function (thisArg, body) {
|
|
50
|
-
var _ = {
|
|
51
|
-
label: 0,
|
|
52
|
-
sent: function sent() {
|
|
53
|
-
if (t[0] & 1) throw t[1];
|
|
54
|
-
return t[1];
|
|
55
|
-
},
|
|
56
|
-
trys: [],
|
|
57
|
-
ops: []
|
|
58
|
-
},
|
|
59
|
-
f,
|
|
60
|
-
y,
|
|
61
|
-
t,
|
|
62
|
-
g;
|
|
63
|
-
return g = {
|
|
64
|
-
next: verb(0),
|
|
65
|
-
"throw": verb(1),
|
|
66
|
-
"return": verb(2)
|
|
67
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
68
|
-
return this;
|
|
69
|
-
}), g;
|
|
70
|
-
|
|
71
|
-
function verb(n) {
|
|
72
|
-
return function (v) {
|
|
73
|
-
return step([n, v]);
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function step(op) {
|
|
78
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
79
|
-
|
|
80
|
-
while (_) {
|
|
81
|
-
try {
|
|
82
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
83
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
84
|
-
|
|
85
|
-
switch (op[0]) {
|
|
86
|
-
case 0:
|
|
87
|
-
case 1:
|
|
88
|
-
t = op;
|
|
89
|
-
break;
|
|
90
|
-
|
|
91
|
-
case 4:
|
|
92
|
-
_.label++;
|
|
93
|
-
return {
|
|
94
|
-
value: op[1],
|
|
95
|
-
done: false
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
case 5:
|
|
99
|
-
_.label++;
|
|
100
|
-
y = op[1];
|
|
101
|
-
op = [0];
|
|
102
|
-
continue;
|
|
103
|
-
|
|
104
|
-
case 7:
|
|
105
|
-
op = _.ops.pop();
|
|
106
|
-
|
|
107
|
-
_.trys.pop();
|
|
108
|
-
|
|
109
|
-
continue;
|
|
110
|
-
|
|
111
|
-
default:
|
|
112
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
113
|
-
_ = 0;
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
118
|
-
_.label = op[1];
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
123
|
-
_.label = t[1];
|
|
124
|
-
t = op;
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (t && _.label < t[2]) {
|
|
129
|
-
_.label = t[2];
|
|
130
|
-
|
|
131
|
-
_.ops.push(op);
|
|
132
|
-
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (t[2]) _.ops.pop();
|
|
137
|
-
|
|
138
|
-
_.trys.pop();
|
|
139
|
-
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
op = body.call(thisArg, _);
|
|
144
|
-
} catch (e) {
|
|
145
|
-
op = [6, e];
|
|
146
|
-
y = 0;
|
|
147
|
-
} finally {
|
|
148
|
-
f = t = 0;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (op[0] & 5) throw op[1];
|
|
153
|
-
return {
|
|
154
|
-
value: op[0] ? op[1] : void 0,
|
|
155
|
-
done: true
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
import ROSLIB from 'roslib';
|
|
161
|
-
|
|
162
|
-
var RosConfigure =
|
|
163
|
-
/** @class */
|
|
164
|
-
function () {
|
|
165
|
-
function RosConfigure(getConfig) {
|
|
166
|
-
this._conf = null;
|
|
167
|
-
this._ros = null;
|
|
168
|
-
this.getConfig = getConfig;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
Object.defineProperty(RosConfigure.prototype, "conf", {
|
|
172
|
-
get: function get() {
|
|
173
|
-
var initialValues = {};
|
|
174
|
-
|
|
175
|
-
if (!this._conf) {
|
|
176
|
-
return initialValues;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return __assign({}, this._conf);
|
|
180
|
-
},
|
|
181
|
-
enumerable: false,
|
|
182
|
-
configurable: true
|
|
183
|
-
});
|
|
184
|
-
Object.defineProperty(RosConfigure.prototype, "ros", {
|
|
185
|
-
get: function get() {
|
|
186
|
-
if (!this._ros) {
|
|
187
|
-
throw Error('please init first!');
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return this._ros;
|
|
191
|
-
},
|
|
192
|
-
enumerable: false,
|
|
193
|
-
configurable: true
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
RosConfigure.prototype.init = function () {
|
|
197
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
198
|
-
var _a;
|
|
199
|
-
|
|
200
|
-
return __generator(this, function (_b) {
|
|
201
|
-
switch (_b.label) {
|
|
202
|
-
case 0:
|
|
203
|
-
if (this._conf) {
|
|
204
|
-
return [2
|
|
205
|
-
/*return*/
|
|
206
|
-
];
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
_a = this;
|
|
210
|
-
return [4
|
|
211
|
-
/*yield*/
|
|
212
|
-
, this.getConfig()];
|
|
213
|
-
|
|
214
|
-
case 1:
|
|
215
|
-
_a._conf = _b.sent();
|
|
216
|
-
this._ros = new ROSLIB.Ros({
|
|
217
|
-
url: this._conf.ros_bridge_url
|
|
218
|
-
});
|
|
219
|
-
return [2
|
|
220
|
-
/*return*/
|
|
221
|
-
];
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
return RosConfigure;
|
|
228
|
-
}();
|
|
229
|
-
|
|
230
|
-
export { RosConfigure };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import ROSLIB from 'roslib';
|
|
2
|
-
import { RosConfigure } from './configure';
|
|
3
|
-
import type { CreateFactory } from './super';
|
|
4
|
-
interface RosActionConfig {
|
|
5
|
-
serverName: string;
|
|
6
|
-
actionName: string;
|
|
7
|
-
}
|
|
8
|
-
interface TopicType {
|
|
9
|
-
name: string;
|
|
10
|
-
messageType: string;
|
|
11
|
-
}
|
|
12
|
-
interface RoseServiceConfig {
|
|
13
|
-
name: string;
|
|
14
|
-
serviceType: string;
|
|
15
|
-
}
|
|
16
|
-
declare type RoseServiceFunc = (payload: any) => Promise<any>;
|
|
17
|
-
declare type RoseActionFunc = (goalMessage: any) => Promise<any>;
|
|
18
|
-
interface RosTopic extends ROSLIB.Topic {
|
|
19
|
-
publishMessage: (payload: any) => void;
|
|
20
|
-
}
|
|
21
|
-
declare type RosTopicFunc = () => RosTopic;
|
|
22
|
-
export declare class RosUtils {
|
|
23
|
-
private readonly configure;
|
|
24
|
-
constructor(configure: RosConfigure);
|
|
25
|
-
private readonly publishService;
|
|
26
|
-
private readonly publishAction;
|
|
27
|
-
private readonly rosTopic;
|
|
28
|
-
createRosService: CreateFactory<RoseServiceConfig, RoseServiceFunc>;
|
|
29
|
-
createRosAction: CreateFactory<RosActionConfig, RoseActionFunc>;
|
|
30
|
-
createRosTopic: CreateFactory<TopicType, RosTopicFunc>;
|
|
31
|
-
}
|
|
32
|
-
export {};
|