Skip to content

Commit de62778

Browse files
author
Russell Toris
committed
param now contains delete function
1 parent e769c2e commit de62778

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

build/roslib.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,24 @@ ROSLIB.Param.prototype.set = function(value) {
294294
});
295295
};
296296

297+
/**
298+
* Delete this parameter on the ROS server.
299+
*/
300+
ROSLIB.Param.prototype.delete = function() {
301+
var paramClient = new ROSLIB.Service({
302+
ros : this.ros,
303+
name : '/rosapi/delete_param',
304+
serviceType : 'rosapi/DeleteParam'
305+
});
306+
307+
var request = new ROSLIB.ServiceRequest({
308+
name : this.name
309+
});
310+
311+
paramClient.callService(request, function() {
312+
});
313+
};
314+
297315
/**
298316
* @author Brandon Alexander - [email protected]
299317
*/
@@ -528,6 +546,26 @@ ROSLIB.Ros.prototype.getServices = function(callback) {
528546
});
529547
};
530548

549+
/**
550+
* Retrieves list of active node names in ROS.
551+
*
552+
* @param callback - function with the following params:
553+
* * nodes - array of node names
554+
*/
555+
ROSLIB.Ros.prototype.getNodes = function(callback) {
556+
var nodesClient = new ROSLIB.Service({
557+
ros : this,
558+
name : '/rosapi/nodes',
559+
serviceType : 'rosapi/Nodes'
560+
});
561+
562+
var request = new ROSLIB.ServiceRequest();
563+
564+
nodesClient.callService(request, function(result) {
565+
callback(result.nodes);
566+
});
567+
};
568+
531569
/**
532570
* Retrieves list of param names from the ROS Parameter Server.
533571
*

0 commit comments

Comments
 (0)