ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Are you sure you want to stop once subscribed? You do NOT have a message then.

This whole thing also goes against usual ROS usage patterns. For one time things a service call might be better suited. It might be a good idea to state what you want to actually achieve with this.

If you want to stop a node there are some possibilities.

  • Nodes are binaries, you can just kill them with a normal system command (you'll need to know the pid/name or figure it out)
  • rosnode kill <node> kills the node with name <node>.
  • If you don't know the node's name for the setup, but have some kind of ROS configurable connection you can send a shutdown service/message that would trigger that node to end itself manually.