Package master_sync_fkie :: Module sync_thread :: Class SyncThread
[frames] | no frames]

Class SyncThread

source code

object --+
         |
        SyncThread

A thread to synchronize the local ROS master with a remote master. While the synchronization only the topic of the remote ROS master will be registered by the local ROS master. The remote ROS master will be keep unchanged.

Instance Methods
 
__init__(self, name, uri, discoverer_name, monitoruri, timestamp, sync_on_demand=False)
Initialization method for the SyncThread.
source code
SyncMasterInfo
getSyncInfo(self)
Returns the synchronized publisher, subscriber and services.
source code
 
update(self, name, uri, discoverer_name, monitoruri, timestamp)
Sets a request to synchronize the local ROS master with this ROS master.
source code
 
setOwnMasterState(self, own_state, sync_on_demand=False)
Sets the state of the local ROS master state.
source code
 
stop(self)
Stops running thread.
source code

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

Class Variables
  MAX_UPDATE_DELAY = 5
Properties

Inherited from object: __class__

Method Details

__init__(self, name, uri, discoverer_name, monitoruri, timestamp, sync_on_demand=False)
(Constructor)

source code 

Initialization method for the SyncThread.

Parameters:
  • name (str) - the name of the ROS master synchronized with.
  • uri (str) - the URI of the ROS master synchronized with
  • discoverer_name (str) - the name of the discovery node running on ROS master synchronized with.
  • monitoruri (str) - The URI of RPC server of the discovery node to get the ROS master state by calling a method only once.
  • timestamp (float64) - The timestamp of the current state of the ROS master info.
  • sync_on_demand (bool) - Synchronize topics on demand
Overrides: object.__init__

update(self, name, uri, discoverer_name, monitoruri, timestamp)

source code 

Sets a request to synchronize the local ROS master with this ROS master.

Parameters:
  • name (str) - the name of the ROS master synchronized with.
  • uri (str) - the URI of the ROS master synchronized with
  • discoverer_name (str) - the name of the discovery node running on ROS master synchronized with.
  • monitoruri (str) - The URI of RPC server of the discovery node to get the ROS master state by calling a method only once.
  • timestamp (float64) - The timestamp of the current state of the ROS master info.

Note: If currently a synchronization is running this request will be ignored!

setOwnMasterState(self, own_state, sync_on_demand=False)

source code 

Sets the state of the local ROS master state. If this state is not None, the topics on demand will be synchronized.

Parameters:
  • own_state (master_discovery_fkie/MasterInfo) - the state of the local ROS master state
  • sync_on_demand (bool) - if True, sync only topic, which are also local exists (Default: False)