pubo-web 1.0.4-alpha.0
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 +13 -0
- package/es/file/download.d.ts +1 -0
- package/es/file/download.js +14 -0
- package/es/file/parser.d.ts +3 -0
- package/es/file/parser.js +35 -0
- package/es/index.d.ts +7 -0
- package/es/index.js +7 -0
- package/es/load-script/index.d.ts +1 -0
- package/es/load-script/index.js +88 -0
- package/es/ros/factory/configure.d.ts +14 -0
- package/es/ros/factory/configure.js +230 -0
- package/es/ros/factory/index.d.ts +32 -0
- package/es/ros/factory/index.js +116 -0
- package/es/ros/factory/super.d.ts +11 -0
- package/es/ros/factory/super.js +43 -0
- package/es/ros/index.d.ts +7 -0
- package/es/ros/index.js +10 -0
- package/es/ros/ros3d/inject.d.ts +6 -0
- package/es/ros/ros3d/inject.js +39 -0
- package/es/ros/ros3d/utils.d.ts +11 -0
- package/es/ros/ros3d/utils.js +249 -0
- package/es/ros/ros3d/viewer.d.ts +19 -0
- package/es/ros/ros3d/viewer.js +244 -0
- package/es/storage/index.d.ts +16 -0
- package/es/storage/index.js +65 -0
- package/lib/file/download.d.ts +1 -0
- package/lib/file/download.js +21 -0
- package/lib/file/parser.d.ts +3 -0
- package/lib/file/parser.js +44 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +72 -0
- package/lib/load-script/index.d.ts +1 -0
- package/lib/load-script/index.js +95 -0
- package/lib/ros/factory/configure.d.ts +14 -0
- package/lib/ros/factory/configure.js +243 -0
- package/lib/ros/factory/index.d.ts +32 -0
- package/lib/ros/factory/index.js +130 -0
- package/lib/ros/factory/super.d.ts +11 -0
- package/lib/ros/factory/super.js +50 -0
- package/lib/ros/index.d.ts +7 -0
- package/lib/ros/index.js +19 -0
- package/lib/ros/ros3d/inject.d.ts +6 -0
- package/lib/ros/ros3d/inject.js +46 -0
- package/lib/ros/ros3d/utils.d.ts +11 -0
- package/lib/ros/ros3d/utils.js +272 -0
- package/lib/ros/ros3d/viewer.d.ts +19 -0
- package/lib/ros/ros3d/viewer.js +259 -0
- package/lib/storage/index.d.ts +16 -0
- package/lib/storage/index.js +72 -0
- package/package.json +26 -0
package/dist/pubo-web.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["pubo-web"]=t():e["pubo-web"]=t()}(this,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=50)}([function(e,t,n){var i=this.ROSLIB||{REVISION:"1.2.0"},r=n(1);r(i,n(28)),r(i,n(40)),r(i,n(43)),r(i,n(44)),r(i,n(46)),e.exports=i},function(e,t,n){"use strict";
|
|
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(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,c=o(e),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(e,t,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(e){return"[object Array]"===Object.prototype.toString.call(e)},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(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function m(){this._events={},this._conf&&v.call(this,this._conf)}function v(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),void 0!==e.maxListeners&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function y(e,t){var n="(node) warning: possible EventEmitter memory leak detected. "+e+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(n+=" Event name: "+t+"."),void 0!==i&&i.emitWarning){var r=new Error(n);r.name="MaxListenersExceededWarning",r.emitter=this,r.count=e,i.emitWarning(r)}else console.error(n),console.trace&&console.trace()}var d=function(e,t,n){var i=arguments.length;switch(i){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,n];default:for(var r=new Array(i);i--;)r[i]=arguments[i];return r}};function g(e,t){for(var n={},i=e.length,r=t?value.length:0,s=0;s<i;s++)n[e[s]]=s<r?t[s]:void 0;return n}function b(e,t,n){var i,r;if(this._emitter=e,this._target=t,this._listeners={},this._listenersCount=0,(n.on||n.off)&&(i=n.on,r=n.off),t.addEventListener?(i=t.addEventListener,r=t.removeEventListener):t.addListener?(i=t.addListener,r=t.removeListener):t.on&&(i=t.on,r=t.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=e._observers;s?s.push(this):e._observers=[this]}function w(e,t,n,i){var r=Object.assign({},t);if(!e)return r;if("object"!=typeof e)throw TypeError("options must be an object");var s,o,c,u=Object.keys(e),l=u.length;function h(e){throw Error('Invalid "'+s+'" option value'+(e?". Reason: "+e:""))}for(var f=0;f<l;f++){if(s=u[f],!i&&!a.call(t,s))throw Error('Unknown "'+s+'" option');void 0!==(o=e[s])&&(c=n[s],r[s]=c?c(o,h):o)}return r}function _(e,t){return"function"==typeof e&&e.hasOwnProperty("prototype")||t("value must be a constructor"),e}function x(e){var t="value must be type of "+e.join("|"),n=e.length,i=e[0],r=e[1];return 1===n?function(e,n){if(typeof e===i)return e;n(t)}:2===n?function(e,n){var s=typeof e;if(s===i||s===r)return e;n(t)}:function(i,r){for(var s=typeof i,o=n;o-- >0;)if(s===e[o])return i;r(t)}}Object.assign(b.prototype,{subscribe:function(e,t,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:t,original:e};if(n){var a=n.call(r,o);!1!==a&&s.emit.apply(s,[o.name].concat(i))}else s.emit.apply(s,[t].concat(i))};if(o[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,s._newListener&&s._removeListener&&!i._onNewListener?(this._onNewListener=function(n){n===t&&null===o[e]&&(o[e]=a,i._on.call(r,e,a))},s.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===t&&!s.hasListeners(n)&&o[e]&&(o[e]=null,i._off.call(r,e,a))},o[e]=null,s.on("removeListener",this._onRemoveListener)):(o[e]=a,i._on.call(r,e,a))},unsubscribe:function(e){var t,n,i,r=this,s=this._listeners,o=this._emitter,a=this._off,c=this._target;if(e&&"string"!=typeof e)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 e=L.call(o,r);o._observers.splice(e,1)}if(e){if(!(t=s[e]))return;a.call(c,e,t),delete s[e],--this._listenersCount||u()}else{for(i=(n=p(s)).length;i-- >0;)e=n[i],a.call(c,e,s[e]);this._listeners={},this._listenersCount=0,u()}}});var T=x(["function"]),k=x(["object","function"]);function S(e,t,n){var i,r,s,o=0,a=new e((function(c,u,l){function h(){r&&(r=null),o&&(clearTimeout(o),o=0)}n=w(n,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),i=!n.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof l;var f=function(e){h(),c(e)},p=function(e){h(),u(e)};i?t(f,p,l):(r=[function(e){p(e||Error("canceled"))}],t(f,p,(function(e){if(s)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");r.push(e)})),s=!0),n.timeout>0&&(o=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",o=0,a.cancel(e),u(e)}),n.timeout))}));return i||(a.cancel=function(e){if(r){for(var t=r.length,n=1;n<t;n++)r[n](e);r[0](e),r=null}}),a}function L(e){var t=this._observers;if(!t)return-1;for(var n=t.length,i=0;i<n;i++)if(t[i]._target===e)return i;return-1}function M(e,t,n,i,r){if(!n)return null;if(0===i){var s=typeof t;if("string"===s){var o,a,c=0,u=0,l=this.delimiter,h=l.length;if(-1!==(a=t.indexOf(l))){o=new Array(5);do{o[c++]=t.slice(u,a),u=a+h}while(-1!==(a=t.indexOf(l,u)));o[c++]=t.slice(u),t=o,r=c}else t=[t],r=1}else"object"===s?r=t.length:(t=[t],r=1)}var f,m,v,y,d,g,b,w=null,_=t[i],x=t[i+1];if(i===r)n._listeners&&("function"==typeof n._listeners?(e&&e.push(n._listeners),w=[n]):(e&&e.push.apply(e,n._listeners),w=[n]));else{if("*"===_){for(a=(g=p(n)).length;a-- >0;)"_listeners"!==(f=g[a])&&(b=M(e,t,n[f],i+1,r))&&(w?w.push.apply(w,b):w=b);return w}if("**"===_){for((d=i+1===r||i+2===r&&"*"===x)&&n._listeners&&(w=M(e,t,n,r,r)),a=(g=p(n)).length;a-- >0;)"_listeners"!==(f=g[a])&&("*"===f||"**"===f?(n[f]._listeners&&!d&&(b=M(e,t,n[f],r,r))&&(w?w.push.apply(w,b):w=b),b=M(e,t,n[f],i,r)):b=M(e,t,n[f],f===x?i+2:i,r),b&&(w?w.push.apply(w,b):w=b));return w}n[_]&&(w=M(e,t,n[_],i+1,r))}if((m=n["*"])&&M(e,t,m,i+1,r),v=n["**"])if(i<r)for(v._listeners&&M(e,t,v,r,r),a=(g=p(v)).length;a-- >0;)"_listeners"!==(f=g[a])&&(f===x?M(e,t,v[f],i+2,r):f===_?M(e,t,v[f],i+1,r):((y={})[f]=v[f],M(e,t,{"**":y},i+1,r)));else v._listeners?M(e,t,v,r,r):v["*"]&&v["*"]._listeners&&M(e,t,v["*"],r,r);return w}function O(e,t,n){var i,r,s=0,o=0,a=this.delimiter,c=a.length;if("string"==typeof e)if(-1!==(i=e.indexOf(a))){r=new Array(5);do{r[s++]=e.slice(o,i),o=i+c}while(-1!==(i=e.indexOf(a,o)));r[s++]=e.slice(o)}else r=[e],s=1;else r=e,s=e.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(t):l._listeners.push(t),!l._listeners.warned&&this._maxListeners>0&&l._listeners.length>this._maxListeners&&(l._listeners.warned=!0,y.call(this,l._listeners.length,u))):l._listeners=t,!0;return!0}function A(e,t,n,i){for(var r,s,o,a,c=p(e),u=c.length,l=e._listeners;u-- >0;)r=e[s=c[u]],o="_listeners"===s?n:n?n.concat(s):[s],a=i||"symbol"==typeof s,l&&t.push(a?o:o.join(this.delimiter)),"object"==typeof r&&A.call(this,r,t,o,a);return t}function E(e){for(var t,n,i,r=p(e),s=r.length;s-- >0;)(t=e[n=r[s]])&&(i=!0,"_listeners"===n||E(t)||delete e[n]);return i}function F(e,t,n){this.emitter=e,this.event=t,this.listener=n}function j(e,t,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=t,l=t._origin||t;if(o&&!u)throw Error("process.nextTick is not supported");void 0===s&&(s="AsyncFunction"===t.constructor.name),(t=function(){var e=arguments,t=this,n=this.event;return s?o?Promise.resolve():new Promise((function(e){f(e)})).then((function(){return t.event=n,c.apply(t,e)})):(o?i.nextTick:f)((function(){t.event=n,c.apply(t,e)}))})._async=!0,t._origin=l}return[t,a?new F(this,e,t):this]}function N(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,v.call(this,e)}F.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},N.EventEmitter2=N,N.prototype.listenTo=function(e,t,n){if("object"!=typeof e)throw TypeError("target musts be an object");var i=this;function r(t){if("object"!=typeof t)throw TypeError("events must be an object");var r,s=n.reducers,o=L.call(i,e);r=-1===o?new b(i,e,n):i._observers[o];for(var a,c=p(t),u=c.length,l="function"==typeof s,h=0;h<u;h++)a=c[h],r.subscribe(a,t[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(t)?r(g(t)):r("string"==typeof t?g(t.split(/\s+/)):t),this},N.prototype.stopListeningTo=function(e,t){var n=this._observers;if(!n)return!1;var i,r=n.length,s=!1;if(e&&"object"!=typeof e)throw TypeError("target should be an object");for(;r-- >0;)i=n[r],e&&i._target!==e||(i.unsubscribe(t),s=!0);return s},N.prototype.delimiter=".",N.prototype.setMaxListeners=function(e){void 0!==e&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},N.prototype.getMaxListeners=function(){return this._maxListeners},N.prototype.event="",N.prototype.once=function(e,t,n){return this._once(e,t,!1,n)},N.prototype.prependOnceListener=function(e,t,n){return this._once(e,t,!0,n)},N.prototype._once=function(e,t,n,i){return this._many(e,1,t,n,i)},N.prototype.many=function(e,t,n,i){return this._many(e,t,n,!1,i)},N.prototype.prependMany=function(e,t,n,i){return this._many(e,t,n,!0,i)},N.prototype._many=function(e,t,n,i,r){var s=this;if("function"!=typeof n)throw new Error("many only accepts instances of Function");function o(){return 0==--t&&s.off(e,o),n.apply(this,arguments)}return o._origin=n,this._on(e,o,i,r)},N.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||m.call(this);var e,t,n,i,r,s,o=arguments[0],a=this.wildcard;if("newListener"===o&&!this._newListener&&!this._events.newListener)return!1;if(a&&(e=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,e,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(t=new Array(u-1),r=1;r<u;r++)t[r-1]=arguments[r];c.apply(this,t)}return!0}c&&(c=c.slice())}if(c&&c.length){if(u>3)for(t=new Array(u-1),r=1;r<u;r++)t[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,t)}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},N.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||m.call(this);var e,t,n,i,r,s,o=arguments[0],a=this.wildcard;if("newListener"===o&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(a&&(e=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){if(i=o.length,l)for(r=0;r<i;r++)if("symbol"==typeof o[r]){t=!0;break}t||(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,e,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)},N.prototype.on=function(e,t,n){return this._on(e,t,!1,n)},N.prototype.prependListener=function(e,t,n){return this._on(e,t,!0,n)},N.prototype.onAny=function(e){return this._onAny(e,!1)},N.prototype.prependAny=function(e){return this._onAny(e,!0)},N.prototype.addListener=N.prototype.on,N.prototype._onAny=function(e,t){if("function"!=typeof e)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),t?this._all.unshift(e):this._all.push(e),this},N.prototype._on=function(e,t,n,i){if("function"==typeof e)return this._onAny(e,t),this;if("function"!=typeof t)throw new Error("on only accepts instances of Function");this._events||m.call(this);var r,s=this;return void 0!==i&&(t=(r=j.call(this,e,t,i))[0],s=r[1]),this._newListener&&this.emit("newListener",e,t),this.wildcard?(O.call(this,e,t,n),s):(this._events[e]?("function"==typeof this._events[e]&&(this._events[e]=[this._events[e]]),n?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&this._maxListeners>0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,y.call(this,this._events[e].length,e))):this._events[e]=t,s)},N.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var n,i=[];if(this.wildcard){var r="string"==typeof e?e.split(this.delimiter):e.slice();if(!(i=M.call(this,null,r,this.listenerTree,0)))return this}else{if(!this._events[e])return this;n=this._events[e],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]===t||n[u].listener&&n[u].listener===t||n[u]._origin&&n[u]._origin===t){a=u;break}if(a<0)continue;return this.wildcard?o._listeners.splice(a,1):this._events[e].splice(a,1),0===n.length&&(this.wildcard?delete o._listeners:delete this._events[e]),this._removeListener&&this.emit("removeListener",e,t),this}(n===t||n.listener&&n.listener===t||n._origin&&n._origin===t)&&(this.wildcard?delete o._listeners:delete this._events[e],this._removeListener&&this.emit("removeListener",e,t))}return this.listenerTree&&E(this.listenerTree),this},N.prototype.offAny=function(e){var t,n=0,i=0;if(e&&this._all&&this._all.length>0){for(n=0,i=(t=this._all).length;n<i;n++)if(e===t[n])return t.splice(n,1),this._removeListener&&this.emit("removeListenerAny",e),this}else{if(t=this._all,this._removeListener)for(n=0,i=t.length;n<i;n++)this.emit("removeListenerAny",t[n]);this._all=[]}return this},N.prototype.removeListener=N.prototype.off,N.prototype.removeAllListeners=function(e){if(void 0===e)return!this._events||m.call(this),this;if(this.wildcard){var t,n=M.call(this,null,e,this.listenerTree,0);if(!n)return this;for(t=0;t<n.length;t++)n[t]._listeners=null;this.listenerTree&&E(this.listenerTree)}else this._events&&(this._events[e]=null);return this},N.prototype.listeners=function(e){var t,n,i,r,s,o=this._events;if(void 0===e){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!o)return[];for(r=(t=p(o)).length,i=[];r-- >0;)"function"==typeof(n=o[t[r]])?i.push(n):i.push.apply(i,n);return i}if(this.wildcard){if(!(s=this.listenerTree))return[];var a=[],c="string"==typeof e?e.split(this.delimiter):e.slice();return M.call(this,a,c,s,0),a}return o&&(n=o[e])?"function"==typeof n?[n]:n:[]},N.prototype.eventNames=function(e){var t=this._events;return this.wildcard?A.call(this,this.listenerTree,[],null,e):t?p(t):[]},N.prototype.listenerCount=function(e){return this.listeners(e).length},N.prototype.hasListeners=function(e){if(this.wildcard){var t=[],n="string"==typeof e?e.split(this.delimiter):e.slice();return M.call(this,t,n,this.listenerTree,0),t.length>0}var i=this._events,r=this._all;return!!(r&&r.length||i&&(void 0===e?p(i).length:i[e]))},N.prototype.listenersAny=function(){return this._all?this._all:[]},N.prototype.waitFor=function(e,t){var n=this,i=typeof t;return"number"===i?t={timeout:t}:"function"===i&&(t={filter:t}),S((t=w(t,{timeout:0,filter:void 0,handleError:!1,Promise:Promise,overload:!1},{filter:T,Promise:_})).Promise,(function(i,r,s){function o(){var s=t.filter;if(!s||s.apply(n,arguments))if(n.off(e,o),t.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(e,o)})),n._on(e,o,!1)}),{timeout:t.timeout,overload:t.overload})};var C=N.prototype;Object.defineProperties(N,{defaultMaxListeners:{get:function(){return C._maxListeners},set:function(e){if("number"!=typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");C._maxListeners=e},enumerable:!0},once:{value:function(e,t,n){return S((n=w(n,{Promise:Promise,timeout:0,overload:!1},{Promise:_})).Promise,(function(n,i,r){var s;if("function"==typeof e.addEventListener)return s=function(){n(d.apply(null,arguments))},r((function(){e.removeEventListener(t,s)})),void e.addEventListener(t,s,{once:!0});var o,a=function(){o&&e.removeListener("error",o),n(d.apply(null,arguments))};"error"!==t&&(o=function(n){e.removeListener(t,a),i(n)},e.once("error",o)),r((function(){o&&e.removeListener("error",o),e.removeListener(t,a)})),e.once(t,a)}),{timeout:n.timeout,overload:n.overload})},writable:!0,configurable:!0}}),Object.defineProperties(C,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),void 0===(s=function(){return N}.call(t,n,t,e))||(e.exports=s)}()}).call(this,n(16),n(37).setImmediate)},function(e,t){function n(e){e=e||{},this.x=e.x||0,this.y=e.y||0,this.z=e.z||0}n.prototype.add=function(e){this.x+=e.x,this.y+=e.y,this.z+=e.z},n.prototype.subtract=function(e){this.x-=e.x,this.y-=e.y,this.z-=e.z},n.prototype.multiplyQuaternion=function(e){var t=e.w*this.x+e.y*this.z-e.z*this.y,n=e.w*this.y+e.z*this.x-e.x*this.z,i=e.w*this.z+e.x*this.y-e.y*this.x,r=-e.x*this.x-e.y*this.y-e.z*this.z;this.x=t*e.w+r*-e.x+n*-e.z-i*-e.y,this.y=n*e.w+r*-e.y+i*-e.x-t*-e.z,this.z=i*e.w+r*-e.z+t*-e.y-n*-e.x},n.prototype.clone=function(){return new n(this)},e.exports=n},function(e,t,n){var i=n(1);e.exports=function(e){i(this,e)}},function(e,t,n){var i=n(1);e.exports=function(e){i(this,e)}},function(e,t,n){var i=n(2).EventEmitter2,r=n(4);function s(e){e=e||{},this.ros=e.ros,this.name=e.name,this.messageType=e.messageType,this.isAdvertised=!1,this.compression=e.compression||"none",this.throttle_rate=e.throttle_rate||0,this.latch=e.latch||!1,this.queue_size=e.queue_size||100,this.queue_length=e.queue_length||0,this.reconnect_on_close=void 0===e.reconnect_on_close||e.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 t=this;this.reconnect_on_close?this.callForSubscribeAndAdvertise=function(e){t.ros.callOnConnection(e),t.waitForReconnect=!1,t.reconnectFunc=function(){t.waitForReconnect||(t.waitForReconnect=!0,t.ros.callOnConnection(e),t.ros.once("connection",(function(){t.waitForReconnect=!1})))},t.ros.on("close",t.reconnectFunc)}:this.callForSubscribeAndAdvertise=this.ros.callOnConnection,this._messageCallback=function(e){t.emit("message",new r(e))}}s.prototype.__proto__=i.prototype,s.prototype.subscribe=function(e){"function"==typeof e&&this.on("message",e),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(e){e&&(this.off("message",e),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 e=this;this.ros.on("close",(function(){e.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(e){this.isAdvertised||this.advertise(),this.ros.idCounter++;var t={op:"publish",id:"publish:"+this.name+":"+this.ros.idCounter,topic:this.name,msg:e,latch:this.latch};this.ros.callOnConnection(t)},e.exports=s},function(e,t){function n(e){e=e||{},this.x=e.x||0,this.y=e.y||0,this.z=e.z||0,this.w="number"==typeof e.w?e.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 e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e)},n.prototype.invert=function(){this.conjugate(),this.normalize()},n.prototype.multiply=function(e){var t=this.x*e.w+this.y*e.z-this.z*e.y+this.w*e.x,n=-this.x*e.z+this.y*e.w+this.z*e.x+this.w*e.y,i=this.x*e.y-this.y*e.x+this.z*e.w+this.w*e.z,r=-this.x*e.x-this.y*e.y-this.z*e.z+this.w*e.w;this.x=t,this.y=n,this.z=i,this.w=r},n.prototype.clone=function(){return new n(this)},e.exports=n},function(e,t){e.exports={URDF_SPHERE:0,URDF_BOX:1,URDF_CYLINDER:2,URDF_MESH:3}},function(e,t,n){var i=n(15),r=(n(5),n(2).EventEmitter2);function s(e){e=e||{},this.ros=e.ros,this.name=e.name,this.serviceType=e.serviceType,this.isAdvertised=!1,this._serviceCallback=null}s.prototype.__proto__=r.prototype,s.prototype.callService=function(e,t,n){if(!this.isAdvertised){var r="call_service:"+this.name+":"+ ++this.ros.idCounter;(t||n)&&this.ros.once(r,(function(e){void 0!==e.result&&!1===e.result?"function"==typeof n&&n(e.values):"function"==typeof t&&t(new i(e.values))}));var s={op:"call_service",id:r,service:this.name,type:this.serviceType,args:e};this.ros.callOnConnection(s)}},s.prototype.advertise=function(e){this.isAdvertised||"function"!=typeof e||(this._serviceCallback=e,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(e){var t={},n=this._serviceCallback(e.args,t),r={op:"service_response",service:this.name,values:new i(t),result:n};e.id&&(r.id=e.id),this.ros.callOnConnection(r)},e.exports=s},function(e,t){e.exports=function(e,t,n){t.forEach((function(t){var i=n[t];e.prototype[t]=function(e){return e.ros=this,new i(e)}}))}},function(e,t,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(e){e=e||{};var t=this;this.socket=null,this.idCounter=0,this.isConnected=!1,this.transportLibrary=e.transportLibrary||"websocket",this.transportOptions=e.transportOptions||{},this._sendFunc=function(e){t.sendEncodedMessage(e)},void 0===e.groovyCompatibility?this.groovyCompatibility=!0:this.groovyCompatibility=e.groovyCompatibility,this.setMaxListeners(0),e.url&&this.connect(e.url)}l.prototype.__proto__=u.prototype,l.prototype.connect=function(e){if("socket.io"===this.transportLibrary)this.socket=c(io(e,{"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(e,this.transportOptions),s(this));else if("websocket"===this.transportLibrary){if(!this.socket||this.socket.readyState===i.CLOSED){var t=new i(e);t.binaryType="arraybuffer",this.socket=c(t,s(this))}}else{if("workersocket"!==this.transportLibrary)throw"Unknown transportLibrary: "+this.transportLibrary.toString();this.socket=c(new r(e),s(this))}},l.prototype.close=function(){this.socket&&this.socket.close()},l.prototype.authenticate=function(e,t,n,i,r,s,o){var a={op:"auth",mac:e,client:t,dest:n,rand:i,t:r,level:s,end:o};this.callOnConnection(a)},l.prototype.sendEncodedMessage=function(e){var t=null,n=this;t="socket.io"===this.transportLibrary?function(e){n.socket.emit("operation",e)}:function(e){n.socket.send(e)},this.isConnected?t(e):n.once("connection",(function(){t(e)}))},l.prototype.callOnConnection=function(e){this.transportOptions.encoder?this.transportOptions.encoder(e,this._sendFunc):this._sendFunc(JSON.stringify(e))},l.prototype.setStatusLevel=function(e,t){var n={op:"set_level",level:e,id:t};this.callOnConnection(n)},l.prototype.getActionServers=function(e,t){var n=new o({ros:this,name:"/rosapi/action_servers",serviceType:"rosapi/GetActionServers"}),i=new a({});"function"==typeof t?n.callService(i,(function(t){e(t.action_servers)}),(function(e){t(e)})):n.callService(i,(function(t){e(t.action_servers)}))},l.prototype.getTopics=function(e,t){var n=new o({ros:this,name:"/rosapi/topics",serviceType:"rosapi/Topics"}),i=new a;"function"==typeof t?n.callService(i,(function(t){e(t)}),(function(e){t(e)})):n.callService(i,(function(t){e(t)}))},l.prototype.getTopicsForType=function(e,t,n){var i=new o({ros:this,name:"/rosapi/topics_for_type",serviceType:"rosapi/TopicsForType"}),r=new a({type:e});"function"==typeof n?i.callService(r,(function(e){t(e.topics)}),(function(e){n(e)})):i.callService(r,(function(e){t(e.topics)}))},l.prototype.getServices=function(e,t){var n=new o({ros:this,name:"/rosapi/services",serviceType:"rosapi/Services"}),i=new a;"function"==typeof t?n.callService(i,(function(t){e(t.services)}),(function(e){t(e)})):n.callService(i,(function(t){e(t.services)}))},l.prototype.getServicesForType=function(e,t,n){var i=new o({ros:this,name:"/rosapi/services_for_type",serviceType:"rosapi/ServicesForType"}),r=new a({type:e});"function"==typeof n?i.callService(r,(function(e){t(e.services)}),(function(e){n(e)})):i.callService(r,(function(e){t(e.services)}))},l.prototype.getServiceRequestDetails=function(e,t,n){var i=new o({ros:this,name:"/rosapi/service_request_details",serviceType:"rosapi/ServiceRequestDetails"}),r=new a({type:e});"function"==typeof n?i.callService(r,(function(e){t(e)}),(function(e){n(e)})):i.callService(r,(function(e){t(e)}))},l.prototype.getServiceResponseDetails=function(e,t,n){var i=new o({ros:this,name:"/rosapi/service_response_details",serviceType:"rosapi/ServiceResponseDetails"}),r=new a({type:e});"function"==typeof n?i.callService(r,(function(e){t(e)}),(function(e){n(e)})):i.callService(r,(function(e){t(e)}))},l.prototype.getNodes=function(e,t){var n=new o({ros:this,name:"/rosapi/nodes",serviceType:"rosapi/Nodes"}),i=new a;"function"==typeof t?n.callService(i,(function(t){e(t.nodes)}),(function(e){t(e)})):n.callService(i,(function(t){e(t.nodes)}))},l.prototype.getNodeDetails=function(e,t,n){var i=new o({ros:this,name:"/rosapi/node_details",serviceType:"rosapi/NodeDetails"}),r=new a({node:e});"function"==typeof n?i.callService(r,(function(e){t(e.subscribing,e.publishing,e.services)}),(function(e){n(e)})):i.callService(r,(function(e){t(e)}))},l.prototype.getParams=function(e,t){var n=new o({ros:this,name:"/rosapi/get_param_names",serviceType:"rosapi/GetParamNames"}),i=new a;"function"==typeof t?n.callService(i,(function(t){e(t.names)}),(function(e){t(e)})):n.callService(i,(function(t){e(t.names)}))},l.prototype.getTopicType=function(e,t,n){var i=new o({ros:this,name:"/rosapi/topic_type",serviceType:"rosapi/TopicType"}),r=new a({topic:e});"function"==typeof n?i.callService(r,(function(e){t(e.type)}),(function(e){n(e)})):i.callService(r,(function(e){t(e.type)}))},l.prototype.getServiceType=function(e,t,n){var i=new o({ros:this,name:"/rosapi/service_type",serviceType:"rosapi/ServiceType"}),r=new a({service:e});"function"==typeof n?i.callService(r,(function(e){t(e.type)}),(function(e){n(e)})):i.callService(r,(function(e){t(e.type)}))},l.prototype.getMessageDetails=function(e,t,n){var i=new o({ros:this,name:"/rosapi/message_details",serviceType:"rosapi/MessageDetails"}),r=new a({type:e});"function"==typeof n?i.callService(r,(function(e){t(e.typedefs)}),(function(e){n(e)})):i.callService(r,(function(e){t(e.typedefs)}))},l.prototype.decodeTypeDefs=function(e){var t=this,n=function(e,i){for(var r={},s=0;s<e.fieldnames.length;s++){var o=e.fieldarraylen[s],a=e.fieldnames[s],c=e.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 t.emit("error","Cannot find "+c+" in decodeTypeDefs")}}return r};return n(e[0],e)},l.prototype.getTopicsAndRawTypes=function(e,t){var n=new o({ros:this,name:"/rosapi/topics_and_raw_types",serviceType:"rosapi/TopicsAndRawTypes"}),i=new a;"function"==typeof t?n.callService(i,(function(t){e(t)}),(function(e){t(e)})):n.callService(i,(function(t){e(t)}))},e.exports=l},function(e,t,n){var i=n(3),r=n(7);function s(e){e=e||{},this.position=new i(e.position),this.orientation=new r(e.orientation)}s.prototype.applyTransform=function(e){this.position.multiplyQuaternion(e.rotation),this.position.add(e.translation);var t=e.rotation.clone();t.multiply(this.orientation),this.orientation=t},s.prototype.clone=function(){return new s(this)},s.prototype.multiply=function(e){var t=e.clone();return t.applyTransform({rotation:this.orientation,translation:this.position}),t},s.prototype.getInverse=function(){var e=this.clone();return e.orientation.invert(),e.position.multiplyQuaternion(e.orientation),e.position.x*=-1,e.position.y*=-1,e.position.z*=-1,e},e.exports=s},function(e,t,n){var i=n(22);function r(e){this.textureFilename=null,this.color=null,this.name=e.xml.getAttribute("name");var t=e.xml.getElementsByTagName("texture");t.length>0&&(this.textureFilename=t[0].getAttribute("filename"));var n=e.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(e){return s(this,e)},e.exports=r},function(e,t){e.exports="undefined"!=typeof window?window.WebSocket:WebSocket},function(e,t,n){var i=n(1);e.exports=function(e){i(this,e)}},function(e,t){var n,i,r=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){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 e=a(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++h<t;)c&&c[h].run();h=-1,t=u.length}c=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function v(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new m(e,t)),1!==u.length||l||a(p)},m.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=v,r.addListener=v,r.once=v,r.off=v,r.removeListener=v,r.removeAllListeners=v,r.emit=v,r.prependListener=v,r.prependOnceListener=v,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var i=n(6),r=n(4),s=n(2).EventEmitter2;function o(e){var t=this;e=e||{},this.ros=e.ros,this.serverName=e.serverName,this.actionName=e.actionName,this.timeout=e.timeout,this.omitFeedback=e.omitFeedback,this.omitStatus=e.omitStatus,this.omitResult=e.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(e){n=!0,e.status_list.forEach((function(e){var n=t.goals[e.goal_id.id];n&&n.emit("status",e)}))})),this.omitFeedback||this.feedbackListener.subscribe((function(e){var n=t.goals[e.status.goal_id.id];n&&(n.emit("status",e.status),n.emit("feedback",e.feedback))})),this.omitResult||this.resultListener.subscribe((function(e){var n=t.goals[e.status.goal_id.id];n&&(n.emit("status",e.status),n.emit("result",e.result))})),this.timeout&&setTimeout((function(){n||t.emit("timeout")}),this.timeout)}o.prototype.__proto__=s.prototype,o.prototype.cancel=function(){var e=new r;this.cancelTopic.publish(e)},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()},e.exports=o},function(e,t,n){var i=n(4),r=n(2).EventEmitter2;function s(e){var t=this;this.actionClient=e.actionClient,this.goalMessage=e.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(e){t.status=e})),this.on("result",(function(e){t.isFinished=!0,t.result=e})),this.on("feedback",(function(e){t.feedback=e})),this.actionClient.goals[this.goalID]=this}s.prototype.__proto__=r.prototype,s.prototype.send=function(e){var t=this;t.actionClient.goalTopic.publish(t.goalMessage),e&&setTimeout((function(){t.isFinished||t.emit("timeout")}),e)},s.prototype.cancel=function(){var e=new i({id:this.goalID});this.actionClient.cancelTopic.publish(e)},e.exports=s},function(e,t,n){var i=n(3),r=n(7);function s(e){e=e||{},this.translation=new i(e.translation),this.rotation=new r(e.rotation)}s.prototype.clone=function(){return new s(this)},e.exports=s},function(e,t,n){var i=n(3),r=n(8);e.exports=function(e){this.dimension=null,this.type=r.URDF_BOX;var t=e.xml.getAttribute("size").split(" ");this.dimension=new i({x:parseFloat(t[0]),y:parseFloat(t[1]),z:parseFloat(t[2])})}},function(e,t){e.exports=function(e){var t=e.xml.getAttribute("rgba").split(" ");this.r=parseFloat(t[0]),this.g=parseFloat(t[1]),this.b=parseFloat(t[2]),this.a=parseFloat(t[3])}},function(e,t,n){var i=n(8);e.exports=function(e){this.type=i.URDF_CYLINDER,this.length=parseFloat(e.xml.getAttribute("length")),this.radius=parseFloat(e.xml.getAttribute("radius"))}},function(e,t,n){var i=n(25);e.exports=function(e){this.name=e.xml.getAttribute("name"),this.visuals=[];for(var t=e.xml.getElementsByTagName("visual"),n=0;n<t.length;n++)this.visuals.push(new i({xml:t[n]}))}},function(e,t,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);e.exports=function(e){var t=e.xml;this.origin=null,this.geometry=null,this.material=null,this.name=e.xml.getAttribute("name");var n=t.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"),m=new s;if(p){p=p.split(" ");var v=parseFloat(p[0])/2,y=parseFloat(p[1])/2,d=parseFloat(p[2])/2,g=Math.sin(v)*Math.cos(y)*Math.cos(d)-Math.cos(v)*Math.sin(y)*Math.sin(d),b=Math.cos(v)*Math.sin(y)*Math.cos(d)+Math.sin(v)*Math.cos(y)*Math.sin(d),w=Math.cos(v)*Math.cos(y)*Math.sin(d)-Math.sin(v)*Math.sin(y)*Math.cos(d),_=Math.cos(v)*Math.cos(y)*Math.cos(d)+Math.sin(v)*Math.sin(y)*Math.sin(d);(m=new s({x:g,y:b,z:w,w:_})).normalize()}this.origin=new i({position:f,orientation:m})}var x=t.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=t.getElementsByTagName("material");O.length>0&&(this.material=new c({xml:O[0]}))}},function(e,t,n){var i=n(3),r=n(8);e.exports=function(e){this.scale=null,this.type=r.URDF_MESH,this.filename=e.xml.getAttribute("filename");var t=e.xml.getAttribute("scale");if(t){var n=t.split(" ");this.scale=new i({x:parseFloat(n[0]),y:parseFloat(n[1]),z:parseFloat(n[2])})}}},function(e,t,n){var i=n(8);e.exports=function(e){this.type=i.URDF_SPHERE,this.radius=parseFloat(e.xml.getAttribute("radius"))}},function(e,t,n){var i=n(10),r=e.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(e,t,n){var i=n(30),r=n(31);function s(e){this.socket_=i(r),this.socket_.addEventListener("message",this.handleWorkerMessage_.bind(this)),this.socket_.postMessage({uri:e})}s.prototype.handleWorkerMessage_=function(e){var t=e.data;if(t instanceof ArrayBuffer||"string"==typeof t)this.onmessage(e);else{var n=t.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(e){this.socket_.postMessage(e)},s.prototype.close=function(){this.socket_.postMessage({close:!0})},e.exports=s},function(e,t){var n=arguments[3],i=arguments[4],r=arguments[5],s=JSON.stringify;e.exports=function(e,t){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===e||h&&h.default===e){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){"+e+"(self); }",f]}var p=Math.floor(Math.pow(16,8)*Math.random()).toString(16),m={};m[o]=o,i[p]=["function(require,module,exports){var f = require("+s(o)+");(f.default ? f.default : f)(self);}",m];var v={};!function e(t){for(var n in v[t]=!0,i[t][1]){var r=i[t][1][n];v[r]||e(r)}}(p);var y="("+n+")({"+Object.keys(v).map((function(e){return s(e)+":["+i[e][0]+","+s(i[e][1])+"]"})).join(",")+"},{},["+s(p)+"])",d=window.URL||window.webkitURL||window.mozURL||window.msURL,g=new Blob([y],{type:"text/javascript"});if(t&&t.bare)return g;var b=d.createObjectURL(g),w=new Worker(b);return w.objectURL=b,w}},function(e,t,n){var i=i||n(14);e.exports=function(e){var t=null;function n(t){var n=t.data;n instanceof ArrayBuffer?e.postMessage(n,[n]):e.postMessage(n)}function r(t){e.postMessage({type:t.type})}e.addEventListener("message",(function(e){var s=e.data;if("string"==typeof s)t.send(s);else if(s.hasOwnProperty("close"))t.close(),t=null;else{if(!s.hasOwnProperty("uri"))throw"Unknown message to WorkerSocket";var o=s.uri;(t=new i(o)).binaryType="arraybuffer",t.onmessage=n,t.onclose=r,t.onopen=r,t.onerror=r}}))}},function(e,t,n){"use strict";var i=n(33),r=n(35),s=n(36),o=null;"undefined"!=typeof bson&&(o=bson().BSON),e.exports=function(e){var t=null;function n(t){"publish"===t.op?e.emit(t.topic,t.msg):"service_response"===t.op?e.emit(t.id,t):"call_service"===t.op?e.emit(t.service,t):"status"===t.op&&(t.id?e.emit("status:"+t.id,t):e.emit("status",t))}function a(e,t){"png"===e.op?i(e.data,t):t(e)}return e.transportOptions.decoder&&(t=e.transportOptions.decoder),{onopen:function(t){e.isConnected=!0,e.emit("connection",t)},onclose:function(t){e.isConnected=!1,e.emit("close",t)},onerror:function(t){e.emit("error",t)},onmessage:function(e){if(t)t(e.data,(function(e){n(e)}));else if("undefined"!=typeof Blob&&e.data instanceof Blob)!function(e,t){if(!o)throw"Cannot process BSON encoded message without BSON header.";var n=new FileReader;n.onload=function(){var e=new Uint8Array(this.result),n=o.deserialize(e);t(n)},n.readAsArrayBuffer(e)}(e.data,(function(e){a(e,n)}));else if(e.data instanceof ArrayBuffer){n(r.decode(e.data,s))}else{a(JSON.parse("string"==typeof e?e:e.data),n)}}}}},function(e,t,n){"use strict";var i=n(34),r=i.Image||window.Image;e.exports=function(e,t){var n=new r;n.onload=function(){var e=new i,r=e.getContext("2d");e.width=n.width,e.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]);t(JSON.parse(o))},n.src="data:image/png;base64,"+e}},function(e,t){e.exports=function(){return document.createElement("canvas")}},function(e,t,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(e){var t,n=new ArrayBuffer(256),i=new DataView(n),r=0;function s(e){for(var s=n.byteLength,o=r+e;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 t=e,i}function o(){r+=t}function a(e){o(s(1).setUint8(r,e))}function l(e){for(var t=s(e.length),n=0;n<e.length;++n)t.setUint8(r+n,e[n]);o()}function h(e,t){t<24?a(e<<5|t):t<256?(a(e<<5|24),a(t)):t<65536?(a(e<<5|25),function(e){o(s(2).setUint16(r,e))}(t)):t<4294967296?(a(e<<5|26),function(e){o(s(4).setUint32(r,e))}(t)):(a(e<<5|27),function(e){var t=e%c,n=(e-t)/c,i=s(8);i.setUint32(r,n),i.setUint32(r+4,t),o()}(t))}if(function e(t){var n;if(!1===t)return a(244);if(!0===t)return a(245);if(null===t)return a(246);if(void 0===t)return a(247);switch(typeof t){case"number":if(Math.floor(t)===t){if(0<=t&&t<=u)return h(0,t);if(-u<=t&&t<0)return h(1,-(t+1))}return a(251),function(e){o(s(8).setFloat64(r,e))}(t);case"string":var i=[];for(n=0;n<t.length;++n){var c=t.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&t.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(t))for(h(4,f=t.length),n=0;n<f;++n)e(t[n]);else if(t instanceof Uint8Array)h(2,t.length),l(t);else{var p=Object.keys(t);for(h(5,f=p.length),n=0;n<f;++n){var m=p[n];e(m),e(t[m])}}}}(e),"slice"in n)return n.slice(0,r);for(var f=new ArrayBuffer(r),p=new DataView(f),m=0;m<r;++m)p.setUint8(m,i.getUint8(m));return f},decode:function(e,t,n){var i=new DataView(e),r=0;function s(e,t){return r+=t,e}function o(t){return s(new Uint8Array(e,r,t),t)}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(e){if(e<24)return e;if(24===e)return u();if(25===e)return l();if(26===e)return h();if(27===e)return h()*c+h();if(31===e)return-1;throw"Invalid length encoding"}function m(e){var t=u();if(255===t)return-1;var n=p(31&t);if(n<0||t>>5!==e)throw"Invalid indefinite length element";return n}function v(e,t){for(var n=0;n<t;++n){var i=u();128&i&&(i<224?(i=(31&i)<<6|63&u(),t-=1):i<240?(i=(15&i)<<12|(63&u())<<6|63&u(),t-=2):(i=(15&i)<<18|(63&u())<<12|(63&u())<<6|63&u(),t-=3)),i<65536?e.push(i):(i-=65536,e.push(55296|i>>10),e.push(56320|1023&i))}}"function"!=typeof t&&(t=function(e){return e}),"function"!=typeof n&&(n=function(){});var y=function e(){var c,h,y=u(),d=y>>5,g=31&y;if(7===d)switch(g){case 25:return function(){var e=new ArrayBuffer(4),t=new DataView(e),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 t.setUint32(0,i<<16|r<<13|s<<13),t.getFloat32(0)}();case 26:return s(i.getFloat32(r),4);case 27:return s(i.getFloat64(r),8)}if((h=p(g))<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 b=[],w=0;(h=m(d))>=0;)w+=h,b.push(o(h));var _=new Uint8Array(w),x=0;for(c=0;c<b.length;++c)_.set(b[c],x),x+=b[c].length;return _}return o(h);case 3:var T=[];if(h<0)for(;(h=m(d))>=0;)v(T,h);else v(T,h);return String.fromCharCode.apply(null,T);case 4:var k;if(h<0)for(k=[];!f();)k.push(e());else for(k=new Array(h),c=0;c<h;++c)k[c]=e();return k;case 5:var S={};for(c=0;c<h||h<0&&!f();++c){S[e()]=e()}return S;case 6:return t(e(),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!==e.byteLength)throw"Remaining bytes";return y}})?i.call(t,n,t,e):i)||(e.exports=r)}()},function(e,t,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(e){s();for(var t=e.byteLength,n=e.byteOffset,r=t/8,o=e.buffer.slice(n,n+t),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(e){s();for(var t=e.byteLength,n=e.byteOffset,r=t/8,o=e.buffer.slice(n,n+t),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}};e.exports&&(e.exports=function(e,t){var n,i,r,s;return t in o?(i=o[t],r=(n=e).byteLength,s=n.byteOffset,new i(n.buffer.slice(s,s+r))):t in a?a[t](e):e})},function(e,t,n){(function(e){var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function s(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new s(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new s(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(38),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(17))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var i,r,s,o,a,c=1,u={},l=!1,h=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick((function(){m(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((s=new MessageChannel).port1.onmessage=function(e){m(e.data)},i=function(e){s.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(r=h.documentElement,i=function(e){var t=h.createElement("script");t.onreadystatechange=function(){m(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):i=function(e){setTimeout(m,0,e)}:(o="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&m(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),i=function(t){e.postMessage(o+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return u[c]=r,i(c),c++},f.clearImmediate=p}function p(e){delete u[e]}function m(e){if(l)setTimeout(m,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(17),n(16))},function(e,t,n){var i=n(9),r=n(5);function s(e){e=e||{},this.ros=e.ros,this.name=e.name}s.prototype.get=function(e){var t=new i({ros:this.ros,name:"/rosapi/get_param",serviceType:"rosapi/GetParam"}),n=new r({name:this.name});t.callService(n,(function(t){var n=JSON.parse(t.value);e(n)}))},s.prototype.set=function(e,t){var n=new i({ros:this.ros,name:"/rosapi/set_param",serviceType:"rosapi/SetParam"}),s=new r({name:this.name,value:JSON.stringify(e)});n.callService(s,t)},s.prototype.delete=function(e){var t=new i({ros:this.ros,name:"/rosapi/delete_param",serviceType:"rosapi/DeleteParam"}),n=new r({name:this.name});t.callService(n,e)},e.exports=s},function(e,t,n){var i=n(11);n(10)(i,["ActionClient","SimpleActionServer"],e.exports={ActionClient:n(18),ActionListener:n(41),Goal:n(19),SimpleActionServer:n(42)})},function(e,t,n){var i=n(6),r=(n(4),n(2).EventEmitter2);function s(e){var t=this;e=e||{},this.ros=e.ros,this.serverName=e.serverName,this.actionName=e.actionName,this.timeout=e.timeout,this.omitFeedback=e.omitFeedback,this.omitStatus=e.omitStatus,this.omitResult=e.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(e){t.emit("goal",e)})),s.subscribe((function(e){e.status_list.forEach((function(e){t.emit("status",e)}))})),r.subscribe((function(e){t.emit("status",e.status),t.emit("feedback",e.feedback)})),o.subscribe((function(e){t.emit("status",e.status),t.emit("result",e.result)}))}s.prototype.__proto__=r.prototype,e.exports=s},function(e,t,n){var i=n(6),r=n(4),s=n(2).EventEmitter2;function o(e){var t=this;e=e||{},this.ros=e.ros,this.serverName=e.serverName,this.actionName=e.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(e){t.currentGoal?(t.nextGoal=e,t.emit("cancel")):(t.statusMessage.status_list=[{goal_id:e.goal_id,status:1}],t.currentGoal=e,t.emit("goal",e.goal))}));var a=function(e,t){return!(e.secs>t.secs)&&(e.secs<t.secs||e.nsecs<t.nsecs)};o.subscribe((function(e){0===e.stamp.secs&&0===e.stamp.secs&&""===e.id?(t.nextGoal=null,t.currentGoal&&t.emit("cancel")):(t.currentGoal&&e.id===t.currentGoal.goal_id.id?t.emit("cancel"):t.nextGoal&&e.id===t.nextGoal.goal_id.id&&(t.nextGoal=null),t.nextGoal&&a(t.nextGoal.goal_id.stamp,e.stamp)&&(t.nextGoal=null),t.currentGoal&&a(t.currentGoal.goal_id.stamp,e.stamp)&&t.emit("cancel"))}));setInterval((function(){var e=new Date,i=Math.floor(e.getTime()/1e3),r=Math.round(1e9*(e.getTime()/1e3-i));t.statusMessage.header.stamp.secs=i,t.statusMessage.header.stamp.nsecs=r,n.publish(t.statusMessage)}),500)}o.prototype.__proto__=s.prototype,o.prototype.setSucceeded=function(e){var t=new r({status:{goal_id:this.currentGoal.goal_id,status:3},result:e});this.resultPublisher.publish(t),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(e){var t=new r({status:{goal_id:this.currentGoal.goal_id,status:4},result:e});this.resultPublisher.publish(t),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(e){var t=new r({status:{goal_id:this.currentGoal.goal_id,status:1},feedback:e});this.feedbackPublisher.publish(t)},o.prototype.setPreempted=function(){this.statusMessage.status_list=[];var e=new r({status:{goal_id:this.currentGoal.goal_id,status:2}});this.resultPublisher.publish(e),this.nextGoal?(this.currentGoal=this.nextGoal,this.nextGoal=null,this.emit("goal",this.currentGoal.goal)):this.currentGoal=null},e.exports=o},function(e,t,n){e.exports={Pose:n(12),Quaternion:n(7),Transform:n(20),Vector3:n(3)}},function(e,t,n){var i=n(11);n(10)(i,["TFClient"],e.exports={TFClient:n(45)})},function(e,t,n){var i=n(18),r=n(19),s=n(9),o=n(5),a=n(6),c=n(20);function u(e){e=e||{},this.ros=e.ros,this.fixedFrame=e.fixedFrame||"/base_link",this.angularThres=e.angularThres||2,this.transThres=e.transThres||.01,this.rate=e.rate||10,this.updateDelay=e.updateDelay||50;var t=e.topicTimeout||2,n=Math.floor(t),r=Math.floor(1e9*(t-n));this.topicTimeout={secs:n,nsecs:r},this.serverName=e.serverName||"/tf2_web_republisher",this.repubServiceName=e.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:e.ros,serverName:this.serverName,actionName:"tf2_web_republisher/TFSubscriptionAction",omitStatus:!0,omitResult:!0}),this.serviceClient=new s({ros:e.ros,name:this.repubServiceName,serviceType:"tf2_web_republisher/RepublishTFs"})}u.prototype.processTFArray=function(e){e.transforms.forEach((function(e){var t=e.child_frame_id;"/"===t[0]&&(t=t.substring(1));var n=this.frameInfos[t];n&&(n.transform=new c({translation:e.transform.translation,rotation:e.transform.rotation}),n.cbs.forEach((function(e){e(n.transform)})))}),this)},u.prototype.updateGoal=function(){var e={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:e}),this.currentGoal.on("feedback",this.processTFArray.bind(this)),this.currentGoal.send();else{e.timeout=this.topicTimeout;var t=new o(e);this.serviceClient.callService(t,this.processResponse.bind(this))}this.republisherUpdateRequested=!1},u.prototype.processResponse=function(e){this._isDisposed||(this.currentTopic&&this.currentTopic.unsubscribe(this._subscribeCB),this.currentTopic=new a({ros:this.ros,name:e.topic_name,messageType:"tf2_web_republisher/TFArray"}),this._subscribeCB=this.processTFArray.bind(this),this.currentTopic.subscribe(this._subscribeCB))},u.prototype.subscribe=function(e,t){"/"===e[0]&&(e=e.substring(1)),this.frameInfos[e]?this.frameInfos[e].transform&&t(this.frameInfos[e].transform):(this.frameInfos[e]={cbs:[]},this.republisherUpdateRequested||(setTimeout(this.updateGoal.bind(this),this.updateDelay),this.republisherUpdateRequested=!0)),this.frameInfos[e].cbs.push(t)},u.prototype.unsubscribe=function(e,t){"/"===e[0]&&(e=e.substring(1));for(var n=this.frameInfos[e],i=n&&n.cbs||[],r=i.length;r--;)i[r]===t&&i.splice(r,1);t&&0!==i.length||delete this.frameInfos[e]},u.prototype.dispose=function(){this._isDisposed=!0,this.actionClient.dispose(),this.currentTopic&&this.currentTopic.unsubscribe(this._subscribeCB)},e.exports=u},function(e,t,n){e.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(e,t,n){var i=n(13),r=n(24),s=n(48),o=n(49).DOMParser;e.exports=function(e){var t=(e=e||{}).xml,n=e.string;this.materials={},this.links={},this.joints={},n&&(t=(new o).parseFromString(n,"text/xml"));var a=t.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 m=f.visuals[p].material;null!==m&&m.name&&(void 0!==this.materials[m.name]?f.visuals[p].material=this.materials[m.name]:this.materials[m.name]=m)}this.links[f.name]=f}}else if("joint"===l.tagName){var v=new s({xml:l});this.joints[v.name]=v}}}},function(e,t,n){var i=n(12),r=n(3),s=n(7);e.exports=function(e){this.name=e.xml.getAttribute("name"),this.type=e.xml.getAttribute("type");var t=e.xml.getElementsByTagName("parent");t.length>0&&(this.parent=t[0].getAttribute("link"));var n=e.xml.getElementsByTagName("child");n.length>0&&(this.child=n[0].getAttribute("link"));var o=e.xml.getElementsByTagName("limit");o.length>0&&(this.minval=parseFloat(o[0].getAttribute("lower")),this.maxval=parseFloat(o[0].getAttribute("upper")));var a=e.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,m=parseFloat(l[2])/2,v=Math.sin(f)*Math.cos(p)*Math.cos(m)-Math.cos(f)*Math.sin(p)*Math.sin(m),y=Math.cos(f)*Math.sin(p)*Math.cos(m)+Math.sin(f)*Math.cos(p)*Math.sin(m),d=Math.cos(f)*Math.cos(p)*Math.sin(m)-Math.sin(f)*Math.sin(p)*Math.cos(m),g=Math.cos(f)*Math.cos(p)*Math.cos(m)+Math.sin(f)*Math.sin(p)*Math.sin(m);(h=new s({x:v,y:y,z:d,w:g})).normalize()}this.origin=new i({position:u,orientation:h})}}},function(e,t){t.DOMImplementation=window.DOMImplementation,t.XMLSerializer=window.XMLSerializer,t.DOMParser=window.DOMParser},function(e,t,n){"use strict";n.r(t),n.d(t,"loadScript",(function(){return r})),n.d(t,"blob2text",(function(){return s})),n.d(t,"blob2base64",(function(){return o})),n.d(t,"blob2file",(function(){return a})),n.d(t,"downloadFile",(function(){return c})),n.d(t,"WebStorage",(function(){return l})),n.d(t,"createConfigureRos",(function(){return O})),n.d(t,"RosConfigure",(function(){return j}));var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},r=function(e,t){void 0===t&&(t={});return new Promise((function(n){var r,s;if(function(){var t,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===e)return a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return null}())return n(e);var o=document.createElement("script");try{for(var a=i(Object.keys(t)),c=a.next();!c.done;c=a.next()){var u=c.value;o[u]=t[u]}}catch(e){r={error:e}}finally{try{c&&!c.done&&(s=a.return)&&s.call(a)}finally{if(r)throw r.error}}return o.src=e,o.onload=function(){return n(e)},document.body.appendChild(o),"success"}))},s=function(e){return new Promise((function(t){var n=new FileReader;n.onload=function(e){return t(e.target.result)},n.readAsText(e)}))},o=function(e){return new Promise((function(t,n){var i=new FileReader;e?(i.onload=function(e){return t(e.target.result)},i.onabort=function(){return n()},i.readAsDataURL(e)):n("文件爲空!")}))},a=function(e,t,n){return new File(e,t,{type:n})},c=function(e,t){var n=document.createElement("a");n.href=e,t&&(n.download=t),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(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},l=function(){function e(e){var t=e.type,n=void 0===t?"sessionStorage":t,i=e.key;this._key=i,this.storage=window[n]}return Object.defineProperty(e.prototype,"state",{get:function(){var e=this.storage.getItem(this._key);return e?JSON.parse(e):null},set:function(e){var t=JSON.stringify(e);this.storage.setItem(this._key,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this._key},enumerable:!1,configurable:!0}),e.prototype.merge=function(e){var t=this.state;this.state=u(u({},t),e)},e.prototype.clear=function(){this.storage.removeItem(this._key)},e}(),h=n(0),f=n.n(h),p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},m=function(e){return function(t){var n,i,r={};try{for(var s=p(Object.keys(t)),o=s.next();!o.done;o=s.next()){var a=o.value;r[a]=e(t[a])}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return r}},v=function(){return(v=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},y=function(e){var t=this;this.configure=null,this.publishService=function(e){var n=e.name,i=e.serviceType,r=e.payload;return new Promise((function(e,s){var o=new f.a.Service({ros:t.configure.ros,name:n,serviceType:i}),a=new f.a.ServiceRequest(r);o.callService(a,e,s)}))},this.publishAction=function(e){var n=e.serverName,i=e.actionName,r=e.goalMessage;return new Promise((function(e,s){var o=new f.a.ActionClient({ros:t.configure.ros,serverName:n,actionName:i,timeout:0}),a=new f.a.Goal({actionClient:o,goalMessage:r});a.on("result",(function(t){return e(t)})),a.on("error",(function(e){return s(e)})),a.send()}))},this.rosTopic=function(e){var n=new f.a.Topic(v({ros:t.configure.ros},e));return n.publishMessage=function(e){"function"==typeof n.publish&&n.publish(new f.a.Message(e))},n},this.createRosService=function(e){return m((function(e){return function(n){return t.publishService(v(v({},e),{payload:n}))}}))(e)},this.createRosAction=function(e){return m((function(e){return function(n){return t.publishAction(v(v({},e),{goalMessage:n}))}}))(e)},this.createRosTopic=function(e){return m((function(e){return function(){return t.rosTopic(e)}}))(e)},this.configure=e},d=function(){return(d=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},g=function(){function e(){this.state={}}return e.prototype.inject=function(e,t){return new e(d(d({},this.state),t))},e.prototype.install=function(e,t){this.state[e]=t},e.prototype.remove=function(e){delete this.state[e]},e}(),b=function(){return(b=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},w=function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(o,a)}c((i=i.apply(e,t||[])).next())}))},_=function(e,t){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=t.call(e,o)}catch(e){s=[6,e],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(e){return w(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return window.ROSLIB||(window.ROSLIB=f.a),window.ROS3D?[2,window.ROS3D]:[4,r(e)];case 1:return t.sent(),[2,window.ROS3D]}}))}))}var T={colorsrc:"intensity",material:{size:.1},max_pts:1e7,colormap:function(e){return function(e){var t=5*(1-e)+1,n=Math.floor(t),i=t%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(e){return o[e]=255*o[e]})),b(b({},o),{a:1})}(Math.max(0,Math.min((Math.pow(e,4)-0)/134217728,1)))}},k=function(){return(k=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},S=function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(o,a)}c((i=i.apply(e,t||[])).next())}))},L=function(e,t){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=t.call(e,o)}catch(e){s=[6,e],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 e(e){this.iu=new g,this.configure=e}return e.prototype.init=function(e){var t=e.elem,n=e.view,i=void 0===n?{}:n,r=e.tf,s=void 0===r?{}:r;return S(this,void 0,void 0,(function(){var e,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 e=this,[4,x(this.configure.conf.ros3d_lib_url)];case 1:return e.ROS3D=r.sent(),this.elem=t,this.iu.install("ros",this.configure.ros),this.viewer=new this.ROS3D.Viewer(k({elem:t,width:t.clientWidth,height:t.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]}}))}))},e.prototype.destroy=function(){this.viewer&&"function"==typeof this.viewer.stop&&this.viewer.stop(),this.elem.innerHTML=""},e.prototype.initPointClouds=function(e){var t=this;return e.map((function(e){return t.iu.inject(t.ROS3D.PointCloud2,k(k({},T),e))}))},e}(),O=function(e){return{rosUtils:new y(e),createRosViewer:function(){return new M(e)}}},A=function(){return(A=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},E=function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){e.done?r(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(o,a)}c((i=i.apply(e,t||[])).next())}))},F=function(e,t){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=t.call(e,o)}catch(e){s=[6,e],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 e(e){this._conf=null,this._ros=null,this.getConfig=e}return Object.defineProperty(e.prototype,"conf",{get:function(){return this._conf?A({},this._conf):{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ros",{get:function(){if(!this._ros)throw Error("please init first!");return this._ros},enumerable:!1,configurable:!0}),e.prototype.init=function(){return E(this,void 0,void 0,(function(){var e;return F(this,(function(t){switch(t.label){case 0:return this._conf?[2]:(e=this,[4,this.getConfig()]);case 1:return e._conf=t.sent(),this._ros=new f.a.Ros({url:this._conf.ros_bridge_url}),[2]}}))}))},e}()}])}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const downloadFile: (uri: string, name: string) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var downloadFile = function downloadFile(uri, name) {
|
|
2
|
+
var a = document.createElement('a');
|
|
3
|
+
a.href = uri;
|
|
4
|
+
|
|
5
|
+
if (name) {
|
|
6
|
+
a.download = name;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
a.style.position = 'fixed';
|
|
10
|
+
a.style.visibility = 'hidden';
|
|
11
|
+
document.body.appendChild(a);
|
|
12
|
+
a.click();
|
|
13
|
+
document.body.removeChild(a);
|
|
14
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export var blob2text = function blob2text(blob) {
|
|
2
|
+
return new Promise(function (resolve) {
|
|
3
|
+
var reader = new FileReader();
|
|
4
|
+
|
|
5
|
+
reader.onload = function (e) {
|
|
6
|
+
return resolve(e.target.result);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
reader.readAsText(blob);
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export var blob2base64 = function blob2base64(blob) {
|
|
13
|
+
return new Promise(function (resolve, reject) {
|
|
14
|
+
var reader = new FileReader();
|
|
15
|
+
|
|
16
|
+
if (!blob) {
|
|
17
|
+
reject('文件爲空!');
|
|
18
|
+
} else {
|
|
19
|
+
reader.onload = function (e) {
|
|
20
|
+
return resolve(e.target.result);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
reader.onabort = function () {
|
|
24
|
+
return reject();
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
reader.readAsDataURL(blob);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export var blob2file = function blob2file(blob, name, type) {
|
|
32
|
+
return new File(blob, name, {
|
|
33
|
+
type: type
|
|
34
|
+
});
|
|
35
|
+
};
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { loadScript } from './load-script';
|
|
2
|
+
import { blob2text, blob2base64, blob2file } from './file/parser';
|
|
3
|
+
import { downloadFile } from './file/download';
|
|
4
|
+
import { WebStorage } from './storage';
|
|
5
|
+
import { createConfigureRos } from './ros';
|
|
6
|
+
import { RosConfigure } from './ros/factory/configure';
|
|
7
|
+
export { loadScript, blob2text, blob2base64, blob2file, downloadFile, WebStorage, createConfigureRos, RosConfigure };
|
package/es/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { loadScript } from './load-script';
|
|
2
|
+
import { blob2text, blob2base64, blob2file } from './file/parser';
|
|
3
|
+
import { downloadFile } from './file/download';
|
|
4
|
+
import { WebStorage } from './storage';
|
|
5
|
+
import { createConfigureRos } from './ros';
|
|
6
|
+
import { RosConfigure } from './ros/factory/configure';
|
|
7
|
+
export { loadScript, blob2text, blob2base64, blob2file, downloadFile, WebStorage, createConfigureRos, RosConfigure };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadScript: (url: string, options?: any) => Promise<unknown>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __values = this && this.__values || function (o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator,
|
|
3
|
+
m = s && o[s],
|
|
4
|
+
i = 0;
|
|
5
|
+
if (m) return m.call(o);
|
|
6
|
+
if (o && typeof o.length === "number") return {
|
|
7
|
+
next: function next() {
|
|
8
|
+
if (o && i >= o.length) o = void 0;
|
|
9
|
+
return {
|
|
10
|
+
value: o && o[i++],
|
|
11
|
+
done: !o
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export var loadScript = function loadScript(url, options) {
|
|
19
|
+
if (options === void 0) {
|
|
20
|
+
options = {};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var findScript = function findScript() {
|
|
24
|
+
var e_1, _a;
|
|
25
|
+
|
|
26
|
+
var list = document.getElementsByTagName('script');
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
for (var list_1 = __values(list), list_1_1 = list_1.next(); !list_1_1.done; list_1_1 = list_1.next()) {
|
|
30
|
+
var item = list_1_1.value;
|
|
31
|
+
|
|
32
|
+
if (item.src === url) {
|
|
33
|
+
return item;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} catch (e_1_1) {
|
|
37
|
+
e_1 = {
|
|
38
|
+
error: e_1_1
|
|
39
|
+
};
|
|
40
|
+
} finally {
|
|
41
|
+
try {
|
|
42
|
+
if (list_1_1 && !list_1_1.done && (_a = list_1["return"])) _a.call(list_1);
|
|
43
|
+
} finally {
|
|
44
|
+
if (e_1) throw e_1.error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return new Promise(function (resolve) {
|
|
52
|
+
var e_2, _a;
|
|
53
|
+
|
|
54
|
+
var old = findScript();
|
|
55
|
+
|
|
56
|
+
if (old) {
|
|
57
|
+
return resolve(url);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var el = document.createElement('script');
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
for (var _b = __values(Object.keys(options)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
64
|
+
var key = _c.value;
|
|
65
|
+
el[key] = options[key];
|
|
66
|
+
}
|
|
67
|
+
} catch (e_2_1) {
|
|
68
|
+
e_2 = {
|
|
69
|
+
error: e_2_1
|
|
70
|
+
};
|
|
71
|
+
} finally {
|
|
72
|
+
try {
|
|
73
|
+
if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
|
|
74
|
+
} finally {
|
|
75
|
+
if (e_2) throw e_2.error;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
el.src = url;
|
|
80
|
+
|
|
81
|
+
el.onload = function () {
|
|
82
|
+
return resolve(url);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
document.body.appendChild(el);
|
|
86
|
+
return 'success';
|
|
87
|
+
});
|
|
88
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,230 @@
|
|
|
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 };
|
|
@@ -0,0 +1,32 @@
|
|
|
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 {};
|