Package master_sync_fkie :: Module master_sync :: Class Main
[frames] | no frames]

Class Main

source code

object --+
         |
        Main

Instance Methods
 
__init__(self)
Creates a new instance.
source code
 
obtain_masters(self)
This method use the service 'list_masters' of the master_discoverer to get the list of discovered ROS master.
source code
 
update_master(self, mastername, masteruri, timestamp, timestamp_local, discoverer_name, monitoruri, online)
Updates the timestamp of the given ROS master, or creates a new SyncThread to synchronize the local master with given ROS master.
source code
 
get_own_state(self, monitoruri)
Gets the master info from local master discovery and set it to all sync threads.
source code
 
remove_master(self, ros_master_name)
Removes the master with given name from the synchronization list.
source code
 
finish(self, msg='')
Removes all remote masters and unregister their topics and services.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  UPDATE_INTERVALL = 30
Instance Variables
  materuri
the ROS master URI of the local ROS master.
  sub_changes
`dict` with topics {name: rospy.Subscriber} publishes the changes of the discovered ROS masters.
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

Creates a new instance. Find the topic of the master_discovery node using master_discovery_fkie.interface_finder.get_changes_topic(). Also the parameter ~ignore_hosts will be analyzed to exclude hosts from sync.

Overrides: object.__init__

obtain_masters(self)

source code 

This method use the service 'list_masters' of the master_discoverer to get the list of discovered ROS master. Based on this list the SyncThread for synchronization will be created.

update_master(self, mastername, masteruri, timestamp, timestamp_local, discoverer_name, monitoruri, online)

source code 

Updates the timestamp of the given ROS master, or creates a new SyncThread to synchronize the local master with given ROS master.

Parameters:
  • mastername (str) - the name of the remote ROS master to update or synchronize.
  • masteruri (str) - the URI of the remote ROS master.
  • timestamp (float64) - the timestamp of the remote ROS master.
  • timestamp_local (float64) - the timestamp of the remote ROS master. (only local changes)
  • discoverer_name (str) - the name of the remote master_discoverer node
  • monitoruri (str) - the URI of the RPC interface of the remote master_discoverer node.
  • online (bool) - the current state on the master.

get_own_state(self, monitoruri)

source code 

Gets the master info from local master discovery and set it to all sync threads. This function is running in a thread!!!

remove_master(self, ros_master_name)

source code 

Removes the master with given name from the synchronization list.

Parameters:
  • ros_master_name (str) - the name of the ROS master to remove.