Skip to content

Commit

Permalink
Update Build
Browse files Browse the repository at this point in the history
  • Loading branch information
EzraBrooks authored and github-actions[bot] committed Nov 28, 2023
1 parent 5efa9c3 commit d77d4a2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions build/roslib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -3386,7 +3392,7 @@ Param.prototype.delete = function(callback) {
name : this.name
});

paramClient.callService(request, callback);
paramClient.callService(request, callback, failedCallback);
};

module.exports = Param;
Expand Down
2 changes: 1 addition & 1 deletion build/roslib.min.js

Large diffs are not rendered by default.

0 comments on commit d77d4a2

Please sign in to comment.