added node destruction
Signed-off-by: Jakub Delicat <jakub.delicat@pwr.edu.pl>
This commit is contained in:
parent
a136c86ba1
commit
1d7d2c1269
@ -122,3 +122,6 @@ class MasterPlugin(Plugin):
|
|||||||
def restrictions_changed(self, restrictions):
|
def restrictions_changed(self, restrictions):
|
||||||
self._master_info.restrictions = restrictions
|
self._master_info.restrictions = restrictions
|
||||||
self._ros_wrapper.restrictions_changed(restrictions)
|
self._ros_wrapper.restrictions_changed(restrictions)
|
||||||
|
|
||||||
|
def shutdown_plugin(self):
|
||||||
|
self._ros_wrapper.unregister_node()
|
||||||
|
@ -113,15 +113,17 @@ class ROSWrapper(Node):
|
|||||||
self.master_stop_publisher.publish(stop_msg)
|
self.master_stop_publisher.publish(stop_msg)
|
||||||
|
|
||||||
def cancel_subscribers_and_publishers(self):
|
def cancel_subscribers_and_publishers(self):
|
||||||
|
self.when_robots_disabled()
|
||||||
|
|
||||||
self.unregister_publisher(self.master_stop_publisher)
|
self.unregister_publisher(self.master_stop_publisher)
|
||||||
self.unregister_publisher(self.restrictions_publisher)
|
self.unregister_publisher(self.restrictions_publisher)
|
||||||
|
|
||||||
for key, value in self.robot_info_subscribers.iteritems():
|
for subscriber in self.robot_info_subscribers.values():
|
||||||
self.unsubscribe(value)
|
self.unsubscribe(subscriber)
|
||||||
|
|
||||||
def unregister_node(self):
|
def unregister_node(self):
|
||||||
self.cancel_subscribers_and_publishers()
|
self.cancel_subscribers_and_publishers()
|
||||||
rospy.signal_shutdown("Closing safety master plugin")
|
# rospy.signal_shutdown("Closing safety master plugin")
|
||||||
|
|
||||||
def setup_get_master_stop_state_function(self, function):
|
def setup_get_master_stop_state_function(self, function):
|
||||||
self.get_master_stop_state = function
|
self.get_master_stop_state = function
|
||||||
|
Loading…
Reference in New Issue
Block a user