plugin.py
Go to the documentation of this file.
1 import rospy
2 
3 
5  _plugin_dictionary = {}
6  _connected_plugin_dictionary = {}
7 
8  def __init__(self):
9  if not rospy.has_param(rospy.get_name() + "/data"):
10  return
11 
12  plugin_list = rospy.get_param(rospy.get_name() + "/data")
13  for plugin in plugin_list:
14  if "key" in plugin:
15  self._plugin_dictionary[plugin["key"]] = plugin
16 
17  def on_connect(self, data_connection_id, key):
18  if key in self._plugin_dictionary:
19  plugin = self._plugin_dictionary.pop(key)
20  self._connected_plugin_dictionary[data_connection_id] = plugin
21  return plugin
22  else:
23  return None
24 
25  def on_disconnect(self, key):
26  if key in self._connected_plugin_dictionary:
27  plugin = self._connected_plugin_dictionary.pop(key)
28  self._plugin_dictionary[plugin["key"]] = plugin
dictionary _connected_plugin_dictionary
Definition: plugin.py:6
dictionary _plugin_dictionary
Definition: plugin.py:5
def on_connect(self, data_connection_id, key)
Definition: plugin.py:17
def on_disconnect(self, key)
Definition: plugin.py:25


skyway
Author(s): Toshiya Nakakura
autogenerated on Sat Apr 15 2023 02:08:21