Information

Documentation

Get OpenRDK at SourceForge.net. Fast, secure and Free Open Source software downloads

edit SideBar

Remote RConsole

In this Section, we will connect two OpenRDK processes (agents). This technique can be used for many purposes, but one of the most common is to connect a RConsole, e.g., on your laptop, to a remote RAgent, e.g., running on the robot.

This example we will run both agents on the same machine. First of all, we need two configuration files, one for each agent. For the RAgent, we use the ra-stringWriter.config from the previous section, while for RConsole, we will use rq.config.

The "yellow pages" file

In OpenRDK, each agent has a name that is unique in the domain. The agent name is read from the configuration file. For example, if you open ra-stringWriter.config, in one of the first line you can read the value of the string agentName (i.e., ra01).

In order to find each other, OpenRDK agents use a file with network address information for each name. This file is named yp.config (yp = yellow pages). Every agents, during startup, load this configuration file and use its entries to locate name in the network. If you open the yp.config of the example directory, you can see three agents (ra01, rqra01 and rconsole), each of which has its own address and port for TCP communications and UDP communications.

In the next section, we will run two agents: one uses the ra-stringWriter.config file, while the other uses rq.config. If you open these files, you can see that their names are, respectively, ra01 and rconsole. These names are listed in the yp.config file, together with address information. Both agents use the same yp.config file for consistency.

In case you want to have the two agents on two different machines, you should copy the yp.config file on both machines, so that the two agents refer to each other in a consistent way.

In future versions of OpenRDK, dynamic yellow pages will be implemented, but so far you have to write addresses for all agents in the yellow pages file (and, if you are running the agents on different machines, you have to provide the same yp.config file in each of them).

Running the two processes

Now we will run two agents, one with the ra-stringWriter.config that is called ra01 and the other, running rq.config that is called rconsole. In the yellow pages file there is the address of both of them.

Open two consoles, and run the RAgent in the first:

  $ ragent2 -c ra-stringWriter.config

and the RConsole in the second:

  $ rconsoleqt -c rq.config

Now you have the two processes running on your PC. The RConsole GUI is empty, you can connect to the "remote" RAgent by choosing "Connect to a remote repository" entry of the "Network" menu. In the text box with the name of the agent to connect to, write "ra01". A property tree viewer will be open after the connection and thus you can see the property tree of the "remote" agent. Feel free to look at its properties and change their values, and see the effect on the RAgent messages.

© 2004-2009 RoCoCo Laboratory Powered by PmWiki
Edit - History - Printable View - Recent Changes - Search
Page last modified on October 27, 2009, at 12:26 PM