Multi-robot communication

created 16/05/02 - updates 21/05/02 | 03/06/02

There is one special point that the RCX-software designers should add to a further firmware-release. This is to allow a reliable network-protocol for multi-robot applications. Networking exists for the open-source replacement firmware legOS, but not for lejOS.

We have already dealt with broadcasting, which means to send information to several RCXs avoiding any computer reaction to possible RCX-replies. Broadcasting is a one-way data-transfer, with no or only limited possibility to check whether the correct message has actually been received. We now propose a bi-directional data-transmission.

This is not evident at all. So there must be some explanations and restrictions. 

First of all the case we are studying here is the communication between the COMPUTER and one single RCX-n, all the others being active. As we will see later there are some side-effects which affect all the RCXs involved. But we want the computer and the specifyied RCX to exchange data without disturbing the work of the other RCXs.

For example, suppose there are two RCX playing soccer and the computer surveying the match via camera. The computer should download positioning data to the RCXs and they should upload some sensor-readings.

If you try this through normal infrared-communication, you'll get plenty of error-messages and garbage-data. The major problem comes from the master-slave communication system as we already explained earlier.

To solve the challenge, the principle idea is to sacrifice two global variables (we propose 21, 22 - remember that in Robolab variables 23-29 are used during datalogging and variable 31 during some of the remote-fill operations:

This sounds very difficult and in fact it is, but here some illustrations:

LASM-code

delt 0

task 0
set 0,21,2,0
Label1002:
chkl 2,1,3,0,21,Label1003
ping
jmpl Label1002
Label1003:

set 33,16,2,3
set 33,17,2,0
set 33,15,2,16
uart 15,1
wait 2,10

---->continue

set 33,0,2,5
set 33,1,2,0
set 33,2,2,22
set 33,3,2,2
setv 31,9,0
andv 31,2,255
set 33,4,0,31
setv 31,9,0
divv 31,2,256
set 33,5,0,31
uart 0,6
wait 2,10

endt




plays 5

The request-opcode 0x14 (SETVAR) has four parameters: 

The upload-opcode 0x05 (SET) to be controlled by the computer-software has 5 parameters:

Note the opcode-header 55 FF 00 and the alternation of code and complement, finally the checksum and its complement.

Download all the related files. 

21/5/2002 small bug fixed in Comm_Tower_RCX_Tower.vi

3/6/2002 

IMPORTANT NOTE: 

The Robolab 2.5 original fill remote container.vi only works for positive numbers. Negative numbers are NOT transmitted correctly. We added a custom bug-free version which unfortunately uses another variable (local 32), and an auto-incrementing label, needed because of the jump.  Here an extract:


RetourMain Page