Skip to content

Commit d77d4a2

Browse files
EzraBrooksgithub-actions[bot]
authored andcommitted
Update Build
1 parent 5efa9c3 commit d77d4a2

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

build/roslib.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,8 +3331,10 @@ function Param(options) {
33313331
*
33323332
* @param {function} callback - Function with the following params:
33333333
* @param {Object} callback.value - The value of the param from ROS.
3334+
* @param {function} [failedCallback] - Function when the service call failed with the following params:
3335+
* @param {string} failedCallback.error - The error message reported by ROS.
33343336
*/
3335-
Param.prototype.get = function(callback) {
3337+
Param.prototype.get = function(callback, failedCallback) {
33363338
var paramClient = new Service({
33373339
ros : this.ros,
33383340
name : '/rosapi/get_param',
@@ -3346,16 +3348,18 @@ Param.prototype.get = function(callback) {
33463348
paramClient.callService(request, function(result) {
33473349
var value = JSON.parse(result.value);
33483350
callback(value);
3349-
});
3351+
}, failedCallback);
33503352
};
33513353

33523354
/**
33533355
* Set the value of the param in ROS.
33543356
*
33553357
* @param {Object} value - The value to set param to.
3356-
* @param {function} callback - The callback function.
3358+
* @param {function} [callback] - The callback function.
3359+
* @param {function} [failedCallback] - The callback function when the service call failed.
3360+
* @param {string} failedCallback.error - The error message reported by ROS.
33573361
*/
3358-
Param.prototype.set = function(value, callback) {
3362+
Param.prototype.set = function(value, callback, failedCallback) {
33593363
var paramClient = new Service({
33603364
ros : this.ros,
33613365
name : '/rosapi/set_param',
@@ -3367,15 +3371,17 @@ Param.prototype.set = function(value, callback) {
33673371
value : JSON.stringify(value)
33683372
});
33693373

3370-
paramClient.callService(request, callback);
3374+
paramClient.callService(request, callback, failedCallback);
33713375
};
33723376

33733377
/**
33743378
* Delete this parameter on the ROS server.
33753379
*
3376-
* @param {function} callback - The callback function.
3380+
* @param {function} [callback] - The callback function when the service call succeeded.
3381+
* @param {function} [failedCallback] - The callback function when the service call failed.
3382+
* @param {string} failedCallback.error - The error message reported by ROS.
33773383
*/
3378-
Param.prototype.delete = function(callback) {
3384+
Param.prototype.delete = function(callback, failedCallback) {
33793385
var paramClient = new Service({
33803386
ros : this.ros,
33813387
name : '/rosapi/delete_param',
@@ -3386,7 +3392,7 @@ Param.prototype.delete = function(callback) {
33863392
name : this.name
33873393
});
33883394

3389-
paramClient.callService(request, callback);
3395+
paramClient.callService(request, callback, failedCallback);
33903396
};
33913397

33923398
module.exports = Param;

build/roslib.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)