RCX using Wireless Radio

Wireless Radio Communication with RCX
We use the low-cost hardware LEGO Mindstorms RCX robotics platform for simple prototyping in research and student projects. The communication capabilities of the RCX brick are limited to the IR-communication, which requires direct or at least reflected visibility, it is limited to short distances, and it has limited reliability mainly due to the irregularities in IR-light reflections. In addition, multiple modules communicating at the same time result in collisions, and the communication is only half-duplex (it is bi-directional, but sending in one direction at a time).

In order to overcome at least some of these limitations, we were investigating options for wireless radio-based communication. There are four basic options for setting up such a radio communication link known to us:

  • Analog radio: using one of the variety of analog transmission systems, while building a specialized circuitry to translate the digital signals to analog and vice versa. This type of transmission (in addition to need for extra AD/DA circuitry for translating the signal) suffers from noise. The user would have to implement handshaking and error-correcting protocols to achieve a reliable communication.
  • Radio modem: using one of the available radio modems that translate the serial portcommunication to radio signal and back. An example of such a module would be Parallax 433 MHz RF Transceiver Package, which is a high-cost solution requiring two separate modules on both sides, and allows connecting for only a single pair of communicating devices. In addition, it is vulnerable to the interference with other devices that use the same frequencies.
  • Wifi: wireless Ethernet, (IEEE 802.11*) devices connect either peer-to-peer, or using a shared access point. An example of a robotic platform capable of WIFI communication was the SONY Aibo robotic platform. The advantages are the standardized and well-supported communication protocol, possibility for multiple units coexisting in the same space, while all the communication conflicts are handled by the lower levels of the communication protocols, transparent to the user. Another advantage is the possibility to connect the local WIFI network to the Internet, and thus expose the robots directly on the public network. Finally, WIFI networks have high throughput and can be used even in such applications as video transmission.
  • Finally, Bluetooth communication protocol provides somewhat lower-cost alternative while keeping most of the advantages of WIFI: standardized protocol with automatic prevention of collisions and error correction, multiple communicating peers, secure authentication if needed. The communication speed is typically lower, but there is an advantage of performing as a direct serial communication link once a connection between the two communicating peers is established, and virtual serial port is opened. Bluetooth platform is typical for many embedded devices, which can perform in slave-mode and can be connected by master (for example a PC). In that way, the PC can take the role of a hub and connects to multiple hosts at the same time, possibly coordinating the communication.

Communication using Wireless camera
The student experiment consisted of an autonomous rescue mobile robot moving in an arena. Its task was to discover victims as detected by a color camera mounted on the robot. The camera is a network-type, i.e. it is running an on-board web server, and makes the video available to be viewed in a web browser, where it is shown by a proprietary ActiveX plug-in. The frame-rate of the update is up to 30 frames per second; however, the only way to obtain the frames, according to the producer, is to grab the frames from the web browser screen. We have therefore developed a C++ application (and indeed also Java API using JNI), which initializes the communication (i.e. starts the web-browser automatically), and grabs the images from the browser window (even if it is running in the background). This is achieved using the PrintWindow() Windows API, which prints the contents of the window into a buffer provided., The grabbed image is processed further using the Intel's OpenCV image processing library. We detect the colored victims using our proprietary algorithm for simple color segmentation of the image. To consider an alternative solution: the camera software provides also an option of static image, which can be downloaded from the camera using ftp-protocol.

More importantly for this article, the camera is designed to be used as a security camera and thus it has a single-bit digital output and a single-bit digital input, for connecting the alarm siren, and motion detection sensor respectively. These bits can be triggered and determined by logging to the camera using telnet protocol and issuing service commands from the console. Connecting both of these contacts to a single RCX sensor port yields a setup, where the RCX can trigger the digital input of the camera by changing the sensor port configuration between active and passive sensor mode (i.e. whether it is powered or not), and triggering of the camera's digital output can be detected by reading the value from the RCX sensor port. In this way, we have connected the program running on the RCX to the same WIFI network where the network of the robot communicates.

There is, however, one displeasing limitation of this setup: the digital input and output are electrically separated from the wireless camera, and the switching on and off is performed using a slow relay, which cannot switch more than a very few times a second.