Testing your setup, part 2.

First, test the connection from your computer to your robot, via the command server. This is testing the right half of the diagram on the "howto" page.

There are several parts to this test. First you need to download a control program onto the robot.

  1. Jacky wrote a sample program, which you can download here: sample-robot.tar.gz

  2. Unpack this file.

  3. Edit the Makefile and set the constant BRICKOS_ROOT to be the root directory where brickos.new got installed. Note that there are two included files: Makefile.common and Makefile.user -- DON'T TOUCH THOSE!!!

  4. Run make. The output will be sample_robot.lx, which is the executable program that gets downloaded to the RCX.

  5. Download the executable onto the RCX. Go into the brickos/util directory and run:
    	bash# dll ../../../eleague/jacky/sample-robot/sample-robot.lx
    
Second, you need to have a program which acts as the team process, sending commands to the robot to tell it what to do at any given time. For this test, Jacky wrote a human controller that lets you use the arrow keys on your computer to control the RCX directly.

  1. Jacky wrote a human controller, which you can download here: human-player.tar.gz

  2. Unpack this file.

  3. Run make. The output will be an executable called simplePlayer.
Third, start up the command server.
  1. Set the RCXTTY environment variable to point to the port where the communication tower is plugged in:
    	bash# export RCXTTY=/dev/usb/lego0
    
    if you are using the USB tower, or
    	bash# export RCXTTY=/dev/ttyS0
    
    if you're using serial port 1

  2. Go to the directory where you've installed the command server and run:
    	bash# command_server --port 6364 --robot blue1=0
    
    Notes:
    * You will have to substitute 6364 for whatever port you are using.
    * You will have to include the name and number for each robot you want to talk to, to establish the mapping from names (string format) to id numbers (0..7) which are used in the 8-byte command message (one byte per robot). In this case, there will only be one robot.

Fourth, turn on your robot and put it within sight of the IR transmitter.

Fifth, start up the human player.

  1. Go to the directory where you created the human player (the simplePlayer executable).

  2. Run it as follows:
    	bash# simplePlayer --port 6364 --robot blue1
    
    Press the arrow keys to control the robot. The up-arrow drives both motors forward. The down-arrow drives both motors backwards. The right arrow key turns only the right motor. The left arrow key turns only the left motor. Type "q" to quit the program.

back to eleague howto page