-
Notifications
You must be signed in to change notification settings - Fork 13
/
PnP__AHRS_8c.html
269 lines (259 loc) · 19.7 KB
/
PnP__AHRS_8c.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Paparazzi UAS: sw/airborne/modules/computer_vision/lib/vision/PnP_AHRS.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="penguin_icon.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Paparazzi UAS
 <span id="projectnumber">v6.1.0_stable</span>
</div>
<div id="projectbrief">Paparazzi is a free software Unmanned Aircraft System.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('PnP__AHRS_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">PnP_AHRS.c File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Functions for solving a perspective-n-point problem, using the AHRS to get the relevant angles.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include "<a class="el" href="PnP__AHRS_8h_source.html">PnP_AHRS.h</a>"</code><br />
<code>#include "<a class="el" href="state_8h_source.html">state.h</a>"</code><br />
<code>#include <stdio.h></code><br />
</div><div class="textblock"><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Include dependency graph for PnP_AHRS.c:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="PnP__AHRS_8c__incl.png" border="0" usemap="#sw_2airborne_2modules_2computer__vision_2lib_2vision_2PnP__AHRS_8c" alt=""/></div>
<map name="sw_2airborne_2modules_2computer__vision_2lib_2vision_2PnP__AHRS_8c" id="sw_2airborne_2modules_2computer__vision_2lib_2vision_2PnP__AHRS_8c">
<area shape="rect" title="Functions for solving a perspective-n-point problem, using the AHRS to get the relevant angles." alt="" coords="1220,5,1379,61"/>
<area shape="rect" href="PnP__AHRS_8h.html" title="Functions for solving a perspective-n-point problem, using the AHRS to get the relevant angles." alt="" coords="562,109,663,136"/>
<area shape="rect" href="state_8h.html" title=" " alt="" coords="951,363,1018,389"/>
<area shape="rect" title=" " alt="" coords="1337,109,1403,136"/>
<area shape="rect" title=" " alt="" coords="1033,676,1088,703"/>
<area shape="rect" title=" " alt="" coords="159,676,227,703"/>
<area shape="rect" href="pprz__algebra_8h.html" title="Paparazzi generic algebra macros." alt="" coords="372,601,528,628"/>
<area shape="rect" href="pprz__algebra__float_8h.html" title="Paparazzi floating point algebra." alt="" coords="595,527,787,553"/>
<area shape="rect" href="pprz__simple__matrix_8h.html" title="Simple matrix helper macros." alt="" coords="44,601,245,628"/>
<area shape="rect" href="video__device_8h.html" title=" " alt="" coords="273,191,470,218"/>
<area shape="rect" href="undistortion_8h.html" title="Functions for undistorting camera images." alt="" coords="1337,184,1528,225"/>
<area shape="rect" title=" " alt="" coords="419,676,481,703"/>
<area shape="rect" title=" " alt="" coords="311,676,381,703"/>
<area shape="rect" title=" " alt="" coords="654,601,811,628"/>
<area shape="rect" title=" " alt="" coords="141,281,223,307"/>
<area shape="rect" title=" " alt="" coords="248,281,335,307"/>
<area shape="rect" href="image_8h.html" title=" " alt="" coords="359,273,549,315"/>
<area shape="rect" title=" " alt="" coords="358,363,449,389"/>
<area shape="rect" href="pprz__algebra__int_8h.html" title="Paparazzi fixed point algebra." alt="" coords="1113,527,1293,553"/>
<area shape="rect" href="pprz__geodetic__int_8h.html" title="Paparazzi fixed point math for geodetic calculations." alt="" coords="1092,437,1243,479"/>
<area shape="rect" href="pprz__geodetic__float_8h.html" title="Paparazzi floating point math for geodetic calculations." alt="" coords="727,437,877,479"/>
<area shape="rect" href="pprz__orientation__conversion_8h.html" title=" " alt="" coords="901,437,1068,479"/>
<area shape="rect" href="pprz__trig__int_8h.html" title="Paparazzi fixed point trig functions." alt="" coords="1089,601,1243,628"/>
<area shape="rect" title=" " alt="" coords="995,601,1065,628"/>
<area shape="rect" href="pprz__geodetic_8h.html" title="Paparazzi generic macros for geodetic calculations." alt="" coords="913,527,1038,553"/>
</map>
</div>
</div>
<p><a href="PnP__AHRS_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a30f92e7ee757f2657644e0df845ff43a"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="group__math__algebra__float.html#structFloatVect3">FloatVect3</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="PnP__AHRS_8c.html#a30f92e7ee757f2657644e0df845ff43a">get_world_position_from_image_points</a> (int *x_corners, int *y_corners, struct <a class="el" href="group__math__algebra__float.html#structFloatVect3">FloatVect3</a> *<a class="el" href="detect__gate_8c.html#a5abe2d7a4b0bc945745785222ef0d59a">world_corners</a>, int <a class="el" href="detect__gate_8c.html#afbc2c3a79a0312bcc3173018a91dccca">n_corners</a>, struct <a class="el" href="video__device_8h.html#structcamera__intrinsics__t">camera_intrinsics_t</a> cam_intrinsics, struct <a class="el" href="group__math__algebra__float.html#structFloatEulers">FloatEulers</a> <a class="el" href="detect__gate_8c.html#a6614f0e4c0cc22a362eb20dcc5e6c3ae">cam_body</a>)</td></tr>
<tr class="memdesc:a30f92e7ee757f2657644e0df845ff43a"><td class="mdescLeft"> </td><td class="mdescRight">Get the world position of the camera, given image coordinates and corresponding world coordinates. <a href="PnP__AHRS_8c.html#a30f92e7ee757f2657644e0df845ff43a">More...</a><br /></td></tr>
<tr class="separator:a30f92e7ee757f2657644e0df845ff43a"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Functions for solving a perspective-n-point problem, using the AHRS to get the relevant angles. </p>
<p>Solves a perspective-n-point problem while using the attitude estimates of the AHRS. Using the AHRS makes the solution more robust than a purely maximal likelihood estimate from a standard PnP solver.</p>
<p>The module needs to get information on:</p><ol type="1">
<li>The real-world coordinates of the points.</li>
<li>The image coordinates of the points.</li>
<li>The camera parameters for undistortion purposes.</li>
<li>The rotation of the camera to the drone body. </li>
</ol>
<p class="definition">Definition in file <a class="el" href="PnP__AHRS_8c_source.html">PnP_AHRS.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a30f92e7ee757f2657644e0df845ff43a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a30f92e7ee757f2657644e0df845ff43a">◆ </a></span>get_world_position_from_image_points()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">struct <a class="el" href="group__math__algebra__float.html#structFloatVect3">FloatVect3</a> get_world_position_from_image_points </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"><em>x_corners</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>y_corners</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="group__math__algebra__float.html#structFloatVect3">FloatVect3</a> * </td>
<td class="paramname"><em>world_corners</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>n_corners</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="video__device_8h.html#structcamera__intrinsics__t">camera_intrinsics_t</a> </td>
<td class="paramname"><em>cam_intrinsics</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="group__math__algebra__float.html#structFloatEulers">FloatEulers</a> </td>
<td class="paramname"><em>cam_body</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the world position of the camera, given image coordinates and corresponding world coordinates. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">x_corners</td><td>Image x-coordinates of the corners. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">y_corners</td><td>Image y-coordinates of the corners. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">world_corners</td><td>World coordinates of the corners. The order has to be the same as for the image coordinates. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">n_corners</td><td>Number of corners. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">cam_intrinsics</td><td>The camera intrinsics necessary for doing undistortion. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">cam_body</td><td>The rotation from camera to body. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">A</td><td>single struct <a class="el" href="group__math__algebra__float.html#structFloatVect3">FloatVect3</a> representing the camera world position. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="PnP__AHRS_8c_source.html#l00054">54</a> of file <a class="el" href="PnP__AHRS_8c_source.html">PnP_AHRS.c</a>.</p>
<p class="reference">References <a class="el" href="cc2500__compat_8h_source.html#l00079">attitude</a>, <a class="el" href="detect__gate_8c_source.html#l00112">cam_body</a>, <a class="el" href="undistortion_8c_source.html#l00128">distorted_pixels_to_normalized_coords()</a>, <a class="el" href="pprz__algebra__float_8h_source.html#l00234">FLOAT_MAT33_DIAG</a>, <a class="el" href="pprz__algebra__float_8h_source.html#l00222">FLOAT_MAT33_ZERO</a>, <a class="el" href="pprz__algebra__float_8c_source.html#l00194">float_rmat_of_eulers_321()</a>, <a class="el" href="pprz__algebra__float_8h_source.html#l00161">FLOAT_VECT3_ZERO</a>, <a class="el" href="undistort__image_8c_source.html#l00041">K</a>, <a class="el" href="pprz__algebra_8h_source.html#l00438">MAT33_COPY</a>, <a class="el" href="pprz__algebra_8h_source.html#l00489">MAT33_INV</a>, <a class="el" href="pprz__algebra_8h_source.html#l00534">MAT33_MAT33_DIFF</a>, <a class="el" href="pprz__algebra_8h_source.html#l00547">MAT33_MAT33_SUM</a>, <a class="el" href="pprz__algebra_8h_source.html#l00560">MAT33_TRANS</a>, <a class="el" href="pprz__algebra_8h_source.html#l00463">MAT33_VECT3_MUL</a>, <a class="el" href="detect__gate_8c_source.html#l00109">n_corners</a>, <a class="el" href="pprz__algebra__float_8h_source.html#l00085">FloatEulers::phi</a>, <a class="el" href="state_8h_source.html#l01143">stateGetNedToBodyEulers_f()</a>, <a class="el" href="pprz__algebra__float_8h_source.html#l00086">FloatEulers::theta</a>, <a class="el" href="pprz__algebra_8h_source.html#l00252">VECT3_NORM2</a>, <a class="el" href="pprz__algebra_8h_source.html#l00196">VECT3_SDIV</a>, <a class="el" href="pprz__algebra_8h_source.html#l00161">VECT3_SUM</a>, <a class="el" href="pprz__algebra_8h_source.html#l00521">VECT3_VECT3_TRANS_MUL</a>, <a class="el" href="detect__gate_8c_source.html#l00106">world_corners</a>, <a class="el" href="pprz__algebra__float_8h_source.html#l00055">FloatVect3::x</a>, <a class="el" href="pprz__algebra__float_8h_source.html#l00056">FloatVect3::y</a>, and <a class="el" href="pprz__algebra__float_8h_source.html#l00057">FloatVect3::z</a>.</p>
<p class="reference">Referenced by <a class="el" href="detect__gate_8c_source.html#l00134">detect_gate_func()</a>.</p>
<div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-1-trigger" src="closed.png" alt="+"/> Here is the call graph for this function:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="PnP__AHRS_8c_a30f92e7ee757f2657644e0df845ff43a_cgraph.png" border="0" usemap="#PnP__AHRS_8c_a30f92e7ee757f2657644e0df845ff43a_cgraph" alt=""/></div>
<map name="PnP__AHRS_8c_a30f92e7ee757f2657644e0df845ff43a_cgraph" id="PnP__AHRS_8c_a30f92e7ee757f2657644e0df845ff43a_cgraph">
<area shape="rect" title="Get the world position of the camera, given image coordinates and corresponding world coordinates." alt="" coords="5,82,160,123"/>
<area shape="rect" href="undistortion_8c.html#a2c56172dffbf789b4b5c164c08395740" title="Transform distorted pixel coordinates to normalized coordinates." alt="" coords="233,23,385,65"/>
<area shape="rect" href="group__math__algebra__float.html#ga00bc75df1116d9ecef980b2e9f0699f0" title="Rotation matrix from 321 Euler angles (float)." alt="" coords="216,89,403,116"/>
<area shape="rect" href="group__state__attitude.html#ga9a5e6bac6e7d78e1b33430e73344615b" title="Get vehicle body attitude euler angles (float)." alt="" coords="208,140,411,167"/>
<area shape="rect" href="undistortion_8c.html#a81ad256378b5df58e5c0e61f3bddcbe2" title="Undistort distorted normalized image coordinates with the invertible Dhane method." alt="" coords="468,5,617,32"/>
<area shape="rect" href="undistortion_8c.html#abd20e3c24af3ed0e37744adcbcd6fbc2" title="Transform pixel coordinates to normalized coordinates." alt="" coords="463,56,623,83"/>
<area shape="rect" href="group__math__orientation__representation.html#gaaae3838d0b45682d48257d5dbfff3030" title="Get vehicle body attitude euler angles (float)." alt="" coords="459,140,627,167"/>
<area shape="rect" href="group__math__orientation__representation.html#ga8b8bf1c74adb971f399f0dd4f84d9388" title=" " alt="" coords="675,140,848,167"/>
<area shape="rect" href="group__math__algebra__float.html#gacd48accfe6eaac320b0d651d894e1db8" title="euler rotation 'ZYX'" alt="" coords="897,115,1051,141"/>
<area shape="rect" href="group__math__algebra__float.html#gac568e7074d2732d1237f80898c1dfb76" title=" " alt="" coords="896,165,1052,192"/>
</map>
</div>
<div id="dynsection-2" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-2-trigger" src="closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-2-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-2-content" class="dyncontent" style="display:none;">
<div class="center"><img src="PnP__AHRS_8c_a30f92e7ee757f2657644e0df845ff43a_icgraph.png" border="0" usemap="#PnP__AHRS_8c_a30f92e7ee757f2657644e0df845ff43a_icgraph" alt=""/></div>
<map name="PnP__AHRS_8c_a30f92e7ee757f2657644e0df845ff43a_icgraph" id="PnP__AHRS_8c_a30f92e7ee757f2657644e0df845ff43a_icgraph">
<area shape="rect" title="Get the world position of the camera, given image coordinates and corresponding world coordinates." alt="" coords="363,5,517,47"/>
<area shape="rect" href="detect__gate_8c.html#a33f5e6c0b684ec61feb65db935e01ff9" title=" " alt="" coords="180,13,315,39"/>
<area shape="rect" href="detect__gate_8h.html#afad85937ed43b1d2963bec59f0031ec1" title=" " alt="" coords="5,13,132,39"/>
</map>
</div>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_01fcd3835fb4e7d9331b722d86291b65.html">sw</a></li><li class="navelem"><a class="el" href="dir_5e9153041680afc3c016fd52fa730b56.html">airborne</a></li><li class="navelem"><a class="el" href="dir_c2abcdd6ccb39c3582929c0e3f5651c2.html">modules</a></li><li class="navelem"><a class="el" href="dir_304e79c9f5d09ea65a2f55aafb6a6b9d.html">computer_vision</a></li><li class="navelem"><a class="el" href="dir_9adc125244b74c64b95124778e5b932a.html">lib</a></li><li class="navelem"><a class="el" href="dir_02b33bf6f772461f444923131a9a8dda.html">vision</a></li><li class="navelem"><a class="el" href="PnP__AHRS_8c.html">PnP_AHRS.c</a></li>
<li class="footer">Generated on Tue Feb 1 2022 13:08:50 for Paparazzi UAS by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>
</html>