Public Member Functions | |
def | __init__ |
def | get_flipped_connections |
Accessors for Gateway Info. | |
def | update |
Monitoring. | |
Public Attributes | |
firewall | |
flip_all | |
flipped | |
unflip_all | |
Private Member Functions | |
def | _generate_flips |
Utility Methods. |
Flipped Interface.
The flipped interface is the set of rules (pubs/subs/services/actions) and rules controlling flips to other gateways.
Definition at line 26 of file flipped_interface.py.
def rocon_gateway.flipped_interface.FlippedInterface.__init__ | ( | self, | |
firewall, | |||
default_rule_blacklist, | |||
default_rules, | |||
all_targets | |||
) |
Initialises the flipped interface. @param firewall : flag to prevent this gateway from accepting flips @type Bool @param default_rule_blacklist : used when in flip all mode @type dictionary of gateway @param default_rules : static rules to flip on startup @type gateway_msgs.msg.RemoteRule[] @param all_targets : static flip all targets to flip to on startup @type string[]
Definition at line 32 of file flipped_interface.py.
def rocon_gateway.flipped_interface.FlippedInterface._generate_flips | ( | self, | |
type, | |||
name, | |||
node, | |||
gateways, | |||
unique_name | |||
) | [private] |
Utility Methods.
Checks if a local rule (obtained from master.getSystemState) is a suitable association with any of the rules or patterns. This can return multiple matches, since the same local rule properties can be multiply flipped to different remote gateways. Used in the update() call above that is run in the watcher thread. Note, don't need to lock here as the update() function takes care of it. @param type : rule type @type str : string constant from gateway_msgs.msg.Rule @param name : fully qualified topic, service or action name @type str @param node : ros node name (coming from master.getSystemState) @type str @param gateways : gateways that are available (registered on the hub) @type string @return all the flip rules that match this local rule @return list of RemoteRule objects updated with node names from self.watchlist
Definition at line 120 of file flipped_interface.py.
Accessors for Gateway Info.
Gets the flipped connections list for GatewayInfo consumption. @return the list of flip rules that are activated and have been flipped. @rtype RemoteRule[]
Definition at line 180 of file flipped_interface.py.
def rocon_gateway.flipped_interface.FlippedInterface.update | ( | self, | |
connections, | |||
gateways, | |||
unique_name | |||
) |
Monitoring.
Computes a new flipped interface and returns two dictionaries - removed and newly added flips so the watcher thread can take appropriate action (inform the remote gateways). This is run in the watcher thread (warning: take care - other additions come from ros service calls in different threads!) @param connections : list of all the system state connections from the local master @type connection type keyed dictionary of utils.Connection lists. @param gateways : gateways that are available (registered on the hub) @type string @return new_flips, old_flips @rtype pair of connection type keyed dictionary of gateway_msgs.msg.Rule lists.
Definition at line 59 of file flipped_interface.py.
Definition at line 44 of file flipped_interface.py.
Definition at line 44 of file flipped_interface.py.
Definition at line 44 of file flipped_interface.py.
Definition at line 44 of file flipped_interface.py.