Public Member Functions | |
List< Object > | getPublishedTopics (GraphName caller, GraphName subgraph) |
List< Object > | getSystemState () |
List< List< String > > | getTopicTypes (GraphName calledId) |
URI | lookupNode (GraphName nodeName) |
URI | lookupService (GraphName serviceName) |
MasterServer (BindAddress bindAddress, AdvertiseAddress advertiseAddress) | |
void | onNodeReplacement (NodeRegistrationInfo nodeInfo) |
List< URI > | registerPublisher (GraphName nodeName, URI nodeSlaveUri, GraphName topicName, String topicMessageType) |
void | registerService (GraphName nodeName, URI nodeSlaveUri, GraphName serviceName, URI serviceUri) |
List< URI > | registerSubscriber (GraphName nodeName, URI nodeSlaveUri, GraphName topicName, String topicMessageType) |
void | start () |
boolean | unregisterPublisher (GraphName nodeName, GraphName topicName) |
boolean | unregisterService (GraphName nodeName, GraphName serviceName, URI serviceUri) |
boolean | unregisterSubscriber (GraphName nodeName, GraphName topicName) |
Static Public Attributes | |
static final int | SYSTEM_STATE_PUBLISHERS = 0 |
static final int | SYSTEM_STATE_SERVICES = 2 |
static final int | SYSTEM_STATE_SUBSCRIBERS = 1 |
Protected Member Functions | |
void | contactSubscriberForPublisherUpdate (URI subscriberSlaveUri, GraphName topicName, List< URI > publisherUris) |
Private Member Functions | |
List< Object > | getSystemStatePublishers (Collection< TopicRegistrationInfo > topics) |
List< Object > | getSystemStateServices () |
List< Object > | getSystemStateSubscribers (Collection< TopicRegistrationInfo > topics) |
void | publisherUpdate (TopicRegistrationInfo topicInfo, List< URI > subscriberSlaveUris) |
Private Attributes | |
final MasterRegistrationManagerImpl | masterRegistrationManager |
Static Private Attributes | |
static final boolean | DEBUG = false |
static final Log | log = LogFactory.getLog(MasterServer.class) |
static final GraphName | MASTER_NODE_NAME = GraphName.of("/master") |
The MasterServer provides naming and registration services to the rest of the Nodes in the ROS system. It tracks Publishers and Subscribers to TopicSystemStates as well as ServiceServers. The role of the MasterServer is to enable individual ROS Nodes to locate one another. Once these Nodes have located each other they communicate with each other peer-to-peer.
Definition at line 56 of file MasterServer.java.
org.ros.internal.node.server.master.MasterServer.MasterServer | ( | BindAddress | bindAddress, |
AdvertiseAddress | advertiseAddress | ||
) | [inline] |
Definition at line 87 of file MasterServer.java.
void org.ros.internal.node.server.master.MasterServer.contactSubscriberForPublisherUpdate | ( | URI | subscriberSlaveUri, |
GraphName | topicName, | ||
List< URI > | publisherUris | ||
) | [inline, protected] |
Contact a subscriber and send it a publisher update.
subscriberSlaveUri | the slave URI of the subscriber to contact |
topicName | the name of the topic whose publisher URIs are being updated |
publisherUris | the new list of publisher URIs to be sent to the subscriber |
Definition at line 266 of file MasterServer.java.
List<Object> org.ros.internal.node.server.master.MasterServer.getPublishedTopics | ( | GraphName | caller, |
GraphName | subgraph | ||
) | [inline] |
Get a list of all topics published for the give subgraph.
caller | name of the caller |
subgraph | subgraph containing the requested TopicSystemStates, relative to caller |
Definition at line 462 of file MasterServer.java.
List<Object> org.ros.internal.node.server.master.MasterServer.getSystemState | ( | ) | [inline] |
Get the state of the ROS graph.
This includes information about publishers, subscribers, and services.
Definition at line 339 of file MasterServer.java.
List<Object> org.ros.internal.node.server.master.MasterServer.getSystemStatePublishers | ( | Collection< TopicRegistrationInfo > | topics | ) | [inline, private] |
Get the system state for Publishers.
topics | all topics known by the master |
Definition at line 361 of file MasterServer.java.
List<Object> org.ros.internal.node.server.master.MasterServer.getSystemStateServices | ( | ) | [inline, private] |
Get the system state for ServiceServers.
Definition at line 416 of file MasterServer.java.
List<Object> org.ros.internal.node.server.master.MasterServer.getSystemStateSubscribers | ( | Collection< TopicRegistrationInfo > | topics | ) | [inline, private] |
Get the system state for Subscribers.
topics | all topics known by the master |
Definition at line 390 of file MasterServer.java.
List<List<String> > org.ros.internal.node.server.master.MasterServer.getTopicTypes | ( | GraphName | calledId | ) | [inline] |
Get a List of all TopicSystemState message types.
calledId | the Node name of the caller |
Definition at line 321 of file MasterServer.java.
URI org.ros.internal.node.server.master.MasterServer.lookupNode | ( | GraphName | nodeName | ) | [inline] |
Returns a NodeIdentifier for the Node with the given name. This API is for looking information about Publishers and Subscribers. Use lookupService(GraphName) instead to lookup ROS-RPC URIs for ServiceServers.
nodeName | name of Node to lookup |
null
Definition at line 302 of file MasterServer.java.
URI org.ros.internal.node.server.master.MasterServer.lookupService | ( | GraphName | serviceName | ) | [inline] |
Lookup the provider of a particular service.
serviceName | name of service |
null
Definition at line 438 of file MasterServer.java.
void org.ros.internal.node.server.master.MasterServer.onNodeReplacement | ( | NodeRegistrationInfo | nodeInfo | ) | [inline] |
A node is being replaced.
The information object is about to be trashed, so it should not be hung onto.
nodeInfo | the node being replaced |
Implements org.ros.internal.node.server.master.MasterRegistrationListener.
Definition at line 476 of file MasterServer.java.
void org.ros.internal.node.server.master.MasterServer.publisherUpdate | ( | TopicRegistrationInfo | topicInfo, |
List< URI > | subscriberSlaveUris | ||
) | [inline, private] |
Something has happened to the publishers for a topic. Tell every subscriber about the current set of publishers.
topicInfo | the topic information for the update |
subscriberSlaveUris | IRIs for all subscribers |
Definition at line 240 of file MasterServer.java.
List<URI> org.ros.internal.node.server.master.MasterServer.registerPublisher | ( | GraphName | nodeName, |
URI | nodeSlaveUri, | ||
GraphName | topicName, | ||
String | topicMessageType | ||
) | [inline] |
Register the caller as a Publisher of the specified topic.
nodeName | the GraphName of the Node offering the service |
nodeSlaveUri | the URI of the Node's SlaveServer |
topicName | the GraphName of the subscribed TopicParticipant |
topicMessageType | the message type of the topic |
Definition at line 207 of file MasterServer.java.
void org.ros.internal.node.server.master.MasterServer.registerService | ( | GraphName | nodeName, |
URI | nodeSlaveUri, | ||
GraphName | serviceName, | ||
URI | serviceUri | ||
) | [inline] |
Register a service with the master.
nodeName | the GraphName of the Node offering the service |
nodeSlaveUri | the URI of the Node's SlaveServer |
serviceName | the GraphName of the service |
serviceUri | the URI of the service |
Definition at line 114 of file MasterServer.java.
List<URI> org.ros.internal.node.server.master.MasterServer.registerSubscriber | ( | GraphName | nodeName, |
URI | nodeSlaveUri, | ||
GraphName | topicName, | ||
String | topicMessageType | ||
) | [inline] |
Subscribe the caller to the specified topic. In addition to receiving a list of current publishers, the subscriber will also receive notifications of new publishers via the publisherUpdate API.
nodeName | the GraphName of the Node offering the service |
nodeSlaveUri | the URI of the Node's SlaveServer |
topicName | the GraphName of the subscribed TopicParticipant |
topicMessageType | the message type of the topic |
Definition at line 154 of file MasterServer.java.
void org.ros.internal.node.server.master.MasterServer.start | ( | ) | [inline] |
Start the MasterServer.
Definition at line 95 of file MasterServer.java.
boolean org.ros.internal.node.server.master.MasterServer.unregisterPublisher | ( | GraphName | nodeName, |
GraphName | topicName | ||
) | [inline] |
Unregister a Publisher.
nodeName | the GraphName of the Node offering the service |
topicName | the GraphName of the subscribed TopicParticipant |
true
Definition at line 281 of file MasterServer.java.
boolean org.ros.internal.node.server.master.MasterServer.unregisterService | ( | GraphName | nodeName, |
GraphName | serviceName, | ||
URI | serviceUri | ||
) | [inline] |
boolean org.ros.internal.node.server.master.MasterServer.unregisterSubscriber | ( | GraphName | nodeName, |
GraphName | topicName | ||
) | [inline] |
Unregister a Subscriber.
nodeName | the GraphName of the Node offering the service |
topicName | the GraphName of the subscribed TopicParticipant |
true
Definition at line 183 of file MasterServer.java.
final boolean org.ros.internal.node.server.master.MasterServer.DEBUG = false [static, private] |
Reimplemented from org.ros.internal.node.server.XmlRpcServer.
Definition at line 58 of file MasterServer.java.
final Log org.ros.internal.node.server.master.MasterServer.log = LogFactory.getLog(MasterServer.class) [static, private] |
Reimplemented from org.ros.internal.node.server.XmlRpcServer.
Definition at line 59 of file MasterServer.java.
final GraphName org.ros.internal.node.server.master.MasterServer.MASTER_NODE_NAME = GraphName.of("/master") [static, private] |
The node name (i.e. the callerId XML-RPC field) used when the MasterServer contacts a SlaveServer.
Definition at line 80 of file MasterServer.java.
final MasterRegistrationManagerImpl org.ros.internal.node.server.master.MasterServer.masterRegistrationManager [private] |
The manager for handling master registration information.
Definition at line 85 of file MasterServer.java.
final int org.ros.internal.node.server.master.MasterServer.SYSTEM_STATE_PUBLISHERS = 0 [static] |
Position in the getSystemState() for publisher information.
Definition at line 64 of file MasterServer.java.
final int org.ros.internal.node.server.master.MasterServer.SYSTEM_STATE_SERVICES = 2 [static] |
Position in the getSystemState() for service information.
Definition at line 74 of file MasterServer.java.
final int org.ros.internal.node.server.master.MasterServer.SYSTEM_STATE_SUBSCRIBERS = 1 [static] |
Position in the getSystemState() for subscriber information.
Definition at line 69 of file MasterServer.java.