-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
216 lines (199 loc) · 16.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overhead Localization System User Manual</title>
<style type="text/css">
body
{
font:14px/17px "Lucida Grande",Helvetica,Arial,sans-serif;
}
p {}
.mybody
{
width:800px;
line-height:150%
}
.name
{
font-size:small;
}
.headerlink
{
}
.headmsg
{
font:18px "Times New Roman", Times, serif;
line-height:150%;
}
.quicklink
{
line-height:150%
}
</style>
</head>
<body>
<center>
<div class="mybody" style="text-align:left">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="728"><h1>Overhead Localization System User Manual</h1>
<p class="name">Created by Chuck Yang ty244 at cornell dot edu last modified: 2/9/2011</p></td>
<td width="72"><img src="doc/images/tdloc_icon.png" alt="" width="72" height="72" /></td>
</tr>
</table>
<p class="headmsg"><em> "Overhead localization system is a solution that aims to create an indoor GPS-like localization system for robotics lab, classes, and research. It utilizes 8 Unibrain firewire cameras, ARtags with computer vision techniques in order to achieve such solution with minimum budget in mind.</em>"</p>
<p> </p>
<h2>Quick Links</h2>
<p class="quicklink"> <a class="headerlink" href="#requirements">Requirements</a><br />
<a class="headerlink" href="#specifications">Specifications</a><br />
<a class="headerlink" href="#beforeyoustart">Before you start</a><br />
<a class="headerlink" href="#readyforaction">Ready for action</a><br />
<a class="headerlink" href="#camerainitialization">Camera Initialization</a><br />
<a class="headerlink" href="#calibration">Calibration</a><br />
<a class="headerlink" href="#intrinsicparameters">Intrinsic parameters</a><br />
<a class="headerlink" href="#extrinsicparameters">Extrinsic parameters</a><br />
<a class="headerlink" href="#broadcastartagpose">Broadcast ARtag pose</a><br />
<a class="headerlink" href="#quittingtheprogram">Quitting the program</a><br />
<a class="headerlink" href="#matlabclientfunction">MATLAB client function</a><br />
<a class="headerlink" href="#artaggeneration">ARtag generation</a><br />
<a class="headerlink" href="#troubleshooting">Troubleshooting</a><br />
</p>
<p> </p>
<a name="requirements"></a>
<h2>Requirements</h2>
<p><a href="http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.2/OpenCV-2.2.0-win32-vs2010.exe/download">OpenCV2.2</a><br />
<a href="http://www.cs.cmu.edu/~iwan/1394/downloads/1394camera645.exe">CMU1394Camera driver</a><br />
Windows 7 32bit<br />
<a href="http://www.unibrain.com/products/visionimg/fire_i_dc.htm">Unibrain Fire-i cameras</a></p>
<p> </p>
<p><a name="specifications"></a>
</p>
<h2>Specifications</h2>
<table width="635" border="0" cellpadding="10" cellspacing="0">
<tr>
<th width="131" scope="row" align="right">Total field of view:</th>
<td width="464" align="left">Approximately 4 m in x and 2 m in y direction</td>
</tr>
<tr>
<th scope="row" align="right">Resolution:</th>
<td align="left"><p>640 px by 480 px for each camera</p></td>
</tr>
<tr>
<th scope="row" align="right">Error:</th>
<td align="left"><p>+- 0.05 m in both x and y<br />
+- 0.1 rad in yaw</p></td>
</tr>
<tr>
<th scope="row" align="right">Axis orientation:</th>
<td align="left">+x goes towards the window of the room<br />
+y goes towards the blackboard in the room<br />
+yaw in counter-clockwise direction with 0 starts from the +x axis</td>
</tr>
<tr>
<th scope="row" align="right">ARtag support:</th>
<td align="left">Support up to 48 ARtags (with ID from 0 to 49) to be localized simulanuously on the field.</td>
</tr>
</table>
<p> </p>
<p><a name="beforeyoustart"></a>
</p>
<h2>Before you start</h2>
<p> Make sure firewire cables are connected to the overhead localization system correctly. Then
check the number of cameras detected by the computer under Device Manager (shortcut on desktop). You should get 8 normally.</p>
<p align="center"><a href="doc/images/device_cameras.png"><img src="doc/images/device_cameras_sm.png" width="500" height="358" alt="Camera attached under device manager" /></a></p>
<p>If you think you are missing a camera or two, disconnect the 2 firewire cable from the firewire hub and reconnect it, this should correct the problem.</p>
<p> </p>
<p><a name="readyforaction"></a>
</p>
<h2>Ready for action</h2>
<p> Double click on the <em>"Overhead Localization Server"</em> shortcut on the desktop. This opens up the program's console.
The message printed in the console (<em>Initializing # camera(s)....</em>) indicates the number of cameras you have currently attached to your computer. If it's different than what you think you should have, close the program and double check the hardware connection.</p>
<p><a name="camerainitialization"></a>
<h3>Camera Initialization</h3>
<p> Wait for the 8 cameras to be initialized. This should take some time, be patient.</p>
<p align="center"><img src="doc/images/cam_init.png" width="677" height="342" alt="Camera Initializing" /></p>
<p>When all 8 cameras are initialized, you will see the console looks like following picture.</p>
<p align="center"><img src="doc/images/select_view.png" width="723" height="411" alt="All cameras initialized" /></p>
<p>In addition, one more window will be created (titled <em>CameraServ...</em>), select the view window and press <strong>[spacebar]</strong> to expand/hide this view window. When the view window is expanded, you will be able to see the view of all 8 cameras. In the view window, any ARtags localized by the program will display a red colored text with ID number and its pose <em>(x,y,yaw)</em> next to the ARtag. Following image shows an un-calibrated camera extrinsic. Notice that the pose showed in the image is with origin at each camera's focal center before camera extrinsic calibration.</p>
<p align="center"><a href="doc/images/view_uncalib.png"><img src="doc/images/view_uncalib_sm.png" width="862" height="340" alt="Uncalibrated view" /></a></p>
<p><a name="calibration"></a>
<h3>Calibration</h3>
<p>There are 2 kinds of camera calibration for the system, find out the camera intrinsic parameters and extrinsic parameters.</p>
<p><a name="intrinsicparameters"></a>
<h4>Intrinsic parameters</h4>
<p> One can use MATLAB's <a href="http://www.vision.caltech.edu/bouguetj/calib_doc/index.html">camera calibration toolbox</a> to find out the intrinsic parameters and obtain camera's focal length, focal center, distortion coefficients and obtain an ASCII-file containing the camera intrinsic parameter (example). More detail can be found on the bottom section of <a href="http://studierstube.icg.tu-graz.ac.at/handheld_ar/artoolkitplus.php">ARToolKitPlus' website</a>. Place the ASCII-file containing the camera intrinsic parameter under <em>tdloc_trunk\ARToolKitPlus\data\</em> and modify <em>ARtagLocalizer.c</em>'s init function to load such file properly. Then recompile and build the program. </p>
<p><em>Note: The user usually doesn't need to recalibrate the intrinsic parameter if one uses the same model of cameras.</em></p>
<p><a name="extrinsicparameters"></a>
<h4>Extrinsic parameters</h4>
<p> There are 8 cameras being used by the program. Camera extrinsic is the relative position between each camera's coordinate frames. Such calibration is built-in with the Overhead Localization Server program. User can press <strong>[C]</strong> to calibrate the camera extrinsic any time after the cameras are initialized.</p>
<p>Place a couple of ARtags under the cameras so that it shows the tag is visible and the ARtag IDs are displayed in the camera view. User should place the ARtags in the overlapped region between two cameras in order for the program to calculate the relative camera offsets. When there is no tag with same ID that's placed in two cameras' overlapped region, the console displays <em>"Trying again..."</em> to notify user to place some more ARtags in the field and make sure it can be seen by two nearby cameras.</p>
<p align="center"><a href="doc/images/view_calib_trying.png"><img src="doc/images/view_calib_trying_sm.png" width="480" height="270" alt="No common ARtags seen" /></a></p>
<p>The origin of the world coordinate is set to be where the ARtag ID 0 is located. If no ARtag with ID 0 is located in the camera field of view, then the origin of the world coordinate is set to be the focal center of the camera 0 (the camera that provide the top left view in the view window). In order to verify that the camera extrinsic is calibrated, user has to inspect the ARtag poses displayed in the view window. For example, in following image, ARtag 18, 17, and 16 are placed 1.20 m apart in x direction with real world measurement. So their poses localized in the view window should also agree (or close to) with real world measurement.</p>
<p align="center"><a href="doc/images/view_calib_with0.png"><img src="doc/images/view_calib_with0_sm.png" width="480" height="270" alt="ARtag with ID 0 is the origin of the world coordinate" /></a></p>
<p><em>Note: It is recommended that user placed lots of ARtags in two camera's overlapped region so that the camera can be calibrated with less effect from lens distortion (even though the lens distortion is virtually removed from the calibration of camera intrinsic). The program averages the offsets calculated from the ARtags in the overlapped region.</em></p>
<p align="center"><a href="doc/images/view_calib_many.png"><img src="doc/images/view_calib_many_sm.png" width="862" height="340" alt="Many ARtags in overlapped region" /></a></p>
<p><a name="broadcastartagpose"></a>
<h3>Broadcast ARtag pose</h3>
<p> With the view window selected, press <strong>[V]</strong> to go into program's normal operation mode. The console will then display the pose information with timestamps of current ARtags that are been localized by the cameras. <em>"Total of # ARtags broadcasted."</em> message printed in the console also indicate the number of ARtags pose information with timestamp that are being broadcasted to the network through UDP. With the view window selected, user can press <strong>[B]</strong> to toggle the broadcasting of the pose message.</p>
<p align="center"><img src="doc/images/view_pressv.png" width="677" height="342" alt="Real time indication of ARtag pose" /></p>
<p><a name="quittingtheprogram"></a>
<h3>Quitting the program</h3>
<p> With the view window selected, press <strong>[Q]</strong> to quit the program. The console will display something looks like following indicating a proper termination of the camera threads and firewire driver:</p>
<p align="center"><img src="doc/images/view_pressq.png" width="677" height="342" alt="quit program" /></p>
<p> </p>
<p><a name="matlabclientfunction"></a>
</p>
<h2>MATLAB client function</h2>
<p>The MATLAB function developed to retrieve overhead localization data for the Autonomous Mobile Robots Lab is called <em><a href="Create_Location.m">Create_Localization.m</a></em> <br />
<h4>Function Input <em>N</em>:</h4>
<p><em>N</em> should be a vector of ARtag ID numbers for which the user wishes to know the pose. If one or all of these ID’s are not within the field of view of the system the function will print a message to the screen stating which ID’s are not visible. Also if there are no tags visible to the system then a message will print to the screen stating such.</p>
<h4>Function Output:</h4>
<p>There are three choices for the format of the output.<br />
<ul>
<li><h5>Print to screen</h5>
If the user wants the information to only print to the screen without returning a variable to the workspace they can call the function without setting it equal anything (i.e. >><em>Create_Location(N)</em>). </li>
<li><h5>Output to matrix</h5>
If the user wants the information in one single matrix they can call the function by setting it equal to one single variable (i.e. <em>P=Create_Location(N)</em>). This will return a matrix of size: number of requested ID’s by five. Each column is a piece of the pose of the form col.1 is ID number (#), col.2 is x-position (m), col.3 is y-position (m), col.4 is orientation (rad), and col.5 is the timestamp (sec.). The ID’s will be in ascending order index 1 to n, <strong>not necessarily</strong> the same order as in <em>N</em>.</li>
<li><h5>Output to vectors</h5>
If the user wants the information in five separate specifically labeled vectors, they can call the function by setting it equal to this set of variables (i.e. <em>[Id,X,Y,Theta,TS]=Create_Location(N)</em>). This creates five vectors of the information. The same process of ascending order applies as in “output to matrix.” Each vector is a row vector of length equal to the number of ID’s called.</li></ul></p>
<h4>Notes: </h4>
<ul>
<li>A help file is provided to ease understanding of use.</li>
<li>If robot is not being seen in the field then values of zero are substituted for real data. This can be checked by making sure Timestamp is not zero. If a robot was detected Timestamp for that robot will not be zero.</li>
<li>If an error occurs while the program is running (not a warning) you may need to restart MATLAB. (This should not happen).</li>
<li>A <u>Warning Mesage</u> stating <em>"Warning: The specified amount of data was not returned within the Timeout period."</em> will appear at the beginning of the output. This is perfectly normal and will not affect the functionality of the program.</li>
<li>Two cases will cause the function to print an error message and terminate without running:
<ul>
<li>Too many input arguments.</li>
<li>Zero input arguments. </li>
</ul>
Please read the help file or the above information if you encounter these errors.
</li>
</ul>
<p> </p>
<p><a name="artaggeneration"></a>
</p>
<h2>ARtag generation</h2>
<p> Run the windows command prompt and cd under <em>tdloc_trunk\ARToolKitPlus\</em>. Run <em><a href="doc/attached/IdPatGen.exe">IdPatGen.exe</a></em> without any argument after the command to display help instruction for the program. For the Overhead Localization Server, it is compatible with ARtags that has width of 180 mm, thin border, and BCH marker system. So an example of the command to generate the ARtag with ID 0 looks like following:</p>
<code>IdPatGen -thinborder -w 180 -bch 0 myartag</code>
<p align="center"><img src="doc/images/idpatgen.png" width="677" height="390" alt="IdPatGen command line" /></p>
<p>Then an ARtag with filename of <em>"<a href="doc/images/myartag_0000.tga">myartag_0000.tga</a>"</em> will be generated under the same directory. To print out the ARtag, one can open the <em>.tga</em> file with Quicktime player and print. When it is printed, measure the width of the tag to make sure the width is 180 mm.</p>
<p> </p>
<p><a name="troubleshooting"></a>
</p>
<h2>Troubleshooting</h2>
<h3>Hardware</h3>
<h4> <em>Not all 8 cameras are detected by the computer.</em></h4>
<p> Reconnect the firewire cables from the firewire hubs. Then double check the number of camera detected in the device manager.</p>
<h4> <em>The program cannot initialize the cameras for some reason.</em></h4>
<p> Restart the computer and double check the number of camera detected in the device manager.</p>
<h3>Software</h3>
<h4> <em>There is no message being broadcasted through the network.</em></h4>
<p> Press <strong>[V]</strong> to see if the message <em>“Total of # ARtags broadcasted.”</em> is displayed in the console window. If not, press <strong>[B]</strong> to toggle the broadcasting function.</p>
<p> </p>
<p> </p>
</div>
</center>
</body>
</html>