Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
rocon_gateway.gateway.Gateway Class Reference

Thread. More...

List of all members.

Public Member Functions

def __init__
def disengage_hub
def is_connected
def ros_service_advertise
def ros_service_advertise_all
def ros_service_flip
def ros_service_flip_all
def ros_service_pull
def ros_service_pull_all
def ros_service_set_watcher_period
 Incoming commands from local system (ros service callbacks)
def ros_subscriber_force_update
def shutdown
def spin
def update_flipped_in_interface
def update_flipped_interface
 Update interface states (jobs assigned from watcher thread)
def update_network_information
def update_public_interface
def update_pulled_interface

Public Attributes

 flipped_interface
 hub_manager
 ip
 master
 network_interface_manager
 public_interface
 pulled_interface
 watcher_thread

Private Member Functions

def _add_flip_rules
def _check_remote_gateways
def _remove_flip_rules
def _ros_service_remote_checks

Private Attributes

 _param
 _publish_gateway_info
 _unique_name

Detailed Description

Thread.

  Used to synchronise with hubs.

Definition at line 32 of file src/rocon_gateway/gateway.py.


Constructor & Destructor Documentation

def rocon_gateway.gateway.Gateway.__init__ (   self,
  hub_manager,
  param,
  unique_name,
  publish_gateway_info_callback 
)
@param hub_manager : container for all the hubs this gateway connects to
@type hub_api.HubManmager

@param param : parameters set by ros_parameters.py
@type : dictionary of parameter key-value pairs

@param unique_name : gateway name (param['name']) with unique uuid hash appended

@param publish_gateway_info_callback : callback for publishing gateway info

Definition at line 38 of file src/rocon_gateway/gateway.py.


Member Function Documentation

def rocon_gateway.gateway.Gateway._add_flip_rules (   self,
  remotes 
) [private]
  Add given rules into watcher list

  :param remotes: remote rules
  :type remotes: gateway_msgs.RemoteRule[]
  :return: whether it is successful
  :rtypes: gateway_srvs.RemoteResponse

Definition at line 681 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway._check_remote_gateways (   self,
  remotes 
) [private]
  Check given gateways in remote rules are valid

  :param remotes: remote rules
  :type remotes: gateway_msgs.RemoteRule[]

  :return: whether it is valid, error message if it failes
  :rtypes: None or gateway_srvs.RemoteResponse

Definition at line 663 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway._remove_flip_rules (   self,
  remotes 
) [private]
  remove given rules into watcher list

  :param remotes: remote rules
  :type remotes: gateway_msgs.RemoteRule[]
  :return: whether it is successful
  :rtypes: gateway_srvs.RemoteResponse

Definition at line 709 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway._ros_service_remote_checks (   self,
  gateway 
) [private]
  Some simple checks when pulling or flipping to make sure that the remote gateway is visible. It
  does a strict check on the hash names first, then falls back to looking for weak matches on the
  human friendly name.

  @param gateway : remote gateway target name (can be hash name, basename or regex pattern)
  @type string
  @return pair of result type and message
  @rtype gateway_msgs.ErrorCodes.xxx, string

Definition at line 631 of file src/rocon_gateway/gateway.py.

  Disengage from the specified hub. Don't actually need to clean up connections
  here like we do in shutdown - that can be handled from the watcher thread itself.

  @param hub : the hub that will be deleted.

Definition at line 99 of file src/rocon_gateway/gateway.py.

  We often check if we're connected to any hubs often just to ensure we
  don't waste time processing if there is no-one listening.

  @return True if at least one hub is connected, False otherwise
  @rtype Bool

Definition at line 89 of file src/rocon_gateway/gateway.py.

  Puts/Removes a number of rules on the public interface watchlist.
  As local rules matching these rules become available/go away,
  the public interface is modified accordingly. A manual update is done
  at the end of the advertise call to quickly capture existing
  rules

  @param request
  @type gateway_srvs.AdvertiseRequest
  @return service response
  @rtgateway_srvs.srv.AdvertiseReponse

Definition at line 418 of file src/rocon_gateway/gateway.py.

  Toggles the advertise all mode. If advertising all, an additional
  blacklist parameter can be supplied which includes all the topics that
  will not be advertised/watched for. This blacklist is added to the
  default blacklist of the public interface

  @param request
  @type gateway_srvs.AdvertiseAllRequest
  @return service response
  @rtype gateway_srvs.AdvertiseAllReponse

