CSC714 Real-Time Computer Systems

Group 4 Project Readme/How-to

Remote Controller and WebCam for Lego Mindstorm RCX

Group Member

Haihui Huang(hhuang3@eos.ncsu.edu)

Xuejun Sun(xsun4@unity.ncsu.edu)

The project is for  LegOS RCX Remote Control and WebCam via LNPD.
It consists of two parts: one for host side, another for RCX side.

Hardware Requirements:
1) Lego Mindstorm RCX and IR tower;
2) Logitech QuickCam Pro 3000 or compatible camera;
3) One PC running Linux;
4) One Macintosh running Mac OS X 10.1 above or one PC running Windows 2000/Linux.

Software Requirements:
1) Linux machine should have cross-compiling tools installed for LegOS;
2) Linux machine connected with IR tower also needs to have LNPD installed;
3) Machine with QuickCam Pro compatible camera connected needs to have driver installed(You can get QuickCam Pro driver for Mac OS X from http://webcam-osx.sourceforge.net/);
4) All machines should have Java VM version 1.3.1 above installed.
5) For Apple machine, you can also download QuickTime for Java SDK from http://developer.apple.com/sdk/index.html#QTJava.

Get RCX Running:

1) download and install legos-0.2.6 according to LegOS 0.2.6 page

2) download, compile and install LNPD according to http://legos.sourceforge.net/files/linux/LNPD/

3) put the source code, rcx6.c, remote_common.h, switch_case_motor_control.h in demo directory

4) modify Makefile in demo by add rcx6.lx in PROGRAMS list.
   For convenience, a Makefile is enclosed in this delivery, but don't overwrite your original Makefile if want to keep it.

5) under demo directory execute the command to make the files
    cd .. ; make ; cd demo

6) once legos is downloaded to RCX, download rcx6.lx to your RCX, e.g.,
    dll -p1 rcx6.lx

7) Connect RCX to the appropriate motors on rover.
Turn on RCX and start the program while host end lnpd and control program is in running. Command can be entered via array key for up, down speed, left, right turn, or s or any other key for stop.


Get Java RCX Controller Application Running:

1) Start LNPD on one host running linux with IR tower connected by executing the following command in the directory where lnpd resides:
%./lnpd -d -n -l1.log
For detail command arguments, type "./lnpd --help".

2) Return to the parent directory and start RcxCtrl Java application by type
"java RcxCtrl.RcxCtrlGUI", change connection settings and click connect button to connect to LNPD.

3) Connect a Legitech QuickCam Pro 3000 camera( or compatiable webcams) to a Macintosh or PC.  Change to "SGCapture" directory and start by
"java SGCapture ip_address" and start recording and broadcast.
The ip_address is the IP address of the host which will run the RcxCtrlGUI java application.
Note: Make sure that you saved all your files under Mac OS X by typing "sync" command in the terminal before running the above command. The free device driver for QuickCam Pro Camera will cause the OS to panic after running for a while.

4) You will get the webcam image sent from the host displayed in the Java application. You can also use arrow key to control the RCX to move around. You will also notice that the image will change when you control the RCX to move around.

If you have any questions, feel free to send me email at hhuang3@eos.ncsu.edu.