rosnodejs icon indicating copy to clipboard operation
rosnodejs copied to clipboard

Support shutting down a node.

Open baalexander opened this issue 13 years ago • 1 comments

Right now, a node can only be shutdown using rosnodejs by killing the process. There should probably be a clean way to shutdown a node as well as query the state of being shutdown (see rospy's is_shutdown()) and handling a shutdown (handling a 'shutdown' event?).

baalexander avatar Dec 28 '11 04:12 baalexander

I originally wrote this issue for v0.0.1. With v0.1.0, we now can access individual topics easier. It may make more sense to shut these down individually or the node as a whole. Here's an API proposal:

ros.types([
  'std_msgs/String'
], function(String) {
  var node = ros.node('talker');
  node.topics([
    { topic: 'example', messageType: String }
  ], function(example) {
    example.subscribe(function(message) { });

    // Calls unregister subscriber on master
    example.shutdown();
  });
});

baalexander avatar Apr 16 '12 17:04 baalexander