Definition at line 458 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway.ros_service_flip (   self,
  request 
)
  Puts flip rules on a watchlist which (un)flips them when they
  become (un)available.

  @param request
  @type gateway_srvs.RemoteRequest
  @return service response
  @rtype gateway_srvs.RemoteResponse

Definition at line 491 of file src/rocon_gateway/gateway.py.

  Flips everything except a specified blacklist to a particular gateway,
  or if the cancel flag is set, clears all flips to that gateway.

  @param request
  @type gateway_srvs.RemoteAllRequest
  @return service response
  @rtype gateway_srvs.RemoteAllResponse

Definition at line 524 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway.ros_service_pull (   self,
  request 
)
  Puts a single rule on a watchlist and pulls it from a particular
  gateway when it becomes (un)available.

  @param request
  @type gateway_srvs.RemoteRequest
  @return service response
  @rtype gateway_srvs.RemoteResponse

Definition at line 554 of file src/rocon_gateway/gateway.py.

  Pull everything except a specified blacklist from a particular gateway,
  or if the cancel flag is set, clears all pulls from that gateway.

  @param request
  @type gateway_srvs.RemoteAllRequest
  @return service response
  @rtype gateway_srvs.RemoteAllResponse

Definition at line 601 of file src/rocon_gateway/gateway.py.

Incoming commands from local system (ros service callbacks)

  Configures the watcher period. This is useful to slow/speed up the
  watcher loop. Quite often you want it polling quickly early while
  configuring connections, but on long loops later when it does not have
  to do very much except look for shutdown.

  @param request
  @type gateway_srvs.SetWatcherPeriodRequest
  @return service response
  @rtgateway_srvs.srv.SetWatcherPeriodResponse

Definition at line 397 of file src/rocon_gateway/gateway.py.

  Trigger a watcher loop update

Definition at line 412 of file src/rocon_gateway/gateway.py.

Definition at line 80 of file src/rocon_gateway/gateway.py.

Definition at line 77 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway.update_flipped_in_interface (   self,
  registrations,
  remote_gateway_hub_index 
)
  Match the flipped in connections to supplied registrations using
  supplied registrations, flipping and unflipping as necessary.

  @param registrations : registrations (with status) to be processed
  @type list of (utils.Registration, str) where the str contains the status

Definition at line 298 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway.update_flipped_interface (   self,
  local_connection_index,
  remote_gateway_hub_index 
)

Update interface states (jobs assigned from watcher thread)

  Process the list of local connections and check against
  the current flip rules and patterns for changes. If a rule
  has become (un)available take appropriate action.

  @param local_connection_index : list of current local connections parsed from the master
  @type : dictionary of ConnectionType.xxx keyed lists of utils.Connections

  @param gateways : list of remote gateway string id's
  @type string

Definition at line 113 of file src/rocon_gateway/gateway.py.

  If we are running over a wired connection, then do nothing.
  If over the wireless, updated data transfer rate and signal strength
  for this gateway on the hub

Definition at line 384 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway.update_public_interface (   self,
  local_connection_index 
)
  Process the list of local connections and check against
  the current rules and patterns for changes. If a rule
  has become (un)available take appropriate action.

  @param local_connection_index : list of current local connections parsed from the master
  @type : { utils.ConnectionType.xxx : utils.Connection[] } dictionaries

Definition at line 268 of file src/rocon_gateway/gateway.py.

def rocon_gateway.gateway.Gateway.update_pulled_interface (   self,
  unused_connections,
  remote_gateway_hub_index 
)
  Process the list of local connections and check against
  the current pull rules and patterns for changes. If a rule
  has become (un)available take appropriate action.

  This is called by the watcher thread. The remote_gateway_hub_index
  is always a full dictionary of all remote gateway and hub key-value
  pairs - it is only included as an argument here to save
  processing doubly in the watcher thread.

  @param connections : list of current local connections parsed from the master
  @type : dictionary of ConnectionType.xxx keyed lists of utils.Connections

  @param remote_gateway_hub_index : key-value remote gateway name-hub list pairs
  @type dictionary of remote_gateway_name-list of hub_api.Hub objects key-value pairs

Definition at line 197 of file src/rocon_gateway/gateway.py.


Member Data Documentation

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.

Definition at line 48 of file src/rocon_gateway/gateway.py.


The documentation for this class was generated from the following file:


rocon_gateway
Author(s): Daniel Stonier , Jihoon Lee , Piyush Khandelwal
autogenerated on Sat Jun 8 2019 18:48:44