From d77d4a2064494fceb5b3b88d3c68b3c058d3e907 Mon Sep 17 00:00:00 2001 From: EzraBrooks Date: Tue, 28 Nov 2023 17:25:30 +0000 Subject: [PATCH] Update Build --- build/roslib.js | 22 ++++++++++++++-------- build/roslib.min.js | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/build/roslib.js b/build/roslib.js index b5ce1dbbd..f6811dc2e 100644 --- a/build/roslib.js +++ b/build/roslib.js @@ -3331,8 +3331,10 @@ function Param(options) { * * @param {function} callback - Function with the following params: * @param {Object} callback.value - The value of the param from ROS. + * @param {function} [failedCallback] - Function when the service call failed with the following params: + * @param {string} failedCallback.error - The error message reported by ROS. */ -Param.prototype.get = function(callback) { +Param.prototype.get = function(callback, failedCallback) { var paramClient = new Service({ ros : this.ros, name : '/rosapi/get_param', @@ -3346,16 +3348,18 @@ Param.prototype.get = function(callback) { paramClient.callService(request, function(result) { var value = JSON.parse(result.value); callback(value); - }); + }, failedCallback); }; /** * Set the value of the param in ROS. * * @param {Object} value - The value to set param to. - * @param {function} callback - The callback function. + * @param {function} [callback] - The callback function. + * @param {function} [failedCallback] - The callback function when the service call failed. + * @param {string} failedCallback.error - The error message reported by ROS. */ -Param.prototype.set = function(value, callback) { +Param.prototype.set = function(value, callback, failedCallback) { var paramClient = new Service({ ros : this.ros, name : '/rosapi/set_param', @@ -3367,15 +3371,17 @@ Param.prototype.set = function(value, callback) { value : JSON.stringify(value) }); - paramClient.callService(request, callback); + paramClient.callService(request, callback, failedCallback); }; /** * Delete this parameter on the ROS server. * - * @param {function} callback - The callback function. + * @param {function} [callback] - The callback function when the service call succeeded. + * @param {function} [failedCallback] - The callback function when the service call failed. + * @param {string} failedCallback.error - The error message reported by ROS. */ -Param.prototype.delete = function(callback) { +Param.prototype.delete = function(callback, failedCallback) { var paramClient = new Service({ ros : this.ros, name : '/rosapi/delete_param', @@ -3386,7 +3392,7 @@ Param.prototype.delete = function(callback) { name : this.name }); - paramClient.callService(request, callback); + paramClient.callService(request, callback, failedCallback); }; module.exports = Param; diff --git a/build/roslib.min.js b/build/roslib.min.js index eeeeffed8..37fee344c 100644 --- a/build/roslib.min.js +++ b/build/roslib.min.js @@ -1 +1 @@ -!function n(r,s,o){function a(t,e){if(!s[t]){if(!r[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(c)return c(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}i=s[t]={exports:{}},r[t][0].call(i.exports,function(e){return a(r[t][1][e]||e)},i,i.exports,n,r,s,o)}return s[t].exports}for(var c="function"==typeof require&&require,e=0;e>2),s=0;s>6):(s<55296?n.push(224|s>>12):(s=65536+((s=(1023&s)<<10)|1023&t.charCodeAt(++r)),n.push(240|s>>18),n.push(128|s>>12&63)),n.push(128|s>>6&63)),n.push(128|63&s))}return m(3,n.length),p(n);default:if(Array.isArray(t))for(m(4,o=t.length),r=0;r>5!==e)throw"Invalid indefinite length element";return i}function M(e,t){for(var i=0;i>10),e.push(56320|1023&n))}}"function"!=typeof d&&(d=function(e){return e}),"function"!=typeof y&&(y=function(){return A});var e=function e(){var t,i,n=x(),r=n>>5,n=31&n;if(7==r)switch(n){case 25:var s=new ArrayBuffer(4),s=new DataView(s),o=T(),a=31744&o,c=1023&o;if(31744===a)a=261120;else if(0!==a)a+=114688;else if(0!=c)return c*U;return s.setUint32(0,(32768&o)<<16|a<<13|c<<13),s.getFloat32(0);case 26:return w(g.getFloat32(b),4);case 27:return w(g.getFloat64(b),8)}if((t=L(n))<0&&(r<2||6this._maxListeners&&(l._listeners.warned=!0,f.call(this,l._listeners.length,c))):l._listeners=t,!0;return!0}.call(this,e,t,i):this._events[e]?("function"==typeof this._events[e]&&(this._events[e]=[this._events[e]]),i?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&0this._maxListeners&&(this._events[e].warned=!0,f.call(this,this._events[e].length,e))):this._events[e]=t,r},r.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var i=[];if(this.wildcard){var n="string"==typeof e?e.split(this.delimiter):e.slice();if(!(i=_.call(this,null,n,this.listenerTree,0)))return this}else{if(!this._events[e])return this;o=this._events[e],i.push({_listeners:o})}for(var r=0;rt.secs)&&(e.secs>2),s=0;s>6):(s<55296?n.push(224|s>>12):(s=65536+((s=(1023&s)<<10)|1023&t.charCodeAt(++r)),n.push(240|s>>18),n.push(128|s>>12&63)),n.push(128|s>>6&63)),n.push(128|63&s))}return m(3,n.length),p(n);default:if(Array.isArray(t))for(m(4,o=t.length),r=0;r>5!==e)throw"Invalid indefinite length element";return i}function M(e,t){for(var i=0;i>10),e.push(56320|1023&n))}}"function"!=typeof d&&(d=function(e){return e}),"function"!=typeof y&&(y=function(){return A});var e=function e(){var t,i,n=x(),r=n>>5,n=31&n;if(7==r)switch(n){case 25:var s=new ArrayBuffer(4),s=new DataView(s),o=T(),a=31744&o,c=1023&o;if(31744===a)a=261120;else if(0!==a)a+=114688;else if(0!=c)return c*U;return s.setUint32(0,(32768&o)<<16|a<<13|c<<13),s.getFloat32(0);case 26:return w(g.getFloat32(b),4);case 27:return w(g.getFloat64(b),8)}if((t=L(n))<0&&(r<2||6this._maxListeners&&(l._listeners.warned=!0,f.call(this,l._listeners.length,c))):l._listeners=t,!0;return!0}.call(this,e,t,i):this._events[e]?("function"==typeof this._events[e]&&(this._events[e]=[this._events[e]]),i?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&0this._maxListeners&&(this._events[e].warned=!0,f.call(this,this._events[e].length,e))):this._events[e]=t,r},r.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var i=[];if(this.wildcard){var n="string"==typeof e?e.split(this.delimiter):e.slice();if(!(i=_.call(this,null,n,this.listenerTree,0)))return this}else{if(!this._events[e])return this;o=this._events[e],i.push({_listeners:o})}for(var r=0;rt.secs)&&(e.secs