Using the LambdaTable .... 8=X

Using the LambdaTable!

What you need

Now what?

Setting up your account

Once you have an account, you'll need a few things in your .bashrc or .tcshrc file. Here's my config, I use bash.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/evl/cole/lib:.
export PATH=$PATH:/home/evl/cole/bin:.:/opt/mpich/ch-p4/bin
export TERM=linux
export DISPLAY=:0.0
The /opt/mpich... path is so you can use MPI. The term and display variables are also necessary for certain cluster operations.

Setting up Electro

Its always fun and handy to have your own source copy of electro to play with, especially if you want to develop a table app. For the most part there is nothing special here. Set up as directed at
the electro homepage. The following additional pointers are provided and assume that you are installing on a linux machine. (teiburu actually):

Getting the demo and maintenance table scripts

All the scripts can be downloaded from the evl svn server as follows.
svn co svn:// <destination>
Here's what you're getting:

Some essentials for working at teiburu

Running the Tracker

There are two scenarios for running the tracker: 1- everything is already set up and configured (whoopie) 2- somethings not quite right.

Testing the Tracker

Once the tracker is running, you can see its output on the table by executing the ui-test application. Switch back to teiburu and execute the ui-test.lua script with a
cd <table demo script folder>
electro-table ui-test.lua
Turn on the pucks and place them on the table. You should find they are followed by small spiral markers on the table surface. Button clicking will change the marker's state. This shows the raw output from the tracker and is an excellent tool for spotting strange tracking behavior that needs a fixin!

Running the Demo

Start up the tracker, switch back to teiburu and
cd <table demo script folder>
electro-table view.lua
It will take a while for the datasets to get transfered over to the display cluster nodes. Once you get an electro window on teiburu master, hit F2 then F1. F2 turns off rendering on the master, which is essential to improve performance. Otherwise the master will try to create an overview, which will require it to render the entire scenegraph, rather than a subset as like the slaves. F1 disables the console which pops up first thing when you run the viewer app. With the console up, keyboard commands will not be passed along as events to the application.

Once the application is running, the following commands are availeble:

Known Issues:

Calibrating the Tracker

There are three parts to calibrating the tracker:

Configuring Camera Settings

  1. Switch over to the windows master node (scroll lock, scroll lock, 2).
  2. Run the fly capture utility from the startmenu. (start->point grey research->PGR FlyCapture->FlyCap.exe) Select the camera and press the green arrow to start capturing.
  3. If necessary adjust the zoom and focus of the cameras using the physical controls on the cameras. They should only need adjusting if the cameras have been moved.
    • Using the PGRFlyCapture settings tool (the fly button), set shutter and gain to "auto".
    • If the image is dark, open the aperature slightly until there is sufficient light so that you can see the table.
    • Zoom in on a region that fully encloses the monitor, and leaves approximately a 3 inch border around the display area.
    • Set the zoom screw, locking the field of view in place.
    • Adjust the focus.
  4. Press the fly button to bring up the settings dialog. Use these settings to tweak your image. Currently the best settings are 15 FPS*, shutter speed of about 2ms, and gain of about 20 dB. Everything else should be auto. Test out the settings using one of the table devices. Your resultant image should be mostly dark, with bright spots where the LEDs are embedded in the device. Check your settings with a few devices.
  5. If you cannot get a good image, adjust the aperature setting on the camera. This may require refocusing if the aperature adjustment is large.
  6. Close PGRFlyCapture tool.
  7. Repeat for each camera on each node.
* NOTE: currently cameras cannot exceed 15 frames per second due to firewire bus speed limitations. In order to overcome this difficulty, a second firewire card must be installed in each machine. This should be possible, but there may be complications.

Calculate Inter-Camera Properties

These are the intrinsic camera coefficients, such as barrel distortion and center of projection. Barrel distortion is most significant for wide field of view cameras. The current lambdatable configuration reduces the impact of this distortion. Currently barrel distortion rectification is disabled. If necessary, in order to perform this step:

  1. Remove IR filter from camera.
  2. Get a checkerboard pattern.
  3. Run the PGR Fly Capture utility.
  4. Using the capture frame button, take a number of shots of the checkerboard at various angles and distances. Some should be quite extreme, the fuller the volume covered, the better. 12 or more photos should be taken.
  5. Store these images in a folder on the windows master (using the shared folder if necessary). Name them using a consecutive numerical pattern, such as "cam-1-001.bmp".
  6. Execute MatLab, and run the camera calibration program. (calib_gui) See the website for full documentation on performing the calibration once images are captured.
  7. Extract the coefficients from the calibration results and add them to the tracker config file using the tracker config lua API.

Calculate Intra-Camera Properties

These are the extrinsic camera properties, such as the transformation matrix that places each camera in the correct position relative to eachother. All cameras are positioned relative to the root camera, which is the master node's first camera as defined in the tracker config lua file. To determine these transformation matricies:

  1. Switch to the linux master node (teiburu).
  2. Execute the calibration interface script.
    cd <table demo script folder>
    electro-table cal-interface.lua
    This must be done before the next step.
  3. Switch over to the windows master node.
  4. Run the calib.bat shortcut on the desktop.
  5. Get a device, turn it on, and place it on the table. Move it around the table so that it rests for some time in the overlapping regions between cameras. When the tracker discovers the device in two overlapping camera fields of view, it will connect the two cameras and determine their relative positions. As this calculation is performed, an arrow will appear and become brighter. Once a confidence threshold is reached, a green arrow will appear, signalling that the two cameras have been succesfully connected.
  6. Repeat until all screens show a green check or the "root" label.
  7. Once all cameras have been connected to the root, a crosshair will appear. Place the device over the crosshair and dont move it. After a brief period, the cross hair will move. Place the device at the new location. Repeat for all control points. When the cursor follows the device, this calibration phase is complete.
  8. Navigate to the tracker binary folder by clicking on the desktop shortcut.
  9. Find the "calib.txt" file. Copy the emat and mapfrom data structures from the end of the file.
  10. Paste these data structures into the tracker lua config script, and use them in appropriate calls from the config lua API.

Making a New Device

First you gotto Build it!
Great Now what!?

Your First Table Application

There are three options for interfacing with the tracker.
  1. Use Electro with the luasocket API and parse the track update information directly from the UDP packets. An example of this approach is located in the ui-test.lua script presented above.
  2. Use Electro with the trackerapi lua library interface. This provides a much cleaner interface for connecting to the tracker and polling for updates.To install, follow the instructions listed in the trackerapi documentation for building and installing the lua module. An example similar to the ui-test.lua script is located under the electro folder in this package.
  3. Make your own table application with the trackerapi C library interface. Follow the instructions listed in the trackerapi documentation for building and installing the trackerapi C library. As for building the application... well thats up to you!

Modifying the tracker code

Oh no...
You want to do something that the tracker doesn't do eh?