VRCO trackd tracker daemon
calibration extension trackdCalibrator

Volodymyr Kindratenko
Visualization and Virtual Environments group
National Center for Supercomputing Applications
University of Illinois at Urbana-Champaign

[Tracker Calibration Option in VRCO trackdServer]
[Read Software Copyright][Download theSource Code] [Read README]
[back to ElectromagneticTracker Calibration Page]


Tracker Calibration Option in VRCO trackd

VRCO implemented an option to attach athird party tracker calibration executable code to the trackd's server in the form ofdynamically loaded objects.  In order to use this option, the following needs to bedone:

  1. Include the following line in the trackd configuration file to attach the calibration library
    :
    DeviceOption device calib libcalib.so param0 param1 param2 ...

    where device is the name of the tracking device as defined in the beginning of the configuration file, libcalib.so is the file name of the library, param{0-} are library-specific parameters such as the name of the file containing calibration table, etc.

  2. Build a calibration library libcalib.so that implements the following 3 functions:

    extern "C" LINKAGE void* calib_init(const char* const* params, int numParams)
    This function will be called only once when trackd is started and it is responsible for the initialization of your calibration routine.  The params is an array of pointers to character. If you write "DeviceOption devName calibration your.so your_data 1 radians 25 ", *params points to "your_data", *(params+1) points to "1", *(params+2) points to "radians" and *(params+3) points to "25".  numParams is the number of parameters, it is 4 in this case.  The return value is the pointer to the application-specific data structure casted to void *.  If for some reasons the initialization cannot be completed, return NULL so trackd will not call calib_evaluate.

    extern "C" LINKAGE void calib_evaluate(void *data, float *trackerData)
    The purpose of calib_evaluate it to calibrate trackerData and return it back to the trackd. This function will be called every time trackd needs to update trackers data. Here data is the data structure returned by calib_init and trackerData is an array of 6 float valuables, x, y, z, azim, elev, and roll. The coordinates and angles are in the tracker's coordinate system (the angles are in degrees) - keep this in mind when building the calibration table for calib_init.

    extern "C" LINKAGE void calib_exit(void *data)
    This function will be called when trackd is exiting and it must deallocate the resources allocated in calib_init.

    Makefile may look like this:

    PROJECT = sampleCalib
    LIBS =
    linux:
        gcc -fPIC -c $(PROJECT).c
        gcc -shared -Wl, -o $(PROJECT).so $(PROJECT).o $(LIBS)

    irix:
        CC -c $(PROJECT).c
        CC -shared -o $(PROJECT).so $(PROJECT).o $(LIBS)

  3. Copy libcalib.so and all the required components (calibration table file, etc.) to the trackd's default directory.


trackdCalibrator software description

trackdCalibrator is an electromagnetic trackerscalibration routine for VRCO trackdtracker daemon that uses trackd server option described aboveand is build on top of NCSA'slibTrCalibr 2.00.  It allows to use both high-order polynomial fit andinterpolation calibration techniques implemented in libTrCalibr 2.0. The following needsbe done in order to use the software:

  1. Download the software.  The archive includes the source code and the binaries compiled for SGI IRIX 6.5.  A binary of Win32 version is also available.   If you need to recompile the code, you will also need to download NCSA's libTrCalibr 2.00.  Don't forget to read the software Copyright before downloading.  Copy trackdCalibrator.so (trackdCalibrator.dll and TrCalibrLib.dll for Win98) into trackd/bin directory.  Set LD_LIBRARYN32_PATH environment variable to point to this directory (UNIX only).

  2. Build an appropriate calibration table in the format used in libTrCalibr 2.0.  You may want to use datacollect utility available in the libTrCalibr 2.0 distribution.  Keep in mind that the coordinates/angles in the calibration table should be in the tracker's coordinate system rather than transformed into the application's coordinates.  Copy the file containing the calibration table you just built into the trackd/etc directory.

  3. Include the following line in the trackdserver configuration file:

    DeviceOption device calib trackdCalibrator.so algorithm param1 calibfile param2

    where
    --  device is the name of the tracking device you want to be calibrated; the name should be already defined in your trackd configuration file
    --  algorithm is the name of the calibration technique you want to use: "FIT" for high-order polynomial fit or "ITP" for interpolation
    --  param1 is the algorithm-specific parameter which is the polynomilal order for FIT ranging from 2 to 7 or the weight type for ITP: 1 - linear, 2 - squared, or 3 - log
    --  calibfle is the name (including full path) of the file containing your calibration table
    --  param2 identifies the measuring units for angles used in the calibration table: RADIAND or DEGREES

    examples:
    1.  DeviceOption CAVEfob calib trackdCalibrator.so FIT 4 /usr/local/trackd/etc/caltable1.dat DEGREES
    --  device CAVEfob will be calibrated using 4-th order polynomial fit based on the caltable1.dat calibration table where angles are measured in degrees
    2.  DeviceOption CAVEfob calib trackdCalibrator.so ITP 3 /local/trackd/etc/caltable2.dat RADIANS
    --  device CAVEfob will be calibrated using interpolation with log weights based on the caltable2.dat calibration table where angles are measured in radians

  4. Start trackd server and watch for the messages from trackdCalibrator.   If the routine is successfully initialized, it prints out "Calibration filter is attached...".  Otherwise, it prints out a warning message explaining the reason why the initialization was not possible.


The document was created by VolodymyrKindratenko
Last modified: Friday, February 18, 2000 03:43:02 PM