Welcome

Welcome to the RoboComm information page. This documentation is also included with the JavaBots distribution in RoboComm/docs/index.html .

Jump to the communication Package Index .

Introduction

RoboComm is aimed at simplifying asynchronous robot to robot communication. Although the system is primarily targeted for autonomous robot applications, there is no reason it cannot be employed in other applications as well.

The RoboComm API is implemented in JavaBotSim for robot communication in simulation. It is also implemented using TCP/IP sockets for communication between mobile robots. To aid rapid prototyping, the APIs are implemented so that a user process (usually a robot control system) cannot distinguish between the simulated and TCP/IP versions.

Sending and receiving messages is easy. Here is a code snippet illustrating how a string message can be sent to robot 2:

t.unicast(2, new StringMessage("hello!"));
The process on robot 2 receives the message using code like this:
new_message = r.getNextElement();
RoboComm is composed of a server application and client software. Client software is included in the EDU.gatech.cc.is.communication package.

Installation

The RoboComm application and the communication package are part of the JavaBots distribution. Please follow the installation instructions on the JavaBots webpage.

Once you have installed the software, you can test it using the included demonstration program. First, open a window and start the server:

java RoboComm.RoboComm
Open another window and start client number 1:
java RoboComm.Client 1
Open another window and start client number 2:
java RoboComm.Client 2
The text output in the server window should look like this:
RoboComm 0.91 (c)1998 Tucker Balch
RoboComm.run: started on pilot.cc.gatech.edu
Listening for connections on port 7462
RoboComm: client 1 registered
RoboComm: client 2 registered
There will also be several messages printed in the client windows.

The RoboComm server

At initialization time, each robot initiates a socket connection to the RoboComm server. When a robot sends a message the server looks at the destination information, then duplicates and forwards the message to each intended receiver.

To start the server, type:

java RoboComm.RoboComm
The server will start up and wait for robots to request a connection. It will print informative messages when important events occur, like when a new robot connects, or a connection is lost.

Usually, you can just start the server once and forget about it. Note: you do not need to start the server if you only need communication in simulation.

Sending and receiving messages

The methods for communication are defined by the Transceiver interface. The interface is implemented by the TransceiverHard class for real TCP/IP communication, and by the TransceiverSim class for communication in simulation.

To communicate, the first thing to do is to create a Transceiver object:

Transceiver t = new TransceiverHard("desoto.cc.gatech.edu", 2);
This will open a connection to the RoboComm server on desoto and register the process as robot number 2. A thread to monitor for incoming messages is automatically started up. All messages transmitted to robot 2 will be handled by the thread. As messages are received, they are inserted into a buffer and made available for processing by the higher level software. To access received messages, you need to ask for a ``receive channel'' as follows:
Enumeration messages_in = new t.getReceiveChannel();
You can allocate as many receive channels as you like; all incoming messages will be duplicated and inserted in a queue for each receive channel. You can test to see if any messages are queued by calling the hasMoreElements() method. In this example, we loop while messages are available and print them:
while (messages_in.hasMoreElements())
       System.out.print(messages.nextElement());
Sending messages is also fairly straightforward. RoboComm supports broadcast, unicast, and multicast transmissions. Here are examples of broadcast and unicast:
t.broadcast(message);
t.unicast(1,message);
A broadcast call will send a copy of message to all registered processes. Unicast just sends one message to the specified robot.

Look at Client.java for a complete example client program.

Sending your own message types

RoboComm takes advantage of Java's serialization capability to enable the transmission of ANY serializable Java object. Several useful message types are already defined (e.g. LongMessage for sending long integers), but you may need to create your own if you need to send other types of data. To do this, just extend the Message class. The Message class is really just a wrapper containing information about the message destination. Take a look at some of the other message types defined in the communication for inspiration.

Good luck!