Skip to content

Commit

Permalink
Merge pull request RobotWebTools#248 from Intermodalics/build_PR_247
Browse files Browse the repository at this point in the history
build 'get actionlib servers RobotWebTools#247'
  • Loading branch information
jihoonl authored Jan 19, 2017
2 parents bb2878d + 4ed81ea commit 243860a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
46 changes: 41 additions & 5 deletions build/roslib.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,15 @@
}();

},{}],2:[function(require,module,exports){
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

'use strict';
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;

Expand All @@ -745,7 +752,7 @@ function shouldUseNative() {
// Detect buggy property enumeration order in older V8 versions.

// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
Expand Down Expand Up @@ -774,7 +781,7 @@ function shouldUseNative() {
}

return true;
} catch (e) {
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
Expand All @@ -794,8 +801,8 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
}
}

if (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
Expand Down Expand Up @@ -1616,6 +1623,35 @@ Ros.prototype.callOnConnection = function(message) {
}
};

/**
* Retrieves Action Servers in ROS as an array of string
*
* * actionservers - Array of action server names
*/
Ros.prototype.getActionServers = function(callback, failedCallback) {
var getActionServers = new Service({
ros : this,
name : '/rosapi/action_servers',
serviceType : 'rosapi/GetActionServers'
});

var request = new ServiceRequest({});
if (typeof failedCallback === 'function'){
getActionServers.callService(request,
function(result) {
callback(result.action_servers);
},
function(message){
failedCallback(message);
}
);
}else{
getActionServers.callService(request, function(result) {
callback(result.action_servers);
});
}
};

/**
* Retrieves list of topics in ROS as an array.
*
Expand All @@ -1641,7 +1677,7 @@ Ros.prototype.getTopics = function(callback, failedCallback) {
);
}else{
topicsClient.callService(request, function(result) {
callback(result.topics);
callback(result);
});
}
};
Expand Down
Loading

0 comments on commit 243860a

Please sign in to comment.