Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build 'get actionlib servers #247' #248

Merged
merged 1 commit into from
Jan 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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