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

Support shutting down a node. #11

Open
baalexander opened this issue Dec 28, 2011 · 1 comment
Open

Support shutting down a node. #11

baalexander opened this issue Dec 28, 2011 · 1 comment

Comments

@baalexander
Copy link
Owner

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
Copy link
Owner Author

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 added a commit that referenced this issue Apr 25, 2012
Unregisters the node as a subscriber for the topic. See Issue #11.
baalexander added a commit that referenced this issue Apr 25, 2012
Unregisters publisher as a publisher of a given topic with master. Unpublish may
be an ambiguous name though.

See Issue #11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant