forked from RethinkRobotics-opensource/roslibjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
roslib.min.js
1 lines (1 loc) · 26.8 KB
/
roslib.min.js
1
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a){if(null==a)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}b.exports=Object.assign||function(a,b){for(var c,e,f=d(a),g=1;g<arguments.length;g++){c=arguments[g],e=Object.keys(Object(c));for(var h=0;h<e.length;h++)f[e[h]]=c[e[h]]}return f}},{}],2:[function(a,b,c){var d=this.ROSLIB||{REVISION:"0.18.0-SNAPSHOT"},e=a("object-assign");e(d,a("./core")),e(d,a("./actionlib")),e(d,a("./math")),e(d,a("./tf")),e(d,a("./urdf")),b.exports=d},{"./actionlib":7,"./core":16,"./math":21,"./tf":24,"./urdf":36,"object-assign":1}],3:[function(a,b,c){(function(b){b.ROSLIB=a("./RosLib")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./RosLib":2}],4:[function(a,b,c){function d(a){var b=this;a=a||{},this.ros=a.ros,this.serverName=a.serverName,this.actionName=a.actionName,this.timeout=a.timeout,this.goals={};var c=!1,d=new e({ros:this.ros,name:this.serverName+"/feedback",messageType:this.actionName+"Feedback"}),f=new e({ros:this.ros,name:this.serverName+"/status",messageType:"actionlib_msgs/GoalStatusArray"}),g=new e({ros:this.ros,name:this.serverName+"/result",messageType:this.actionName+"Result"});this.goalTopic=new e({ros:this.ros,name:this.serverName+"/goal",messageType:this.actionName+"Goal"}),this.cancelTopic=new e({ros:this.ros,name:this.serverName+"/cancel",messageType:"actionlib_msgs/GoalID"}),this.goalTopic.advertise(),this.cancelTopic.advertise(),f.subscribe(function(a){c=!0,a.status_list.forEach(function(a){var c=b.goals[a.goal_id.id];c&&c.emit("status",a)})}),d.subscribe(function(a){var c=b.goals[a.status.goal_id.id];c&&(c.emit("status",a.status),c.emit("feedback",a.feedback))}),g.subscribe(function(a){var c=b.goals[a.status.goal_id.id];c&&(c.emit("status",a.status),c.emit("result",a.result))}),this.timeout&&setTimeout(function(){c||b.emit("timeout")},this.timeout)}var e=a("../core/Topic"),f=a("../core/Message"),g=a("./../util/shim/EventEmitter2.js").EventEmitter2;d.prototype.__proto__=g.prototype,d.prototype.cancel=function(){var a=new f;this.cancelTopic.publish(a)},b.exports=d},{"../core/Message":8,"../core/Topic":15,"./../util/shim/EventEmitter2.js":37}],5:[function(a,b,c){function d(a){var b=this;this.actionClient=a.actionClient,this.goalMessage=a.goalMessage,this.isFinished=!1;var c=new Date;this.goalID="goal_"+Math.random()+"_"+c.getTime(),this.goalMessage=new e({goal_id:{stamp:{secs:0,nsecs:0},id:this.goalID},goal:this.goalMessage}),this.on("status",function(a){b.status=a}),this.on("result",function(a){b.isFinished=!0,b.result=a}),this.on("feedback",function(a){b.feedback=a}),this.actionClient.goals[this.goalID]=this}var e=a("../core/Message"),f=a("./../util/shim/EventEmitter2.js").EventEmitter2;d.prototype.__proto__=f.prototype,d.prototype.send=function(a){var b=this;b.actionClient.goalTopic.publish(b.goalMessage),a&&setTimeout(function(){b.isFinished||b.emit("timeout")},a)},d.prototype.cancel=function(){var a=new e({id:this.goalID});this.actionClient.cancelTopic.publish(a)},b.exports=d},{"../core/Message":8,"./../util/shim/EventEmitter2.js":37}],6:[function(a,b,c){function d(a){var b=this;a=a||{},this.ros=a.ros,this.serverName=a.serverName,this.actionName=a.actionName,this.feedbackPublisher=new e({ros:this.ros,name:this.serverName+"/feedback",messageType:this.actionName+"Feedback"}),this.feedbackPublisher.advertise();var c=new e({ros:this.ros,name:this.serverName+"/status",messageType:"actionlib_msgs/GoalStatusArray"});c.advertise(),this.resultPublisher=new e({ros:this.ros,name:this.serverName+"/result",messageType:this.actionName+"Result"}),this.resultPublisher.advertise();var d=new e({ros:this.ros,name:this.serverName+"/goal",messageType:this.actionName+"Goal"}),g=new e({ros:this.ros,name:this.serverName+"/cancel",messageType:"actionlib_msgs/GoalID"});this.statusMessage=new f({header:{stamp:{secs:0,nsecs:100},frame_id:""},status_list:[]}),this.currentGoal=null,this.nextGoal=null,d.subscribe(function(a){b.currentGoal?(b.nextGoal=a,b.emit("cancel")):(b.statusMessage.status_list=[{goal_id:a.goal_id,status:1}],b.currentGoal=a,b.emit("goal",a.goal))});var h=function(a,b){return a.secs>b.secs?!1:a.secs<b.secs?!0:a.nsecs<b.nsecs?!0:!1};g.subscribe(function(a){0===a.stamp.secs&&0===a.stamp.secs&&""===a.id?(b.nextGoal=null,b.currentGoal&&b.emit("cancel")):(b.currentGoal&&a.id===b.currentGoal.goal_id.id?b.emit("cancel"):b.nextGoal&&a.id===b.nextGoal.goal_id.id&&(b.nextGoal=null),b.nextGoal&&h(b.nextGoal.goal_id.stamp,a.stamp)&&(b.nextGoal=null),b.currentGoal&&h(b.currentGoal.goal_id.stamp,a.stamp)&&b.emit("cancel"))});setInterval(function(){var a=new Date,d=Math.floor(a.getTime()/1e3),e=Math.round(1e9*(a.getTime()/1e3-d));b.statusMessage.header.stamp.secs=d,b.statusMessage.header.stamp.nsecs=e,c.publish(b.statusMessage)},500)}var e=a("../core/Topic"),f=a("../core/Message"),g=a("./../util/shim/EventEmitter2.js").EventEmitter2;d.prototype.__proto__=g.prototype,d.prototype.setSucceeded=function(a){var b=new f({status:{goal_id:this.currentGoal.goal_id,status:3},result:a});this.resultPublisher.publish(b),this.statusMessage.status_list=[],this.nextGoal?(this.currentGoal=this.nextGoal,this.nextGoal=null,this.emit("goal",this.currentGoal.goal)):this.currentGoal=null},d.prototype.sendFeedback=function(a){var b=new f({status:{goal_id:this.currentGoal.goal_id,status:1},feedback:a});this.feedbackPublisher.publish(b)},d.prototype.setPreempted=function(){this.statusMessage.status_list=[];var a=new f({status:{goal_id:this.currentGoal.goal_id,status:2}});this.resultPublisher.publish(a),this.nextGoal?(this.currentGoal=this.nextGoal,this.nextGoal=null,this.emit("goal",this.currentGoal.goal)):this.currentGoal=null},b.exports=d},{"../core/Message":8,"../core/Topic":15,"./../util/shim/EventEmitter2.js":37}],7:[function(a,b,c){var d=a("../core/Ros"),e=a("../mixin"),f=b.exports={ActionClient:a("./ActionClient"),Goal:a("./Goal"),SimpleActionServer:a("./SimpleActionServer")};e(d,["ActionClient","SimpleActionServer"],f)},{"../core/Ros":10,"../mixin":22,"./ActionClient":4,"./Goal":5,"./SimpleActionServer":6}],8:[function(a,b,c){function d(a){e(this,a)}var e=a("object-assign");b.exports=d},{"object-assign":1}],9:[function(a,b,c){function d(a){a=a||{},this.ros=a.ros,this.name=a.name}var e=a("./Service"),f=a("./ServiceRequest");d.prototype.get=function(a){var b=new e({ros:this.ros,name:"/rosapi/get_param",serviceType:"rosapi/GetParam"}),c=new f({name:this.name});b.callService(c,function(b){var c=JSON.parse(b.value);a(c)})},d.prototype.set=function(a,b){var c=new e({ros:this.ros,name:"/rosapi/set_param",serviceType:"rosapi/SetParam"}),d=new f({name:this.name,value:JSON.stringify(a)});c.callService(d,b)},d.prototype["delete"]=function(a){var b=new e({ros:this.ros,name:"/rosapi/delete_param",serviceType:"rosapi/DeleteParam"}),c=new f({name:this.name});b.callService(c,a)},b.exports=d},{"./Service":11,"./ServiceRequest":12}],10:[function(a,b,c){function d(a){a=a||{},this.socket=null,this.idCounter=0,this.isConnected=!1,"undefined"==typeof a.groovyCompatibility?this.groovyCompatibility=!0:this.groovyCompatibility=a.groovyCompatibility,this.setMaxListeners(0),a.url&&this.connect(a.url)}var e=a("./../util/shim/WebSocket.js"),f=a("./SocketAdapter.js"),g=a("./Service"),h=a("./ServiceRequest"),i=a("object-assign"),j=a("./../util/shim/EventEmitter2.js").EventEmitter2;d.prototype.__proto__=j.prototype,d.prototype.connect=function(a){this.socket=i(new e(a),f(this))},d.prototype.close=function(){this.socket&&this.socket.close()},d.prototype.authenticate=function(a,b,c,d,e,f,g){var h={op:"auth",mac:a,client:b,dest:c,rand:d,t:e,level:f,end:g};this.callOnConnection(h)},d.prototype.callOnConnection=function(a){var b=this,c=JSON.stringify(a);this.isConnected?b.socket.send(c):b.once("connection",function(){b.socket.send(c)})},d.prototype.getTopics=function(a,b){var c=new g({ros:this,name:"/rosapi/topics",serviceType:"rosapi/Topics"}),d=new h;"function"==typeof b?c.callService(d,function(b){a(b.topics)},function(a){b(a)}):c.callService(d,function(b){a(b.topics)})},d.prototype.getTopicsForType=function(a,b,c){var d=new g({ros:this,name:"/rosapi/topics_for_type",serviceType:"rosapi/TopicsForType"}),e=new h({type:a});"function"==typeof c?d.callService(e,function(a){b(a.topics)},function(a){c(a)}):d.callService(e,function(a){b(a.topics)})},d.prototype.getServices=function(a,b){var c=new g({ros:this,name:"/rosapi/services",serviceType:"rosapi/Services"}),d=new h;"function"==typeof b?c.callService(d,function(b){a(b.services)},function(a){b(a)}):c.callService(d,function(b){a(b.services)})},d.prototype.getServicesForType=function(a,b,c){var d=new g({ros:this,name:"/rosapi/services_for_type",serviceType:"rosapi/ServicesForType"}),e=new h({type:a});"function"==typeof c?d.callService(e,function(a){b(a.services)},function(a){c(a)}):d.callService(e,function(a){b(a.services)})},d.prototype.getNodes=function(a,b){var c=new g({ros:this,name:"/rosapi/nodes",serviceType:"rosapi/Nodes"}),d=new h;"function"==typeof b?c.callService(d,function(b){a(b.nodes)},function(a){b(a)}):c.callService(d,function(b){a(b.nodes)})},d.prototype.getParams=function(a,b){var c=new g({ros:this,name:"/rosapi/get_param_names",serviceType:"rosapi/GetParamNames"}),d=new h;"function"==typeof b?c.callService(d,function(b){a(b.names)},function(a){b(a)}):c.callService(d,function(b){a(b.names)})},d.prototype.getTopicType=function(a,b,c){var d=new g({ros:this,name:"/rosapi/topic_type",serviceType:"rosapi/TopicType"}),e=new h({topic:a});"function"==typeof c?d.callService(e,function(a){b(a.type)},function(a){c(a)}):d.callService(e,function(a){b(a.type)})},d.prototype.getMessageDetails=function(a,b,c){var d=new g({ros:this,name:"/rosapi/message_details",serviceType:"rosapi/MessageDetails"}),e=new h({type:a});"function"==typeof c?d.callService(e,function(a){b(a.typedefs)},function(a){c(a)}):d.callService(e,function(a){b(a.typedefs)})},d.prototype.decodeTypeDefs=function(a){var b=this,c=function(a,d){for(var e={},f=0;f<a.fieldnames.length;f++){var g=a.fieldarraylen[f],h=a.fieldnames[f],i=a.fieldtypes[f];if(-1===i.indexOf("/"))-1===g?e[h]=i:e[h]=[i];else{for(var j=!1,k=0;k<d.length;k++)if(d[k].type.toString()===i.toString()){j=d[k];break}if(j){var l=c(j,d);-1===g?e[h]=l:e[h]=[l]}else b.emit("error","Cannot find "+i+" in decodeTypeDefs")}}return e};return c(a[0],a)},b.exports=d},{"./../util/shim/EventEmitter2.js":37,"./../util/shim/WebSocket.js":38,"./Service":11,"./ServiceRequest":12,"./SocketAdapter.js":14,"object-assign":1}],11:[function(a,b,c){function d(a){a=a||{},this.ros=a.ros,this.name=a.name,this.serviceType=a.serviceType}var e=a("./ServiceResponse");d.prototype.callService=function(a,b,c){var d="call_service:"+this.name+":"+ ++this.ros.idCounter;(b||c)&&this.ros.once(d,function(a){void 0!==a.result&&a.result===!1?"function"==typeof c&&c(a.values):"function"==typeof b&&b(new e(a.values))});var f={op:"call_service",id:d,service:this.name,args:a};this.ros.callOnConnection(f)},b.exports=d},{"./ServiceResponse":13}],12:[function(a,b,c){function d(a){e(this,a)}var e=a("object-assign");b.exports=d},{"object-assign":1}],13:[function(a,b,c){function d(a){e(this,a)}var e=a("object-assign");b.exports=d},{"object-assign":1}],14:[function(a,b,c){(function(c){"use strict";function d(a,b){var c=new g;c.onload=function(){var a=new f,d=a.getContext("2d");a.width=c.width,a.height=c.height,d.imageSmoothingEnabled=!1,d.webkitImageSmoothingEnabled=!1,d.mozImageSmoothingEnabled=!1,d.drawImage(c,0,0);for(var e=d.getImageData(0,0,c.width,c.height).data,g="",h=0;h<e.length;h+=4)g+=String.fromCharCode(e[h],e[h+1],e[h+2]);b(JSON.parse(g))},c.src="data:image/png;base64,"+a.data}function e(a){function b(b){"publish"===b.op?a.emit(b.topic,b.msg):"service_response"===b.op&&a.emit(b.id,b)}return{onopen:function(b){a.isConnected=!0,a.emit("connection",b)},onclose:function(b){a.isConnected=!1,a.emit("close",b)},onerror:function(b){a.emit("error",b)},onmessage:function(a){if("undefined"!=typeof Blob&&a.data instanceof Blob){if(!h)throw"Cannot process BSON encoded message without BSON header.";var c=new FileReader;c.onload=function(){var a=new Uint8Array(this.result),c=h.deserialize(a);"png"===c.op?d(c,b):b(c)},c.readAsArrayBuffer(a.data)}else{var e=JSON.parse("string"==typeof a?a:a.data);"png"===e.op?d(e,b):b(e)}}}}var f=a("./../util/shim/canvas.js"),g=f.Image||c.Image,h=(a("./../util/shim/WebSocket.js"),null);"undefined"!=typeof bson&&(h=bson().BSON),b.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./../util/shim/WebSocket.js":38,"./../util/shim/canvas.js":39}],15:[function(a,b,c){function d(a){a=a||{},this.ros=a.ros,this.name=a.name,this.messageType=a.messageType,this.isAdvertised=!1,this.compression=a.compression||"none",this.throttle_rate=a.throttle_rate||0,this.latch=a.latch||!1,this.queue_size=a.queue_size||100,this.queue_length=a.queue_length||0,this.compression&&"png"!==this.compression&&"none"!==this.compression&&this.emit("warning",this.compression+" compression is not supported. No compression will be used."),this.throttle_rate<0&&(this.emit("warning",this.throttle_rate+" is not allowed. Set to 0"),this.throttle_rate=0);var b=this;this._messageCallback=function(a){b.emit("message",new f(a))}}var e=a("./../util/shim/EventEmitter2.js").EventEmitter2,f=a("./Message");d.prototype.__proto__=e.prototype,d.prototype.subscribe=function(a){"function"==typeof a&&this.on("message",a),this.subscribeId||(this.ros.on(this.name,this._messageCallback),this.subscribeId="subscribe:"+this.name+":"+ ++this.ros.idCounter,this.ros.callOnConnection({op:"subscribe",id:this.subscribeId,type:this.messageType,topic:this.name,compression:this.compression,throttle_rate:this.throttle_rate,queue_length:this.queue_length}))},d.prototype.unsubscribe=function(a){a&&(this.off("message",a),this.listeners("message").length)||this.subscribeId&&(this.ros.off(this.name,this._messageCallback),this.emit("unsubscribe"),this.ros.callOnConnection({op:"unsubscribe",id:this.subscribeId,topic:this.name}),this.subscribeId=null)},d.prototype.advertise=function(){this.isAdvertised||(this.advertiseId="advertise:"+this.name+":"+ ++this.ros.idCounter,this.ros.callOnConnection({op:"advertise",id:this.advertiseId,type:this.messageType,topic:this.name,latch:this.latch,queue_size:this.queue_size}),this.isAdvertised=!0)},d.prototype.unadvertise=function(){this.isAdvertised&&(this.emit("unadvertise"),this.ros.callOnConnection({op:"unadvertise",id:this.advertiseId,topic:this.name}),this.isAdvertised=!1)},d.prototype.publish=function(a){this.isAdvertised||this.advertise(),this.ros.idCounter++;var b={op:"publish",id:"publish:"+this.name+":"+this.ros.idCounter,topic:this.name,msg:a,latch:this.latch};this.ros.callOnConnection(b)},b.exports=d},{"./../util/shim/EventEmitter2.js":37,"./Message":8}],16:[function(a,b,c){var d=a("../mixin"),e=b.exports={Ros:a("./Ros"),Topic:a("./Topic"),Message:a("./Message"),Param:a("./Param"),Service:a("./Service"),ServiceRequest:a("./ServiceRequest"),ServiceResponse:a("./ServiceResponse")};d(e.Ros,["Param","Service","Topic"],e)},{"../mixin":22,"./Message":8,"./Param":9,"./Ros":10,"./Service":11,"./ServiceRequest":12,"./ServiceResponse":13,"./Topic":15}],17:[function(a,b,c){function d(a){a=a||{},this.position=new e(a.position),this.orientation=new f(a.orientation)}var e=a("./Vector3"),f=a("./Quaternion");d.prototype.applyTransform=function(a){this.position.multiplyQuaternion(a.rotation),this.position.add(a.translation);var b=a.rotation.clone();b.multiply(this.orientation),this.orientation=b},d.prototype.clone=function(){return new d(this)},b.exports=d},{"./Quaternion":18,"./Vector3":20}],18:[function(a,b,c){function d(a){a=a||{},this.x=a.x||0,this.y=a.y||0,this.z=a.z||0,this.w="number"==typeof a.w?a.w:1}d.prototype.conjugate=function(){this.x*=-1,this.y*=-1,this.z*=-1},d.prototype.norm=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},d.prototype.normalize=function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);0===a?(this.x=0,this.y=0,this.z=0,this.w=1):(a=1/a,this.x=this.x*a,this.y=this.y*a,this.z=this.z*a,this.w=this.w*a)},d.prototype.invert=function(){this.conjugate(),this.normalize()},d.prototype.multiply=function(a){var b=this.x*a.w+this.y*a.z-this.z*a.y+this.w*a.x,c=-this.x*a.z+this.y*a.w+this.z*a.x+this.w*a.y,d=this.x*a.y-this.y*a.x+this.z*a.w+this.w*a.z,e=-this.x*a.x-this.y*a.y-this.z*a.z+this.w*a.w;this.x=b,this.y=c,this.z=d,this.w=e},d.prototype.clone=function(){return new d(this)},b.exports=d},{}],19:[function(a,b,c){function d(a){a=a||{},this.translation=new e(a.translation),this.rotation=new f(a.rotation)}var e=a("./Vector3"),f=a("./Quaternion");d.prototype.clone=function(){return new d(this)},b.exports=d},{"./Quaternion":18,"./Vector3":20}],20:[function(a,b,c){function d(a){a=a||{},this.x=a.x||0,this.y=a.y||0,this.z=a.z||0}d.prototype.add=function(a){this.x+=a.x,this.y+=a.y,this.z+=a.z},d.prototype.subtract=function(a){this.x-=a.x,this.y-=a.y,this.z-=a.z},d.prototype.multiplyQuaternion=function(a){var b=a.w*this.x+a.y*this.z-a.z*this.y,c=a.w*this.y+a.z*this.x-a.x*this.z,d=a.w*this.z+a.x*this.y-a.y*this.x,e=-a.x*this.x-a.y*this.y-a.z*this.z;this.x=b*a.w+e*-a.x+c*-a.z-d*-a.y,this.y=c*a.w+e*-a.y+d*-a.x-b*-a.z,this.z=d*a.w+e*-a.z+b*-a.y-c*-a.x},d.prototype.clone=function(){return new d(this)},b.exports=d},{}],21:[function(a,b,c){b.exports={Pose:a("./Pose"),Quaternion:a("./Quaternion"),Transform:a("./Transform"),Vector3:a("./Vector3")}},{"./Pose":17,"./Quaternion":18,"./Transform":19,"./Vector3":20}],22:[function(a,b,c){b.exports=function(a,b,c){b.forEach(function(b){var d=c[b];a.prototype[b]=function(a){return a.ros=this,new d(a)}})}},{}],23:[function(a,b,c){function d(a){a=a||{},this.ros=a.ros,this.fixedFrame=a.fixedFrame||"/base_link",this.angularThres=a.angularThres||2,this.transThres=a.transThres||.01,this.rate=a.rate||10,this.updateDelay=a.updateDelay||50;var b=a.topicTimeout||2,c=Math.floor(b),d=Math.floor(1e9*(b-c));this.topicTimeout={secs:c,nsecs:d},this.currentGoal=!1,this.currentTopic=!1,this.frameInfos={},this.republisherUpdateRequested=!1,this.actionClient=this.ros.ActionClient({serverName:"/tf2_web_republisher",actionName:"tf2_web_republisher/TFSubscriptionAction"}),this.serviceClient=this.ros.Service({name:"/republish_tfs",serviceType:"tf2_web_republisher/RepublishTFs"})}var e=(a("../actionlib/ActionClient"),a("../actionlib/Goal")),f=(a("../core/Service.js"),a("../core/ServiceRequest.js")),g=a("../math/Transform");d.prototype.processTFArray=function(a){a.transforms.forEach(function(a){var b=a.child_frame_id;"/"===b[0]&&(b=b.substring(1));var c=this.frameInfos[b];c&&(c.transform=new g({translation:a.transform.translation,rotation:a.transform.rotation}),c.cbs.forEach(function(a){a(c.transform)}))},this)},d.prototype.updateGoal=function(){var a={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 e({actionClient:this.actionClient,goalMessage:a}),this.currentGoal.on("feedback",this.processTFArray.bind(this)),this.currentGoal.send();else{a.timeout=this.topicTimeout;var b=new f(a);this.serviceClient.callService(b,this.processResponse.bind(this))}this.republisherUpdateRequested=!1},d.prototype.processResponse=function(a){this.currentTopic&&this.currentTopic.unsubscribe(),this.currentTopic=this.ros.Topic({name:a.topic_name,messageType:"tf2_web_republisher/TFArray"}),this.currentTopic.subscribe(this.processTFArray.bind(this))},d.prototype.subscribe=function(a,b){"/"===a[0]&&(a=a.substring(1)),this.frameInfos[a]?this.frameInfos[a].transform&&b(this.frameInfos[a].transform):(this.frameInfos[a]={cbs:[]},this.republisherUpdateRequested||(setTimeout(this.updateGoal.bind(this),this.updateDelay),this.republisherUpdateRequested=!0)),this.frameInfos[a].cbs.push(b)},d.prototype.unsubscribe=function(a,b){"/"===a[0]&&(a=a.substring(1));for(var c=this.frameInfos[a],d=c&&c.cbs||[],e=d.length;e--;)d[e]===b&&d.splice(e,1);b&&0!==d.length||delete this.frameInfos[a]},b.exports=d},{"../actionlib/ActionClient":4,"../actionlib/Goal":5,"../core/Service.js":11,"../core/ServiceRequest.js":12,"../math/Transform":19}],24:[function(a,b,c){var d=a("../core/Ros"),e=a("../mixin"),f=b.exports={TFClient:a("./TFClient")};e(d,["TFClient"],f)},{"../core/Ros":10,"../mixin":22,"./TFClient":23}],25:[function(a,b,c){function d(a){this.dimension=null,this.type=f.URDF_BOX;var b=a.xml.getAttribute("size").split(" ");this.dimension=new e({x:parseFloat(b[0]),y:parseFloat(b[1]),z:parseFloat(b[2])})}var e=a("../math/Vector3"),f=a("./UrdfTypes");b.exports=d},{"../math/Vector3":20,"./UrdfTypes":34}],26:[function(a,b,c){function d(a){var b=a.xml.getAttribute("rgba").split(" ");this.r=parseFloat(b[0]),this.g=parseFloat(b[1]),this.b=parseFloat(b[2]),this.a=parseFloat(b[3])}b.exports=d},{}],27:[function(a,b,c){function d(a){this.type=e.URDF_CYLINDER,this.length=parseFloat(a.xml.getAttribute("length")),this.radius=parseFloat(a.xml.getAttribute("radius"))}var e=a("./UrdfTypes");b.exports=d},{"./UrdfTypes":34}],28:[function(a,b,c){function d(a){this.name=a.xml.getAttribute("name"),this.type=a.xml.getAttribute("type");var b=a.xml.getElementsByTagName("limit");b.length>0&&(this.minval=parseFloat(b[0].getAttribute("lower")),this.maxval=parseFloat(b[0].getAttribute("upper")))}b.exports=d},{}],29:[function(a,b,c){function d(a){this.name=a.xml.getAttribute("name"),this.visuals=[];for(var b=a.xml.getElementsByTagName("visual"),c=0;c<b.length;c++)this.visuals.push(new e({xml:b[c]}))}var e=a("./UrdfVisual");b.exports=d},{"./UrdfVisual":35}],30:[function(a,b,c){function d(a){this.textureFilename=null,this.color=null,this.name=a.xml.getAttribute("name");var b=a.xml.getElementsByTagName("texture");b.length>0&&(this.textureFilename=b[0].getAttribute("filename"));var c=a.xml.getElementsByTagName("color");c.length>0&&(this.color=new e({xml:c[0]}))}var e=a("./UrdfColor");d.prototype.isLink=function(){return null===this.color&&null===this.textureFilename};var f=a("object-assign");d.prototype.assign=function(a){return f(this,a)},b.exports=d},{"./UrdfColor":26,"object-assign":1}],31:[function(a,b,c){function d(a){this.scale=null,this.type=f.URDF_MESH,this.filename=a.xml.getAttribute("filename");var b=a.xml.getAttribute("scale");if(b){var c=b.split(" ");this.scale=new e({x:parseFloat(c[0]),y:parseFloat(c[1]),z:parseFloat(c[2])})}}var e=a("../math/Vector3"),f=a("./UrdfTypes");b.exports=d},{"../math/Vector3":20,"./UrdfTypes":34}],32:[function(a,b,c){function d(a){a=a||{};var b=a.xml,c=a.string;if(this.materials={},this.links={},this.joints={},c){var d=new h;b=d.parseFromString(c,"text/xml")}var i=b.documentElement;this.name=i.getAttribute("name");for(var j=i.childNodes,k=0;k<j.length;k++){var l=j[k];if("material"===l.tagName){var m=new e({xml:l});void 0!==this.materials[m.name]?this.materials[m.name].isLink()?this.materials[m.name].assign(m):console.warn("Material "+m.name+"is not unique."):this.materials[m.name]=m}else if("link"===l.tagName){var n=new f({xml:l});if(void 0!==this.links[n.name])console.warn("Link "+n.name+" is not unique.");else{for(var o=0;o<n.visuals.length;o++){var p=n.visuals[o].material;null!==p&&(void 0!==this.materials[p.name]?n.visuals[o].material=this.materials[p.name]:this.materials[p.name]=p)}this.links[n.name]=n}}else if("joint"===l.tagName){var q=new g({xml:l});this.joints[q.name]=q}}}var e=a("./UrdfMaterial"),f=a("./UrdfLink"),g=a("./UrdfJoint"),h=a("./../util/shim/xmldom.js").DOMParser;b.exports=d},{"./../util/shim/xmldom.js":40,"./UrdfJoint":28,"./UrdfLink":29,"./UrdfMaterial":30}],33:[function(a,b,c){function d(a){this.type=e.URDF_SPHERE,this.radius=parseFloat(a.xml.getAttribute("radius"))}var e=a("./UrdfTypes");b.exports=d},{"./UrdfTypes":34}],34:[function(a,b,c){b.exports={URDF_SPHERE:0,URDF_BOX:1,URDF_CYLINDER:2,URDF_MESH:3}},{}],35:[function(a,b,c){function d(a){var b=a.xml;this.origin=null,this.geometry=null,this.material=null;var c=b.getElementsByTagName("origin");if(0===c.length)this.origin=new e;else{var d=c[0].getAttribute("xyz"),m=new f;d&&(d=d.split(" "),m=new f({x:parseFloat(d[0]),y:parseFloat(d[1]),z:parseFloat(d[2])}));var n=c[0].getAttribute("rpy"),o=new g;if(n){n=n.split(" ");var p=parseFloat(n[0]),q=parseFloat(n[1]),r=parseFloat(n[2]),s=p/2,t=q/2,u=r/2,v=Math.sin(s)*Math.cos(t)*Math.cos(u)-Math.cos(s)*Math.sin(t)*Math.sin(u),w=Math.cos(s)*Math.sin(t)*Math.cos(u)+Math.sin(s)*Math.cos(t)*Math.sin(u),x=Math.cos(s)*Math.cos(t)*Math.sin(u)-Math.sin(s)*Math.sin(t)*Math.cos(u),y=Math.cos(s)*Math.cos(t)*Math.cos(u)+Math.sin(s)*Math.sin(t)*Math.sin(u);o=new g({x:v,y:w,z:x,w:y}),o.normalize()}this.origin=new e({position:m,orientation:o})}var z=b.getElementsByTagName("geometry");if(z.length>0){for(var A=z[0],B=null,C=0;C<A.childNodes.length;C++){var D=A.childNodes[C];if(1===D.nodeType){B=D;break}}var E=B.nodeName;"sphere"===E?this.geometry=new l({xml:B}):"box"===E?this.geometry=new i({xml:B}):"cylinder"===E?this.geometry=new h({xml:B}):"mesh"===E?this.geometry=new k({xml:B}):console.warn("Unknown geometry type "+E)}var F=b.getElementsByTagName("material");F.length>0&&(this.material=new j({xml:F[0]}))}var e=a("../math/Pose"),f=a("../math/Vector3"),g=a("../math/Quaternion"),h=a("./UrdfCylinder"),i=a("./UrdfBox"),j=a("./UrdfMaterial"),k=a("./UrdfMesh"),l=a("./UrdfSphere");b.exports=d},{"../math/Pose":17,"../math/Quaternion":18,"../math/Vector3":20,"./UrdfBox":25,"./UrdfCylinder":27,"./UrdfMaterial":30,"./UrdfMesh":31,"./UrdfSphere":33}],36:[function(a,b,c){b.exports=a("object-assign")({UrdfBox:a("./UrdfBox"),UrdfColor:a("./UrdfColor"),UrdfCylinder:a("./UrdfCylinder"),UrdfLink:a("./UrdfLink"),UrdfMaterial:a("./UrdfMaterial"),UrdfMesh:a("./UrdfMesh"),UrdfModel:a("./UrdfModel"),UrdfSphere:a("./UrdfSphere"),UrdfVisual:a("./UrdfVisual")},a("./UrdfTypes"))},{"./UrdfBox":25,"./UrdfColor":26,"./UrdfCylinder":27,"./UrdfLink":29,"./UrdfMaterial":30,"./UrdfMesh":31,"./UrdfModel":32,"./UrdfSphere":33,"./UrdfTypes":34,"./UrdfVisual":35,"object-assign":1}],37:[function(a,b,c){(function(a){b.exports={EventEmitter2:a.EventEmitter2}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],38:[function(a,b,c){(function(a){b.exports=a.WebSocket}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],39:[function(a,b,c){b.exports=function(){return document.createElement("canvas")}},{}],40:[function(a,b,c){(function(a){c.DOMImplementation=a.DOMImplementation,c.XMLSerializer=a.XMLSerializer,c.DOMParser=a.DOMParser}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[3]);