Manual Creation of a Look-Up Table (LUT)

From Lofaro Lab Wiki
Jump to: navigation, search

This tutorial will walk you through the manual creation of a Look-Up Table (LUT) for the area you plan to localize in through the use of POLARIS. If you are interested in how the LUT is used by the localization module, please see the following page on Localizing with AprilTags.

Obtaining the Localization Module

The localization module of POLARIS can be obtained by cloning the POLARIS repository on the Lofaro Labs github. If you do not yet have the POLARIS repo, please execute the following commands in your Ubuntu 12.04 environment:

First obtain the following dependencies for AprilTags:

   sudo apt-get install subversion cmake libopencv-dev libeigen3-dev libv4l-dev

Now obtain the POLARIS repo and make AprilTags:

   git clone
   cd mkLocalization
   cd apriltags

Manually editing the LUT

cd into POLARIS/mkLocalization/apriltags/example

Use your favorite text editor to edit LUT.txt For example:

   vi LUT.txt

For each line of the file you will see that there are four comma-separated values. Each line of the file corresponds to a particular AprilTag. There are 587 lines in the file, corresponding to tags [0-586] of the 36h11 AprilTags family. If a particular tag is viewed, for example, the tag with ID 0, the localization program will look at line zero (the first available line) of the LUT. Similarly, if the tag with ID 26 is viewed, the localization program will look at line 26 (the 27th available line) of the LUT. On the particular line corresponding to the viewed tag's ID, there are x,y,THETA,z values. These values correspond to the tag's position with respect to the global frame origin of the area we want POLARIS to localize in. If the tag that we view has an ID of 110, is 5 meters in the positive direction of the x-axis with respect to the origin, 10 meters in the negative direction of the y-axis with respect to the origin, oriented 10 degrees off from the origin's north (positive direction of y-axis is north), and the tag is two floors above the origin, then the LUT will have the following values at line 110:


Therefore, if you are placing tags to localize in an area using POLARIS, and you want to alter the LUT so that you are properly obtaining localization data with respect to the area's origin, you must give x,y,THETA,z values for every line of the LUT corresponding to a tag you will place in the area. It does not matter what the values are for the other tags in the LUT since they will not be viewed in that area if you have not placed those tags, however, the format for every line of the LUT must be as follows:


Where x, y and THETA are doubles, and z is an integer.