Checking these in makes the libraries too bulky. We need to host them somewhere.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1413 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
DrZiplok@gmail.com 2011-01-04 06:22:02 +00:00
parent ff256d95e2
commit d7fccd1aa9
807 changed files with 0 additions and 118444 deletions

View File

@ -1,51 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_ADC.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___a_d_c_8h_source.html">AP_ADC.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_ADC.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c_8cpp__incl.png" border="0" usemap="#_a_p___a_d_c_8cpp" alt=""/></div>
<map name="_a_p___a_d_c_8cpp" id="_a_p___a_d_c_8cpp">
<area shape="rect" id="node3" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="116,83,201,112"/><area shape="rect" id="node5" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="5,160,157,189"/><area shape="rect" id="node8" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="181,160,293,189"/></map>
</div>
<p><a href="_a_p___a_d_c_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,62 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_ADC.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___a_d_c_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> ADC.cpp - Analog Digital Converter Base Class for Ardupilot Mega</span>
<a name="l00003"></a>00003 <span class="comment"> Code by James Goppert. DIYDrones.com</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">*/</span>
<a name="l00010"></a>00010
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___a_d_c_8h.html">AP_ADC.h</a>&quot;</span>
<a name="l00012"></a>00012
<a name="l00013"></a><a class="code" href="class_a_p___a_d_c.html#a5666c75df84871939288fb4d3da4e090">00013</a> <a class="code" href="class_a_p___a_d_c.html#a5666c75df84871939288fb4d3da4e090">AP_ADC::AP_ADC</a>()
<a name="l00014"></a>00014 {
<a name="l00015"></a>00015 }
<a name="l00016"></a>00016
<a name="l00017"></a><a class="code" href="class_a_p___a_d_c.html#a3e508676c58e628fb39f7d12e8bac011">00017</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___a_d_c.html#a3e508676c58e628fb39f7d12e8bac011">AP_ADC::Init</a>()
<a name="l00018"></a>00018 {
<a name="l00019"></a>00019 }
<a name="l00020"></a>00020
<a name="l00021"></a><a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">00021</a> <span class="keywordtype">int</span> <a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">AP_ADC::Ch</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch_num)
<a name="l00022"></a>00022 {
<a name="l00023"></a>00023 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,64 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_ADC.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html">AP_ADC_ADS7844.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___a_d_c___h_i_l_8h_source.html">AP_ADC_HIL.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_ADC.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c_8h__incl.png" border="0" usemap="#_a_p___a_d_c_8h" alt=""/></div>
<map name="_a_p___a_d_c_8h" id="_a_p___a_d_c_8h">
<area shape="rect" id="node3" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="5,83,157,112"/><area shape="rect" id="node6" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="181,83,293,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c_8h__dep__incl.png" border="0" usemap="#_a_p___a_d_c_8hdep" alt=""/></div>
<map name="_a_p___a_d_c_8hdep" id="_a_p___a_d_c_8hdep">
<area shape="rect" id="node3" href="_a_p___a_d_c_8cpp.html" title="AP_ADC.cpp" alt="" coords="5,83,107,112"/><area shape="rect" id="node5" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="131,83,283,112"/><area shape="rect" id="node10" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="307,83,419,112"/><area shape="rect" id="node15" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="576,237,691,267"/><area shape="rect" id="node17" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="465,315,553,344"/><area shape="rect" id="node24" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="493,83,621,112"/><area shape="rect" id="node8" href="_a_p___a_d_c___a_d_s7844_8cpp.html" title="AP_ADC_ADS7844.cpp" alt="" coords="99,160,267,189"/><area shape="rect" id="node13" href="_a_p___a_d_c___h_i_l_8cpp.html" title="AP_ADC_HIL.cpp" alt="" coords="291,160,419,189"/><area shape="rect" id="node21" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="577,315,708,344"/><area shape="rect" id="node19" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="459,392,560,421"/><area shape="rect" id="node26" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="493,160,576,189"/><area shape="rect" id="node30" href="_a_p___i_m_u___oilpan_8cpp.html" title="AP_IMU_Oilpan.cpp" alt="" coords="600,160,744,189"/></map>
</div>
<p><a href="_a_p___a_d_c_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___a_d_c.html">AP_ADC</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,70 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_ADC.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___a_d_c_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef AP_ADC_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define AP_ADC_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="comment">/*</span>
<a name="l00005"></a>00005 <span class="comment"> AP_ADC.cpp - Analog Digital Converter Base Class for Ardupilot Mega</span>
<a name="l00006"></a>00006 <span class="comment"> Code by James Goppert. DIYDrones.com</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00009"></a>00009 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00010"></a>00010 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00011"></a>00011 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"></span>
<a name="l00013"></a>00013 <span class="comment"> Methods:</span>
<a name="l00014"></a>00014 <span class="comment"> Init() : Initialization of ADC. (interrupts etc)</span>
<a name="l00015"></a>00015 <span class="comment"> Ch(ch_num) : Return the ADC channel value</span>
<a name="l00016"></a>00016 <span class="comment"></span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018
<a name="l00019"></a><a class="code" href="class_a_p___a_d_c.html">00019</a> <span class="keyword">class </span><a class="code" href="class_a_p___a_d_c.html">AP_ADC</a>
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021 <span class="keyword">public</span>:
<a name="l00022"></a>00022 <a class="code" href="class_a_p___a_d_c.html#a5666c75df84871939288fb4d3da4e090">AP_ADC</a>(); <span class="comment">// Constructor</span>
<a name="l00023"></a>00023 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___a_d_c.html#a3e508676c58e628fb39f7d12e8bac011">Init</a>();
<a name="l00024"></a>00024 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch_num);
<a name="l00025"></a>00025 <span class="keyword">private</span>:
<a name="l00026"></a>00026 };
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html">AP_ADC_ADS7844.h</a>&quot;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___a_d_c___h_i_l_8h.html">AP_ADC_HIL.h</a>&quot;</span>
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,80 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC_ADS7844.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<h1>AP_ADC_ADS7844.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;inttypes.h&gt;</code><br/>
<code>#include &lt;avr/interrupt.h&gt;</code><br/>
<code>#include &quot;WConstants.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html">AP_ADC_ADS7844.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_ADC_ADS7844.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c___a_d_s7844_8cpp__incl.png" border="0" usemap="#_a_p___a_d_c___a_d_s7844_8cpp" alt=""/></div>
<map name="_a_p___a_d_c___a_d_s7844_8cpp" id="_a_p___a_d_c___a_d_s7844_8cpp">
<area shape="rect" id="node9" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="291,83,443,112"/><area shape="rect" id="node11" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="325,160,410,189"/><area shape="rect" id="node14" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="311,237,423,267"/></map>
</div>
<p><a href="_a_p___a_d_c___a_d_s7844_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a> (TIMER2_OVF_vect)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a7cfcbe42bd266750aeb6e5d71e5ea479"></a><!-- doxytag: member="AP_ADC_ADS7844.cpp::ISR" ref="a7cfcbe42bd266750aeb6e5d71e5ea479" args="(TIMER2_OVF_vect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ISR </td>
<td>(</td>
<td class="paramtype">TIMER2_OVF_vect&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___a_d_c___a_d_s7844_8cpp_source.html#l00072">72</a> of file <a class="el" href="_a_p___a_d_c___a_d_s7844_8cpp_source.html">AP_ADC_ADS7844.cpp</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,185 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC_ADS7844.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_ADC_ADS7844.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___a_d_c___a_d_s7844_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> AP_ADC_ADS7844.cpp - ADC ADS7844 Library for Ardupilot Mega</span>
<a name="l00003"></a>00003 <span class="comment"> Code by Jordi Muñoz and Jose Julio. DIYDrones.com</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> Modified by John Ihlein 6/19/2010 to:</span>
<a name="l00006"></a>00006 <span class="comment"> 1)Prevent overflow of adc_counter when more than 8 samples collected between reads. Probably</span>
<a name="l00007"></a>00007 <span class="comment"> only an issue on initial read of ADC at program start.</span>
<a name="l00008"></a>00008 <span class="comment"> 2)Reorder analog read order as follows:</span>
<a name="l00009"></a>00009 <span class="comment"> p, q, r, ax, ay, az</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00012"></a>00012 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00013"></a>00013 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00014"></a>00014 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment"> External ADC ADS7844 is connected via Serial port 2 (in SPI mode)</span>
<a name="l00017"></a>00017 <span class="comment"> TXD2 = MOSI = pin PH1</span>
<a name="l00018"></a>00018 <span class="comment"> RXD2 = MISO = pin PH0</span>
<a name="l00019"></a>00019 <span class="comment"> XCK2 = SCK = pin PH2</span>
<a name="l00020"></a>00020 <span class="comment"> Chip Select pin is PC4 (33) [PH6 (9)]</span>
<a name="l00021"></a>00021 <span class="comment"> We are using the 16 clocks per conversion timming to increase efficiency (fast)</span>
<a name="l00022"></a>00022 <span class="comment"> The sampling frequency is 400Hz (Timer2 overflow interrupt)</span>
<a name="l00023"></a>00023 <span class="comment"> So if our loop is at 50Hz, our needed sampling freq should be 100Hz, so</span>
<a name="l00024"></a>00024 <span class="comment"> we have an 4x oversampling and averaging.</span>
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment"> Methods:</span>
<a name="l00027"></a>00027 <span class="comment"> Init() : Initialization of interrupts an Timers (Timer2 overflow interrupt)</span>
<a name="l00028"></a>00028 <span class="comment"> Ch(ch_num) : Return the ADC channel value</span>
<a name="l00029"></a>00029 <span class="comment"></span>
<a name="l00030"></a>00030 <span class="comment"> // HJI - Input definitions. USB connector assumed to be on the left, Rx and servo</span>
<a name="l00031"></a>00031 <span class="comment"> // connector pins to the rear. IMU shield components facing up. These are board</span>
<a name="l00032"></a>00032 <span class="comment"> // referenced sensor inputs, not device referenced.</span>
<a name="l00033"></a>00033 <span class="comment"> On Ardupilot Mega Hardware, oriented as described above:</span>
<a name="l00034"></a>00034 <span class="comment"> Chennel 0 : yaw rate, r</span>
<a name="l00035"></a>00035 <span class="comment"> Channel 1 : roll rate, p</span>
<a name="l00036"></a>00036 <span class="comment"> Channel 2 : pitch rate, q</span>
<a name="l00037"></a>00037 <span class="comment"> Channel 3 : x/y gyro temperature</span>
<a name="l00038"></a>00038 <span class="comment"> Channel 4 : x acceleration, aX</span>
<a name="l00039"></a>00039 <span class="comment"> Channel 5 : y acceleration, aY</span>
<a name="l00040"></a>00040 <span class="comment"> Channel 6 : z acceleration, aZ</span>
<a name="l00041"></a>00041 <span class="comment"> Channel 7 : Differential pressure sensor port</span>
<a name="l00042"></a>00042 <span class="comment"></span>
<a name="l00043"></a>00043 <span class="comment">*/</span>
<a name="l00044"></a>00044 <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00045"></a>00045 <span class="comment">// AVR LibC Includes</span>
<a name="l00046"></a>00046 <span class="preprocessor"> #include &lt;inttypes.h&gt;</span>
<a name="l00047"></a>00047 <span class="preprocessor"> #include &lt;avr/interrupt.h&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor"> #include &quot;WConstants.h&quot;</span>
<a name="l00049"></a>00049 }
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html">AP_ADC_ADS7844.h</a>&quot;</span>
<a name="l00052"></a>00052
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <span class="comment">// Commands for reading ADC channels on ADS7844</span>
<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> adc_cmd[9]= { 0x87, 0xC7, 0x97, 0xD7, 0xA7, 0xE7, 0xB7, 0xF7, 0x00 };
<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keyword">volatile</span> <span class="keywordtype">long</span> adc_value[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keyword">volatile</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> adc_counter[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ADC_SPI_transfer(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> data)
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061 <span class="comment">/* Wait for empty transmit buffer */</span>
<a name="l00062"></a>00062 <span class="keywordflow">while</span> ( !( UCSR2A &amp; (1&lt;&lt;UDRE2)) );
<a name="l00063"></a>00063 <span class="comment">/* Put data into buffer, sends the data */</span>
<a name="l00064"></a>00064 UDR2 = data;
<a name="l00065"></a>00065 <span class="comment">/* Wait for data to be received */</span>
<a name="l00066"></a>00066 <span class="keywordflow">while</span> ( !(UCSR2A &amp; (1&lt;&lt;RXC2)) );
<a name="l00067"></a>00067 <span class="comment">/* Get and return received data from buffer */</span>
<a name="l00068"></a>00068 <span class="keywordflow">return</span> UDR2;
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070
<a name="l00071"></a>00071
<a name="l00072"></a><a class="code" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">00072</a> <a class="code" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a> (TIMER2_OVF_vect)
<a name="l00073"></a>00073 {
<a name="l00074"></a>00074 uint8_t ch;
<a name="l00075"></a>00075 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> adc_tmp;
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="comment">//bit_set(PORTL,6); // To test performance</span>
<a name="l00078"></a>00078 <a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#a4befea8f39b82371375372c32827a577">bit_clear</a>(PORTC,4); <span class="comment">// Enable Chip Select (PIN PC4)</span>
<a name="l00079"></a>00079 ADC_SPI_transfer(adc_cmd[0]); <span class="comment">// Command to read the first channel</span>
<a name="l00080"></a>00080 <span class="keywordflow">for</span> (ch=0;ch&lt;8;ch++)
<a name="l00081"></a>00081 {
<a name="l00082"></a>00082 <span class="keywordflow">if</span> (adc_counter[ch] &gt;= 17) <span class="comment">// HJI - Added this to prevent</span>
<a name="l00083"></a>00083 { <span class="comment">// overflow of adc_value</span>
<a name="l00084"></a>00084 adc_value[ch] = 0;
<a name="l00085"></a>00085 adc_counter[ch] = 0;
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087 adc_tmp = ADC_SPI_transfer(0)&lt;&lt;8; <span class="comment">// Read first byte</span>
<a name="l00088"></a>00088 adc_tmp |= ADC_SPI_transfer(adc_cmd[ch+1]); <span class="comment">// Read second byte and send next command</span>
<a name="l00089"></a>00089 adc_value[ch] += adc_tmp&gt;&gt;3; <span class="comment">// Shift to 12 bits</span>
<a name="l00090"></a>00090 adc_counter[ch]++; <span class="comment">// Number of samples</span>
<a name="l00091"></a>00091 }
<a name="l00092"></a>00092 <a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#a05adecac4f6f6e2d5e6bf43b496bbc9f">bit_set</a>(PORTC,4); <span class="comment">// Disable Chip Select (PIN PC4)</span>
<a name="l00093"></a>00093 <span class="comment">//bit_clear(PORTL,6); // To test performance</span>
<a name="l00094"></a>00094 TCNT2 = 104; <span class="comment">// 400 Hz</span>
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096
<a name="l00097"></a>00097
<a name="l00098"></a>00098 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00099"></a><a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a282a180859046b6cf98782fc150fa61a">00099</a> <a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a282a180859046b6cf98782fc150fa61a">AP_ADC_ADS7844::AP_ADC_ADS7844</a>()
<a name="l00100"></a>00100 {
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00104"></a><a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a15f6735b9bbe6c15a097bbb45bb024ad">00104</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a15f6735b9bbe6c15a097bbb45bb024ad">AP_ADC_ADS7844::Init</a>(<span class="keywordtype">void</span>)
<a name="l00105"></a>00105 {
<a name="l00106"></a>00106 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> tmp;
<a name="l00107"></a>00107
<a name="l00108"></a>00108 pinMode(<a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#ae3ad6262e79df85ff68f27ad8293e8d1">ADC_CHIP_SELECT</a>,OUTPUT);
<a name="l00109"></a>00109
<a name="l00110"></a>00110 digitalWrite(<a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#ae3ad6262e79df85ff68f27ad8293e8d1">ADC_CHIP_SELECT</a>,HIGH); <span class="comment">// Disable device (Chip select is active low)</span>
<a name="l00111"></a>00111
<a name="l00112"></a>00112 <span class="comment">// Setup Serial Port2 in SPI mode</span>
<a name="l00113"></a>00113 UBRR2 = 0;
<a name="l00114"></a>00114 DDRH |= (1&lt;&lt;PH2); <span class="comment">// SPI clock XCK2 (PH2) as output. This enable SPI Master mode</span>
<a name="l00115"></a>00115 <span class="comment">// Set MSPI mode of operation and SPI data mode 0.</span>
<a name="l00116"></a>00116 UCSR2C = (1&lt;&lt;UMSEL21)|(1&lt;&lt;UMSEL20); <span class="comment">//|(0&lt;&lt;UCPHA2)|(0&lt;&lt;UCPOL2);</span>
<a name="l00117"></a>00117 <span class="comment">// Enable receiver and transmitter.</span>
<a name="l00118"></a>00118 UCSR2B = (1&lt;&lt;RXEN2)|(1&lt;&lt;TXEN2);
<a name="l00119"></a>00119 <span class="comment">// Set Baud rate</span>
<a name="l00120"></a>00120 UBRR2 = 2; <span class="comment">// SPI clock running at 2.6MHz</span>
<a name="l00121"></a>00121
<a name="l00122"></a>00122
<a name="l00123"></a>00123 <span class="comment">// Enable Timer2 Overflow interrupt to capture ADC data</span>
<a name="l00124"></a>00124 TIMSK2 = 0; <span class="comment">// Disable interrupts</span>
<a name="l00125"></a>00125 TCCR2A = 0; <span class="comment">// normal counting mode</span>
<a name="l00126"></a>00126 TCCR2B = _BV(CS21)|_BV(CS22); <span class="comment">// Set prescaler of 256</span>
<a name="l00127"></a>00127 TCNT2 = 0;
<a name="l00128"></a>00128 TIFR2 = _BV(TOV2); <span class="comment">// clear pending interrupts;</span>
<a name="l00129"></a>00129 TIMSK2 = _BV(TOIE2) ; <span class="comment">// enable the overflow interrupt</span>
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131
<a name="l00132"></a>00132 <span class="comment">// Read one channel value</span>
<a name="l00133"></a><a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a34bdd64e83c812bdecbe9ece209cd6f3">00133</a> <span class="keywordtype">int</span> <a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a34bdd64e83c812bdecbe9ece209cd6f3">AP_ADC_ADS7844::Ch</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch_num)
<a name="l00134"></a>00134 {
<a name="l00135"></a>00135 <span class="keywordtype">int</span> result;
<a name="l00136"></a>00136
<a name="l00137"></a>00137 cli(); <span class="comment">// We stop interrupts to read the variables</span>
<a name="l00138"></a>00138 <span class="keywordflow">if</span> (adc_counter[ch_num]&gt;0)
<a name="l00139"></a>00139 result = adc_value[ch_num]/adc_counter[ch_num];
<a name="l00140"></a>00140 <span class="keywordflow">else</span>
<a name="l00141"></a>00141 result = 0;
<a name="l00142"></a>00142 adc_value[ch_num] = 0; <span class="comment">// Initialize for next reading</span>
<a name="l00143"></a>00143 adc_counter[ch_num] = 0;
<a name="l00144"></a>00144 sei();
<a name="l00145"></a>00145 <span class="keywordflow">return</span>(result);
<a name="l00146"></a>00146 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,191 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC_ADS7844.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_ADC_ADS7844.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___a_d_c_8h_source.html">AP_ADC.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_ADC_ADS7844.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c___a_d_s7844_8h__incl.png" border="0" usemap="#_a_p___a_d_c___a_d_s7844_8h" alt=""/></div>
<map name="_a_p___a_d_c___a_d_s7844_8h" id="_a_p___a_d_c___a_d_s7844_8h">
<area shape="rect" id="node3" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="39,83,124,112"/><area shape="rect" id="node6" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="25,160,137,189"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c___a_d_s7844_8h__dep__incl.png" border="0" usemap="#_a_p___a_d_c___a_d_s7844_8hdep" alt=""/></div>
<map name="_a_p___a_d_c___a_d_s7844_8hdep" id="_a_p___a_d_c___a_d_s7844_8hdep">
<area shape="rect" id="node3" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="191,83,276,112"/><area shape="rect" id="node30" href="_a_p___a_d_c___a_d_s7844_8cpp.html" title="AP_ADC_ADS7844.cpp" alt="" coords="300,83,468,112"/><area shape="rect" id="node5" href="_a_p___a_d_c_8cpp.html" title="AP_ADC.cpp" alt="" coords="5,160,107,189"/><area shape="rect" id="node8" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="131,160,243,189"/><area shape="rect" id="node13" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="400,315,515,344"/><area shape="rect" id="node15" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="289,392,377,421"/><area shape="rect" id="node22" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="317,160,445,189"/><area shape="rect" id="node11" href="_a_p___a_d_c___h_i_l_8cpp.html" title="AP_ADC_HIL.cpp" alt="" coords="115,237,243,267"/><area shape="rect" id="node19" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="401,392,532,421"/><area shape="rect" id="node17" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="283,469,384,499"/><area shape="rect" id="node24" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="317,237,400,267"/><area shape="rect" id="node28" href="_a_p___i_m_u___oilpan_8cpp.html" title="AP_IMU_Oilpan.cpp" alt="" coords="424,237,568,267"/></map>
</div>
<p><a href="_a_p___a_d_c___a_d_s7844_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___a_d_c___a_d_s7844.html">AP_ADC_ADS7844</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___a_d_c___a_d_s7844_8h.html#a05adecac4f6f6e2d5e6bf43b496bbc9f">bit_set</a>(p, m)&nbsp;&nbsp;&nbsp;((p) |= ( 1&lt;&lt;m))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___a_d_c___a_d_s7844_8h.html#a4befea8f39b82371375372c32827a577">bit_clear</a>(p, m)&nbsp;&nbsp;&nbsp;((p) &amp;= ~(1&lt;&lt;m))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___a_d_c___a_d_s7844_8h.html#a5aa2fb5f9d53ff212dba7368fd0c4e00">ADC_DATAOUT</a>&nbsp;&nbsp;&nbsp;51</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___a_d_c___a_d_s7844_8h.html#a26eb539027d693cc3826c414d11c366d">ADC_DATAIN</a>&nbsp;&nbsp;&nbsp;50</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___a_d_c___a_d_s7844_8h.html#ab73167dbbd40eb138e3eb548ef907351">ADC_SPICLOCK</a>&nbsp;&nbsp;&nbsp;52</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___a_d_c___a_d_s7844_8h.html#ae3ad6262e79df85ff68f27ad8293e8d1">ADC_CHIP_SELECT</a>&nbsp;&nbsp;&nbsp;33</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ae3ad6262e79df85ff68f27ad8293e8d1"></a><!-- doxytag: member="AP_ADC_ADS7844.h::ADC_CHIP_SELECT" ref="ae3ad6262e79df85ff68f27ad8293e8d1" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ADC_CHIP_SELECT&nbsp;&nbsp;&nbsp;33</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html#l00011">11</a> of file <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html">AP_ADC_ADS7844.h</a>.</p>
</div>
</div>
<a class="anchor" id="a26eb539027d693cc3826c414d11c366d"></a><!-- doxytag: member="AP_ADC_ADS7844.h::ADC_DATAIN" ref="a26eb539027d693cc3826c414d11c366d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ADC_DATAIN&nbsp;&nbsp;&nbsp;50</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html#l00009">9</a> of file <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html">AP_ADC_ADS7844.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5aa2fb5f9d53ff212dba7368fd0c4e00"></a><!-- doxytag: member="AP_ADC_ADS7844.h::ADC_DATAOUT" ref="a5aa2fb5f9d53ff212dba7368fd0c4e00" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ADC_DATAOUT&nbsp;&nbsp;&nbsp;51</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html#l00008">8</a> of file <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html">AP_ADC_ADS7844.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab73167dbbd40eb138e3eb548ef907351"></a><!-- doxytag: member="AP_ADC_ADS7844.h::ADC_SPICLOCK" ref="ab73167dbbd40eb138e3eb548ef907351" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ADC_SPICLOCK&nbsp;&nbsp;&nbsp;52</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html#l00010">10</a> of file <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html">AP_ADC_ADS7844.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4befea8f39b82371375372c32827a577"></a><!-- doxytag: member="AP_ADC_ADS7844.h::bit_clear" ref="a4befea8f39b82371375372c32827a577" args="(p, m)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define bit_clear</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">p, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">m</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;((p) &amp;= ~(1&lt;&lt;m))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html#l00005">5</a> of file <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html">AP_ADC_ADS7844.h</a>.</p>
</div>
</div>
<a class="anchor" id="a05adecac4f6f6e2d5e6bf43b496bbc9f"></a><!-- doxytag: member="AP_ADC_ADS7844.h::bit_set" ref="a05adecac4f6f6e2d5e6bf43b496bbc9f" args="(p, m)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define bit_set</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">p, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">m</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;((p) |= ( 1&lt;&lt;m))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html#l00004">4</a> of file <a class="el" href="_a_p___a_d_c___a_d_s7844_8h_source.html">AP_ADC_ADS7844.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,63 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC_ADS7844.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_ADC_ADS7844.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___a_d_c___a_d_s7844_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef AP_ADC_ADS7844_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define AP_ADC_ADS7844_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a><a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#a05adecac4f6f6e2d5e6bf43b496bbc9f">00004</a> <span class="preprocessor">#define bit_set(p,m) ((p) |= ( 1&lt;&lt;m))</span>
<a name="l00005"></a><a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#a4befea8f39b82371375372c32827a577">00005</a> <span class="preprocessor"></span><span class="preprocessor">#define bit_clear(p,m) ((p) &amp;= ~(1&lt;&lt;m))</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span>
<a name="l00007"></a>00007 <span class="comment">// We use Serial Port 2 in SPI Mode</span>
<a name="l00008"></a><a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#a5aa2fb5f9d53ff212dba7368fd0c4e00">00008</a> <span class="preprocessor">#define ADC_DATAOUT 51 // MOSI</span>
<a name="l00009"></a><a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#a26eb539027d693cc3826c414d11c366d">00009</a> <span class="preprocessor"></span><span class="preprocessor">#define ADC_DATAIN 50 // MISO</span>
<a name="l00010"></a><a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#ab73167dbbd40eb138e3eb548ef907351">00010</a> <span class="preprocessor"></span><span class="preprocessor">#define ADC_SPICLOCK 52 // SCK</span>
<a name="l00011"></a><a class="code" href="_a_p___a_d_c___a_d_s7844_8h.html#ae3ad6262e79df85ff68f27ad8293e8d1">00011</a> <span class="preprocessor"></span><span class="preprocessor">#define ADC_CHIP_SELECT 33 // PC4 9 // PH6 Puerto:0x08 Bit mask : 0x40</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___a_d_c_8h.html">AP_ADC.h</a>&quot;</span>
<a name="l00014"></a>00014
<a name="l00015"></a><a class="code" href="class_a_p___a_d_c___a_d_s7844.html">00015</a> <span class="keyword">class </span><a class="code" href="class_a_p___a_d_c___a_d_s7844.html">AP_ADC_ADS7844</a> : <span class="keyword">public</span> <a class="code" href="class_a_p___a_d_c.html">AP_ADC</a>
<a name="l00016"></a>00016 {
<a name="l00017"></a>00017 <span class="keyword">public</span>:
<a name="l00018"></a>00018 <a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a282a180859046b6cf98782fc150fa61a">AP_ADC_ADS7844</a>(); <span class="comment">// Constructor</span>
<a name="l00019"></a>00019 <span class="keywordtype">void</span> <a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a15f6735b9bbe6c15a097bbb45bb024ad">Init</a>();
<a name="l00020"></a>00020 <span class="keywordtype">int</span> <a class="code" href="class_a_p___a_d_c___a_d_s7844.html#a34bdd64e83c812bdecbe9ece209cd6f3">Ch</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch_num);
<a name="l00021"></a>00021 <span class="keyword">private</span>:
<a name="l00022"></a>00022 };
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC_HIL.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_ADC_HIL.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___a_d_c___h_i_l_8h_source.html">AP_ADC_HIL.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_w_program_8h_source.html">WProgram.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_ADC_HIL.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c___h_i_l_8cpp__incl.png" border="0" usemap="#_a_p___a_d_c___h_i_l_8cpp" alt=""/></div>
<map name="_a_p___a_d_c___h_i_l_8cpp" id="_a_p___a_d_c___h_i_l_8cpp">
<area shape="rect" id="node3" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="101,83,213,112"/><area shape="rect" id="node13" href="_w_program_8h.html" title="WProgram.h" alt="" coords="237,83,336,112"/><area shape="rect" id="node7" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="115,160,200,189"/><area shape="rect" id="node9" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="81,237,233,267"/></map>
</div>
<p><a href="_a_p___a_d_c___h_i_l_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,108 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC_HIL.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_ADC_HIL.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___a_d_c___h_i_l_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___a_d_c___h_i_l_8h.html">AP_ADC_HIL.h</a>&quot;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &quot;<a class="code" href="_w_program_8h.html">WProgram.h</a>&quot;</span>
<a name="l00003"></a>00003
<a name="l00004"></a>00004 <span class="comment">/*</span>
<a name="l00005"></a>00005 <span class="comment"> AP_ADC_HIL.cpp</span>
<a name="l00006"></a>00006 <span class="comment"> Author: James Goppert</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment"> License:</span>
<a name="l00009"></a>00009 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00010"></a>00010 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00011"></a>00011 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00012"></a>00012 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment">*/</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="keyword">const</span> uint8_t AP_ADC_HIL::sensors[6] = {1,2,0,4,5,6};
<a name="l00016"></a>00016 <span class="keyword">const</span> int8_t AP_ADC_HIL::sensorSign[6] = { 1, -1, -1,-1, 1, 1};
<a name="l00017"></a>00017 <span class="keyword">const</span> <span class="keywordtype">float</span> AP_ADC_HIL::gyroBias[3] = {1665,1665,1665};
<a name="l00018"></a>00018 <span class="keyword">const</span> <span class="keywordtype">float</span> AP_ADC_HIL::accelBias[3] = {2025,2025,2025};
<a name="l00019"></a>00019 <span class="comment">// gyroScale = 1/[GyroGain*pi/180] GyroGains (0.4,0.41,0.41)</span>
<a name="l00020"></a>00020 <span class="keyword">const</span> <span class="keywordtype">float</span> AP_ADC_HIL::gyroScale[3] = {143.239, 139.746, 139.746};
<a name="l00021"></a>00021 <span class="keyword">const</span> <span class="keywordtype">float</span> AP_ADC_HIL::accelScale[3] = {418,418,418}; <span class="comment">// adcPerG</span>
<a name="l00022"></a>00022
<a name="l00023"></a><a class="code" href="class_a_p___a_d_c___h_i_l.html#aaf28ba26c4e5f7efb92ae5a77fb93b8e">00023</a> <a class="code" href="class_a_p___a_d_c___h_i_l.html#aaf28ba26c4e5f7efb92ae5a77fb93b8e">AP_ADC_HIL::AP_ADC_HIL</a>()
<a name="l00024"></a>00024 {
<a name="l00025"></a>00025 <span class="comment">// gyros set to zero for calibration</span>
<a name="l00026"></a>00026 setGyro(0,0);
<a name="l00027"></a>00027 setGyro(1,0);
<a name="l00028"></a>00028 setGyro(2,0);
<a name="l00029"></a>00029
<a name="l00030"></a>00030 <span class="comment">// accels set to zero for calibration</span>
<a name="l00031"></a>00031 setAccel(0,0);
<a name="l00032"></a>00032 setAccel(1,0);
<a name="l00033"></a>00033 setAccel(2,0);
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="comment">// set diff press and temp to zero</span>
<a name="l00036"></a>00036 setGyroTemp(0);
<a name="l00037"></a>00037 setPressure(0);
<a name="l00038"></a>00038 }
<a name="l00039"></a>00039
<a name="l00040"></a><a class="code" href="class_a_p___a_d_c___h_i_l.html#ad8daf76e8e59008219d7d1ff03d4b8f1">00040</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___a_d_c___h_i_l.html#ad8daf76e8e59008219d7d1ff03d4b8f1">AP_ADC_HIL::Init</a>(<span class="keywordtype">void</span>)
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 }
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="comment">// Read one channel value</span>
<a name="l00045"></a><a class="code" href="class_a_p___a_d_c___h_i_l.html#a7c79592a003322aec008aa48ebe8967c">00045</a> <span class="keywordtype">int</span> <a class="code" href="class_a_p___a_d_c___h_i_l.html#a7c79592a003322aec008aa48ebe8967c">AP_ADC_HIL::Ch</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch_num)
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="keywordflow">return</span> adcValue[ch_num];
<a name="l00048"></a>00048 }
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="comment">// Set one channel value</span>
<a name="l00051"></a><a class="code" href="class_a_p___a_d_c___h_i_l.html#afa27c576c7cc52fbac840c96b09bb238">00051</a> <span class="keywordtype">int</span> <a class="code" href="class_a_p___a_d_c___h_i_l.html#afa27c576c7cc52fbac840c96b09bb238">AP_ADC_HIL::setHIL</a>(int16_t p, int16_t q, int16_t r, int16_t gyroTemp,
<a name="l00052"></a>00052 int16_t aX, int16_t aY, int16_t aZ, int16_t diffPress)
<a name="l00053"></a>00053 {
<a name="l00054"></a>00054 <span class="comment">// gyros</span>
<a name="l00055"></a>00055 setGyro(0,p);
<a name="l00056"></a>00056 setGyro(1,q);
<a name="l00057"></a>00057 setGyro(2,r);
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="comment">// temp</span>
<a name="l00060"></a>00060 setGyroTemp(gyroTemp);
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <span class="comment">// accel</span>
<a name="l00063"></a>00063 setAccel(0,aX);
<a name="l00064"></a>00064 setAccel(1,aY);
<a name="l00065"></a>00065 setAccel(2,aZ);
<a name="l00066"></a>00066
<a name="l00067"></a>00067 <span class="comment">// differential pressure</span>
<a name="l00068"></a>00068 setPressure(diffPress);
<a name="l00069"></a>00069 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,64 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC_HIL.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_ADC_HIL.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;inttypes.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___a_d_c_8h_source.html">AP_ADC.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_ADC_HIL.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c___h_i_l_8h__incl.png" border="0" usemap="#_a_p___a_d_c___h_i_l_8h" alt=""/></div>
<map name="_a_p___a_d_c___h_i_l_8h" id="_a_p___a_d_c___h_i_l_8h">
<area shape="rect" id="node5" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="115,83,200,112"/><area shape="rect" id="node7" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="81,160,233,189"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___a_d_c___h_i_l_8h__dep__incl.png" border="0" usemap="#_a_p___a_d_c___h_i_l_8hdep" alt=""/></div>
<map name="_a_p___a_d_c___h_i_l_8hdep" id="_a_p___a_d_c___h_i_l_8hdep">
<area shape="rect" id="node3" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="220,83,305,112"/><area shape="rect" id="node30" href="_a_p___a_d_c___h_i_l_8cpp.html" title="AP_ADC_HIL.cpp" alt="" coords="329,83,457,112"/><area shape="rect" id="node5" href="_a_p___a_d_c_8cpp.html" title="AP_ADC.cpp" alt="" coords="5,160,107,189"/><area shape="rect" id="node7" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="131,160,283,189"/><area shape="rect" id="node13" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="440,315,555,344"/><area shape="rect" id="node15" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="329,392,417,421"/><area shape="rect" id="node22" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="357,160,485,189"/><area shape="rect" id="node10" href="_a_p___a_d_c___a_d_s7844_8cpp.html" title="AP_ADC_ADS7844.cpp" alt="" coords="115,237,283,267"/><area shape="rect" id="node19" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="441,392,572,421"/><area shape="rect" id="node17" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="323,469,424,499"/><area shape="rect" id="node24" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="357,237,440,267"/><area shape="rect" id="node28" href="_a_p___i_m_u___oilpan_8cpp.html" title="AP_IMU_Oilpan.cpp" alt="" coords="464,237,608,267"/></map>
</div>
<p><a href="_a_p___a_d_c___h_i_l_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___a_d_c___h_i_l.html">AP_ADC_HIL</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,117 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_ADC_HIL.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_ADC_HIL.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___a_d_c___h_i_l_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef AP_ADC_HIL_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define AP_ADC_HIL_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="comment">/*</span>
<a name="l00005"></a>00005 <span class="comment"> AP_ADC_HIL.h</span>
<a name="l00006"></a>00006 <span class="comment"> Author: James Goppert</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment"> License:</span>
<a name="l00009"></a>00009 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00010"></a>00010 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00011"></a>00011 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00012"></a>00012 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment">*/</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___a_d_c_8h.html">AP_ADC.h</a>&quot;</span>
<a name="l00017"></a>00017
<a name="l00019"></a>00019 <span class="comment">// A hardware in the loop model of the ADS7844 analog to digital converter</span>
<a name="l00020"></a>00020 <span class="comment">// @author James Goppert DIYDrones.com</span>
<a name="l00021"></a><a class="code" href="class_a_p___a_d_c___h_i_l.html">00021</a> <span class="keyword">class </span><a class="code" href="class_a_p___a_d_c___h_i_l.html">AP_ADC_HIL</a> : <span class="keyword">public</span> <a class="code" href="class_a_p___a_d_c.html">AP_ADC</a>
<a name="l00022"></a>00022 {
<a name="l00023"></a>00023 <span class="keyword">public</span>:
<a name="l00024"></a>00024
<a name="l00026"></a>00026 <span class="comment">// Constructor</span>
<a name="l00027"></a>00027 <a class="code" href="class_a_p___a_d_c___h_i_l.html#aaf28ba26c4e5f7efb92ae5a77fb93b8e">AP_ADC_HIL</a>(); <span class="comment">// Constructor</span>
<a name="l00028"></a>00028
<a name="l00030"></a>00030 <span class="comment">// Initializes sensor, part of public AP_ADC interface</span>
<a name="l00031"></a>00031 <span class="keywordtype">void</span> <a class="code" href="class_a_p___a_d_c___h_i_l.html#ad8daf76e8e59008219d7d1ff03d4b8f1">Init</a>();
<a name="l00032"></a>00032
<a name="l00034"></a>00034 <span class="comment">// Read the sensor, part of public AP_ADC interface</span>
<a name="l00035"></a>00035 <span class="keywordtype">int</span> <a class="code" href="class_a_p___a_d_c___h_i_l.html#a7c79592a003322aec008aa48ebe8967c">Ch</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ch_num);
<a name="l00036"></a>00036
<a name="l00038"></a>00038 <span class="comment">// Set the adc raw values given the current rotations rates,</span>
<a name="l00039"></a>00039 <span class="comment">// temps, accels, and pressures</span>
<a name="l00040"></a>00040 <span class="keywordtype">int</span> <a class="code" href="class_a_p___a_d_c___h_i_l.html#afa27c576c7cc52fbac840c96b09bb238">setHIL</a>(int16_t p, int16_t q, int16_t r, int16_t gyroTemp,
<a name="l00041"></a>00041 int16_t aX, int16_t aY, int16_t aZ, int16_t diffPress);
<a name="l00042"></a>00042
<a name="l00043"></a>00043 <span class="keyword">private</span>:
<a name="l00044"></a>00044
<a name="l00046"></a>00046 <span class="comment">// The raw adc array</span>
<a name="l00047"></a>00047 uint16_t adcValue[8];
<a name="l00048"></a>00048
<a name="l00050"></a>00050 <span class="comment">// sensor constants</span>
<a name="l00051"></a>00051 <span class="comment">// constants declared in cpp file</span>
<a name="l00052"></a>00052 <span class="comment">// @see AP_ADC_HIL.cpp</span>
<a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keyword">const</span> uint8_t sensors[6];
<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> gyroBias[3];
<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> gyroScale[3];
<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> accelBias[3];
<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> accelScale[3];
<a name="l00058"></a>00058 <span class="keyword">static</span> <span class="keyword">const</span> int8_t sensorSign[6];
<a name="l00059"></a>00059
<a name="l00061"></a>00061 <span class="comment">// gyro set function</span>
<a name="l00062"></a>00062 <span class="comment">// @param val the value of the gyro in milli rad/s</span>
<a name="l00063"></a>00063 <span class="comment">// @param index the axis for the gyro(0-x,1-y,2-z)</span>
<a name="l00064"></a>00064 <span class="keyword">inline</span> <span class="keywordtype">void</span> setGyro(uint8_t index, int16_t val) {
<a name="l00065"></a>00065 int16_t temp = val * gyroScale[index] / 1000 + gyroBias[index];
<a name="l00066"></a>00066 adcValue[sensors[index]] = (sensorSign[index] &lt; 0) ? -temp : temp;
<a name="l00067"></a>00067 }
<a name="l00068"></a>00068
<a name="l00070"></a>00070 <span class="comment">// accel set function</span>
<a name="l00071"></a>00071 <span class="comment">// @param val the value of the accel in milli g&#39;s</span>
<a name="l00072"></a>00072 <span class="comment">// @param index the axis for the accelerometer(0-x,1-y,2-z)</span>
<a name="l00073"></a>00073 <span class="keyword">inline</span> <span class="keywordtype">void</span> setAccel(uint8_t index, int16_t val) {
<a name="l00074"></a>00074 int16_t temp = val * accelScale[index] / 1000 + accelBias[index];
<a name="l00075"></a>00075 adcValue[sensors[index+3]] = (sensors[index+3] &lt; 0) ? -temp : temp;
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077
<a name="l00079"></a>00079 <span class="comment">// Sets the differential pressure adc channel</span>
<a name="l00080"></a>00080 <span class="comment">// TODO: implement</span>
<a name="l00081"></a>00081 <span class="keywordtype">void</span> setPressure(int16_t val) {}
<a name="l00082"></a>00082
<a name="l00084"></a>00084 <span class="comment">// Sets the gyro temp adc channel</span>
<a name="l00085"></a>00085 <span class="comment">// TODO: implement</span>
<a name="l00086"></a>00086 <span class="keywordtype">void</span> setGyroTemp(int16_t val) {}
<a name="l00087"></a>00087 };
<a name="l00088"></a>00088
<a name="l00089"></a>00089 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,59 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Common.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Common.cpp File Reference</h1> </div>
</div>
<div class="contents">
<p>Common utility routines for the ArduPilot libraries.
<a href="#_details">More...</a></p>
<code>#include &quot;<a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Common.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___common_8cpp__incl.png" border="0" usemap="#_a_p___common_8cpp" alt=""/></div>
<map name="_a_p___common_8cpp" id="_a_p___common_8cpp">
<area shape="rect" id="node3" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries." alt="" coords="248,83,365,112"/><area shape="rect" id="node7" href="menu_8h.html" title="Simple commandline menu subsystem. &#160;The Menu class implements a simple CLI that accepts commands type..." alt="" coords="99,160,219,189"/><area shape="rect" id="node9" href="c_09_09_8h.html" title="c++.h" alt="" coords="243,160,304,189"/><area shape="rect" id="node11" href="_a_p___vector_8h.html" title="AP_Vector.h" alt="" coords="332,237,431,267"/><area shape="rect" id="node19" href="_a_p___loop_8h.html" title="AP_Loop.h" alt="" coords="379,160,467,189"/><area shape="rect" id="node22" href="_a_p___var_8h.html" title="AP_Var.h" alt="" coords="491,160,568,189"/><area shape="rect" id="node17" href="_w_program_8h.html" title="WProgram.h" alt="" coords="448,315,547,344"/></map>
</div>
<p><a href="_a_p___common_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Common utility routines for the ArduPilot libraries. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Exercise restraint adding code here; everything in this library will be linked with any sketch using it. </dd></dl>
<p>Definition in file <a class="el" href="_a_p___common_8cpp_source.html">AP_Common.cpp</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,50 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Common.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Common.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___common_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// This is free software; you can redistribute it and/or modify it under</span>
<a name="l00004"></a>00004 <span class="comment">// the terms of the GNU Lesser General Public License as published by the</span>
<a name="l00005"></a>00005 <span class="comment">// Free Software Foundation; either version 2.1 of the License, or (at</span>
<a name="l00006"></a>00006 <span class="comment">// your option) any later version.</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008
<a name="l00015"></a>00015
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries.">AP_Common.h</a>&quot;</span>
<a name="l00017"></a>00017
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,207 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Common.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_Common.h File Reference</h1> </div>
</div>
<div class="contents">
<p>Common definitions and utility routines for the ArduPilot libraries.
<a href="#_details">More...</a></p>
<code>#include &lt;stdint.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="menu_8h_source.html">include/menu.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="c_09_09_8h_source.html">c++.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___vector_8h_source.html">AP_Vector.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___loop_8h_source.html">AP_Loop.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___var_8h_source.html">AP_Var.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Common.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___common_8h__incl.png" border="0" usemap="#_a_p___common_8h" alt=""/></div>
<map name="_a_p___common_8h" id="_a_p___common_8h">
<area shape="rect" id="node5" href="menu_8h.html" title="Simple commandline menu subsystem. &#160;The Menu class implements a simple CLI that accepts commands type..." alt="" coords="99,83,219,112"/><area shape="rect" id="node7" href="c_09_09_8h.html" title="c++.h" alt="" coords="243,83,304,112"/><area shape="rect" id="node9" href="_a_p___vector_8h.html" title="AP_Vector.h" alt="" coords="332,160,431,189"/><area shape="rect" id="node17" href="_a_p___loop_8h.html" title="AP_Loop.h" alt="" coords="379,83,467,112"/><area shape="rect" id="node20" href="_a_p___var_8h.html" title="AP_Var.h" alt="" coords="491,83,568,112"/><area shape="rect" id="node15" href="_w_program_8h.html" title="WProgram.h" alt="" coords="448,237,547,267"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___common_8h__dep__incl.png" border="0" usemap="#_a_p___common_8hdep" alt=""/></div>
<map name="_a_p___common_8hdep" id="_a_p___common_8hdep">
<area shape="rect" id="node3" href="_a_p___common_8cpp.html" title="Common utility routines for the ArduPilot libraries." alt="" coords="5,83,136,112"/><area shape="rect" id="node5" href="menu_8cpp.html" title="menu.cpp" alt="" coords="160,83,245,112"/><area shape="rect" id="node7" href="_a_p___e_e_prom_8h.html" title="AP_EEProm.h" alt="" coords="269,83,376,112"/><area shape="rect" id="node11" href="_a_p___rc_channel_8h.html" title="AP_RcChannel manager." alt="" coords="301,160,427,189"/><area shape="rect" id="node13" href="_a_p___rc_channel_8cpp.html" title="AP_RcChannel.cpp" alt="" coords="344,237,483,267"/><area shape="rect" id="node15" href="_a_p___i_m_u___oilpan_8cpp.html" title="AP_IMU_Oilpan.cpp" alt="" coords="501,83,645,112"/><area shape="rect" id="node9" href="_a_p___e_e_prom_8cpp.html" title="AP_EEProm.cpp" alt="" coords="155,160,277,189"/></map>
</div>
<p><a href="_a_p___common_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_location.html">Location</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Warning control</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrpbb75df1695a438d2c1d8b28dd6c38c9f"></a>simple menu subsystem </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___common_8h.html#a75acaba9e781937468d0911423bc0c35">PROGMEM</a>&nbsp;&nbsp;&nbsp;__attribute__(( section(&quot;.progmem.data&quot;) ))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___common_8h.html#a05ca900ebf7cd121be73c654d9ccb3eb">PSTR</a>(s)&nbsp;&nbsp;&nbsp;(__extension__({static prog_char __c[] PROGMEM = (s); &amp;__c[0];}))</td></tr>
<tr><td colspan="2"><div class="groupHeader">Conversions</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p><a class="anchor" id="amgrp6332798b12e537b25b1c6ad254e14f54"></a> Conversion macros and factors. </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___common_8h.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(x)&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___common_8h.html#a3c9d151923236c7e8ccccf86f131e550">ToDeg</a>(x)&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___common_8h.html#a3c9d151923236c7e8ccccf86f131e550">ToDeg</a>(x)&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___common_8h.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(x)&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Common definitions and utility routines for the ArduPilot libraries. </p>
<p>Definition in file <a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>.</p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a75acaba9e781937468d0911423bc0c35"></a><!-- doxytag: member="AP_Common.h::PROGMEM" ref="a75acaba9e781937468d0911423bc0c35" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PROGMEM&nbsp;&nbsp;&nbsp;__attribute__(( section(&quot;.progmem.data&quot;) ))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___common_8h_source.html#l00065">65</a> of file <a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a05ca900ebf7cd121be73c654d9ccb3eb"></a><!-- doxytag: member="AP_Common.h::PSTR" ref="a05ca900ebf7cd121be73c654d9ccb3eb" args="(s)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PSTR</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">s</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(__extension__({static prog_char __c[] PROGMEM = (s); &amp;__c[0];}))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___common_8h_source.html#l00067">67</a> of file <a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3c9d151923236c7e8ccccf86f131e550"></a><!-- doxytag: member="AP_Common.h::ToDeg" ref="a3c9d151923236c7e8ccccf86f131e550" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToDeg</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>XXX this should probably be replaced with radians()/degrees(), but their inclusion in wiring.h makes doing that here difficult. </p>
<p>Definition at line <a class="el" href="_a_p___common_8h_source.html#l00105">105</a> of file <a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3c9d151923236c7e8ccccf86f131e550"></a><!-- doxytag: member="AP_Common.h::ToDeg" ref="a3c9d151923236c7e8ccccf86f131e550" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToDeg</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>XXX this should probably be replaced with radians()/degrees(), but their inclusion in wiring.h makes doing that here difficult. </p>
<p>Definition at line <a class="el" href="_a_p___common_8h_source.html#l00105">105</a> of file <a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a728f9499baea61e7df3ae70a374f2512"></a><!-- doxytag: member="AP_Common.h::ToRad" ref="a728f9499baea61e7df3ae70a374f2512" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToRad</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___common_8h_source.html#l00106">106</a> of file <a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a728f9499baea61e7df3ae70a374f2512"></a><!-- doxytag: member="AP_Common.h::ToRad" ref="a728f9499baea61e7df3ae70a374f2512" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToRad</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___common_8h_source.html#l00106">106</a> of file <a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,126 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Common.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Common.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___common_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// This is free software; you can redistribute it and/or modify it under</span>
<a name="l00004"></a>00004 <span class="comment">// the terms of the GNU Lesser General Public License as published by the</span>
<a name="l00005"></a>00005 <span class="comment">// Free Software Foundation; either version 2.1 of the License, or (at</span>
<a name="l00006"></a>00006 <span class="comment">// your option) any later version.</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="preprocessor">#ifndef _AP_COMMON_H</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define _AP_COMMON_H</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="menu_8h.html" title="Simple commandline menu subsystem. The Menu class implements a simple CLI that accepts commands type...">include/menu.h</a>&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="c_09_09_8h.html">c++.h</a>&quot;</span> <span class="comment">// c++ additions</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___vector_8h.html">AP_Vector.h</a>&quot;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___loop_8h.html">AP_Loop.h</a>&quot;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___var_8h.html">AP_Var.h</a>&quot;</span>
<a name="l00024"></a>00024
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="comment">//</span>
<a name="l00029"></a>00029 <span class="comment">// Turn on/off warnings of interest.</span>
<a name="l00030"></a>00030 <span class="comment">//</span>
<a name="l00031"></a>00031 <span class="comment">// These warnings are normally suppressed by the Arduino IDE,</span>
<a name="l00032"></a>00032 <span class="comment">// but with some minor hacks it&#39;s possible to have warnings</span>
<a name="l00033"></a>00033 <span class="comment">// emitted. This helps greatly when diagnosing subtle issues.</span>
<a name="l00034"></a>00034 <span class="comment">//</span>
<a name="l00035"></a>00035 <span class="preprocessor">#pragma GCC diagnostic warning &quot;-Wall&quot;</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#pragma GCC diagnostic warning &quot;-Wextra&quot;</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#pragma GCC diagnostic warning &quot;-Wlogical-op&quot;</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#pragma GCC diagnostic ignored &quot;-Wredundant-decls&quot;</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="comment">// Make some dire warnings into errors</span>
<a name="l00041"></a>00041 <span class="comment">//</span>
<a name="l00042"></a>00042 <span class="comment">// Some warnings indicate questionable code; rather than let</span>
<a name="l00043"></a>00043 <span class="comment">// these slide, we force them to become errors so that the</span>
<a name="l00044"></a>00044 <span class="comment">// developer has to find a safer alternative.</span>
<a name="l00045"></a>00045 <span class="comment">//</span>
<a name="l00046"></a>00046 <span class="preprocessor">#pragma GCC diagnostic error &quot;-Wfloat-equal&quot;</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a>00048 <span class="comment">// The following is strictly for type-checking arguments to printf_P calls</span>
<a name="l00049"></a>00049 <span class="comment">// in conjunction with a suitably modified Arduino IDE; never define for</span>
<a name="l00050"></a>00050 <span class="comment">// production as it generates bad code.</span>
<a name="l00051"></a>00051 <span class="comment">//</span>
<a name="l00052"></a>00052 <span class="preprocessor">#if PRINTF_FORMAT_WARNING_DEBUG</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor"># undef PSTR</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor"># define PSTR(_x) _x // help the compiler with printf_P</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor"># define float double // silence spurious format warnings for %f</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="comment">// This is a workaround for GCC bug c++/34734.</span>
<a name="l00058"></a>00058 <span class="comment">//</span>
<a name="l00059"></a>00059 <span class="comment">// The C++ compiler normally emits many spurious warnings for the use</span>
<a name="l00060"></a>00060 <span class="comment">// of PSTR (even though it generates correct code). This workaround</span>
<a name="l00061"></a>00061 <span class="comment">// has an equivalent effect but avoids the warnings, which otherwise</span>
<a name="l00062"></a>00062 <span class="comment">// make finding real issues difficult.</span>
<a name="l00063"></a>00063 <span class="comment">//</span>
<a name="l00064"></a>00064 <span class="preprocessor"># undef PROGMEM</span>
<a name="l00065"></a><a class="code" href="_a_p___common_8h.html#a75acaba9e781937468d0911423bc0c35">00065</a> <span class="preprocessor"></span><span class="preprocessor"># define PROGMEM __attribute__(( section(&quot;.progmem.data&quot;) ))</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor"># undef PSTR</span>
<a name="l00067"></a><a class="code" href="_a_p___common_8h.html#a05ca900ebf7cd121be73c654d9ccb3eb">00067</a> <span class="preprocessor"></span><span class="preprocessor"># define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &amp;__c[0];}))</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span>
<a name="l00070"></a>00070
<a name="l00074"></a>00074 <span class="preprocessor">#define ToRad(x) (x*0.01745329252) // *pi/180</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#define ToDeg(x) (x*57.2957795131) // *180/pi</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="comment">// @}</span>
<a name="l00077"></a>00077
<a name="l00078"></a>00078
<a name="l00084"></a>00084
<a name="l00085"></a>00085
<a name="l00086"></a><a class="code" href="struct_location.html">00086</a> <span class="keyword">struct </span><a class="code" href="struct_location.html">Location</a> {
<a name="l00087"></a><a class="code" href="struct_location.html#a593656d91e577815782c34c538d9d3e8">00087</a> uint8_t <a class="code" href="struct_location.html#a593656d91e577815782c34c538d9d3e8" title="command id">id</a>;
<a name="l00088"></a><a class="code" href="struct_location.html#a37174be5ef591767697043ca8b95155c">00088</a> uint8_t <a class="code" href="struct_location.html#a37174be5ef591767697043ca8b95155c" title="param 1">p1</a>;
<a name="l00089"></a><a class="code" href="struct_location.html#a89e532f5bcc13db2f51ff9eed667c2b6">00089</a> int32_t <a class="code" href="struct_location.html#a89e532f5bcc13db2f51ff9eed667c2b6" title="param 2 - Altitude in centimeters (meters * 100)">alt</a>;
<a name="l00090"></a><a class="code" href="struct_location.html#ae51548c2cf32311043ca19b94b9a9223">00090</a> int32_t <a class="code" href="struct_location.html#ae51548c2cf32311043ca19b94b9a9223" title="param 3 - Lattitude * 10**7">lat</a>;
<a name="l00091"></a><a class="code" href="struct_location.html#a5831f0aca9e51a15adb96fad465f72f8">00091</a> int32_t <a class="code" href="struct_location.html#a5831f0aca9e51a15adb96fad465f72f8" title="param 4 - Longitude * 10**7">lng</a>;
<a name="l00092"></a>00092 };
<a name="l00093"></a>00093
<a name="l00095"></a>00095
<a name="l00101"></a>00101
<a name="l00102"></a>00102
<a name="l00105"></a><a class="code" href="_a_p___common_8h.html#a3c9d151923236c7e8ccccf86f131e550">00105</a> <span class="preprocessor">#define ToDeg(x) (x*57.2957795131) // *180/pi</span>
<a name="l00106"></a><a class="code" href="_a_p___common_8h.html#a728f9499baea61e7df3ae70a374f2512">00106</a> <span class="preprocessor"></span><span class="preprocessor">#define ToRad(x) (x*0.01745329252) // *pi/180</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span>
<a name="l00109"></a>00109
<a name="l00110"></a>00110
<a name="l00111"></a>00111 <span class="preprocessor">#endif // _AP_COMMON_H</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,66 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Compass.h File Reference</h1> </div>
</div>
<div class="contents">
<p>Catch-all header that defines all supported compass classes.
<a href="#_details">More...</a></p>
<code>#include &quot;<a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___compass___h_i_l_8h_source.html">AP_Compass_HIL.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Compass.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___compass_8h__incl.png" border="0" usemap="#_a_p___compass_8h" alt=""/></div>
<map name="_a_p___compass_8h" id="_a_p___compass_8h">
<area shape="rect" id="node3" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="5,160,192,189"/><area shape="rect" id="node26" href="_a_p___compass___h_i_l_8h.html" title="AP_Compass_HIL.h" alt="" coords="179,83,323,112"/><area shape="rect" id="node5" href="_compass_8h.html" title="Compass.h" alt="" coords="239,237,332,267"/><area shape="rect" id="node9" href="_a_p___math_8h.html" title="../AP_Math/AP_Math.h" alt="" coords="204,315,367,344"/><area shape="rect" id="node11" href="vector2_8h.html" title="vector2.h" alt="" coords="193,469,276,499"/><area shape="rect" id="node15" href="vector3_8h.html" title="vector3.h" alt="" coords="300,469,383,499"/><area shape="rect" id="node20" href="matrix3_8h.html" title="matrix3.h" alt="" coords="323,392,405,421"/><area shape="rect" id="node30" href="_w_program_8h.html" title="WProgram.h" alt="" coords="216,160,315,189"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___compass_8h__dep__incl.png" border="0" usemap="#_a_p___compass_8hdep" alt=""/></div>
<map name="_a_p___compass_8hdep" id="_a_p___compass_8hdep">
<area shape="rect" id="node3" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,83,208,112"/><area shape="rect" id="node5" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,160,100,189"/><area shape="rect" id="node9" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,160,255,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,237,107,267"/></map>
</div>
<p><a href="_a_p___compass_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Catch-all header that defines all supported compass classes. </p>
<p>Definition in file <a class="el" href="_a_p___compass_8h_source.html">AP_Compass.h</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,44 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Compass.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___compass_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___compass___h_m_c5843_8h.html">AP_Compass_HMC5843.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___compass___h_i_l_8h.html">AP_Compass_HIL.h</a>&quot;</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,51 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass_HIL.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Compass_HIL.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___compass___h_i_l_8h_source.html">AP_Compass_HIL.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Compass_HIL.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___compass___h_i_l_8cpp__incl.png" border="0" usemap="#_a_p___compass___h_i_l_8cpp" alt=""/></div>
<map name="_a_p___compass___h_i_l_8cpp" id="_a_p___compass___h_i_l_8cpp">
<area shape="rect" id="node3" href="_a_p___compass___h_i_l_8h.html" title="AP_Compass_HIL.h" alt="" coords="268,83,412,112"/><area shape="rect" id="node5" href="_compass_8h.html" title="Compass.h" alt="" coords="163,237,256,267"/><area shape="rect" id="node25" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="247,160,433,189"/><area shape="rect" id="node29" href="_w_program_8h.html" title="WProgram.h" alt="" coords="457,160,556,189"/><area shape="rect" id="node9" href="_a_p___math_8h.html" title="../AP_Math/AP_Math.h" alt="" coords="115,315,277,344"/><area shape="rect" id="node11" href="vector2_8h.html" title="vector2.h" alt="" coords="104,469,187,499"/><area shape="rect" id="node15" href="vector3_8h.html" title="vector3.h" alt="" coords="211,469,293,499"/><area shape="rect" id="node20" href="matrix3_8h.html" title="matrix3.h" alt="" coords="233,392,316,421"/></map>
</div>
<p><a href="_a_p___compass___h_i_l_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,174 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass_HIL.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Compass_HIL.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___compass___h_i_l_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> AP_Compass_HIL.cpp - Arduino Library for HIL model of HMC5843 I2C Magnetometer</span>
<a name="l00003"></a>00003 <span class="comment"> Code by James Goppert. DIYDrones.com</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and / or</span>
<a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">*/</span>
<a name="l00010"></a>00010
<a name="l00011"></a>00011
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___compass___h_i_l_8h.html">AP_Compass_HIL.h</a>&quot;</span>
<a name="l00013"></a>00013
<a name="l00014"></a>00014 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00015"></a><a class="code" href="class_a_p___compass___h_i_l.html#a54036d8a8354e8484db9f1ca33af9572">00015</a> <a class="code" href="class_a_p___compass___h_i_l.html#a54036d8a8354e8484db9f1ca33af9572">AP_Compass_HIL::AP_Compass_HIL</a>() : orientation(0), declination(0.0)
<a name="l00016"></a>00016 {
<a name="l00017"></a>00017 <span class="comment">// mag x y z offset initialisation</span>
<a name="l00018"></a>00018 memset(offset, 0, <span class="keyword">sizeof</span>(offset));
<a name="l00019"></a>00019
<a name="l00020"></a>00020 <span class="comment">// initialise orientation matrix</span>
<a name="l00021"></a>00021 orientation_matrix = ROTATION_NONE;
<a name="l00022"></a>00022 }
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00025"></a><a class="code" href="class_a_p___compass___h_i_l.html#aefa72efcf8536c3696a25de69f1731c7">00025</a> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___compass___h_i_l.html#aefa72efcf8536c3696a25de69f1731c7">AP_Compass_HIL::init</a>(<span class="keywordtype">int</span> initialise_wire_lib)
<a name="l00026"></a>00026 {
<a name="l00027"></a>00027 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> currentTime = <a class="code" href="test_8cpp.html#a941a22cb7e0f6429fe40f91e83ead3d9">millis</a>(); <span class="comment">// record current time</span>
<a name="l00028"></a>00028 <span class="keywordtype">int</span> numAttempts = 0;
<a name="l00029"></a>00029 <span class="keywordtype">int</span> success = 0;
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="comment">// calibration initialisation</span>
<a name="l00032"></a>00032 calibration[0] = 1.0;
<a name="l00033"></a>00033 calibration[1] = 1.0;
<a name="l00034"></a>00034 calibration[2] = 1.0;
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keywordflow">while</span>( success == 0 &amp;&amp; numAttempts &lt; 5 )
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 <span class="comment">// record number of attempts at initialisation</span>
<a name="l00039"></a>00039 numAttempts++;
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="comment">// read values from the compass</span>
<a name="l00042"></a>00042 <a class="code" href="class_a_p___compass___h_i_l.html#ac8d183edcd14cf5ee56895c498ebf02a">read</a>();
<a name="l00043"></a>00043 delay(10);
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <span class="comment">// calibrate</span>
<a name="l00046"></a>00046 <span class="keywordflow">if</span>( abs(<a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>) &gt; 500 &amp;&amp; abs(<a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>) &lt; 1000 &amp;&amp; abs(<a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>) &gt; 500 &amp;&amp; abs(<a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>) &lt; 1000 &amp;&amp; abs(<a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>) &gt; 500 &amp;&amp; abs(<a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>) &lt; 1000)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048 calibration[0] = fabs(715.0 / <a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>);
<a name="l00049"></a>00049 calibration[1] = fabs(715.0 / <a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>);
<a name="l00050"></a>00050 calibration[2] = fabs(715.0 / <a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>);
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="comment">// mark success</span>
<a name="l00053"></a>00053 success = 1;
<a name="l00054"></a>00054 }
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056 <span class="keywordflow">return</span>(success);
<a name="l00057"></a>00057 }
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="comment">// Read Sensor data</span>
<a name="l00060"></a><a class="code" href="class_a_p___compass___h_i_l.html#ac8d183edcd14cf5ee56895c498ebf02a">00060</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#ac8d183edcd14cf5ee56895c498ebf02a">AP_Compass_HIL::read</a>()
<a name="l00061"></a>00061 {
<a name="l00062"></a>00062 <span class="comment">// values set by setHIL function</span>
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064
<a name="l00065"></a><a class="code" href="class_a_p___compass___h_i_l.html#a755d7409dedf3e903225b36fbf16e622">00065</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#a755d7409dedf3e903225b36fbf16e622">AP_Compass_HIL::calculate</a>(<span class="keywordtype">float</span> roll, <span class="keywordtype">float</span> pitch)
<a name="l00066"></a>00066 {
<a name="l00067"></a>00067 <span class="keywordtype">float</span> headX;
<a name="l00068"></a>00068 <span class="keywordtype">float</span> headY;
<a name="l00069"></a>00069 <span class="keywordtype">float</span> cos_roll;
<a name="l00070"></a>00070 <span class="keywordtype">float</span> sin_roll;
<a name="l00071"></a>00071 <span class="keywordtype">float</span> cos_pitch;
<a name="l00072"></a>00072 <span class="keywordtype">float</span> sin_pitch;
<a name="l00073"></a>00073 <a class="code" href="class_vector3.html">Vector3f</a> rotMagVec;
<a name="l00074"></a>00074
<a name="l00075"></a>00075 cos_roll = cos(roll); <span class="comment">// Optimizacion, se puede sacar esto de la matriz DCM?</span>
<a name="l00076"></a>00076 sin_roll = sin(roll);
<a name="l00077"></a>00077 cos_pitch = cos(pitch);
<a name="l00078"></a>00078 sin_pitch = sin(pitch);
<a name="l00079"></a>00079
<a name="l00080"></a>00080 <span class="comment">// rotate the magnetometer values depending upon orientation</span>
<a name="l00081"></a>00081 <span class="keywordflow">if</span>( orientation == 0 )
<a name="l00082"></a>00082 rotMagVec = <a class="code" href="vector3_8h.html#af345ad77ba5e240c7ab72b4b2077e754">Vector3f</a>(<a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>+offset[0],<a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>+offset[1],<a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>+offset[2]);
<a name="l00083"></a>00083 <span class="keywordflow">else</span>
<a name="l00084"></a>00084 rotMagVec = orientation_matrix*<a class="code" href="vector3_8h.html#af345ad77ba5e240c7ab72b4b2077e754">Vector3f</a>(<a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>+offset[0],<a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>+offset[1],<a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>+offset[2]);
<a name="l00085"></a>00085
<a name="l00086"></a>00086 <span class="comment">// Tilt compensated Magnetic field X component:</span>
<a name="l00087"></a>00087 headX = rotMagVec.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>*cos_pitch+rotMagVec.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>*sin_roll*sin_pitch+rotMagVec.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>*cos_roll*sin_pitch;
<a name="l00088"></a>00088 <span class="comment">// Tilt compensated Magnetic field Y component:</span>
<a name="l00089"></a>00089 headY = rotMagVec.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>*cos_roll-rotMagVec.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>*sin_roll;
<a name="l00090"></a>00090 <span class="comment">// Magnetic heading</span>
<a name="l00091"></a>00091 <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> = atan2(-headY,headX);
<a name="l00092"></a>00092
<a name="l00093"></a>00093 <span class="comment">// Declination correction (if supplied)</span>
<a name="l00094"></a>00094 <span class="keywordflow">if</span>( declination != 0.0 )
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096 <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> = <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> + declination;
<a name="l00097"></a>00097 <span class="keywordflow">if</span> (<a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> &gt; M_PI) <span class="comment">// Angle normalization (-180 deg, 180 deg)</span>
<a name="l00098"></a>00098 <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> -= (2.0 * M_PI);
<a name="l00099"></a>00099 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> &lt; -M_PI)
<a name="l00100"></a>00100 <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> += (2.0 * M_PI);
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="comment">// Optimization for external DCM use. Calculate normalized components</span>
<a name="l00104"></a>00104 <a class="code" href="class_compass.html#aafc7608bd711702f519d52afbc06dc7a">heading_x</a> = cos(<a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a>);
<a name="l00105"></a>00105 <a class="code" href="class_compass.html#a2e1554fb76b067f36d011f59e7e8dd58">heading_y</a> = sin(<a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a>);
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107
<a name="l00108"></a><a class="code" href="class_a_p___compass___h_i_l.html#aae23c67a982d566e2f538509799ee277">00108</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#aae23c67a982d566e2f538509799ee277">AP_Compass_HIL::set_orientation</a>(<span class="keyword">const</span> <a class="code" href="class_matrix3.html">Matrix3f</a> &amp;rotation_matrix)
<a name="l00109"></a>00109 {
<a name="l00110"></a>00110 orientation_matrix = rotation_matrix;
<a name="l00111"></a>00111 <span class="keywordflow">if</span>( orientation_matrix == <a class="code" href="_a_p___compass___h_m_c5843_8h.html#a4df2438502f1e4fcccf06122417ef115">ROTATION_NONE</a> )
<a name="l00112"></a>00112 orientation = 0;
<a name="l00113"></a>00113 <span class="keywordflow">else</span>
<a name="l00114"></a>00114 orientation = 1;
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116
<a name="l00117"></a><a class="code" href="class_a_p___compass___h_i_l.html#a1fb0fcecfa08549ea1ca9d0cf9f7eb14">00117</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#a1fb0fcecfa08549ea1ca9d0cf9f7eb14">AP_Compass_HIL::set_offsets</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> z)
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119 offset[0] = x;
<a name="l00120"></a>00120 offset[1] = y;
<a name="l00121"></a>00121 offset[2] = z;
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123
<a name="l00124"></a><a class="code" href="class_a_p___compass___h_i_l.html#a4b4d22637d14bd5585aa8d2d5e32ea43">00124</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#a4b4d22637d14bd5585aa8d2d5e32ea43">AP_Compass_HIL::set_declination</a>(<span class="keywordtype">float</span> radians)
<a name="l00125"></a>00125 {
<a name="l00126"></a>00126 declination = radians;
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128
<a name="l00129"></a><a class="code" href="class_a_p___compass___h_i_l.html#a3a78f477d793be7840a2170de8f202d8">00129</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#a3a78f477d793be7840a2170de8f202d8">AP_Compass_HIL::setHIL</a>(<span class="keywordtype">float</span> _mag_x, <span class="keywordtype">float</span> _mag_y, <span class="keywordtype">float</span> _mag_z)
<a name="l00130"></a>00130 {
<a name="l00131"></a>00131 <span class="comment">// TODO: map floats to raw</span>
<a name="l00132"></a>00132 <a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a> = _mag_x;
<a name="l00133"></a>00133 <a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a> = _mag_y;
<a name="l00134"></a>00134 <a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a> = _mag_z;
<a name="l00135"></a>00135 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,65 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass_HIL.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_Compass_HIL.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_compass_8h_source.html">Compass.h</a>&gt;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_w_program_8h_source.html">WProgram.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Compass_HIL.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___compass___h_i_l_8h__incl.png" border="0" usemap="#_a_p___compass___h_i_l_8h" alt=""/></div>
<map name="_a_p___compass___h_i_l_8h" id="_a_p___compass___h_i_l_8h">
<area shape="rect" id="node3" href="_compass_8h.html" title="Compass.h" alt="" coords="163,160,256,189"/><area shape="rect" id="node23" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="247,83,433,112"/><area shape="rect" id="node27" href="_w_program_8h.html" title="WProgram.h" alt="" coords="457,83,556,112"/><area shape="rect" id="node7" href="_a_p___math_8h.html" title="../AP_Math/AP_Math.h" alt="" coords="115,237,277,267"/><area shape="rect" id="node9" href="vector2_8h.html" title="vector2.h" alt="" coords="104,392,187,421"/><area shape="rect" id="node13" href="vector3_8h.html" title="vector3.h" alt="" coords="211,392,293,421"/><area shape="rect" id="node18" href="matrix3_8h.html" title="matrix3.h" alt="" coords="233,315,316,344"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___compass___h_i_l_8h__dep__incl.png" border="0" usemap="#_a_p___compass___h_i_l_8hdep" alt=""/></div>
<map name="_a_p___compass___h_i_l_8hdep" id="_a_p___compass___h_i_l_8hdep">
<area shape="rect" id="node3" href="_a_p___compass_8h.html" title="Catch&#45;all header that defines all supported compass classes." alt="" coords="44,83,161,112"/><area shape="rect" id="node14" href="_a_p___compass___h_i_l_8cpp.html" title="AP_Compass_HIL.cpp" alt="" coords="185,83,345,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___compass___h_i_l_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___compass___h_i_l.html">AP_Compass_HIL</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,68 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass_HIL.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Compass_HIL.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___compass___h_i_l_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef AP_Compass_HIL_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define AP_Compass_HIL_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;<a class="code" href="_compass_8h.html">Compass.h</a>&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___compass___h_m_c5843_8h.html">AP_Compass_HMC5843.h</a>&quot;</span> <span class="comment">// to get #defines since we are modelling this</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="_w_program_8h.html">WProgram.h</a>&quot;</span>
<a name="l00007"></a>00007
<a name="l00008"></a><a class="code" href="class_a_p___compass___h_i_l.html">00008</a> <span class="keyword">class </span><a class="code" href="class_a_p___compass___h_i_l.html">AP_Compass_HIL</a> : <span class="keyword">public</span> <a class="code" href="class_compass.html">Compass</a>
<a name="l00009"></a>00009 {
<a name="l00010"></a>00010 <span class="keyword">public</span>:
<a name="l00011"></a>00011 <a class="code" href="class_a_p___compass___h_i_l.html#a54036d8a8354e8484db9f1ca33af9572">AP_Compass_HIL</a>(); <span class="comment">// Constructor</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="keywordtype">bool</span> <a class="code" href="class_a_p___compass___h_i_l.html#aefa72efcf8536c3696a25de69f1731c7">init</a>(<span class="keywordtype">int</span> initialise_wire_lib = 1);
<a name="l00014"></a>00014 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#ac8d183edcd14cf5ee56895c498ebf02a">read</a>();
<a name="l00015"></a>00015 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#a755d7409dedf3e903225b36fbf16e622">calculate</a>(<span class="keywordtype">float</span> roll, <span class="keywordtype">float</span> pitch);
<a name="l00016"></a>00016 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#aae23c67a982d566e2f538509799ee277">set_orientation</a>(<span class="keyword">const</span> <a class="code" href="class_matrix3.html">Matrix3f</a> &amp;rotation_matrix);
<a name="l00017"></a>00017 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#a1fb0fcecfa08549ea1ca9d0cf9f7eb14">set_offsets</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> z);
<a name="l00018"></a>00018 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#a4b4d22637d14bd5585aa8d2d5e32ea43">set_declination</a>(<span class="keywordtype">float</span> radians);
<a name="l00019"></a>00019 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_i_l.html#a3a78f477d793be7840a2170de8f202d8">setHIL</a>(<span class="keywordtype">float</span> Mag_X, <span class="keywordtype">float</span> Mag_Y, <span class="keywordtype">float</span> Mag_Z);
<a name="l00020"></a>00020
<a name="l00021"></a>00021 <span class="keyword">private</span>:
<a name="l00022"></a>00022 <span class="keywordtype">int</span> orientation;
<a name="l00023"></a>00023 <a class="code" href="class_matrix3.html">Matrix3f</a> orientation_matrix;
<a name="l00024"></a>00024 <span class="keywordtype">float</span> calibration[3];
<a name="l00025"></a>00025 <span class="keywordtype">int</span> offset[3];
<a name="l00026"></a>00026 <span class="keywordtype">float</span> declination;
<a name="l00027"></a>00027 };
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,219 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass_HMC5843.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_Compass_HMC5843.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;math.h&gt;</code><br/>
<code>#include &quot;WConstants.h&quot;</code><br/>
<code>#include &lt;Wire.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Compass_HMC5843.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___compass___h_m_c5843_8cpp__incl.png" border="0" usemap="#_a_p___compass___h_m_c5843_8cpp" alt=""/></div>
<map name="_a_p___compass___h_m_c5843_8cpp" id="_a_p___compass___h_m_c5843_8cpp">
<area shape="rect" id="node9" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="262,83,448,112"/><area shape="rect" id="node11" href="_compass_8h.html" title="Compass.h" alt="" coords="222,160,315,189"/><area shape="rect" id="node15" href="_a_p___math_8h.html" title="../AP_Math/AP_Math.h" alt="" coords="152,237,315,267"/><area shape="rect" id="node17" href="vector2_8h.html" title="vector2.h" alt="" coords="52,392,135,421"/><area shape="rect" id="node20" href="vector3_8h.html" title="vector3.h" alt="" coords="159,392,242,421"/><area shape="rect" id="node25" href="matrix3_8h.html" title="matrix3.h" alt="" coords="210,315,292,344"/></map>
</div>
<p><a href="_a_p___compass___h_m_c5843_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">COMPASS_ADDRESS</a>&nbsp;&nbsp;&nbsp;0x1E</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#a15238b7dcf6a8be8f8f1cc2714e03497">ConfigRegA</a>&nbsp;&nbsp;&nbsp;0x00</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#a08deb6951571140601e7175e8333deae">ConfigRegB</a>&nbsp;&nbsp;&nbsp;0x01</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#aabdf9c2147724c049a9d863e05ccad74">magGain</a>&nbsp;&nbsp;&nbsp;0x20</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#a69f2264df9626794513fa93cec1b8d26">PositiveBiasConfig</a>&nbsp;&nbsp;&nbsp;0x11</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#aac9df902d44c45313c7145b6f2e24ed7">NegativeBiasConfig</a>&nbsp;&nbsp;&nbsp;0x12</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#acc27c13c79a5a7cd1c3469052779a2ca">NormalOperation</a>&nbsp;&nbsp;&nbsp;0x10</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#a588e30fd18c31816cde04b8e3b3adf15">ModeRegister</a>&nbsp;&nbsp;&nbsp;0x02</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#ade76e9a9487fab6bddb17d2073722cc4">ContinuousConversion</a>&nbsp;&nbsp;&nbsp;0x00</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8cpp.html#ac1e326f2b01d42fc81fe26463b4e84e6">SingleConversion</a>&nbsp;&nbsp;&nbsp;0x01</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a0deae345f38c0e72dd027b6c2e7c38e7"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::COMPASS_ADDRESS" ref="a0deae345f38c0e72dd027b6c2e7c38e7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define COMPASS_ADDRESS&nbsp;&nbsp;&nbsp;0x1E</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00044">44</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a15238b7dcf6a8be8f8f1cc2714e03497"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::ConfigRegA" ref="a15238b7dcf6a8be8f8f1cc2714e03497" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ConfigRegA&nbsp;&nbsp;&nbsp;0x00</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00045">45</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a08deb6951571140601e7175e8333deae"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::ConfigRegB" ref="a08deb6951571140601e7175e8333deae" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ConfigRegB&nbsp;&nbsp;&nbsp;0x01</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00046">46</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ade76e9a9487fab6bddb17d2073722cc4"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::ContinuousConversion" ref="ade76e9a9487fab6bddb17d2073722cc4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ContinuousConversion&nbsp;&nbsp;&nbsp;0x00</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00052">52</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aabdf9c2147724c049a9d863e05ccad74"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::magGain" ref="aabdf9c2147724c049a9d863e05ccad74" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define magGain&nbsp;&nbsp;&nbsp;0x20</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00047">47</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a588e30fd18c31816cde04b8e3b3adf15"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::ModeRegister" ref="a588e30fd18c31816cde04b8e3b3adf15" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ModeRegister&nbsp;&nbsp;&nbsp;0x02</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00051">51</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aac9df902d44c45313c7145b6f2e24ed7"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::NegativeBiasConfig" ref="aac9df902d44c45313c7145b6f2e24ed7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NegativeBiasConfig&nbsp;&nbsp;&nbsp;0x12</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00049">49</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="acc27c13c79a5a7cd1c3469052779a2ca"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::NormalOperation" ref="acc27c13c79a5a7cd1c3469052779a2ca" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NormalOperation&nbsp;&nbsp;&nbsp;0x10</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00050">50</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a69f2264df9626794513fa93cec1b8d26"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::PositiveBiasConfig" ref="a69f2264df9626794513fa93cec1b8d26" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define PositiveBiasConfig&nbsp;&nbsp;&nbsp;0x11</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00048">48</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac1e326f2b01d42fc81fe26463b4e84e6"></a><!-- doxytag: member="AP_Compass_HMC5843.cpp::SingleConversion" ref="ac1e326f2b01d42fc81fe26463b4e84e6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SingleConversion&nbsp;&nbsp;&nbsp;0x01</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html#l00053">53</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8cpp_source.html">AP_Compass_HMC5843.cpp</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,271 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass_HMC5843.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Compass_HMC5843.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___compass___h_m_c5843_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 3; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> AP_Compass_HMC5843.cpp - Arduino Library for HMC5843 I2C magnetometer</span>
<a name="l00004"></a>00004 <span class="comment"> Code by Jordi Muñoz and Jose Julio. DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment"></span>
<a name="l00006"></a>00006 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00007"></a>00007 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment"></span>
<a name="l00011"></a>00011 <span class="comment"> Sensor is conected to I2C port</span>
<a name="l00012"></a>00012 <span class="comment"> Sensor is initialized in Continuos mode (10Hz)</span>
<a name="l00013"></a>00013 <span class="comment"> </span>
<a name="l00014"></a>00014 <span class="comment"> Variables:</span>
<a name="l00015"></a>00015 <span class="comment"> heading : magnetic heading</span>
<a name="l00016"></a>00016 <span class="comment"> heading_x : magnetic heading X component</span>
<a name="l00017"></a>00017 <span class="comment"> heading_y : magnetic heading Y component</span>
<a name="l00018"></a>00018 <span class="comment"> mag_x : Raw X axis magnetometer data</span>
<a name="l00019"></a>00019 <span class="comment"> mag_y : Raw Y axis magnetometer data</span>
<a name="l00020"></a>00020 <span class="comment"> mag_z : Raw Z axis magnetometer data </span>
<a name="l00021"></a>00021 <span class="comment"> last_update : the time of the last successful reading </span>
<a name="l00022"></a>00022 <span class="comment"> </span>
<a name="l00023"></a>00023 <span class="comment"> Methods:</span>
<a name="l00024"></a>00024 <span class="comment"> init() : Initialization of I2C and sensor</span>
<a name="l00025"></a>00025 <span class="comment"> read() : Read Sensor data </span>
<a name="l00026"></a>00026 <span class="comment"> calculate(float roll, float pitch) : Calculate tilt adjusted heading</span>
<a name="l00027"></a>00027 <span class="comment"> set_orientation(const Matrix3f &amp;rotation_matrix) : Set orientation of compass</span>
<a name="l00028"></a>00028 <span class="comment"> set_offsets(int x, int y, int z) : Set adjustments for HardIron disturbances</span>
<a name="l00029"></a>00029 <span class="comment"> set_declination(float radians) : Set heading adjustment between true north and magnetic north</span>
<a name="l00030"></a>00030 <span class="comment"></span>
<a name="l00031"></a>00031 <span class="comment"> To do : code optimization</span>
<a name="l00032"></a>00032 <span class="comment"> Mount position : UPDATED</span>
<a name="l00033"></a>00033 <span class="comment"> Big capacitor pointing backward, connector forward</span>
<a name="l00034"></a>00034 <span class="comment"> </span>
<a name="l00035"></a>00035 <span class="comment">*/</span>
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="comment">// AVR LibC Includes</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &quot;WConstants.h&quot;</span>
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;Wire.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___compass___h_m_c5843_8h.html">AP_Compass_HMC5843.h</a>&quot;</span>
<a name="l00043"></a>00043
<a name="l00044"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">00044</a> <span class="preprocessor">#define COMPASS_ADDRESS 0x1E</span>
<a name="l00045"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a15238b7dcf6a8be8f8f1cc2714e03497">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define ConfigRegA 0x00</span>
<a name="l00046"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a08deb6951571140601e7175e8333deae">00046</a> <span class="preprocessor"></span><span class="preprocessor">#define ConfigRegB 0x01</span>
<a name="l00047"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#aabdf9c2147724c049a9d863e05ccad74">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define magGain 0x20</span>
<a name="l00048"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a69f2264df9626794513fa93cec1b8d26">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define PositiveBiasConfig 0x11</span>
<a name="l00049"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#aac9df902d44c45313c7145b6f2e24ed7">00049</a> <span class="preprocessor"></span><span class="preprocessor">#define NegativeBiasConfig 0x12</span>
<a name="l00050"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#acc27c13c79a5a7cd1c3469052779a2ca">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define NormalOperation 0x10</span>
<a name="l00051"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a588e30fd18c31816cde04b8e3b3adf15">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define ModeRegister 0x02</span>
<a name="l00052"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#ade76e9a9487fab6bddb17d2073722cc4">00052</a> <span class="preprocessor"></span><span class="preprocessor">#define ContinuousConversion 0x00</span>
<a name="l00053"></a><a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#ac1e326f2b01d42fc81fe26463b4e84e6">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define SingleConversion 0x01</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>
<a name="l00055"></a>00055 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00056"></a><a class="code" href="class_a_p___compass___h_m_c5843.html#a94d8caab62c0f3a2a751a8eccfe6bcc1">00056</a> <a class="code" href="class_a_p___compass___h_m_c5843.html#a94d8caab62c0f3a2a751a8eccfe6bcc1">AP_Compass_HMC5843::AP_Compass_HMC5843</a>() : orientation(0), declination(0.0)
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 <span class="comment">// mag x y z offset initialisation</span>
<a name="l00059"></a>00059 offset[0] = 0;
<a name="l00060"></a>00060 offset[1] = 0;
<a name="l00061"></a>00061 offset[2] = 0;
<a name="l00062"></a>00062
<a name="l00063"></a>00063 <span class="comment">// initialise orientation matrix</span>
<a name="l00064"></a>00064 orientation_matrix = ROTATION_NONE;
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066
<a name="l00067"></a>00067 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00068"></a><a class="code" href="class_a_p___compass___h_m_c5843.html#af32c9430d20a2eb7d1df8413870c99b6">00068</a> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#af32c9430d20a2eb7d1df8413870c99b6">AP_Compass_HMC5843::init</a>(<span class="keywordtype">int</span> initialise_wire_lib)
<a name="l00069"></a>00069 {
<a name="l00070"></a>00070 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> currentTime = <a class="code" href="test_8cpp.html#a941a22cb7e0f6429fe40f91e83ead3d9">millis</a>(); <span class="comment">// record current time</span>
<a name="l00071"></a>00071 <span class="keywordtype">int</span> numAttempts = 0;
<a name="l00072"></a>00072 <span class="keywordtype">int</span> success = 0;
<a name="l00073"></a>00073
<a name="l00074"></a>00074 <span class="keywordflow">if</span>( initialise_wire_lib != 0 )
<a name="l00075"></a>00075 Wire.begin();
<a name="l00076"></a>00076
<a name="l00077"></a>00077 delay(10);
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="comment">// calibration initialisation</span>
<a name="l00080"></a>00080 calibration[0] = 1.0;
<a name="l00081"></a>00081 calibration[1] = 1.0;
<a name="l00082"></a>00082 calibration[2] = 1.0;
<a name="l00083"></a>00083
<a name="l00084"></a>00084 <span class="keywordflow">while</span>( success == 0 &amp;&amp; numAttempts &lt; 5 )
<a name="l00085"></a>00085 {
<a name="l00086"></a>00086 <span class="comment">// record number of attempts at initialisation</span>
<a name="l00087"></a>00087 numAttempts++;
<a name="l00088"></a>00088
<a name="l00089"></a>00089 <span class="comment">// force positiveBias (compass should return 715 for all channels)</span>
<a name="l00090"></a>00090 Wire.beginTransmission(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">COMPASS_ADDRESS</a>);
<a name="l00091"></a>00091 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a15238b7dcf6a8be8f8f1cc2714e03497">ConfigRegA</a>);
<a name="l00092"></a>00092 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a69f2264df9626794513fa93cec1b8d26">PositiveBiasConfig</a>);
<a name="l00093"></a>00093 <span class="keywordflow">if</span> (0 != Wire.endTransmission())
<a name="l00094"></a>00094 <span class="keywordflow">continue</span>; <span class="comment">// compass not responding on the bus</span>
<a name="l00095"></a>00095 delay(50);
<a name="l00096"></a>00096
<a name="l00097"></a>00097 <span class="comment">// set gains</span>
<a name="l00098"></a>00098 Wire.beginTransmission(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">COMPASS_ADDRESS</a>);
<a name="l00099"></a>00099 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a08deb6951571140601e7175e8333deae">ConfigRegB</a>);
<a name="l00100"></a>00100 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#aabdf9c2147724c049a9d863e05ccad74">magGain</a>);
<a name="l00101"></a>00101 Wire.endTransmission();
<a name="l00102"></a>00102 delay(10);
<a name="l00103"></a>00103
<a name="l00104"></a>00104 Wire.beginTransmission(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">COMPASS_ADDRESS</a>);
<a name="l00105"></a>00105 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a588e30fd18c31816cde04b8e3b3adf15">ModeRegister</a>);
<a name="l00106"></a>00106 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#ac1e326f2b01d42fc81fe26463b4e84e6">SingleConversion</a>);
<a name="l00107"></a>00107 Wire.endTransmission();
<a name="l00108"></a>00108 delay(10);
<a name="l00109"></a>00109
<a name="l00110"></a>00110 <span class="comment">// read values from the compass</span>
<a name="l00111"></a>00111 <a class="code" href="class_a_p___compass___h_m_c5843.html#ab60b932f53493c46e262c1f46a12bdf6">read</a>();
<a name="l00112"></a>00112 delay(10);
<a name="l00113"></a>00113
<a name="l00114"></a>00114 <span class="comment">// calibrate</span>
<a name="l00115"></a>00115 <span class="keywordflow">if</span>( abs(<a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>) &gt; 500 &amp;&amp; abs(<a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>) &lt; 1000 &amp;&amp; abs(<a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>) &gt; 500 &amp;&amp; abs(<a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>) &lt; 1000 &amp;&amp; abs(<a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>) &gt; 500 &amp;&amp; abs(<a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>) &lt; 1000)
<a name="l00116"></a>00116 {
<a name="l00117"></a>00117 calibration[0] = fabs(715.0 / <a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>);
<a name="l00118"></a>00118 calibration[1] = fabs(715.0 / <a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>);
<a name="l00119"></a>00119 calibration[2] = fabs(715.0 / <a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>);
<a name="l00120"></a>00120
<a name="l00121"></a>00121 <span class="comment">// mark success</span>
<a name="l00122"></a>00122 success = 1;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124
<a name="l00125"></a>00125 <span class="comment">// leave test mode</span>
<a name="l00126"></a>00126 Wire.beginTransmission(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">COMPASS_ADDRESS</a>);
<a name="l00127"></a>00127 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a15238b7dcf6a8be8f8f1cc2714e03497">ConfigRegA</a>);
<a name="l00128"></a>00128 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#acc27c13c79a5a7cd1c3469052779a2ca">NormalOperation</a>);
<a name="l00129"></a>00129 Wire.endTransmission();
<a name="l00130"></a>00130 delay(50);
<a name="l00131"></a>00131
<a name="l00132"></a>00132 Wire.beginTransmission(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">COMPASS_ADDRESS</a>);
<a name="l00133"></a>00133 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a588e30fd18c31816cde04b8e3b3adf15">ModeRegister</a>);
<a name="l00134"></a>00134 Wire.send(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#ade76e9a9487fab6bddb17d2073722cc4">ContinuousConversion</a>); <span class="comment">// Set continuous mode (default to 10Hz)</span>
<a name="l00135"></a>00135 Wire.endTransmission(); <span class="comment">// End transmission</span>
<a name="l00136"></a>00136 delay(50);
<a name="l00137"></a>00137 }
<a name="l00138"></a>00138 <span class="keywordflow">return</span>(success);
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <span class="comment">// Read Sensor data</span>
<a name="l00142"></a><a class="code" href="class_a_p___compass___h_m_c5843.html#ab60b932f53493c46e262c1f46a12bdf6">00142</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#ab60b932f53493c46e262c1f46a12bdf6">AP_Compass_HMC5843::read</a>()
<a name="l00143"></a>00143 {
<a name="l00144"></a>00144 <span class="keywordtype">int</span> i = 0;
<a name="l00145"></a>00145 byte buff[6];
<a name="l00146"></a>00146
<a name="l00147"></a>00147 Wire.beginTransmission(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">COMPASS_ADDRESS</a>);
<a name="l00148"></a>00148 Wire.send(0x03); <span class="comment">//sends address to read from</span>
<a name="l00149"></a>00149 Wire.endTransmission(); <span class="comment">//end transmission</span>
<a name="l00150"></a>00150
<a name="l00151"></a>00151 <span class="comment">//Wire.beginTransmission(COMPASS_ADDRESS); </span>
<a name="l00152"></a>00152 Wire.requestFrom(<a class="code" href="_a_p___compass___h_m_c5843_8cpp.html#a0deae345f38c0e72dd027b6c2e7c38e7">COMPASS_ADDRESS</a>, 6); <span class="comment">// request 6 bytes from device</span>
<a name="l00153"></a>00153 <span class="keywordflow">while</span>(Wire.available())
<a name="l00154"></a>00154 {
<a name="l00155"></a>00155 buff[i] = Wire.receive(); <span class="comment">// receive one byte</span>
<a name="l00156"></a>00156 i++;
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158 Wire.endTransmission(); <span class="comment">//end transmission</span>
<a name="l00159"></a>00159
<a name="l00160"></a>00160 <span class="keywordflow">if</span> (i==6) <span class="comment">// All bytes received?</span>
<a name="l00161"></a>00161 {
<a name="l00162"></a>00162 <span class="comment">// MSB byte first, then LSB, X,Y,Z</span>
<a name="l00163"></a>00163 <a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a> = -((((int)buff[0]) &lt;&lt; 8) | buff[1]) * calibration[0]; <span class="comment">// X axis</span>
<a name="l00164"></a>00164 <a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a> = ((((int)buff[2]) &lt;&lt; 8) | buff[3]) * calibration[1]; <span class="comment">// Y axis</span>
<a name="l00165"></a>00165 <a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a> = -((((int)buff[4]) &lt;&lt; 8) | buff[5]) * calibration[2]; <span class="comment">// Z axis</span>
<a name="l00166"></a>00166 <a class="code" href="class_compass.html#a66419d0c87ac23bc422db0279486fd31">last_update</a> = <a class="code" href="test_8cpp.html#a941a22cb7e0f6429fe40f91e83ead3d9">millis</a>(); <span class="comment">// record time of update</span>
<a name="l00167"></a>00167 }
<a name="l00168"></a>00168 }
<a name="l00169"></a>00169
<a name="l00170"></a><a class="code" href="class_a_p___compass___h_m_c5843.html#aaef4df8c859b284d17c8a374d13e4e51">00170</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#aaef4df8c859b284d17c8a374d13e4e51">AP_Compass_HMC5843::calculate</a>(<span class="keywordtype">float</span> roll, <span class="keywordtype">float</span> pitch)
<a name="l00171"></a>00171 {
<a name="l00172"></a>00172 <span class="keywordtype">float</span> headX;
<a name="l00173"></a>00173 <span class="keywordtype">float</span> headY;
<a name="l00174"></a>00174 <span class="keywordtype">float</span> cos_roll;
<a name="l00175"></a>00175 <span class="keywordtype">float</span> sin_roll;
<a name="l00176"></a>00176 <span class="keywordtype">float</span> cos_pitch;
<a name="l00177"></a>00177 <span class="keywordtype">float</span> sin_pitch;
<a name="l00178"></a>00178 <a class="code" href="class_vector3.html">Vector3f</a> rotmagVec;
<a name="l00179"></a>00179
<a name="l00180"></a>00180 cos_roll = cos(roll); <span class="comment">// Optimizacion, se puede sacar esto de la matriz DCM?</span>
<a name="l00181"></a>00181 sin_roll = sin(roll);
<a name="l00182"></a>00182 cos_pitch = cos(pitch);
<a name="l00183"></a>00183 sin_pitch = sin(pitch);
<a name="l00184"></a>00184
<a name="l00185"></a>00185 <span class="comment">// rotate the magnetometer values depending upon orientation</span>
<a name="l00186"></a>00186 <span class="keywordflow">if</span>( orientation == 0 )
<a name="l00187"></a>00187 rotmagVec = <a class="code" href="vector3_8h.html#af345ad77ba5e240c7ab72b4b2077e754">Vector3f</a>(<a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>+offset[0],<a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>+offset[1],<a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>+offset[2]);
<a name="l00188"></a>00188 <span class="keywordflow">else</span>
<a name="l00189"></a>00189 rotmagVec = orientation_matrix*<a class="code" href="vector3_8h.html#af345ad77ba5e240c7ab72b4b2077e754">Vector3f</a>(<a class="code" href="class_compass.html#a8324bcab8618a2a2076a511dec2cc8a0">mag_x</a>+offset[0],<a class="code" href="class_compass.html#a4de5f44fab49fabf8524ea79e9d3f84a">mag_y</a>+offset[1],<a class="code" href="class_compass.html#a6c05eabd47bd8116c4823481c3ea4549">mag_z</a>+offset[2]);
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <span class="comment">// Tilt compensated magnetic field X component:</span>
<a name="l00192"></a>00192 headX = rotmagVec.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>*cos_pitch+rotmagVec.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>*sin_roll*sin_pitch+rotmagVec.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>*cos_roll*sin_pitch;
<a name="l00193"></a>00193 <span class="comment">// Tilt compensated magnetic field Y component:</span>
<a name="l00194"></a>00194 headY = rotmagVec.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>*cos_roll-rotmagVec.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>*sin_roll;
<a name="l00195"></a>00195 <span class="comment">// magnetic heading</span>
<a name="l00196"></a>00196 <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> = atan2(-headY,headX);
<a name="l00197"></a>00197
<a name="l00198"></a>00198 <span class="comment">// Declination correction (if supplied)</span>
<a name="l00199"></a>00199 <span class="keywordflow">if</span>( declination != 0.0 )
<a name="l00200"></a>00200 {
<a name="l00201"></a>00201 <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> = <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> + declination;
<a name="l00202"></a>00202 <span class="keywordflow">if</span> (<a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> &gt; M_PI) <span class="comment">// Angle normalization (-180 deg, 180 deg)</span>
<a name="l00203"></a>00203 <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> -= (2.0 * M_PI);
<a name="l00204"></a>00204 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> &lt; -M_PI)
<a name="l00205"></a>00205 <a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a> += (2.0 * M_PI);
<a name="l00206"></a>00206 }
<a name="l00207"></a>00207
<a name="l00208"></a>00208 <span class="comment">// Optimization for external DCM use. Calculate normalized components</span>
<a name="l00209"></a>00209 <a class="code" href="class_compass.html#aafc7608bd711702f519d52afbc06dc7a">heading_x</a> = cos(<a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a>);
<a name="l00210"></a>00210 <a class="code" href="class_compass.html#a2e1554fb76b067f36d011f59e7e8dd58">heading_y</a> = sin(<a class="code" href="class_compass.html#af34cf40b43e957554a48ed27b848a35f">heading</a>);
<a name="l00211"></a>00211 }
<a name="l00212"></a>00212
<a name="l00213"></a><a class="code" href="class_a_p___compass___h_m_c5843.html#a5dafbafd496867d435168c8decc742fa">00213</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#a5dafbafd496867d435168c8decc742fa">AP_Compass_HMC5843::set_orientation</a>(<span class="keyword">const</span> <a class="code" href="class_matrix3.html">Matrix3f</a> &amp;rotation_matrix)
<a name="l00214"></a>00214 {
<a name="l00215"></a>00215 orientation_matrix = rotation_matrix;
<a name="l00216"></a>00216 <span class="keywordflow">if</span>( orientation_matrix == <a class="code" href="_a_p___compass___h_m_c5843_8h.html#a4df2438502f1e4fcccf06122417ef115">ROTATION_NONE</a> )
<a name="l00217"></a>00217 orientation = 0;
<a name="l00218"></a>00218 <span class="keywordflow">else</span>
<a name="l00219"></a>00219 orientation = 1;
<a name="l00220"></a>00220 }
<a name="l00221"></a>00221
<a name="l00222"></a><a class="code" href="class_a_p___compass___h_m_c5843.html#a90481085e451fe3f64d46ebb401b5aaf">00222</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#a90481085e451fe3f64d46ebb401b5aaf">AP_Compass_HMC5843::set_offsets</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> z)
<a name="l00223"></a>00223 {
<a name="l00224"></a>00224 offset[0] = x;
<a name="l00225"></a>00225 offset[1] = y;
<a name="l00226"></a>00226 offset[2] = z;
<a name="l00227"></a>00227 }
<a name="l00228"></a>00228
<a name="l00229"></a><a class="code" href="class_a_p___compass___h_m_c5843.html#a2ba3fc3b5bd78a28f717c2740948d61e">00229</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#a2ba3fc3b5bd78a28f717c2740948d61e">AP_Compass_HMC5843::set_declination</a>(<span class="keywordtype">float</span> radians)
<a name="l00230"></a>00230 {
<a name="l00231"></a>00231 declination = radians;
<a name="l00232"></a>00232 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,836 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass_HMC5843.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_Compass_HMC5843.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_compass_8h_source.html">Compass.h</a>&quot;</code><br/>
<code>#include &quot;../AP_Math/AP_Math.h&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Compass_HMC5843.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___compass___h_m_c5843_8h__incl.png" border="0" usemap="#_a_p___compass___h_m_c5843_8h" alt=""/></div>
<map name="_a_p___compass___h_m_c5843_8h" id="_a_p___compass___h_m_c5843_8h">
<area shape="rect" id="node3" href="_compass_8h.html" title="Compass.h" alt="" coords="175,83,268,112"/><area shape="rect" id="node7" href="_a_p___math_8h.html" title="../AP_Math/AP_Math.h" alt="" coords="115,160,277,189"/><area shape="rect" id="node9" href="vector2_8h.html" title="vector2.h" alt="" coords="104,315,187,344"/><area shape="rect" id="node13" href="vector3_8h.html" title="vector3.h" alt="" coords="211,315,293,344"/><area shape="rect" id="node18" href="matrix3_8h.html" title="matrix3.h" alt="" coords="233,237,316,267"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___compass___h_m_c5843_8h__dep__incl.png" border="0" usemap="#_a_p___compass___h_m_c5843_8hdep" alt=""/></div>
<map name="_a_p___compass___h_m_c5843_8hdep" id="_a_p___compass___h_m_c5843_8hdep">
<area shape="rect" id="node3" href="_a_p___compass_8h.html" title="Catch&#45;all header that defines all supported compass classes." alt="" coords="44,160,161,189"/><area shape="rect" id="node14" href="_a_p___compass___h_i_l_8h.html" title="AP_Compass_HIL.h" alt="" coords="140,83,284,112"/><area shape="rect" id="node19" href="_a_p___compass___h_m_c5843_8cpp.html" title="AP_Compass_HMC5843.cpp" alt="" coords="308,83,511,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,237,208,267"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,315,100,344"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,315,255,344"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,392,107,421"/><area shape="rect" id="node17" href="_a_p___compass___h_i_l_8cpp.html" title="AP_Compass_HIL.cpp" alt="" coords="185,160,345,189"/></map>
</div>
<p><a href="_a_p___compass___h_m_c5843_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___compass___h_m_c5843.html">AP_Compass_HMC5843</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a4df2438502f1e4fcccf06122417ef115">ROTATION_NONE</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(1, 0, 0, 0, 1, 0, 0 ,0, 1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a7e604e9771a7b454945d01aa8c0683e8">ROTATION_YAW_45</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0.70710678, -0.70710678, 0, 0.70710678, 0.70710678, 0, 0, 0, 1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a0b9d7e2557972b95c5a679a916a94e0e">ROTATION_YAW_90</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0, -1, 0, 1, 0, 0, 0, 0, 1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a5c6438440432b57017fe01fd678ca957">ROTATION_YAW_135</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-0.70710678, -0.70710678, 0, 0.70710678, -0.70710678, 0, 0, 0, 1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a5a122ed874d2cf6086912b9e866b1898">ROTATION_YAW_180</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-1, 0, 0, 0, -1, 0, 0, 0, 1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a2a2f398ba3c0f96097649712cce61329">ROTATION_YAW_225</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-0.70710678, 0.70710678, 0, -0.70710678, -0.70710678, 0, 0, 0, 1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a3faca3e51a129e29afc2dae55630d771">ROTATION_YAW_270</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0, 1, 0, -1, 0, 0, 0, 0, 1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#ab5b3f4f6b27a8a12713f7f94c0b08ab4">ROTATION_YAW_315</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0.70710678, 0.70710678, 0, -0.70710678, 0.70710678, 0, 0, 0, 1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#adcff3b2c8133dadb6aba45cba2b026fa">ROTATION_ROLL_180</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(1, 0, 0, 0, -1, 0, 0, 0, -1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a145d713092a60ae5245f7510ec4d8676">ROTATION_ROLL_180_YAW_45</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0.70710678, 0.70710678, 0, 0.70710678, -0.70710678, 0, 0, 0, -1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a1ffe5ed8da3929481fd36bf157a1bc86">ROTATION_ROLL_180_YAW_90</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0, 1, 0, 1, 0, 0, 0, 0, -1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#ad68e02a96a965780dfc84eed448b803d">ROTATION_ROLL_180_YAW_135</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-0.70710678, 0.70710678, 0, 0.70710678, 0.70710678, 0, 0, 0, -1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a36ebd710a6ca9c6cd4b6aebd17b1ef50">ROTATION_PITCH_180</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-1, 0, 0, 0, 1, 0, 0, 0, -1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#adb01c2afda2bd2316b207fc3eed9a920">ROTATION_ROLL_180_YAW_225</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-0.70710678, -0.70710678, 0, -0.70710678, 0.70710678, 0, 0, 0, -1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a5b798aa7ce4235f581ba9ff4ecc401c2">ROTATION_ROLL_180_YAW_270</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0, -1, 0, -1, 0, 0, 0, 0, -1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a2b3bb9bfe8e12743ec6bbbcc73d2b564">ROTATION_ROLL_180_YAW_315</a>&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0.70710678, -0.70710678, 0, -0.70710678, -0.70710678, 0, 0, 0, -1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#aecb68fb696735acfc11242fa2ffa2b2e">AP_COMPASS_COMPONENTS_UP_PINS_FORWARD</a>&nbsp;&nbsp;&nbsp;ROTATION_NONE</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#ad6e2a30f55918963430aebea6d96a6d6">AP_COMPASS_COMPONENTS_UP_PINS_FORWARD_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_45</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a25e8e548317f53addbb7dd1ddb9e7e0e">AP_COMPASS_COMPONENTS_UP_PINS_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_90</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a05cf7b33f5f13ceb421c73715707f81e">AP_COMPASS_COMPONENTS_UP_PINS_BACK_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_135</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#abe2e1c42c865208b61c72fe578144064">AP_COMPASS_COMPONENTS_UP_PINS_BACK</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_180</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#ade680db5fbfc0bf8c3fd6fc1d9a88ced">AP_COMPASS_COMPONENTS_UP_PINS_BACK_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_225</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a49041dfe68b20a184d74279706366ac4">AP_COMPASS_COMPONENTS_UP_PINS_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_270</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a03c6ff046975193444b044be79d1cb5e">AP_COMPASS_COMPONENTS_UP_PINS_FORWARD_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_315</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#adcecbcee633e567e56ccd637d0654542">AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#afc0533871aaf8b7b340c0bfd6e4bcd4e">AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_45</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a1d50a9c38f9eb713f13c0f3e9bb58e45">AP_COMPASS_COMPONENTS_DOWN_PINS_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_90</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a5958bccac96c255cb2aa242d84507121">AP_COMPASS_COMPONENTS_DOWN_PINS_BACK_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_135</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a326cb734017b19efe97a317fcf6e2102">AP_COMPASS_COMPONENTS_DOWN_PINS_BACK</a>&nbsp;&nbsp;&nbsp;ROTATION_PITCH_180</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a0aa722cbdacc3940df027ea5a4158224">AP_COMPASS_COMPONENTS_DOWN_PINS_BACK_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_225</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a2f836afa9cc511f39cc7d9774712838f">AP_COMPASS_COMPONENTS_DOWN_PINS_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_270</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#aa8c6965ce41bdff050efad3906a520e0">AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_315</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a8b7d9c3f1976ab63d9fd41b2ce8d9c33">AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_270</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a8d23f7ac7ae377d7ea9b5699f242eb61">AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_315</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a54f71e3e28c128c56f9412a52ba37867">AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_NONE</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#afe13734c86fe1d72d91a70ef7242024e">AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_45</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a2381b4f71301976061dfd7a6ae801748">AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_90</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a08fdaddb505aee1f0ec3dbaa83946e89">AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_135</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#aff5c87a5cd3cf8a62ad79730a52f6e53">AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_180</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a6992df8f3b7f41bf21f29268e83c4a78">AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_YAW_225</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#ac853631d69420b18ea5fe3dca912656e">AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_90</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#aeac9e3d4f50daac4998f1b9d304ac1c4">AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_135</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a698237f0504c9d3c5f3a8ee6a2dff3e3">AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_PITCH_180</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#abfbc0401c1acbfd1c3cb1b332d547ac8">AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK_RIGHT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_225</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a3c8cf640b5fd3d16caefa226ee3d4fc2">AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_270</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#ac6da11ca6e64ea5b53f97526e5d8124b">AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_315</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#ade65c3c17495137e1c629ee73f6b0623">AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___compass___h_m_c5843_8h.html#a5bd15251481326faf2b4b00a3773b7f0">AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD_LEFT</a>&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_45</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a326cb734017b19efe97a317fcf6e2102"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_DOWN_PINS_BACK" ref="a326cb734017b19efe97a317fcf6e2102" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_DOWN_PINS_BACK&nbsp;&nbsp;&nbsp;ROTATION_PITCH_180</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00038">38</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0aa722cbdacc3940df027ea5a4158224"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_DOWN_PINS_BACK_LEFT" ref="a0aa722cbdacc3940df027ea5a4158224" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_DOWN_PINS_BACK_LEFT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_225</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00039">39</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5958bccac96c255cb2aa242d84507121"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_DOWN_PINS_BACK_RIGHT" ref="a5958bccac96c255cb2aa242d84507121" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_DOWN_PINS_BACK_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_135</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00037">37</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="adcecbcee633e567e56ccd637d0654542"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD" ref="adcecbcee633e567e56ccd637d0654542" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00034">34</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa8c6965ce41bdff050efad3906a520e0"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD_LEFT" ref="aa8c6965ce41bdff050efad3906a520e0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD_LEFT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_315</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00041">41</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="afc0533871aaf8b7b340c0bfd6e4bcd4e"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD_RIGHT" ref="afc0533871aaf8b7b340c0bfd6e4bcd4e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_45</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00035">35</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2f836afa9cc511f39cc7d9774712838f"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_DOWN_PINS_LEFT" ref="a2f836afa9cc511f39cc7d9774712838f" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_DOWN_PINS_LEFT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_270</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00040">40</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1d50a9c38f9eb713f13c0f3e9bb58e45"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_DOWN_PINS_RIGHT" ref="a1d50a9c38f9eb713f13c0f3e9bb58e45" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_DOWN_PINS_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_90</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00036">36</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="abe2e1c42c865208b61c72fe578144064"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_UP_PINS_BACK" ref="abe2e1c42c865208b61c72fe578144064" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_UP_PINS_BACK&nbsp;&nbsp;&nbsp;ROTATION_YAW_180</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00030">30</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="ade680db5fbfc0bf8c3fd6fc1d9a88ced"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_UP_PINS_BACK_LEFT" ref="ade680db5fbfc0bf8c3fd6fc1d9a88ced" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_UP_PINS_BACK_LEFT&nbsp;&nbsp;&nbsp;ROTATION_YAW_225</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00031">31</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a05cf7b33f5f13ceb421c73715707f81e"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_UP_PINS_BACK_RIGHT" ref="a05cf7b33f5f13ceb421c73715707f81e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_UP_PINS_BACK_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_YAW_135</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00029">29</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="aecb68fb696735acfc11242fa2ffa2b2e"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_UP_PINS_FORWARD" ref="aecb68fb696735acfc11242fa2ffa2b2e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_UP_PINS_FORWARD&nbsp;&nbsp;&nbsp;ROTATION_NONE</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00026">26</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a03c6ff046975193444b044be79d1cb5e"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_UP_PINS_FORWARD_LEFT" ref="a03c6ff046975193444b044be79d1cb5e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_UP_PINS_FORWARD_LEFT&nbsp;&nbsp;&nbsp;ROTATION_YAW_315</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00033">33</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad6e2a30f55918963430aebea6d96a6d6"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_UP_PINS_FORWARD_RIGHT" ref="ad6e2a30f55918963430aebea6d96a6d6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_UP_PINS_FORWARD_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_YAW_45</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00027">27</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a49041dfe68b20a184d74279706366ac4"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_UP_PINS_LEFT" ref="a49041dfe68b20a184d74279706366ac4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_UP_PINS_LEFT&nbsp;&nbsp;&nbsp;ROTATION_YAW_270</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00032">32</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a25e8e548317f53addbb7dd1ddb9e7e0e"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_COMPONENTS_UP_PINS_RIGHT" ref="a25e8e548317f53addbb7dd1ddb9e7e0e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_COMPONENTS_UP_PINS_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_YAW_90</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00028">28</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3c8cf640b5fd3d16caefa226ee3d4fc2"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK" ref="a3c8cf640b5fd3d16caefa226ee3d4fc2" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_270</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00056">56</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac6da11ca6e64ea5b53f97526e5d8124b"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK_LEFT" ref="ac6da11ca6e64ea5b53f97526e5d8124b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK_LEFT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_315</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00057">57</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="abfbc0401c1acbfd1c3cb1b332d547ac8"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK_RIGHT" ref="abfbc0401c1acbfd1c3cb1b332d547ac8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_225</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00055">55</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac853631d69420b18ea5fe3dca912656e"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD" ref="ac853631d69420b18ea5fe3dca912656e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_90</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00052">52</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5bd15251481326faf2b4b00a3773b7f0"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD_LEFT" ref="a5bd15251481326faf2b4b00a3773b7f0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD_LEFT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_45</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00059">59</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="aeac9e3d4f50daac4998f1b9d304ac1c4"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD_RIGHT" ref="aeac9e3d4f50daac4998f1b9d304ac1c4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180_YAW_135</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00053">53</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="ade65c3c17495137e1c629ee73f6b0623"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_LEFT" ref="ade65c3c17495137e1c629ee73f6b0623" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_LEFT&nbsp;&nbsp;&nbsp;ROTATION_ROLL_180</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00058">58</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a698237f0504c9d3c5f3a8ee6a2dff3e3"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_RIGHT" ref="a698237f0504c9d3c5f3a8ee6a2dff3e3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_PITCH_180</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00054">54</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2381b4f71301976061dfd7a6ae801748"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK" ref="a2381b4f71301976061dfd7a6ae801748" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK&nbsp;&nbsp;&nbsp;ROTATION_YAW_90</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00048">48</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a08fdaddb505aee1f0ec3dbaa83946e89"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK_LEFT" ref="a08fdaddb505aee1f0ec3dbaa83946e89" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK_LEFT&nbsp;&nbsp;&nbsp;ROTATION_YAW_135</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00049">49</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="afe13734c86fe1d72d91a70ef7242024e"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK_RIGHT" ref="afe13734c86fe1d72d91a70ef7242024e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_YAW_45</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00047">47</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8b7d9c3f1976ab63d9fd41b2ce8d9c33"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD" ref="a8b7d9c3f1976ab63d9fd41b2ce8d9c33" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD&nbsp;&nbsp;&nbsp;ROTATION_YAW_270</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00044">44</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6992df8f3b7f41bf21f29268e83c4a78"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD_LEFT" ref="a6992df8f3b7f41bf21f29268e83c4a78" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD_LEFT&nbsp;&nbsp;&nbsp;ROTATION_YAW_225</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00051">51</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a8d23f7ac7ae377d7ea9b5699f242eb61"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD_RIGHT" ref="a8d23f7ac7ae377d7ea9b5699f242eb61" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_YAW_315</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00045">45</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="aff5c87a5cd3cf8a62ad79730a52f6e53"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_LEFT" ref="aff5c87a5cd3cf8a62ad79730a52f6e53" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_LEFT&nbsp;&nbsp;&nbsp;ROTATION_YAW_180</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00050">50</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a54f71e3e28c128c56f9412a52ba37867"></a><!-- doxytag: member="AP_Compass_HMC5843.h::AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_RIGHT" ref="a54f71e3e28c128c56f9412a52ba37867" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_RIGHT&nbsp;&nbsp;&nbsp;ROTATION_NONE</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00046">46</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4df2438502f1e4fcccf06122417ef115"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_NONE" ref="a4df2438502f1e4fcccf06122417ef115" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_NONE&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(1, 0, 0, 0, 1, 0, 0 ,0, 1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00008">8</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a36ebd710a6ca9c6cd4b6aebd17b1ef50"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_PITCH_180" ref="a36ebd710a6ca9c6cd4b6aebd17b1ef50" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_PITCH_180&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-1, 0, 0, 0, 1, 0, 0, 0, -1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00020">20</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="adcff3b2c8133dadb6aba45cba2b026fa"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_ROLL_180" ref="adcff3b2c8133dadb6aba45cba2b026fa" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_ROLL_180&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(1, 0, 0, 0, -1, 0, 0, 0, -1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00016">16</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad68e02a96a965780dfc84eed448b803d"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_ROLL_180_YAW_135" ref="ad68e02a96a965780dfc84eed448b803d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_ROLL_180_YAW_135&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-0.70710678, 0.70710678, 0, 0.70710678, 0.70710678, 0, 0, 0, -1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00019">19</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="adb01c2afda2bd2316b207fc3eed9a920"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_ROLL_180_YAW_225" ref="adb01c2afda2bd2316b207fc3eed9a920" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_ROLL_180_YAW_225&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-0.70710678, -0.70710678, 0, -0.70710678, 0.70710678, 0, 0, 0, -1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00021">21</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5b798aa7ce4235f581ba9ff4ecc401c2"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_ROLL_180_YAW_270" ref="a5b798aa7ce4235f581ba9ff4ecc401c2" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_ROLL_180_YAW_270&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0, -1, 0, -1, 0, 0, 0, 0, -1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00022">22</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2b3bb9bfe8e12743ec6bbbcc73d2b564"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_ROLL_180_YAW_315" ref="a2b3bb9bfe8e12743ec6bbbcc73d2b564" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_ROLL_180_YAW_315&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0.70710678, -0.70710678, 0, -0.70710678, -0.70710678, 0, 0, 0, -1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00023">23</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a145d713092a60ae5245f7510ec4d8676"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_ROLL_180_YAW_45" ref="a145d713092a60ae5245f7510ec4d8676" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_ROLL_180_YAW_45&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0.70710678, 0.70710678, 0, 0.70710678, -0.70710678, 0, 0, 0, -1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00017">17</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1ffe5ed8da3929481fd36bf157a1bc86"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_ROLL_180_YAW_90" ref="a1ffe5ed8da3929481fd36bf157a1bc86" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_ROLL_180_YAW_90&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0, 1, 0, 1, 0, 0, 0, 0, -1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00018">18</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5c6438440432b57017fe01fd678ca957"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_YAW_135" ref="a5c6438440432b57017fe01fd678ca957" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_YAW_135&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-0.70710678, -0.70710678, 0, 0.70710678, -0.70710678, 0, 0, 0, 1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00011">11</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5a122ed874d2cf6086912b9e866b1898"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_YAW_180" ref="a5a122ed874d2cf6086912b9e866b1898" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_YAW_180&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-1, 0, 0, 0, -1, 0, 0, 0, 1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00012">12</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2a2f398ba3c0f96097649712cce61329"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_YAW_225" ref="a2a2f398ba3c0f96097649712cce61329" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_YAW_225&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(-0.70710678, 0.70710678, 0, -0.70710678, -0.70710678, 0, 0, 0, 1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00013">13</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3faca3e51a129e29afc2dae55630d771"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_YAW_270" ref="a3faca3e51a129e29afc2dae55630d771" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_YAW_270&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0, 1, 0, -1, 0, 0, 0, 0, 1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00014">14</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="ab5b3f4f6b27a8a12713f7f94c0b08ab4"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_YAW_315" ref="ab5b3f4f6b27a8a12713f7f94c0b08ab4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_YAW_315&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0.70710678, 0.70710678, 0, -0.70710678, 0.70710678, 0, 0, 0, 1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00015">15</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7e604e9771a7b454945d01aa8c0683e8"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_YAW_45" ref="a7e604e9771a7b454945d01aa8c0683e8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_YAW_45&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0.70710678, -0.70710678, 0, 0.70710678, 0.70710678, 0, 0, 0, 1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00009">9</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0b9d7e2557972b95c5a679a916a94e0e"></a><!-- doxytag: member="AP_Compass_HMC5843.h::ROTATION_YAW_90" ref="a0b9d7e2557972b95c5a679a916a94e0e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ROTATION_YAW_90&nbsp;&nbsp;&nbsp;<a class="el" href="class_matrix3.html">Matrix3f</a>(0, -1, 0, 1, 0, 0, 0, 0, 1)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html#l00010">10</a> of file <a class="el" href="_a_p___compass___h_m_c5843_8h_source.html">AP_Compass_HMC5843.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,117 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Compass_HMC5843.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Compass_HMC5843.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___compass___h_m_c5843_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef AP_Compass_HMC5843_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define AP_Compass_HMC5843_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="_compass_8h.html">Compass.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;../AP_Math/AP_Math.h&quot;</span>
<a name="l00006"></a>00006
<a name="l00007"></a>00007 <span class="comment">// Rotation matrices</span>
<a name="l00008"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a4df2438502f1e4fcccf06122417ef115">00008</a> <span class="preprocessor">#define ROTATION_NONE Matrix3f(1, 0, 0, 0, 1, 0, 0 ,0, 1)</span>
<a name="l00009"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a7e604e9771a7b454945d01aa8c0683e8">00009</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_YAW_45 Matrix3f(0.70710678, -0.70710678, 0, 0.70710678, 0.70710678, 0, 0, 0, 1)</span>
<a name="l00010"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a0b9d7e2557972b95c5a679a916a94e0e">00010</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_YAW_90 Matrix3f(0, -1, 0, 1, 0, 0, 0, 0, 1)</span>
<a name="l00011"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a5c6438440432b57017fe01fd678ca957">00011</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_YAW_135 Matrix3f(-0.70710678, -0.70710678, 0, 0.70710678, -0.70710678, 0, 0, 0, 1)</span>
<a name="l00012"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a5a122ed874d2cf6086912b9e866b1898">00012</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_YAW_180 Matrix3f(-1, 0, 0, 0, -1, 0, 0, 0, 1)</span>
<a name="l00013"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a2a2f398ba3c0f96097649712cce61329">00013</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_YAW_225 Matrix3f(-0.70710678, 0.70710678, 0, -0.70710678, -0.70710678, 0, 0, 0, 1)</span>
<a name="l00014"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a3faca3e51a129e29afc2dae55630d771">00014</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_YAW_270 Matrix3f(0, 1, 0, -1, 0, 0, 0, 0, 1)</span>
<a name="l00015"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#ab5b3f4f6b27a8a12713f7f94c0b08ab4">00015</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_YAW_315 Matrix3f(0.70710678, 0.70710678, 0, -0.70710678, 0.70710678, 0, 0, 0, 1)</span>
<a name="l00016"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#adcff3b2c8133dadb6aba45cba2b026fa">00016</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_ROLL_180 Matrix3f(1, 0, 0, 0, -1, 0, 0, 0, -1)</span>
<a name="l00017"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a145d713092a60ae5245f7510ec4d8676">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_ROLL_180_YAW_45 Matrix3f(0.70710678, 0.70710678, 0, 0.70710678, -0.70710678, 0, 0, 0, -1)</span>
<a name="l00018"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a1ffe5ed8da3929481fd36bf157a1bc86">00018</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_ROLL_180_YAW_90 Matrix3f(0, 1, 0, 1, 0, 0, 0, 0, -1)</span>
<a name="l00019"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#ad68e02a96a965780dfc84eed448b803d">00019</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_ROLL_180_YAW_135 Matrix3f(-0.70710678, 0.70710678, 0, 0.70710678, 0.70710678, 0, 0, 0, -1)</span>
<a name="l00020"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a36ebd710a6ca9c6cd4b6aebd17b1ef50">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_PITCH_180 Matrix3f(-1, 0, 0, 0, 1, 0, 0, 0, -1)</span>
<a name="l00021"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#adb01c2afda2bd2316b207fc3eed9a920">00021</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_ROLL_180_YAW_225 Matrix3f(-0.70710678, -0.70710678, 0, -0.70710678, 0.70710678, 0, 0, 0, -1)</span>
<a name="l00022"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a5b798aa7ce4235f581ba9ff4ecc401c2">00022</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_ROLL_180_YAW_270 Matrix3f(0, -1, 0, -1, 0, 0, 0, 0, -1)</span>
<a name="l00023"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a2b3bb9bfe8e12743ec6bbbcc73d2b564">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATION_ROLL_180_YAW_315 Matrix3f(0.70710678, -0.70710678, 0, -0.70710678, -0.70710678, 0, 0, 0, -1)</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="comment">// orientations for DIYDrones magnetometer</span>
<a name="l00026"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#aecb68fb696735acfc11242fa2ffa2b2e">00026</a> <span class="preprocessor">#define AP_COMPASS_COMPONENTS_UP_PINS_FORWARD ROTATION_NONE</span>
<a name="l00027"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#ad6e2a30f55918963430aebea6d96a6d6">00027</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_UP_PINS_FORWARD_RIGHT ROTATION_YAW_45</span>
<a name="l00028"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a25e8e548317f53addbb7dd1ddb9e7e0e">00028</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_UP_PINS_RIGHT ROTATION_YAW_90</span>
<a name="l00029"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a05cf7b33f5f13ceb421c73715707f81e">00029</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_UP_PINS_BACK_RIGHT ROTATION_YAW_135</span>
<a name="l00030"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#abe2e1c42c865208b61c72fe578144064">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_UP_PINS_BACK ROTATION_YAW_180</span>
<a name="l00031"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#ade680db5fbfc0bf8c3fd6fc1d9a88ced">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_UP_PINS_BACK_LEFT ROTATION_YAW_225</span>
<a name="l00032"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a49041dfe68b20a184d74279706366ac4">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_UP_PINS_LEFT ROTATION_YAW_270</span>
<a name="l00033"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a03c6ff046975193444b044be79d1cb5e">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_UP_PINS_FORWARD_LEFT ROTATION_YAW_315</span>
<a name="l00034"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#adcecbcee633e567e56ccd637d0654542">00034</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD ROTATION_ROLL_180</span>
<a name="l00035"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#afc0533871aaf8b7b340c0bfd6e4bcd4e">00035</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD_RIGHT ROTATION_ROLL_180_YAW_45</span>
<a name="l00036"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a1d50a9c38f9eb713f13c0f3e9bb58e45">00036</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_DOWN_PINS_RIGHT ROTATION_ROLL_180_YAW_90</span>
<a name="l00037"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a5958bccac96c255cb2aa242d84507121">00037</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_DOWN_PINS_BACK_RIGHT ROTATION_ROLL_180_YAW_135</span>
<a name="l00038"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a326cb734017b19efe97a317fcf6e2102">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_DOWN_PINS_BACK ROTATION_PITCH_180</span>
<a name="l00039"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a0aa722cbdacc3940df027ea5a4158224">00039</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_DOWN_PINS_BACK_LEFT ROTATION_ROLL_180_YAW_225</span>
<a name="l00040"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a2f836afa9cc511f39cc7d9774712838f">00040</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_DOWN_PINS_LEFT ROTATION_ROLL_180_YAW_270</span>
<a name="l00041"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#aa8c6965ce41bdff050efad3906a520e0">00041</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD_LEFT ROTATION_ROLL_180_YAW_315</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span>
<a name="l00043"></a>00043 <span class="comment">// orientations for Sparkfun magnetometer</span>
<a name="l00044"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a8b7d9c3f1976ab63d9fd41b2ce8d9c33">00044</a> <span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD ROTATION_YAW_270</span>
<a name="l00045"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a8d23f7ac7ae377d7ea9b5699f242eb61">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD_RIGHT ROTATION_YAW_315</span>
<a name="l00046"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a54f71e3e28c128c56f9412a52ba37867">00046</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_RIGHT ROTATION_NONE</span>
<a name="l00047"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#afe13734c86fe1d72d91a70ef7242024e">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK_RIGHT ROTATION_YAW_45</span>
<a name="l00048"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a2381b4f71301976061dfd7a6ae801748">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK ROTATION_YAW_90</span>
<a name="l00049"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a08fdaddb505aee1f0ec3dbaa83946e89">00049</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_BACK_LEFT ROTATION_YAW_135</span>
<a name="l00050"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#aff5c87a5cd3cf8a62ad79730a52f6e53">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_LEFT ROTATION_YAW_180</span>
<a name="l00051"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a6992df8f3b7f41bf21f29268e83c4a78">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_UP_PINS_FORWARD_LEFT ROTATION_YAW_225</span>
<a name="l00052"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#ac853631d69420b18ea5fe3dca912656e">00052</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD ROTATION_ROLL_180_YAW_90</span>
<a name="l00053"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#aeac9e3d4f50daac4998f1b9d304ac1c4">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD_RIGHT ROTATION_ROLL_180_YAW_135</span>
<a name="l00054"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a698237f0504c9d3c5f3a8ee6a2dff3e3">00054</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_RIGHT ROTATION_PITCH_180</span>
<a name="l00055"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#abfbc0401c1acbfd1c3cb1b332d547ac8">00055</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK_RIGHT ROTATION_ROLL_180_YAW_225</span>
<a name="l00056"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a3c8cf640b5fd3d16caefa226ee3d4fc2">00056</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK ROTATION_ROLL_180_YAW_270</span>
<a name="l00057"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#ac6da11ca6e64ea5b53f97526e5d8124b">00057</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_BACK_LEFT ROTATION_ROLL_180_YAW_315</span>
<a name="l00058"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#ade65c3c17495137e1c629ee73f6b0623">00058</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_LEFT ROTATION_ROLL_180</span>
<a name="l00059"></a><a class="code" href="_a_p___compass___h_m_c5843_8h.html#a5bd15251481326faf2b4b00a3773b7f0">00059</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_COMPASS_SPARKFUN_COMPONENTS_DOWN_PINS_FORWARD_LEFT ROTATION_ROLL_180_YAW_45</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span>
<a name="l00061"></a><a class="code" href="class_a_p___compass___h_m_c5843.html">00061</a> <span class="keyword">class </span><a class="code" href="class_a_p___compass___h_m_c5843.html">AP_Compass_HMC5843</a> : <span class="keyword">public</span> <a class="code" href="class_compass.html">Compass</a>
<a name="l00062"></a>00062 {
<a name="l00063"></a>00063 <span class="keyword">private</span>:
<a name="l00064"></a>00064 <span class="keywordtype">int</span> orientation;
<a name="l00065"></a>00065 <a class="code" href="class_matrix3.html">Matrix3f</a> orientation_matrix;
<a name="l00066"></a>00066 <span class="keywordtype">float</span> calibration[3];
<a name="l00067"></a>00067 <span class="keywordtype">int</span> offset[3];
<a name="l00068"></a>00068 <span class="keywordtype">float</span> declination;
<a name="l00069"></a>00069 <span class="keyword">public</span>:
<a name="l00070"></a>00070 <a class="code" href="class_a_p___compass___h_m_c5843.html#a94d8caab62c0f3a2a751a8eccfe6bcc1">AP_Compass_HMC5843</a>(); <span class="comment">// Constructor</span>
<a name="l00071"></a>00071 <span class="keywordtype">bool</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#af32c9430d20a2eb7d1df8413870c99b6">init</a>(<span class="keywordtype">int</span> initialiseWireLib = 1);
<a name="l00072"></a>00072 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#ab60b932f53493c46e262c1f46a12bdf6">read</a>();
<a name="l00073"></a>00073 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#aaef4df8c859b284d17c8a374d13e4e51">calculate</a>(<span class="keywordtype">float</span> roll, <span class="keywordtype">float</span> pitch);
<a name="l00074"></a>00074 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#a5dafbafd496867d435168c8decc742fa">set_orientation</a>(<span class="keyword">const</span> <a class="code" href="class_matrix3.html">Matrix3f</a> &amp;rotation_matrix);
<a name="l00075"></a>00075 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#a90481085e451fe3f64d46ebb401b5aaf">set_offsets</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> z);
<a name="l00076"></a>00076 <span class="keywordtype">void</span> <a class="code" href="class_a_p___compass___h_m_c5843.html#a2ba3fc3b5bd78a28f717c2740948d61e">set_declination</a>(<span class="keywordtype">float</span> radians);
<a name="l00077"></a>00077 };
<a name="l00078"></a>00078 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,210 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_DCM.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_DCM.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_a_p___d_c_m_8h_source.html">AP_DCM.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_DCM.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___d_c_m_8cpp__incl.png" border="0" usemap="#_a_p___d_c_m_8cpp" alt=""/></div>
<map name="_a_p___d_c_m_8cpp" id="_a_p___d_c_m_8cpp">
<area shape="rect" id="node3" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="1631,83,1719,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="1617,160,1732,189"/><area shape="rect" id="node7" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="1161,392,1257,421"/><area shape="rect" id="node23" href="_a_p___math_8h.html" title="AP_Math.h" alt="" coords="2064,547,2155,576"/><area shape="rect" id="node38" href="_w_program_8h.html" title="WProgram.h" alt="" coords="1543,392,1641,421"/><area shape="rect" id="node40" href="_a_p___compass_8h.html" title="Catch&#45;all header that defines all supported compass classes." alt="" coords="1416,237,1533,267"/><area shape="rect" id="node56" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="1737,392,1823,421"/><area shape="rect" id="node65" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="697,237,783,267"/><area shape="rect" id="node104" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="1829,237,1912,267"/><area shape="rect" id="node17" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="833,469,956,499"/><area shape="rect" id="node25" href="vector2_8h.html" title="vector2.h" alt="" coords="1989,701,2072,731"/><area shape="rect" id="node29" href="vector3_8h.html" title="vector3.h" alt="" coords="2096,701,2179,731"/><area shape="rect" id="node34" href="matrix3_8h.html" title="matrix3.h" alt="" coords="2068,624,2151,653"/><area shape="rect" id="node42" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="1281,392,1468,421"/><area shape="rect" id="node51" href="_a_p___compass___h_i_l_8h.html" title="AP_Compass_HIL.h" alt="" coords="1396,315,1540,344"/><area shape="rect" id="node44" href="_compass_8h.html" title="Compass.h" alt="" coords="1432,469,1525,499"/><area shape="rect" id="node58" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="1736,469,1888,499"/><area shape="rect" id="node61" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="1600,469,1712,499"/><area shape="rect" id="node67" href="_a_p___g_p_s___n_m_e_a_8h.html" title="AP_GPS_NMEA.h" alt="" coords="649,392,780,421"/><area shape="rect" id="node73" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="97,392,215,421"/><area shape="rect" id="node76" href="_a_p___g_p_s__406_8h.html" title="AP_GPS_406.h" alt="" coords="5,315,120,344"/><area shape="rect" id="node79" href="_a_p___g_p_s___u_b_l_o_x_8h.html" title="AP_GPS_UBLOX.h" alt="" coords="804,392,937,421"/><area shape="rect" id="node82" href="_a_p___g_p_s___m_t_k_8h.html" title="AP_GPS_MTK.h" alt="" coords="480,315,597,344"/><area shape="rect" id="node87" href="_a_p___g_p_s___m_t_k16_8h.html" title="AP_GPS_MTK16.h" alt="" coords="621,315,755,344"/><area shape="rect" id="node91" href="_a_p___g_p_s___none_8h.html" title="AP_GPS_None.h" alt="" coords="961,392,1087,421"/><area shape="rect" id="node94" href="_a_p___g_p_s___auto_8h.html" title="AP_GPS_Auto.h" alt="" coords="1063,315,1185,344"/><area shape="rect" id="node98" href="_a_p___g_p_s___h_i_l_8h.html" title="AP_GPS_HIL.h" alt="" coords="195,315,307,344"/><area shape="rect" id="node101" href="_a_p___g_p_s___shim_8h.html" title="AP_GPS_Shim.h" alt="" coords="331,315,456,344"/><area shape="rect" id="node69" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="684,469,745,499"/><area shape="rect" id="node85" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="391,392,575,421"/><area shape="rect" id="node106" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="1817,315,1945,344"/><area shape="rect" id="node115" href="_a_p___i_m_u___shim_8h.html" title="IMU shim driver, used when the IMU data is coming from somewhere else." alt="" coords="1969,315,2092,344"/><area shape="rect" id="node108" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit." alt="" coords="1963,469,2021,499"/></map>
</div>
<p><a href="_a_p___d_c_m_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#aca3c9e529eec0dcbf5ac2e4240391068">OUTPUTMODE</a>&nbsp;&nbsp;&nbsp;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(x)&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">ToDeg</a>(x)&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#a3ab9b5d54678d8d03770f19607886ed6">Kp_ROLLPITCH</a>&nbsp;&nbsp;&nbsp;0.05967</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#a7acbbef42a2b56f585c4dafc151e3806">Ki_ROLLPITCH</a>&nbsp;&nbsp;&nbsp;0.00001278</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#a3c59c4be08d2d06edcdc0a02369da6b6">Kp_YAW</a>&nbsp;&nbsp;&nbsp;0.8</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#aea9dd7972c8f6c2381b1541b964b3893">Ki_YAW</a>&nbsp;&nbsp;&nbsp;0.00004</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#a6ab736b5db0f112fd61581a440f2d3ca">SPEEDFILT</a>&nbsp;&nbsp;&nbsp;300</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>&nbsp;&nbsp;&nbsp;900</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ae4132efd8235f9b057b6b1d24272dd79"></a><!-- doxytag: member="AP_DCM.cpp::ADC_CONSTRAINT" ref="ae4132efd8235f9b057b6b1d24272dd79" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ADC_CONSTRAINT&nbsp;&nbsp;&nbsp;900</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00031">31</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7acbbef42a2b56f585c4dafc151e3806"></a><!-- doxytag: member="AP_DCM.cpp::Ki_ROLLPITCH" ref="a7acbbef42a2b56f585c4dafc151e3806" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Ki_ROLLPITCH&nbsp;&nbsp;&nbsp;0.00001278</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00026">26</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aea9dd7972c8f6c2381b1541b964b3893"></a><!-- doxytag: member="AP_DCM.cpp::Ki_YAW" ref="aea9dd7972c8f6c2381b1541b964b3893" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Ki_YAW&nbsp;&nbsp;&nbsp;0.00004</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00028">28</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3ab9b5d54678d8d03770f19607886ed6"></a><!-- doxytag: member="AP_DCM.cpp::Kp_ROLLPITCH" ref="a3ab9b5d54678d8d03770f19607886ed6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Kp_ROLLPITCH&nbsp;&nbsp;&nbsp;0.05967</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00025">25</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3c59c4be08d2d06edcdc0a02369da6b6"></a><!-- doxytag: member="AP_DCM.cpp::Kp_YAW" ref="a3c59c4be08d2d06edcdc0a02369da6b6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define Kp_YAW&nbsp;&nbsp;&nbsp;0.8</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00027">27</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aca3c9e529eec0dcbf5ac2e4240391068"></a><!-- doxytag: member="AP_DCM.cpp::OUTPUTMODE" ref="aca3c9e529eec0dcbf5ac2e4240391068" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define OUTPUTMODE&nbsp;&nbsp;&nbsp;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00021">21</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6ab736b5db0f112fd61581a440f2d3ca"></a><!-- doxytag: member="AP_DCM.cpp::SPEEDFILT" ref="a6ab736b5db0f112fd61581a440f2d3ca" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SPEEDFILT&nbsp;&nbsp;&nbsp;300</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00030">30</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3c9d151923236c7e8ccccf86f131e550"></a><!-- doxytag: member="AP_DCM.cpp::ToDeg" ref="a3c9d151923236c7e8ccccf86f131e550" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToDeg</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00023">23</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a728f9499baea61e7df3ae70a374f2512"></a><!-- doxytag: member="AP_DCM.cpp::ToRad" ref="a728f9499baea61e7df3ae70a374f2512" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToRad</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m_8cpp_source.html#l00022">22</a> of file <a class="el" href="_a_p___d_c_m_8cpp_source.html">AP_DCM.cpp</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,373 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_DCM.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_DCM.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___d_c_m_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> APM_DCM_FW.cpp - DCM AHRS Library, fixed wing version, for Ardupilot Mega</span>
<a name="l00003"></a>00003 <span class="comment"> Code by Doug Weibel, Jordi Muñoz and Jose Julio. DIYDrones.com</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> This library works with the ArduPilot Mega and &quot;Oilpan&quot;</span>
<a name="l00006"></a>00006 <span class="comment"> </span>
<a name="l00007"></a>00007 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00008"></a>00008 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00009"></a>00009 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00010"></a>00010 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00011"></a>00011 <span class="comment"></span>
<a name="l00012"></a>00012 <span class="comment"> Methods:</span>
<a name="l00013"></a>00013 <span class="comment"> update_DCM(_G_Dt) : Updates the AHRS by integrating the rotation matrix over time _G_Dt using the IMU object data</span>
<a name="l00014"></a>00014 <span class="comment"> get_gyro() : Returns gyro vector corrected for bias</span>
<a name="l00015"></a>00015 <span class="comment"> get_accel() : Returns accelerometer vector</span>
<a name="l00016"></a>00016 <span class="comment"> get_dcm_matrix() : Returns dcm matrix</span>
<a name="l00017"></a>00017 <span class="comment"></span>
<a name="l00018"></a>00018 <span class="comment">*/</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___d_c_m_8h.html">AP_DCM.h</a>&gt;</span>
<a name="l00020"></a>00020
<a name="l00021"></a><a class="code" href="_a_p___d_c_m_8cpp.html#aca3c9e529eec0dcbf5ac2e4240391068">00021</a> <span class="preprocessor">#define OUTPUTMODE 1 // This is just used for debugging, remove later</span>
<a name="l00022"></a><a class="code" href="_a_p___d_c_m_8cpp.html#a728f9499baea61e7df3ae70a374f2512">00022</a> <span class="preprocessor"></span><span class="preprocessor">#define ToRad(x) (x*0.01745329252) // *pi/180</span>
<a name="l00023"></a><a class="code" href="_a_p___d_c_m_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define ToDeg(x) (x*57.2957795131) // *180/pi</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a><a class="code" href="_a_p___d_c_m_8cpp.html#a3ab9b5d54678d8d03770f19607886ed6">00025</a> <span class="preprocessor">#define Kp_ROLLPITCH 0.05967 // .0014 * 418/9.81 Pitch&amp;Roll Drift Correction Proportional Gain</span>
<a name="l00026"></a><a class="code" href="_a_p___d_c_m_8cpp.html#a7acbbef42a2b56f585c4dafc151e3806">00026</a> <span class="preprocessor"></span><span class="preprocessor">#define Ki_ROLLPITCH 0.00001278 // 0.0000003 * 418/9.81 Pitch&amp;Roll Drift Correction Integrator Gain</span>
<a name="l00027"></a><a class="code" href="_a_p___d_c_m_8cpp.html#a3c59c4be08d2d06edcdc0a02369da6b6">00027</a> <span class="preprocessor"></span><span class="preprocessor">#define Kp_YAW 0.8 // Yaw Drift Correction Porportional Gain </span>
<a name="l00028"></a><a class="code" href="_a_p___d_c_m_8cpp.html#aea9dd7972c8f6c2381b1541b964b3893">00028</a> <span class="preprocessor"></span><span class="preprocessor">#define Ki_YAW 0.00004 // Yaw Drift CorrectionIntegrator Gain</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00030"></a><a class="code" href="_a_p___d_c_m_8cpp.html#a6ab736b5db0f112fd61581a440f2d3ca">00030</a> <span class="preprocessor">#define SPEEDFILT 300 // centimeters/second</span>
<a name="l00031"></a><a class="code" href="_a_p___d_c_m_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define ADC_CONSTRAINT 900</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="keywordtype">void</span>
<a name="l00035"></a><a class="code" href="class_a_p___d_c_m.html#adc0ecb44c04652f3696e62be5eb4ebd1">00035</a> <a class="code" href="class_a_p___d_c_m.html#adc0ecb44c04652f3696e62be5eb4ebd1">AP_DCM::set_compass</a>(<a class="code" href="class_compass.html">Compass</a> *compass)
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 _compass = compass;
<a name="l00038"></a>00038 }
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="comment">/**************************************************/</span>
<a name="l00041"></a>00041 <span class="keywordtype">void</span>
<a name="l00042"></a><a class="code" href="class_a_p___d_c_m.html#a9188cdc31e905c85a5f14dcdb063720b">00042</a> <a class="code" href="class_a_p___d_c_m.html#a9188cdc31e905c85a5f14dcdb063720b">AP_DCM::update_DCM</a>(<span class="keywordtype">float</span> _G_Dt)
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044 _gyro_vector = _imu-&gt;<a class="code" href="class_i_m_u.html#aae81f4e2b32ec27d7c3fb1f6b74a177a">get_gyro</a>(); <span class="comment">// Get current values for IMU sensors</span>
<a name="l00045"></a>00045 _accel_vector = _imu-&gt;<a class="code" href="class_i_m_u.html#a8736c63185c19a8fadc86623fd4cd0c7">get_accel</a>(); <span class="comment">// Get current values for IMU sensors</span>
<a name="l00046"></a>00046
<a name="l00047"></a>00047 matrix_update(_G_Dt); <span class="comment">// Integrate the DCM matrix</span>
<a name="l00048"></a>00048 normalize(); <span class="comment">// Normalize the DCM matrix</span>
<a name="l00049"></a>00049 drift_correction(); <span class="comment">// Perform drift correction</span>
<a name="l00050"></a>00050
<a name="l00051"></a>00051 euler_angles(); <span class="comment">// Calculate pitch, roll, yaw for stabilization and navigation</span>
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <span class="comment">/**************************************************/</span>
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="comment">//For Debugging</span>
<a name="l00057"></a>00057 <span class="comment">/*</span>
<a name="l00058"></a>00058 <span class="comment">void</span>
<a name="l00059"></a>00059 <span class="comment">printm(const char *l, Matrix3f &amp;m)</span>
<a name="l00060"></a>00060 <span class="comment">{ Serial.println(&quot; &quot;); Serial.println(l);</span>
<a name="l00061"></a>00061 <span class="comment"> Serial.print(m.a.x, 12); Serial.print(&quot; &quot;); Serial.print(m.a.y, 12); Serial.print(&quot; &quot;); Serial.println(m.a.z, 12);</span>
<a name="l00062"></a>00062 <span class="comment"> Serial.print(m.b.x, 12); Serial.print(&quot; &quot;); Serial.print(m.b.y, 12); Serial.print(&quot; &quot;); Serial.println(m.b.z, 12);</span>
<a name="l00063"></a>00063 <span class="comment"> Serial.print(m.c.x, 12); Serial.print(&quot; &quot;); Serial.print(m.c.y, 12); Serial.print(&quot; &quot;); Serial.println(m.c.z, 12); </span>
<a name="l00064"></a>00064 <span class="comment"> Serial.print(*(uint32_t *)&amp;(m.a.x), HEX); Serial.print(&quot; &quot;); Serial.print(*(uint32_t *)&amp;(m.a.y), HEX); Serial.print(&quot; &quot;); Serial.println(*(uint32_t *)&amp;(m.a.z), HEX);</span>
<a name="l00065"></a>00065 <span class="comment"> Serial.print(*(uint32_t *)&amp;(m.b.x), HEX); Serial.print(&quot; &quot;); Serial.print(*(uint32_t *)&amp;(m.b.y), HEX); Serial.print(&quot; &quot;); Serial.println(*(uint32_t *)&amp;(m.b.z), HEX);</span>
<a name="l00066"></a>00066 <span class="comment"> Serial.print(*(uint32_t *)&amp;(m.c.x), HEX); Serial.print(&quot; &quot;); Serial.print(*(uint32_t *)&amp;(m.c.y), HEX); Serial.print(&quot; &quot;); Serial.println(*(uint32_t *)&amp;(m.c.z), HEX);</span>
<a name="l00067"></a>00067 <span class="comment">}</span>
<a name="l00068"></a>00068 <span class="comment">*/</span>
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="comment">/**************************************************/</span>
<a name="l00071"></a>00071 <span class="keywordtype">void</span>
<a name="l00072"></a>00072 AP_DCM::matrix_update(<span class="keywordtype">float</span> _G_Dt)
<a name="l00073"></a>00073 {
<a name="l00074"></a>00074 <a class="code" href="class_matrix3.html">Matrix3f</a> update_matrix;
<a name="l00075"></a>00075 <a class="code" href="class_matrix3.html">Matrix3f</a> temp_matrix;
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="comment">//Record when you saturate any of the gyros.</span>
<a name="l00078"></a>00078 <span class="keywordflow">if</span>((fabs(_gyro_vector.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>) &gt;= radians(300)) ||
<a name="l00079"></a>00079 (fabs(_gyro_vector.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>) &gt;= radians(300)) ||
<a name="l00080"></a>00080 (fabs(_gyro_vector.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>) &gt;= radians(300))){
<a name="l00081"></a>00081 <a class="code" href="class_a_p___d_c_m.html#a8ba0327e56c9d591070b93a72216041a">gyro_sat_count</a>++;
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083
<a name="l00084"></a>00084 _omega_integ_corr = _gyro_vector + _omega_I; <span class="comment">// Used for _centripetal correction (theoretically better than _omega)</span>
<a name="l00085"></a>00085 _omega = _omega_integ_corr + _omega_P; <span class="comment">// Equation 16, adding proportional and integral correction terms </span>
<a name="l00086"></a>00086
<a name="l00087"></a>00087 <span class="keywordflow">if</span>(_centripetal){
<a name="l00088"></a>00088 accel_adjust(); <span class="comment">// Remove _centripetal acceleration.</span>
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090
<a name="l00091"></a>00091 <span class="preprocessor"> #if OUTPUTMODE == 1 </span>
<a name="l00092"></a>00092 <span class="preprocessor"></span> update_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = 0;
<a name="l00093"></a>00093 update_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = -_G_Dt * _omega.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>; <span class="comment">// -delta Theta z</span>
<a name="l00094"></a>00094 update_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = _G_Dt * _omega.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>; <span class="comment">// delta Theta y</span>
<a name="l00095"></a>00095 update_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = _G_Dt * _omega.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>; <span class="comment">// delta Theta z</span>
<a name="l00096"></a>00096 update_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = 0;
<a name="l00097"></a>00097 update_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = -_G_Dt * _omega.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>; <span class="comment">// -delta Theta x</span>
<a name="l00098"></a>00098 update_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = -_G_Dt * _omega.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>; <span class="comment">// -delta Theta y</span>
<a name="l00099"></a>00099 update_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = _G_Dt * _omega.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>; <span class="comment">// delta Theta x</span>
<a name="l00100"></a>00100 update_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = 0;
<a name="l00101"></a>00101 <span class="preprocessor"> #else // Uncorrected data (no drift correction) </span>
<a name="l00102"></a>00102 <span class="preprocessor"></span> update_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = 0;
<a name="l00103"></a>00103 update_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = -_G_Dt * _gyro_vector.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>;
<a name="l00104"></a>00104 update_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = _G_Dt * _gyro_vector.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>;
<a name="l00105"></a>00105 update_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = _G_Dt * _gyro_vector.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>;
<a name="l00106"></a>00106 update_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = 0;
<a name="l00107"></a>00107 update_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = -_G_Dt * _gyro_vector.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>;
<a name="l00108"></a>00108 update_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = -_G_Dt * _gyro_vector.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>;
<a name="l00109"></a>00109 update_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = _G_Dt * _gyro_vector.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>;
<a name="l00110"></a>00110 update_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = 0;
<a name="l00111"></a>00111 <span class="preprocessor"> #endif</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span>
<a name="l00113"></a>00113 temp_matrix = _dcm_matrix * update_matrix;
<a name="l00114"></a>00114 _dcm_matrix = _dcm_matrix + temp_matrix; <span class="comment">// Equation 17</span>
<a name="l00115"></a>00115
<a name="l00116"></a>00116 }
<a name="l00117"></a>00117
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <span class="comment">/**************************************************/</span>
<a name="l00120"></a>00120 <span class="keywordtype">void</span>
<a name="l00121"></a>00121 AP_DCM::accel_adjust(<span class="keywordtype">void</span>)
<a name="l00122"></a>00122 {
<a name="l00123"></a>00123 <a class="code" href="class_vector3.html">Vector3f</a> veloc, temp;
<a name="l00124"></a>00124 <span class="keywordtype">float</span> vel;
<a name="l00125"></a>00125
<a name="l00126"></a>00126 veloc.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = _gps-&gt;<a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> / 100; <span class="comment">// We are working with acceleration in m/s^2 units</span>
<a name="l00127"></a>00127
<a name="l00128"></a>00128 <span class="comment">// We are working with a modified version of equation 26 as our IMU object reports acceleration in the positive axis direction as positive</span>
<a name="l00129"></a>00129
<a name="l00130"></a>00130 <span class="comment">//_accel_vector -= _omega_integ_corr % _veloc; // Equation 26 This line is giving the compiler a problem so we break it up below</span>
<a name="l00131"></a>00131 temp.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = 0;
<a name="l00132"></a>00132 temp.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = _omega_integ_corr.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> * veloc.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>; <span class="comment">// only computing the non-zero terms</span>
<a name="l00133"></a>00133 temp.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = -1.0f * _omega_integ_corr.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> * veloc.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>; <span class="comment">// After looking at the compiler issue lets remove _veloc and simlify </span>
<a name="l00134"></a>00134
<a name="l00135"></a>00135 _accel_vector -= temp;
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137
<a name="l00138"></a>00138
<a name="l00139"></a>00139 <span class="comment">/*************************************************</span>
<a name="l00140"></a>00140 <span class="comment">Direction Cosine Matrix IMU: Theory</span>
<a name="l00141"></a>00141 <span class="comment">William Premerlani and Paul Bizard</span>
<a name="l00142"></a>00142 <span class="comment"></span>
<a name="l00143"></a>00143 <span class="comment">Numerical errors will gradually reduce the orthogonality conditions expressed by equation 5 </span>
<a name="l00144"></a>00144 <span class="comment">to approximations rather than identities. In effect, the axes in the two frames of reference no </span>
<a name="l00145"></a>00145 <span class="comment">longer describe a rigid body. Fortunately, numerical error accumulates very slowly, so it is a </span>
<a name="l00146"></a>00146 <span class="comment">simple matter to stay ahead of it.</span>
<a name="l00147"></a>00147 <span class="comment">We call the process of enforcing the orthogonality conditions ÒrenormalizationÓ.</span>
<a name="l00148"></a>00148 <span class="comment">*/</span>
<a name="l00149"></a>00149 <span class="keywordtype">void</span>
<a name="l00150"></a>00150 AP_DCM::normalize(<span class="keywordtype">void</span>)
<a name="l00151"></a>00151 {
<a name="l00152"></a>00152 <span class="keywordtype">float</span> error = 0;
<a name="l00153"></a>00153 <a class="code" href="class_vector3.html">Vector3f</a> temporary[3];
<a name="l00154"></a>00154
<a name="l00155"></a>00155 <span class="keywordtype">int</span> problem = 0;
<a name="l00156"></a>00156
<a name="l00157"></a>00157 error = _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a> * _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>; <span class="comment">// eq.18</span>
<a name="l00158"></a>00158
<a name="l00159"></a>00159 temporary[0] = _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>;
<a name="l00160"></a>00160 temporary[1] = _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>;
<a name="l00161"></a>00161 temporary[0] = _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a> - (temporary[0] * (0.5f * error)); <span class="comment">// eq.19</span>
<a name="l00162"></a>00162 temporary[1] = _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a> - (temporary[1] * (0.5f * error)); <span class="comment">// eq.19</span>
<a name="l00163"></a>00163
<a name="l00164"></a>00164 temporary[2] = temporary[0] % temporary[1]; <span class="comment">// c= a x b // eq.20</span>
<a name="l00165"></a>00165
<a name="l00166"></a>00166 _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a> = renorm(temporary[0], problem);
<a name="l00167"></a>00167 _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a> = renorm(temporary[1], problem);
<a name="l00168"></a>00168 _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a> = renorm(temporary[2], problem);
<a name="l00169"></a>00169
<a name="l00170"></a>00170 <span class="keywordflow">if</span> (problem == 1) { <span class="comment">// Our solution is blowing up and we will force back to initial condition. Hope we are not upside down!</span>
<a name="l00171"></a>00171 _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = 1.0f;
<a name="l00172"></a>00172 _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = 0.0f;
<a name="l00173"></a>00173 _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = 0.0f;
<a name="l00174"></a>00174 _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = 0.0f;
<a name="l00175"></a>00175 _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = 1.0f;
<a name="l00176"></a>00176 _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = 0.0f;
<a name="l00177"></a>00177 _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = 0.0f;
<a name="l00178"></a>00178 _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = 0.0f;
<a name="l00179"></a>00179 _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = 1.0f;
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182
<a name="l00183"></a>00183 <span class="comment">/**************************************************/</span>
<a name="l00184"></a>00184 <a class="code" href="class_vector3.html">Vector3f</a>
<a name="l00185"></a>00185 AP_DCM::renorm(<a class="code" href="class_vector3.html">Vector3f</a> <span class="keyword">const</span> &amp;a, <span class="keywordtype">int</span> &amp;problem)
<a name="l00186"></a>00186 {
<a name="l00187"></a>00187 <span class="keywordtype">float</span> renorm;
<a name="l00188"></a>00188
<a name="l00189"></a>00189 renorm = a * a;
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <span class="keywordflow">if</span> (renorm &lt; 1.5625f &amp;&amp; renorm &gt; 0.64f) { <span class="comment">// Check if we are OK to use Taylor expansion</span>
<a name="l00192"></a>00192 renorm = 0.5 * (3 - renorm); <span class="comment">// eq.21</span>
<a name="l00193"></a>00193 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (renorm &lt; 100.0f &amp;&amp; renorm &gt; 0.01f) {
<a name="l00194"></a>00194 renorm = 1.0 / sqrt(renorm);
<a name="l00195"></a>00195 <a class="code" href="class_a_p___d_c_m.html#ad724a2a16817d25dc95b16dc48f28ef4">renorm_sqrt_count</a>++;
<a name="l00196"></a>00196 } <span class="keywordflow">else</span> {
<a name="l00197"></a>00197 problem = 1;
<a name="l00198"></a>00198 <a class="code" href="class_a_p___d_c_m.html#ae518c49e92751f43af3f1b7457254e13">renorm_blowup_count</a>++;
<a name="l00199"></a>00199 }
<a name="l00200"></a>00200
<a name="l00201"></a>00201 <span class="keywordflow">return</span>(a * renorm);
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203
<a name="l00204"></a>00204 <span class="comment">/**************************************************/</span>
<a name="l00205"></a>00205 <span class="keywordtype">void</span>
<a name="l00206"></a>00206 AP_DCM::drift_correction(<span class="keywordtype">void</span>)
<a name="l00207"></a>00207 {
<a name="l00208"></a>00208 <span class="comment">//Compensation the Roll, Pitch and Yaw drift. </span>
<a name="l00209"></a>00209 <span class="comment">//float mag_heading_x;</span>
<a name="l00210"></a>00210 <span class="comment">//float mag_heading_y;</span>
<a name="l00211"></a>00211 <span class="keywordtype">float</span> error_course;
<a name="l00212"></a>00212 <span class="keywordtype">float</span> accel_magnitude;
<a name="l00213"></a>00213 <span class="keywordtype">float</span> accel_weight;
<a name="l00214"></a>00214 <span class="keywordtype">float</span> integrator_magnitude;
<a name="l00215"></a>00215 <span class="comment">//static float scaled_omega_P[3];</span>
<a name="l00216"></a>00216 <span class="comment">//static float scaled_omega_I[3];</span>
<a name="l00217"></a>00217 <span class="keyword">static</span> <span class="keywordtype">bool</span> in_motion = <span class="keyword">false</span>;
<a name="l00218"></a>00218 <a class="code" href="class_matrix3.html">Matrix3f</a> rot_mat;
<a name="l00219"></a>00219
<a name="l00220"></a>00220 <span class="comment">//*****Roll and Pitch***************</span>
<a name="l00221"></a>00221
<a name="l00222"></a>00222 <span class="comment">// Calculate the magnitude of the accelerometer vector</span>
<a name="l00223"></a>00223 accel_magnitude = _accel_vector.<a class="code" href="class_vector3.html#aeae8eae4d5a0a909aa0129c53c493038">length</a>() / 9.80665f;
<a name="l00224"></a>00224
<a name="l00225"></a>00225 <span class="comment">// Dynamic weighting of accelerometer info (reliability filter)</span>
<a name="l00226"></a>00226 <span class="comment">// Weight for accelerometer info (&lt;0.5G = 0.0, 1G = 1.0 , &gt;1.5G = 0.0)</span>
<a name="l00227"></a>00227 accel_weight = constrain(1 - 2 * fabs(1 - accel_magnitude), 0, 1); <span class="comment">// </span>
<a name="l00228"></a>00228
<a name="l00229"></a>00229 <span class="comment">// We monitor the amount that the accelerometer based drift correction is deweighted for performance reporting</span>
<a name="l00230"></a>00230 _health += constrain((0.02 * (accel_weight - .5)), 0, 1);
<a name="l00231"></a>00231
<a name="l00232"></a>00232 <span class="comment">// adjust the ground of reference </span>
<a name="l00233"></a>00233 _error_roll_pitch = _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a> % _accel_vector; <span class="comment">// Equation 27 *** sign changed from prev implementation???</span>
<a name="l00234"></a>00234
<a name="l00235"></a>00235 <span class="comment">// error_roll_pitch are in Accel m/s^2 units</span>
<a name="l00236"></a>00236 <span class="comment">// Limit max error_roll_pitch to limit max omega_P and omega_I</span>
<a name="l00237"></a>00237 _error_roll_pitch.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = constrain(_error_roll_pitch.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>, -1.17f, 1.17f);
<a name="l00238"></a>00238 _error_roll_pitch.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = constrain(_error_roll_pitch.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>, -1.17f, 1.17f);
<a name="l00239"></a>00239 _error_roll_pitch.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = constrain(_error_roll_pitch.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>, -1.17f, 1.17f);
<a name="l00240"></a>00240
<a name="l00241"></a>00241 _omega_P = _error_roll_pitch * (<a class="code" href="_a_p___d_c_m_8cpp.html#a3ab9b5d54678d8d03770f19607886ed6">Kp_ROLLPITCH</a> * accel_weight);
<a name="l00242"></a>00242 _omega_I += _error_roll_pitch * (<a class="code" href="_a_p___d_c_m_8cpp.html#a7acbbef42a2b56f585c4dafc151e3806">Ki_ROLLPITCH</a> * accel_weight);
<a name="l00243"></a>00243
<a name="l00244"></a>00244
<a name="l00245"></a>00245 <span class="comment">//*****YAW***************</span>
<a name="l00246"></a>00246
<a name="l00247"></a>00247 <span class="keywordflow">if</span> (_compass) {
<a name="l00248"></a>00248 <span class="comment">// We make the gyro YAW drift correction based on compass magnetic heading</span>
<a name="l00249"></a>00249 error_course = (_dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> * _compass-&gt;<a class="code" href="class_compass.html#a2e1554fb76b067f36d011f59e7e8dd58">heading_y</a>) - (_dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> * _compass-&gt;<a class="code" href="class_compass.html#aafc7608bd711702f519d52afbc06dc7a">heading_x</a>); <span class="comment">// Equation 23, Calculating YAW error </span>
<a name="l00250"></a>00250
<a name="l00251"></a>00251 } <span class="keywordflow">else</span> {
<a name="l00252"></a>00252
<a name="l00253"></a>00253 <span class="comment">// Use GPS Ground course to correct yaw gyro drift</span>
<a name="l00254"></a>00254 <span class="keywordflow">if</span> (_gps-&gt;<a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> &gt;= <a class="code" href="_a_p___d_c_m_8cpp.html#a6ab736b5db0f112fd61581a440f2d3ca">SPEEDFILT</a>) {
<a name="l00255"></a>00255 _course_over_ground_x = cos(<a class="code" href="_a_p___d_c_m_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(_gps-&gt;<a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>/100.0));
<a name="l00256"></a>00256 _course_over_ground_y = sin(<a class="code" href="_a_p___d_c_m_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(_gps-&gt;<a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>/100.0));
<a name="l00257"></a>00257 <span class="keywordflow">if</span>(in_motion) {
<a name="l00258"></a>00258 error_course = (_dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> * _course_over_ground_y) - (_dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> * _course_over_ground_x); <span class="comment">// Equation 23, Calculating YAW error</span>
<a name="l00259"></a>00259 } <span class="keywordflow">else</span> {
<a name="l00260"></a>00260 <span class="keywordtype">float</span> cos_psi_err, sin_psi_err;
<a name="l00261"></a>00261 <span class="comment">// This is the case for when we first start moving and reset the DCM so that yaw matches the gps ground course</span>
<a name="l00262"></a>00262 <span class="comment">// This is just to get a reasonable estimate faster</span>
<a name="l00263"></a>00263 <a class="code" href="class_a_p___d_c_m.html#abddbee0f81d02d51ee91f57addedc266">yaw</a> = atan2(_dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>, _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>);
<a name="l00264"></a>00264 cos_psi_err = cos(<a class="code" href="_a_p___d_c_m_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(_gps-&gt;<a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>/100.0) - <a class="code" href="class_a_p___d_c_m.html#abddbee0f81d02d51ee91f57addedc266">yaw</a>);
<a name="l00265"></a>00265 sin_psi_err = sin(<a class="code" href="_a_p___d_c_m_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(_gps-&gt;<a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>/100.0) - <a class="code" href="class_a_p___d_c_m.html#abddbee0f81d02d51ee91f57addedc266">yaw</a>);
<a name="l00266"></a>00266 <span class="comment">// Rxx = cos psi err, Rxy = - sin psi err, Rxz = 0</span>
<a name="l00267"></a>00267 <span class="comment">// Ryx = sin psi err, Ryy = cos psi err, Ryz = 0</span>
<a name="l00268"></a>00268 <span class="comment">// Rzx = Rzy = 0, Rzz = 1</span>
<a name="l00269"></a>00269 rot_mat.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = cos_psi_err;
<a name="l00270"></a>00270 rot_mat.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = -sin_psi_err;
<a name="l00271"></a>00271 rot_mat.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = sin_psi_err;
<a name="l00272"></a>00272 rot_mat.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = cos_psi_err;
<a name="l00273"></a>00273 rot_mat.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = 0;
<a name="l00274"></a>00274 rot_mat.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = 0;
<a name="l00275"></a>00275 rot_mat.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = 0;
<a name="l00276"></a>00276 rot_mat.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = 0;
<a name="l00277"></a>00277 rot_mat.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = 1.0;
<a name="l00278"></a>00278
<a name="l00279"></a>00279 _dcm_matrix = rot_mat * _dcm_matrix;
<a name="l00280"></a>00280 in_motion = <span class="keyword">true</span>;
<a name="l00281"></a>00281 error_course = 0;
<a name="l00282"></a>00282
<a name="l00283"></a>00283 }
<a name="l00284"></a>00284 } <span class="keywordflow">else</span> {
<a name="l00285"></a>00285 error_course = 0;
<a name="l00286"></a>00286 in_motion = <span class="keyword">false</span>;
<a name="l00287"></a>00287 }
<a name="l00288"></a>00288 }
<a name="l00289"></a>00289
<a name="l00290"></a>00290 _error_yaw = _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a> * error_course; <span class="comment">// Equation 24, Applys the yaw correction to the XYZ rotation of the aircraft, depeding the position.</span>
<a name="l00291"></a>00291
<a name="l00292"></a>00292 _omega_P += _error_yaw * Kp_YAW; <span class="comment">// Adding yaw correction to proportional correction vector.</span>
<a name="l00293"></a>00293 _omega_I += _error_yaw * Ki_YAW; <span class="comment">// adding yaw correction to integrator correction vector. </span>
<a name="l00294"></a>00294
<a name="l00295"></a>00295 <span class="comment">// Here we will place a limit on the integrator so that the integrator cannot ever exceed half the saturation limit of the gyros</span>
<a name="l00296"></a>00296 integrator_magnitude = _omega_I.length();
<a name="l00297"></a>00297 <span class="keywordflow">if</span> (integrator_magnitude &gt; radians(300)) {
<a name="l00298"></a>00298 _omega_I *= (0.5f * radians(300) / integrator_magnitude); <span class="comment">// Why do we have this discontinuous? EG, why the 0.5?</span>
<a name="l00299"></a>00299 }
<a name="l00300"></a>00300 <span class="comment">//Serial.print(&quot;*&quot;);</span>
<a name="l00301"></a>00301 }
<a name="l00302"></a>00302
<a name="l00303"></a>00303
<a name="l00304"></a>00304 <span class="comment">/**************************************************/</span>
<a name="l00305"></a>00305 <span class="keywordtype">void</span>
<a name="l00306"></a>00306 AP_DCM::euler_angles(<span class="keywordtype">void</span>)
<a name="l00307"></a>00307 {
<a name="l00308"></a>00308 <span class="preprocessor"> #if (OUTPUTMODE == 2) // Only accelerometer info (debugging purposes)</span>
<a name="l00309"></a>00309 <span class="preprocessor"></span> <a class="code" href="class_a_p___d_c_m.html#a9793adc8a62cbc21439aef2b19259a39">roll</a> = atan2(_accel_vector.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>, -_accel_vector.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>); <span class="comment">// atan2(acc_y, acc_z)</span>
<a name="l00310"></a>00310 <a class="code" href="class_a_p___d_c_m.html#a175109cd6b70bc290a7779174a88b42a">pitch</a> = asin((_accel_vector.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>) / (<span class="keywordtype">double</span>)9.81); <span class="comment">// asin(acc_x)</span>
<a name="l00311"></a>00311 <a class="code" href="class_a_p___d_c_m.html#abddbee0f81d02d51ee91f57addedc266">yaw</a> = 0;
<a name="l00312"></a>00312 <span class="preprocessor"> #else</span>
<a name="l00313"></a>00313 <span class="preprocessor"></span> <a class="code" href="class_a_p___d_c_m.html#a175109cd6b70bc290a7779174a88b42a">pitch</a> = -asin(_dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>);
<a name="l00314"></a>00314 <a class="code" href="class_a_p___d_c_m.html#a9793adc8a62cbc21439aef2b19259a39">roll</a> = atan2(_dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a>, _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a>);
<a name="l00315"></a>00315 <a class="code" href="class_a_p___d_c_m.html#abddbee0f81d02d51ee91f57addedc266">yaw</a> = atan2(_dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>, _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a>);
<a name="l00316"></a>00316 <span class="preprocessor"> #endif</span>
<a name="l00317"></a>00317 <span class="preprocessor"></span>
<a name="l00318"></a>00318 <a class="code" href="class_a_p___d_c_m.html#a0bb05c5d94979b86aca523b9d924dcda">roll_sensor</a> = degrees(<a class="code" href="class_a_p___d_c_m.html#a9793adc8a62cbc21439aef2b19259a39">roll</a>) * 100;
<a name="l00319"></a>00319 <a class="code" href="class_a_p___d_c_m.html#adf141fbe2398c902c2f1e400c265a1aa">pitch_sensor</a> = degrees(<a class="code" href="class_a_p___d_c_m.html#a175109cd6b70bc290a7779174a88b42a">pitch</a>) * 100;
<a name="l00320"></a>00320 <a class="code" href="class_a_p___d_c_m.html#a9e24af31523858a17ddbd800f35ed25b">yaw_sensor</a> = degrees(<a class="code" href="class_a_p___d_c_m.html#abddbee0f81d02d51ee91f57addedc266">yaw</a>) * 100;
<a name="l00321"></a>00321
<a name="l00322"></a>00322 <span class="keywordflow">if</span> (<a class="code" href="class_a_p___d_c_m.html#a9e24af31523858a17ddbd800f35ed25b">yaw_sensor</a> &lt; 0)
<a name="l00323"></a>00323 <a class="code" href="class_a_p___d_c_m.html#a9e24af31523858a17ddbd800f35ed25b">yaw_sensor</a> += 36000;
<a name="l00324"></a>00324 }
<a name="l00325"></a>00325
<a name="l00326"></a>00326 <span class="comment">/**************************************************/</span>
<a name="l00327"></a>00327
<a name="l00328"></a>00328 <span class="keywordtype">float</span>
<a name="l00329"></a><a class="code" href="class_a_p___d_c_m.html#a74d43cf5fd575ccdedf92eb1c2572417">00329</a> <a class="code" href="class_a_p___d_c_m.html#a74d43cf5fd575ccdedf92eb1c2572417">AP_DCM::get_health</a>(<span class="keywordtype">void</span>)
<a name="l00330"></a>00330 {
<a name="l00331"></a>00331 <span class="keywordflow">return</span> _health;
<a name="l00332"></a>00332 }
<a name="l00333"></a>00333
<a name="l00334"></a>00334
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,71 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_DCM.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_DCM.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___d_c_m___h_i_l_8h_source.html">AP_DCM_HIL.h</a>&quot;</code><br/>
<code>#include &lt;<a class="el" href="_fast_serial_8h_source.html">FastSerial.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___math_8h_source.html">AP_Math.h</a>&gt;</code><br/>
<code>#include &lt;inttypes.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_w_program_8h_source.html">WProgram.h</a>&quot;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___compass_8h_source.html">AP_Compass.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___a_d_c_8h_source.html">AP_ADC.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___g_p_s_8h_source.html">AP_GPS.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___i_m_u_8h_source.html">AP_IMU.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_DCM.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___d_c_m_8h__incl.png" border="0" usemap="#_a_p___d_c_m_8h" alt=""/></div>
<map name="_a_p___d_c_m_8h" id="_a_p___d_c_m_8h">
<area shape="rect" id="node3" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="1617,83,1732,112"/><area shape="rect" id="node5" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="1161,315,1257,344"/><area shape="rect" id="node21" href="_a_p___math_8h.html" title="AP_Math.h" alt="" coords="2064,469,2155,499"/><area shape="rect" id="node36" href="_w_program_8h.html" title="WProgram.h" alt="" coords="1543,315,1641,344"/><area shape="rect" id="node38" href="_a_p___compass_8h.html" title="Catch&#45;all header that defines all supported compass classes." alt="" coords="1416,160,1533,189"/><area shape="rect" id="node54" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="1737,315,1823,344"/><area shape="rect" id="node63" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="697,160,783,189"/><area shape="rect" id="node102" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="1829,160,1912,189"/><area shape="rect" id="node15" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="833,392,956,421"/><area shape="rect" id="node23" href="vector2_8h.html" title="vector2.h" alt="" coords="1989,624,2072,653"/><area shape="rect" id="node27" href="vector3_8h.html" title="vector3.h" alt="" coords="2096,624,2179,653"/><area shape="rect" id="node32" href="matrix3_8h.html" title="matrix3.h" alt="" coords="2068,547,2151,576"/><area shape="rect" id="node40" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="1281,315,1468,344"/><area shape="rect" id="node49" href="_a_p___compass___h_i_l_8h.html" title="AP_Compass_HIL.h" alt="" coords="1396,237,1540,267"/><area shape="rect" id="node42" href="_compass_8h.html" title="Compass.h" alt="" coords="1432,392,1525,421"/><area shape="rect" id="node56" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="1736,392,1888,421"/><area shape="rect" id="node59" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="1600,392,1712,421"/><area shape="rect" id="node65" href="_a_p___g_p_s___n_m_e_a_8h.html" title="AP_GPS_NMEA.h" alt="" coords="649,315,780,344"/><area shape="rect" id="node71" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="97,315,215,344"/><area shape="rect" id="node74" href="_a_p___g_p_s__406_8h.html" title="AP_GPS_406.h" alt="" coords="5,237,120,267"/><area shape="rect" id="node77" href="_a_p___g_p_s___u_b_l_o_x_8h.html" title="AP_GPS_UBLOX.h" alt="" coords="804,315,937,344"/><area shape="rect" id="node80" href="_a_p___g_p_s___m_t_k_8h.html" title="AP_GPS_MTK.h" alt="" coords="480,237,597,267"/><area shape="rect" id="node85" href="_a_p___g_p_s___m_t_k16_8h.html" title="AP_GPS_MTK16.h" alt="" coords="621,237,755,267"/><area shape="rect" id="node89" href="_a_p___g_p_s___none_8h.html" title="AP_GPS_None.h" alt="" coords="961,315,1087,344"/><area shape="rect" id="node92" href="_a_p___g_p_s___auto_8h.html" title="AP_GPS_Auto.h" alt="" coords="1063,237,1185,267"/><area shape="rect" id="node96" href="_a_p___g_p_s___h_i_l_8h.html" title="AP_GPS_HIL.h" alt="" coords="195,237,307,267"/><area shape="rect" id="node99" href="_a_p___g_p_s___shim_8h.html" title="AP_GPS_Shim.h" alt="" coords="331,237,456,267"/><area shape="rect" id="node67" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="684,392,745,421"/><area shape="rect" id="node83" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="391,315,575,344"/><area shape="rect" id="node104" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="1817,237,1945,267"/><area shape="rect" id="node113" href="_a_p___i_m_u___shim_8h.html" title="IMU shim driver, used when the IMU data is coming from somewhere else." alt="" coords="1969,237,2092,267"/><area shape="rect" id="node106" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit." alt="" coords="1963,392,2021,421"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___d_c_m_8h__dep__incl.png" border="0" usemap="#_a_p___d_c_m_8hdep" alt=""/></div>
<map name="_a_p___d_c_m_8hdep" id="_a_p___d_c_m_8hdep">
<area shape="rect" id="node3" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,83,107,112"/></map>
</div>
<p><a href="_a_p___d_c_m_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___d_c_m.html">AP_DCM</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,147 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_DCM.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_DCM.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___d_c_m_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef AP_DCM_h</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define AP_DCM_h</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="comment">// teporarily include all other classes here</span>
<a name="l00005"></a>00005 <span class="comment">// since this naming is a bit off from the</span>
<a name="l00006"></a>00006 <span class="comment">// convention and the AP_DCM should be the top</span>
<a name="l00007"></a>00007 <span class="comment">// header file</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___d_c_m___h_i_l_8h.html">AP_DCM_HIL.h</a>&quot;</span>
<a name="l00009"></a>00009
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;<a class="code" href="_fast_serial_8h.html">FastSerial.h</a>&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___math_8h.html">AP_Math.h</a>&gt;</span>
<a name="l00012"></a><a class="code" href="class_a_p___d_c_m.html#a0e33d3f4e5b628127fc58cbff7b5eb29">00012</a> <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;<a class="code" href="_w_program_8h.html">WProgram.h</a>&quot;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___compass_8h.html" title="Catch-all header that defines all supported compass classes.">AP_Compass.h</a>&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___a_d_c_8h.html">AP_ADC.h</a>&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___g_p_s_8h.html" title="Catch-all header that defines all supported GPS classes.">AP_GPS.h</a>&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___i_m_u_8h.html" title="Catch-all header that defines all supported IMU classes.">AP_IMU.h</a>&gt;</span>
<a name="l00018"></a>00018
<a name="l00019"></a>00019
<a name="l00020"></a><a class="code" href="class_a_p___d_c_m.html">00020</a> <span class="keyword">class </span><a class="code" href="class_a_p___d_c_m.html">AP_DCM</a>
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022 <span class="keyword">public</span>:
<a name="l00023"></a><a class="code" href="class_a_p___d_c_m.html#ad0e3a59894face2e7bc3349f839db194">00023</a> <span class="comment">// Constructors</span>
<a name="l00024"></a>00024 <a class="code" href="class_a_p___d_c_m.html#a0e33d3f4e5b628127fc58cbff7b5eb29">AP_DCM</a>(<a class="code" href="class_i_m_u.html">IMU</a> *imu, <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> *gps) :
<a name="l00025"></a>00025 _imu(imu),
<a name="l00026"></a>00026 _gps(gps),
<a name="l00027"></a>00027 _compass(0),
<a name="l00028"></a>00028 _dcm_matrix(1, 0, 0,
<a name="l00029"></a>00029 0, 1, 0,
<a name="l00030"></a>00030 0, 0, 1),
<a name="l00031"></a>00031 _course_over_ground_x(0),
<a name="l00032"></a>00032 _course_over_ground_y(1)
<a name="l00033"></a>00033 {}
<a name="l00034"></a>00034
<a name="l00035"></a><a class="code" href="class_a_p___d_c_m.html#a26e4515d100903df7d801891b75cdfc2">00035</a> <a class="code" href="class_a_p___d_c_m.html#a0e33d3f4e5b628127fc58cbff7b5eb29">AP_DCM</a>(<a class="code" href="class_i_m_u.html">IMU</a> *imu, <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> *gps, <a class="code" href="class_compass.html">Compass</a> *withCompass) :
<a name="l00036"></a><a class="code" href="class_a_p___d_c_m.html#a2c03c18b2b80fc5c9cbbd0f3205e0459">00036</a> _imu(imu),
<a name="l00037"></a><a class="code" href="class_a_p___d_c_m.html#a8472ebe5394725ce4231cec96d452988">00037</a> _gps(gps),
<a name="l00038"></a><a class="code" href="class_a_p___d_c_m.html#ae6866e8b88a8bf3bda59037cc95c2061">00038</a> _compass(withCompass),
<a name="l00039"></a>00039 _dcm_matrix(1, 0, 0,
<a name="l00040"></a>00040 0, 1, 0,
<a name="l00041"></a>00041 0, 0, 1),
<a name="l00042"></a>00042 _course_over_ground_x(0),
<a name="l00043"></a>00043 _course_over_ground_y(1)
<a name="l00044"></a>00044 {}
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="comment">// Accessors</span>
<a name="l00047"></a>00047 <a class="code" href="class_vector3.html">Vector3f</a> <a class="code" href="class_a_p___d_c_m.html#a26e4515d100903df7d801891b75cdfc2">get_gyro</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> _omega_integ_corr; } <span class="comment">// We return the raw gyro vector corrected for bias</span>
<a name="l00048"></a><a class="code" href="class_a_p___d_c_m.html#a0bb05c5d94979b86aca523b9d924dcda">00048</a> <a class="code" href="class_vector3.html">Vector3f</a> <a class="code" href="class_a_p___d_c_m.html#a2c03c18b2b80fc5c9cbbd0f3205e0459">get_accel</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> _accel_vector; }
<a name="l00049"></a><a class="code" href="class_a_p___d_c_m.html#adf141fbe2398c902c2f1e400c265a1aa">00049</a> <a class="code" href="class_matrix3.html">Matrix3f</a> <a class="code" href="class_a_p___d_c_m.html#a8472ebe5394725ce4231cec96d452988">get_dcm_matrix</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> _dcm_matrix; }
<a name="l00050"></a><a class="code" href="class_a_p___d_c_m.html#a9e24af31523858a17ddbd800f35ed25b">00050</a> <a class="code" href="class_matrix3.html">Matrix3f</a> <a class="code" href="class_a_p___d_c_m.html#ae6866e8b88a8bf3bda59037cc95c2061">get_dcm_transposed</a>(<span class="keywordtype">void</span>) {<a class="code" href="class_matrix3.html">Matrix3f</a> temp = _dcm_matrix; <span class="keywordflow">return</span> temp.<a class="code" href="class_matrix3.html#a689b1ae3ea245ef3da02ed40941e130b">transpose</a>();}
<a name="l00051"></a>00051
<a name="l00052"></a><a class="code" href="class_a_p___d_c_m.html#a9793adc8a62cbc21439aef2b19259a39">00052</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___d_c_m.html#a680fa13a3114ece0d0f3019e06d8617e">set_centripetal</a>(<span class="keywordtype">bool</span> b);
<a name="l00053"></a><a class="code" href="class_a_p___d_c_m.html#a175109cd6b70bc290a7779174a88b42a">00053</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___d_c_m.html#adc0ecb44c04652f3696e62be5eb4ebd1">set_compass</a>(<a class="code" href="class_compass.html">Compass</a> *compass);
<a name="l00054"></a><a class="code" href="class_a_p___d_c_m.html#abddbee0f81d02d51ee91f57addedc266">00054</a>
<a name="l00055"></a>00055 <span class="comment">// Methods</span>
<a name="l00056"></a><a class="code" href="class_a_p___d_c_m.html#a8ba0327e56c9d591070b93a72216041a">00056</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___d_c_m.html#a9188cdc31e905c85a5f14dcdb063720b">update_DCM</a>(<span class="keywordtype">float</span> _G_Dt);
<a name="l00057"></a><a class="code" href="class_a_p___d_c_m.html#ad724a2a16817d25dc95b16dc48f28ef4">00057</a>
<a name="l00058"></a><a class="code" href="class_a_p___d_c_m.html#ae518c49e92751f43af3f1b7457254e13">00058</a> <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m.html#a74d43cf5fd575ccdedf92eb1c2572417">get_health</a>(<span class="keywordtype">void</span>);
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="keywordtype">long</span> <a class="code" href="class_a_p___d_c_m.html#a0bb05c5d94979b86aca523b9d924dcda">roll_sensor</a>; <span class="comment">// Degrees * 100</span>
<a name="l00061"></a>00061 <span class="keywordtype">long</span> <a class="code" href="class_a_p___d_c_m.html#adf141fbe2398c902c2f1e400c265a1aa">pitch_sensor</a>; <span class="comment">// Degrees * 100</span>
<a name="l00062"></a>00062 <span class="keywordtype">long</span> <a class="code" href="class_a_p___d_c_m.html#a9e24af31523858a17ddbd800f35ed25b">yaw_sensor</a>; <span class="comment">// Degrees * 100</span>
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m.html#a9793adc8a62cbc21439aef2b19259a39">roll</a>; <span class="comment">// Radians</span>
<a name="l00065"></a>00065 <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m.html#a175109cd6b70bc290a7779174a88b42a">pitch</a>; <span class="comment">// Radians</span>
<a name="l00066"></a>00066 <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m.html#abddbee0f81d02d51ee91f57addedc266">yaw</a>; <span class="comment">// Radians</span>
<a name="l00067"></a>00067
<a name="l00068"></a>00068 uint8_t <a class="code" href="class_a_p___d_c_m.html#a8ba0327e56c9d591070b93a72216041a">gyro_sat_count</a>;
<a name="l00069"></a>00069 uint8_t <a class="code" href="class_a_p___d_c_m.html#ad724a2a16817d25dc95b16dc48f28ef4">renorm_sqrt_count</a>;
<a name="l00070"></a>00070 uint8_t <a class="code" href="class_a_p___d_c_m.html#ae518c49e92751f43af3f1b7457254e13">renorm_blowup_count</a>;
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="keyword">private</span>:
<a name="l00073"></a>00073 <span class="comment">// Methods</span>
<a name="l00074"></a>00074 <span class="keywordtype">void</span> read_adc_raw(<span class="keywordtype">void</span>);
<a name="l00075"></a>00075 <span class="keywordtype">void</span> accel_adjust(<span class="keywordtype">void</span>);
<a name="l00076"></a>00076 <span class="keywordtype">float</span> read_adc(<span class="keywordtype">int</span> select);
<a name="l00077"></a>00077 <span class="keywordtype">void</span> matrix_update(<span class="keywordtype">float</span> _G_Dt);
<a name="l00078"></a>00078 <span class="keywordtype">void</span> normalize(<span class="keywordtype">void</span>);
<a name="l00079"></a>00079 <a class="code" href="class_vector3.html">Vector3f</a> renorm(<a class="code" href="class_vector3.html">Vector3f</a> <span class="keyword">const</span> &amp;a, <span class="keywordtype">int</span> &amp;problem);
<a name="l00080"></a>00080 <span class="keywordtype">void</span> drift_correction(<span class="keywordtype">void</span>);
<a name="l00081"></a>00081 <span class="keywordtype">void</span> euler_angles(<span class="keywordtype">void</span>);
<a name="l00082"></a>00082
<a name="l00083"></a>00083 <span class="comment">// members</span>
<a name="l00084"></a>00084 <a class="code" href="class_compass.html">Compass</a> * _compass;
<a name="l00085"></a>00085 <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> * _gps;
<a name="l00086"></a>00086 <a class="code" href="class_i_m_u.html">IMU</a> * _imu;
<a name="l00087"></a>00087
<a name="l00088"></a>00088 <a class="code" href="class_matrix3.html">Matrix3f</a> _dcm_matrix;
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <a class="code" href="class_vector3.html">Vector3f</a> _accel_vector; <span class="comment">// Store the acceleration in a vector</span>
<a name="l00091"></a>00091 <a class="code" href="class_vector3.html">Vector3f</a> _gyro_vector; <span class="comment">// Store the gyros turn rate in a vector</span>
<a name="l00092"></a>00092 <a class="code" href="class_vector3.html">Vector3f</a> _omega_P; <span class="comment">// Omega Proportional correction</span>
<a name="l00093"></a>00093 <a class="code" href="class_vector3.html">Vector3f</a> _omega_I; <span class="comment">// Omega Integrator correction</span>
<a name="l00094"></a>00094 <a class="code" href="class_vector3.html">Vector3f</a> _omega_integ_corr; <span class="comment">// Partially corrected Gyro_Vector data - used for centrepetal correction</span>
<a name="l00095"></a>00095 <a class="code" href="class_vector3.html">Vector3f</a> _omega; <span class="comment">// Corrected Gyro_Vector data</span>
<a name="l00096"></a>00096 <a class="code" href="class_vector3.html">Vector3f</a> _error_roll_pitch;
<a name="l00097"></a>00097 <a class="code" href="class_vector3.html">Vector3f</a> _error_yaw;
<a name="l00098"></a>00098 <span class="keywordtype">float</span> _errorCourse;
<a name="l00099"></a>00099 <span class="keywordtype">float</span> _course_over_ground_x; <span class="comment">// Course overground X axis</span>
<a name="l00100"></a>00100 <span class="keywordtype">float</span> _course_over_ground_y; <span class="comment">// Course overground Y axis</span>
<a name="l00101"></a>00101 <span class="keywordtype">float</span> _health;
<a name="l00102"></a>00102 <span class="keywordtype">bool</span> _centripetal;
<a name="l00103"></a>00103 };
<a name="l00104"></a>00104
<a name="l00105"></a>00105 <span class="preprocessor">#endif</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span>
<a name="l00107"></a>00107
<a name="l00108"></a>00108
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,98 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_DCM_HIL.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_DCM_HIL.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_a_p___d_c_m___h_i_l_8h_source.html">AP_DCM_HIL.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_DCM_HIL.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___d_c_m___h_i_l_8cpp__incl.png" border="0" usemap="#_a_p___d_c_m___h_i_l_8cpp" alt=""/></div>
<map name="_a_p___d_c_m___h_i_l_8cpp" id="_a_p___d_c_m___h_i_l_8cpp">
<area shape="rect" id="node3" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="644,83,759,112"/><area shape="rect" id="node5" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="1004,315,1100,344"/><area shape="rect" id="node21" href="_a_p___math_8h.html" title="AP_Math.h" alt="" coords="383,469,473,499"/><area shape="rect" id="node36" href="_w_program_8h.html" title="WProgram.h" alt="" coords="267,315,365,344"/><area shape="rect" id="node38" href="_a_p___compass_8h.html" title="Catch&#45;all header that defines all supported compass classes." alt="" coords="171,160,288,189"/><area shape="rect" id="node54" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="684,315,769,344"/><area shape="rect" id="node63" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="1448,160,1533,189"/><area shape="rect" id="node102" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="609,160,692,189"/><area shape="rect" id="node15" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="1357,392,1480,421"/><area shape="rect" id="node23" href="vector2_8h.html" title="vector2.h" alt="" coords="308,624,391,653"/><area shape="rect" id="node27" href="vector3_8h.html" title="vector3.h" alt="" coords="415,624,497,653"/><area shape="rect" id="node32" href="matrix3_8h.html" title="matrix3.h" alt="" coords="387,547,469,576"/><area shape="rect" id="node40" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="5,315,192,344"/><area shape="rect" id="node49" href="_a_p___compass___h_i_l_8h.html" title="AP_Compass_HIL.h" alt="" coords="157,237,301,267"/><area shape="rect" id="node42" href="_compass_8h.html" title="Compass.h" alt="" coords="183,392,276,421"/><area shape="rect" id="node56" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="624,392,776,421"/><area shape="rect" id="node59" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="800,392,912,421"/><area shape="rect" id="node65" href="_a_p___g_p_s___n_m_e_a_8h.html" title="AP_GPS_NMEA.h" alt="" coords="2033,315,2164,344"/><area shape="rect" id="node71" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="1175,315,1292,344"/><area shape="rect" id="node74" href="_a_p___g_p_s__406_8h.html" title="AP_GPS_406.h" alt="" coords="1192,237,1307,267"/><area shape="rect" id="node77" href="_a_p___g_p_s___u_b_l_o_x_8h.html" title="AP_GPS_UBLOX.h" alt="" coords="1316,315,1449,344"/><area shape="rect" id="node80" href="_a_p___g_p_s___m_t_k_8h.html" title="AP_GPS_MTK.h" alt="" coords="1432,237,1549,267"/><area shape="rect" id="node85" href="_a_p___g_p_s___m_t_k16_8h.html" title="AP_GPS_MTK16.h" alt="" coords="1573,237,1707,267"/><area shape="rect" id="node89" href="_a_p___g_p_s___none_8h.html" title="AP_GPS_None.h" alt="" coords="1783,315,1908,344"/><area shape="rect" id="node92" href="_a_p___g_p_s___auto_8h.html" title="AP_GPS_Auto.h" alt="" coords="1045,237,1168,267"/><area shape="rect" id="node96" href="_a_p___g_p_s___h_i_l_8h.html" title="AP_GPS_HIL.h" alt="" coords="1787,237,1899,267"/><area shape="rect" id="node99" href="_a_p___g_p_s___shim_8h.html" title="AP_GPS_Shim.h" alt="" coords="1924,237,2049,267"/><area shape="rect" id="node67" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="1509,392,1571,421"/><area shape="rect" id="node83" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="1524,315,1708,344"/><area shape="rect" id="node104" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="587,237,715,267"/><area shape="rect" id="node113" href="_a_p___i_m_u___shim_8h.html" title="IMU shim driver, used when the IMU data is coming from somewhere else." alt="" coords="440,237,563,267"/><area shape="rect" id="node106" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit." alt="" coords="491,392,549,421"/></map>
</div>
<p><a href="_a_p___d_c_m___h_i_l_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m___h_i_l_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(x)&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___d_c_m___h_i_l_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">ToDeg</a>(x)&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a3c9d151923236c7e8ccccf86f131e550"></a><!-- doxytag: member="AP_DCM_HIL.cpp::ToDeg" ref="a3c9d151923236c7e8ccccf86f131e550" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToDeg</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m___h_i_l_8cpp_source.html#l00020">20</a> of file <a class="el" href="_a_p___d_c_m___h_i_l_8cpp_source.html">AP_DCM_HIL.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a728f9499baea61e7df3ae70a374f2512"></a><!-- doxytag: member="AP_DCM_HIL.cpp::ToRad" ref="a728f9499baea61e7df3ae70a374f2512" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToRad</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___d_c_m___h_i_l_8cpp_source.html#l00019">19</a> of file <a class="el" href="_a_p___d_c_m___h_i_l_8cpp_source.html">AP_DCM_HIL.cpp</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,92 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_DCM_HIL.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_DCM_HIL.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___d_c_m___h_i_l_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> APM_DCM_HIL.cpp - DCM AHRS Library, for Ardupilot Mega, Hardware in the Loop Model</span>
<a name="l00003"></a>00003 <span class="comment"> Code by James Goppert. DIYDrones.com</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment"> Methods:</span>
<a name="l00011"></a>00011 <span class="comment"> update_DCM(_G_Dt) : Updates the AHRS by integrating the rotation matrix over time _G_Dt using the IMU object data</span>
<a name="l00012"></a>00012 <span class="comment"> get_gyro() : Returns gyro vector corrected for bias</span>
<a name="l00013"></a>00013 <span class="comment"> get_accel() : Returns accelerometer vector</span>
<a name="l00014"></a>00014 <span class="comment"> get_dcm_matrix() : Returns dcm matrix</span>
<a name="l00015"></a>00015 <span class="comment"></span>
<a name="l00016"></a>00016 <span class="comment">*/</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___d_c_m___h_i_l_8h.html">AP_DCM_HIL.h</a>&gt;</span>
<a name="l00018"></a>00018
<a name="l00019"></a><a class="code" href="_a_p___d_c_m___h_i_l_8cpp.html#a728f9499baea61e7df3ae70a374f2512">00019</a> <span class="preprocessor">#define ToRad(x) (x*0.01745329252) // *pi/180</span>
<a name="l00020"></a><a class="code" href="_a_p___d_c_m___h_i_l_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define ToDeg(x) (x*57.2957795131) // *180/pi</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="comment">/**************************************************/</span>
<a name="l00023"></a>00023 <span class="keywordtype">void</span>
<a name="l00024"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a37a3ab07ddbb929f0b9feaa929a1c8ad">00024</a> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a37a3ab07ddbb929f0b9feaa929a1c8ad">AP_DCM_HIL::setHil</a>(<span class="keywordtype">float</span> _roll, <span class="keywordtype">float</span> _pitch, <span class="keywordtype">float</span> _yaw,
<a name="l00025"></a>00025 <span class="keywordtype">float</span> _rollRate, <span class="keywordtype">float</span> _pitchRate, <span class="keywordtype">float</span> _yawRate)
<a name="l00026"></a>00026 {
<a name="l00027"></a>00027 <a class="code" href="class_a_p___d_c_m___h_i_l.html#a48374fe931275819ad81c56480705856">roll</a> = _roll;
<a name="l00028"></a>00028 <a class="code" href="class_a_p___d_c_m___h_i_l.html#a943d62d6b442ae69c975228c180bdedf">pitch</a> = _pitch;
<a name="l00029"></a>00029 <a class="code" href="class_a_p___d_c_m___h_i_l.html#aa17233338e8c57385cde7eed8658aa83">yaw</a> = _yaw;
<a name="l00030"></a>00030
<a name="l00031"></a>00031 _omega_integ_corr.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = _rollRate;
<a name="l00032"></a>00032 _omega_integ_corr.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = _pitchRate;
<a name="l00033"></a>00033 _omega_integ_corr.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = _yawRate;
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <a class="code" href="class_a_p___d_c_m___h_i_l.html#abb27e978801ab981ff086967e87c197b">roll_sensor</a> =<a class="code" href="_a_p___d_c_m___h_i_l_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">ToDeg</a>(<a class="code" href="class_a_p___d_c_m___h_i_l.html#a48374fe931275819ad81c56480705856">roll</a>)*100;
<a name="l00036"></a>00036 <a class="code" href="class_a_p___d_c_m___h_i_l.html#a45dc357f5c4fb707108da596e64fdb27">pitch_sensor</a> =<a class="code" href="_a_p___d_c_m___h_i_l_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">ToDeg</a>(<a class="code" href="class_a_p___d_c_m___h_i_l.html#a943d62d6b442ae69c975228c180bdedf">pitch</a>)*100;
<a name="l00037"></a>00037 <a class="code" href="class_a_p___d_c_m___h_i_l.html#a430a2f9d7ba400bd6a75a6027bae4364">yaw_sensor</a> =<a class="code" href="_a_p___d_c_m___h_i_l_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">ToDeg</a>(<a class="code" href="class_a_p___d_c_m___h_i_l.html#aa17233338e8c57385cde7eed8658aa83">yaw</a>)*100;
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="comment">// Need the standard C_body&lt;-nav dcm from navigation frame to body frame</span>
<a name="l00040"></a>00040 <span class="comment">// Strapdown Inertial Navigation Technology / Titterton/ pg. 41</span>
<a name="l00041"></a>00041 <span class="keywordtype">float</span> sRoll = sin(<a class="code" href="class_a_p___d_c_m___h_i_l.html#a48374fe931275819ad81c56480705856">roll</a>), cRoll = cos(<a class="code" href="class_a_p___d_c_m___h_i_l.html#a48374fe931275819ad81c56480705856">roll</a>);
<a name="l00042"></a>00042 <span class="keywordtype">float</span> sPitch = sin(<a class="code" href="class_a_p___d_c_m___h_i_l.html#a943d62d6b442ae69c975228c180bdedf">pitch</a>), cPitch = cos(<a class="code" href="class_a_p___d_c_m___h_i_l.html#a943d62d6b442ae69c975228c180bdedf">pitch</a>);
<a name="l00043"></a>00043 <span class="keywordtype">float</span> sYaw = sin(<a class="code" href="class_a_p___d_c_m___h_i_l.html#aa17233338e8c57385cde7eed8658aa83">yaw</a>), cYaw = cos(<a class="code" href="class_a_p___d_c_m___h_i_l.html#aa17233338e8c57385cde7eed8658aa83">yaw</a>);
<a name="l00044"></a>00044 _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = cPitch*cYaw;
<a name="l00045"></a>00045 _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = cPitch*sYaw;
<a name="l00046"></a>00046 _dcm_matrix.<a class="code" href="class_matrix3.html#acd7bf3421047fa155168a9c8e5164a2b">a</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = -sPitch;
<a name="l00047"></a>00047 _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = -cRoll*sYaw+sRoll*sPitch*cYaw;
<a name="l00048"></a>00048 _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = cRoll*cYaw+sRoll*sPitch*sYaw;
<a name="l00049"></a>00049 _dcm_matrix.<a class="code" href="class_matrix3.html#ae16bed039ad87c3337f15837c33fe2fb">b</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = sRoll*cPitch;
<a name="l00050"></a>00050 _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = sRoll*sYaw+cRoll*sPitch*cYaw;
<a name="l00051"></a>00051 _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = -sRoll*cYaw+cRoll*sPitch*sYaw;
<a name="l00052"></a>00052 _dcm_matrix.<a class="code" href="class_matrix3.html#a7efa0e7bd4c621a7fe76cd9168960b94">c</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = cRoll*cPitch;
<a name="l00053"></a>00053 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,70 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_DCM_HIL.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_DCM_HIL.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_fast_serial_8h_source.html">FastSerial.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___math_8h_source.html">AP_Math.h</a>&gt;</code><br/>
<code>#include &lt;inttypes.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_w_program_8h_source.html">WProgram.h</a>&quot;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___compass_8h_source.html">AP_Compass.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___a_d_c_8h_source.html">AP_ADC.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___g_p_s_8h_source.html">AP_GPS.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___i_m_u_8h_source.html">AP_IMU.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_DCM_HIL.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___d_c_m___h_i_l_8h__incl.png" border="0" usemap="#_a_p___d_c_m___h_i_l_8h" alt=""/></div>
<map name="_a_p___d_c_m___h_i_l_8h" id="_a_p___d_c_m___h_i_l_8h">
<area shape="rect" id="node3" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="1004,237,1100,267"/><area shape="rect" id="node19" href="_a_p___math_8h.html" title="AP_Math.h" alt="" coords="383,392,473,421"/><area shape="rect" id="node34" href="_w_program_8h.html" title="WProgram.h" alt="" coords="267,237,365,267"/><area shape="rect" id="node36" href="_a_p___compass_8h.html" title="Catch&#45;all header that defines all supported compass classes." alt="" coords="171,83,288,112"/><area shape="rect" id="node52" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="684,237,769,267"/><area shape="rect" id="node61" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="1448,83,1533,112"/><area shape="rect" id="node100" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="609,83,692,112"/><area shape="rect" id="node13" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="1357,315,1480,344"/><area shape="rect" id="node21" href="vector2_8h.html" title="vector2.h" alt="" coords="308,547,391,576"/><area shape="rect" id="node25" href="vector3_8h.html" title="vector3.h" alt="" coords="415,547,497,576"/><area shape="rect" id="node30" href="matrix3_8h.html" title="matrix3.h" alt="" coords="387,469,469,499"/><area shape="rect" id="node38" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="5,237,192,267"/><area shape="rect" id="node47" href="_a_p___compass___h_i_l_8h.html" title="AP_Compass_HIL.h" alt="" coords="157,160,301,189"/><area shape="rect" id="node40" href="_compass_8h.html" title="Compass.h" alt="" coords="183,315,276,344"/><area shape="rect" id="node54" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="624,315,776,344"/><area shape="rect" id="node57" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="800,315,912,344"/><area shape="rect" id="node63" href="_a_p___g_p_s___n_m_e_a_8h.html" title="AP_GPS_NMEA.h" alt="" coords="2033,237,2164,267"/><area shape="rect" id="node69" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="1175,237,1292,267"/><area shape="rect" id="node72" href="_a_p___g_p_s__406_8h.html" title="AP_GPS_406.h" alt="" coords="1192,160,1307,189"/><area shape="rect" id="node75" href="_a_p___g_p_s___u_b_l_o_x_8h.html" title="AP_GPS_UBLOX.h" alt="" coords="1316,237,1449,267"/><area shape="rect" id="node78" href="_a_p___g_p_s___m_t_k_8h.html" title="AP_GPS_MTK.h" alt="" coords="1432,160,1549,189"/><area shape="rect" id="node83" href="_a_p___g_p_s___m_t_k16_8h.html" title="AP_GPS_MTK16.h" alt="" coords="1573,160,1707,189"/><area shape="rect" id="node87" href="_a_p___g_p_s___none_8h.html" title="AP_GPS_None.h" alt="" coords="1783,237,1908,267"/><area shape="rect" id="node90" href="_a_p___g_p_s___auto_8h.html" title="AP_GPS_Auto.h" alt="" coords="1045,160,1168,189"/><area shape="rect" id="node94" href="_a_p___g_p_s___h_i_l_8h.html" title="AP_GPS_HIL.h" alt="" coords="1787,160,1899,189"/><area shape="rect" id="node97" href="_a_p___g_p_s___shim_8h.html" title="AP_GPS_Shim.h" alt="" coords="1924,160,2049,189"/><area shape="rect" id="node65" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="1509,315,1571,344"/><area shape="rect" id="node81" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="1524,237,1708,267"/><area shape="rect" id="node102" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="587,160,715,189"/><area shape="rect" id="node111" href="_a_p___i_m_u___shim_8h.html" title="IMU shim driver, used when the IMU data is coming from somewhere else." alt="" coords="440,160,563,189"/><area shape="rect" id="node104" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit." alt="" coords="491,315,549,344"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___d_c_m___h_i_l_8h__dep__incl.png" border="0" usemap="#_a_p___d_c_m___h_i_l_8hdep" alt=""/></div>
<map name="_a_p___d_c_m___h_i_l_8hdep" id="_a_p___d_c_m___h_i_l_8hdep">
<area shape="rect" id="node3" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,83,100,112"/><area shape="rect" id="node7" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,83,255,112"/><area shape="rect" id="node5" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,160,107,189"/></map>
</div>
<p><a href="_a_p___d_c_m___h_i_l_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___d_c_m___h_i_l.html">AP_DCM_HIL</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,101 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_DCM_HIL.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_DCM_HIL.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___d_c_m___h_i_l_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef AP_DCM_HIL_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define AP_DCM_HIL_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;<a class="code" href="_fast_serial_8h.html">FastSerial.h</a>&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___math_8h.html">AP_Math.h</a>&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="_w_program_8h.html">WProgram.h</a>&quot;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___compass_8h.html" title="Catch-all header that defines all supported compass classes.">AP_Compass.h</a>&gt;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___a_d_c_8h.html">AP_ADC.h</a>&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___g_p_s_8h.html" title="Catch-all header that defines all supported GPS classes.">AP_GPS.h</a>&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___i_m_u_8h.html" title="Catch-all header that defines all supported IMU classes.">AP_IMU.h</a>&gt;</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013
<a name="l00014"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html">00014</a> <span class="keyword">class </span><a class="code" href="class_a_p___d_c_m___h_i_l.html">AP_DCM_HIL</a>
<a name="l00015"></a>00015 {
<a name="l00016"></a>00016 <span class="keyword">public</span>:
<a name="l00017"></a>00017 <span class="comment">// Constructors</span>
<a name="l00018"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#adcc168d94ee4c5daad8681253219609a">00018</a> <a class="code" href="class_a_p___d_c_m___h_i_l.html#adcc168d94ee4c5daad8681253219609a">AP_DCM_HIL</a>() :
<a name="l00019"></a>00019 _dcm_matrix(1, 0, 0,
<a name="l00020"></a>00020 0, 1, 0,
<a name="l00021"></a>00021 0, 0, 1)
<a name="l00022"></a>00022 {}
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="comment">// Accessors</span>
<a name="l00025"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#abf3261982f737ec0946caab2ed936327">00025</a> <a class="code" href="class_vector3.html">Vector3f</a> <a class="code" href="class_a_p___d_c_m___h_i_l.html#abf3261982f737ec0946caab2ed936327">get_gyro</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> _omega_integ_corr; }
<a name="l00026"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a9567b157df477c3f8891452d6b3fb0e6">00026</a> <a class="code" href="class_vector3.html">Vector3f</a> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a9567b157df477c3f8891452d6b3fb0e6">get_accel</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> _accel_vector; }
<a name="l00027"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#ab0411710166b19827686f0c4d7d33a4f">00027</a> <a class="code" href="class_matrix3.html">Matrix3f</a> <a class="code" href="class_a_p___d_c_m___h_i_l.html#ab0411710166b19827686f0c4d7d33a4f">get_dcm_matrix</a>(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> _dcm_matrix; }
<a name="l00028"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a7149e1b918b2459ef63b46dea455e8bb">00028</a> <a class="code" href="class_matrix3.html">Matrix3f</a> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a7149e1b918b2459ef63b46dea455e8bb">get_dcm_transposed</a>(<span class="keywordtype">void</span>) {<a class="code" href="class_matrix3.html">Matrix3f</a> temp = _dcm_matrix; <span class="keywordflow">return</span> temp.<a class="code" href="class_matrix3.html#a689b1ae3ea245ef3da02ed40941e130b">transpose</a>();}
<a name="l00029"></a>00029
<a name="l00030"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a9d3f3cee0faa40d08dfbc4f7e43293ff">00030</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a9d3f3cee0faa40d08dfbc4f7e43293ff">set_centripetal</a>(<span class="keywordtype">bool</span> b) {}
<a name="l00031"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#af47cd722907da46e227148dac7453a4f">00031</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#af47cd722907da46e227148dac7453a4f">set_compass</a>(<a class="code" href="class_compass.html">Compass</a> *compass) {}
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="comment">// Methods</span>
<a name="l00034"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a2a21b2567dd5a7fb86a6768364d0501a">00034</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a2a21b2567dd5a7fb86a6768364d0501a">update_DCM</a>(<span class="keywordtype">float</span> _G_Dt) {}
<a name="l00035"></a>00035
<a name="l00036"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#aa0fe607e5c0d012efa7b722bcd0eb22e">00036</a> <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#aa0fe607e5c0d012efa7b722bcd0eb22e">get_health</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> 1.0; }
<a name="l00037"></a>00037
<a name="l00038"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#abb27e978801ab981ff086967e87c197b">00038</a> <span class="keywordtype">long</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#abb27e978801ab981ff086967e87c197b">roll_sensor</a>; <span class="comment">// Degrees * 100</span>
<a name="l00039"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a45dc357f5c4fb707108da596e64fdb27">00039</a> <span class="keywordtype">long</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a45dc357f5c4fb707108da596e64fdb27">pitch_sensor</a>; <span class="comment">// Degrees * 100</span>
<a name="l00040"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a430a2f9d7ba400bd6a75a6027bae4364">00040</a> <span class="keywordtype">long</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a430a2f9d7ba400bd6a75a6027bae4364">yaw_sensor</a>; <span class="comment">// Degrees * 100</span>
<a name="l00041"></a>00041
<a name="l00042"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a48374fe931275819ad81c56480705856">00042</a> <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a48374fe931275819ad81c56480705856">roll</a>; <span class="comment">// Radians</span>
<a name="l00043"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a943d62d6b442ae69c975228c180bdedf">00043</a> <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a943d62d6b442ae69c975228c180bdedf">pitch</a>; <span class="comment">// Radians</span>
<a name="l00044"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#aa17233338e8c57385cde7eed8658aa83">00044</a> <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#aa17233338e8c57385cde7eed8658aa83">yaw</a>; <span class="comment">// Radians</span>
<a name="l00045"></a>00045
<a name="l00046"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a8ccecfae76967f4e9d32260b59624f08">00046</a> uint8_t <a class="code" href="class_a_p___d_c_m___h_i_l.html#a8ccecfae76967f4e9d32260b59624f08">gyro_sat_count</a>;
<a name="l00047"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#a61d46323d0a54eedde1a6d62b12d0f07">00047</a> uint8_t <a class="code" href="class_a_p___d_c_m___h_i_l.html#a61d46323d0a54eedde1a6d62b12d0f07">renorm_sqrt_count</a>;
<a name="l00048"></a><a class="code" href="class_a_p___d_c_m___h_i_l.html#ab889e544f0fe4e31dae15f86ff3be20e">00048</a> uint8_t <a class="code" href="class_a_p___d_c_m___h_i_l.html#ab889e544f0fe4e31dae15f86ff3be20e">renorm_blowup_count</a>;
<a name="l00049"></a>00049
<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a37a3ab07ddbb929f0b9feaa929a1c8ad">setHil</a>(<span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a48374fe931275819ad81c56480705856">roll</a>, <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#a943d62d6b442ae69c975228c180bdedf">pitch</a>, <span class="keywordtype">float</span> <a class="code" href="class_a_p___d_c_m___h_i_l.html#aa17233338e8c57385cde7eed8658aa83">yaw</a>,
<a name="l00051"></a>00051 <span class="keywordtype">float</span> rollRate, <span class="keywordtype">float</span> pitchRate, <span class="keywordtype">float</span> yawRate);
<a name="l00052"></a>00052 <span class="keyword">private</span>:
<a name="l00053"></a>00053 <span class="comment">// Methods</span>
<a name="l00054"></a>00054 <a class="code" href="class_matrix3.html">Matrix3f</a> _dcm_matrix;
<a name="l00055"></a>00055 <a class="code" href="class_vector3.html">Vector3f</a> _omega_integ_corr;
<a name="l00056"></a>00056 <a class="code" href="class_vector3.html">Vector3f</a> _accel_vector;
<a name="l00057"></a>00057 };
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="preprocessor">#endif</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span>
<a name="l00061"></a>00061
<a name="l00062"></a>00062
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_EEPROMB.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_EEPROMB.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;avr/eeprom.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___e_e_p_r_o_m_b_8h_source.html">AP_EEPROMB.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_EEPROMB.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___e_e_p_r_o_m_b_8cpp__incl.png" border="0" usemap="#_a_p___e_e_p_r_o_m_b_8cpp" alt=""/></div>
<map name="_a_p___e_e_p_r_o_m_b_8cpp" id="_a_p___e_e_p_r_o_m_b_8cpp">
<area shape="rect" id="node5" href="_a_p___e_e_p_r_o_m_b_8h.html" title="AP_EEPROMB manager." alt="" coords="136,83,256,112"/><area shape="rect" id="node7" href="_w_program_8h.html" title="WProgram.h" alt="" coords="147,160,245,189"/></map>
</div>
<p><a href="_a_p___e_e_p_r_o_m_b_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,106 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_EEPROMB.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_EEPROMB.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___e_e_p_r_o_m_b_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> RC_Channel.cpp - Radio library for Arduino</span>
<a name="l00003"></a>00003 <span class="comment"> Code by Jason Short. DIYDrones.com</span>
<a name="l00004"></a>00004 <span class="comment"> </span>
<a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and / or</span>
<a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">*/</span>
<a name="l00011"></a>00011
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;avr/eeprom.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___e_e_p_r_o_m_b_8h.html" title="AP_EEPROMB manager.">AP_EEPROMB.h</a>&quot;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="comment">//#include &quot;WProgram.h&quot;</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="keywordtype">void</span>
<a name="l00018"></a><a class="code" href="class_a_p___e_e_p_r_o_m_b.html#acdb73c655cd5e5d69e22a9a15b819372">00018</a> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#acdb73c655cd5e5d69e22a9a15b819372">AP_EEPROMB::write_byte</a>(<span class="keywordtype">int</span> address, int8_t value)
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020 eeprom_write_byte((uint8_t *) address, value);
<a name="l00021"></a>00021 }
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="keywordtype">void</span>
<a name="l00024"></a>00024 <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a76a66afde2196114cc4fc1b30faea0e7">AP_EEPROMB::write_int</a>(<span class="keywordtype">int</span> address, <span class="keywordtype">int</span> value)
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026 eeprom_write_word((uint16_t *) address, value);
<a name="l00027"></a>00027 }
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="keywordtype">void</span>
<a name="l00030"></a>00030 <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#acbc430dc9b77d0e40a89c67a50153043">AP_EEPROMB::write_long</a>(<span class="keywordtype">int</span> address, <span class="keywordtype">long</span> value)
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 eeprom_write_dword((uint32_t *) address, value);
<a name="l00033"></a>00033 }
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="keywordtype">void</span>
<a name="l00036"></a><a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a2d9701f608bd3d49af1594e5ed33daa4">00036</a> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a2d9701f608bd3d49af1594e5ed33daa4">AP_EEPROMB::write_float</a>(<span class="keywordtype">int</span> address, <span class="keywordtype">float</span> value)
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 _type_union.fvalue = value;
<a name="l00039"></a>00039 <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#acbc430dc9b77d0e40a89c67a50153043">write_long</a>(address, _type_union.lvalue);
<a name="l00040"></a>00040 }
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="keywordtype">int</span>
<a name="l00043"></a><a class="code" href="class_a_p___e_e_p_r_o_m_b.html#af62dbf0e886e944c51892e7460c74f64">00043</a> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#af62dbf0e886e944c51892e7460c74f64">AP_EEPROMB::read_byte</a>(<span class="keywordtype">int</span> address)
<a name="l00044"></a>00044 {
<a name="l00045"></a>00045 <span class="keywordflow">return</span> eeprom_read_byte((<span class="keyword">const</span> uint8_t *) address);
<a name="l00046"></a>00046 }
<a name="l00047"></a>00047
<a name="l00048"></a>00048 <span class="keywordtype">int</span>
<a name="l00049"></a><a class="code" href="class_a_p___e_e_p_r_o_m_b.html#ab705d4b2d44f7d4c27bb1a382e783885">00049</a> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#ab705d4b2d44f7d4c27bb1a382e783885">AP_EEPROMB::read_int</a>(<span class="keywordtype">int</span> address)
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051 <span class="keywordflow">return</span> eeprom_read_word((<span class="keyword">const</span> uint16_t *) address);
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <span class="keywordtype">long</span>
<a name="l00055"></a><a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a9591ef3e3cbbc974ced715d8bd7f2887">00055</a> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a9591ef3e3cbbc974ced715d8bd7f2887">AP_EEPROMB::read_long</a>(<span class="keywordtype">int</span> address)
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 <span class="keywordflow">return</span> eeprom_read_dword((<span class="keyword">const</span> uint32_t *) address);
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="keywordtype">float</span>
<a name="l00061"></a><a class="code" href="class_a_p___e_e_p_r_o_m_b.html#ac868cc5ceaf3956ffb863ebbf87dc27d">00061</a> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#ac868cc5ceaf3956ffb863ebbf87dc27d">AP_EEPROMB::read_float</a>(<span class="keywordtype">int</span> address)
<a name="l00062"></a>00062 {
<a name="l00063"></a>00063 _type_union.lvalue = eeprom_read_dword((<span class="keyword">const</span> uint32_t *) address);
<a name="l00064"></a>00064 <span class="keywordflow">return</span> _type_union.fvalue;
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066
<a name="l00067"></a>00067
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,72 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_EEPROMB.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_EEPROMB.h File Reference</h1> </div>
</div>
<div class="contents">
<p><a class="el" href="class_a_p___e_e_p_r_o_m_b.html" title="Object for reading and writing to the EEPROM.">AP_EEPROMB</a> manager.
<a href="#_details">More...</a></p>
<code>#include &quot;<a class="el" href="_w_program_8h_source.html">WProgram.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_EEPROMB.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___e_e_p_r_o_m_b_8h__incl.png" border="0" usemap="#_a_p___e_e_p_r_o_m_b_8h" alt=""/></div>
<map name="_a_p___e_e_p_r_o_m_b_8h" id="_a_p___e_e_p_r_o_m_b_8h">
<area shape="rect" id="node3" href="_w_program_8h.html" title="WProgram.h" alt="" coords="16,83,115,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___e_e_p_r_o_m_b_8h__dep__incl.png" border="0" usemap="#_a_p___e_e_p_r_o_m_b_8hdep" alt=""/></div>
<map name="_a_p___e_e_p_r_o_m_b_8hdep" id="_a_p___e_e_p_r_o_m_b_8hdep">
<area shape="rect" id="node3" href="_a_p___e_e_p_r_o_m_b_8cpp.html" title="AP_EEPROMB.cpp" alt="" coords="5,83,139,112"/></map>
</div>
<p><a href="_a_p___e_e_p_r_o_m_b_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___e_e_p_r_o_m_b.html">AP_EEPROMB</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Object for reading and writing to the EEPROM. <a href="class_a_p___e_e_p_r_o_m_b.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">union &nbsp;</td><td class="memItemRight" valign="bottom"><b>AP_EEPROMB::type_union</b></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><a class="el" href="class_a_p___e_e_p_r_o_m_b.html" title="Object for reading and writing to the EEPROM.">AP_EEPROMB</a> manager. </p>
<p>Definition in file <a class="el" href="_a_p___e_e_p_r_o_m_b_8h_source.html">AP_EEPROMB.h</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,75 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_EEPROMB.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_EEPROMB.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___e_e_p_r_o_m_b_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#ifndef AP_EEPROMB_h</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span><span class="preprocessor">#define AP_EEPROMB_h</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span>
<a name="l00009"></a>00009 <span class="comment">//#include &lt;stdint.h&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;<a class="code" href="_w_program_8h.html">WProgram.h</a>&quot;</span>
<a name="l00011"></a>00011
<a name="l00014"></a><a class="code" href="class_a_p___e_e_p_r_o_m_b.html">00014</a> <span class="keyword">class </span><a class="code" href="class_a_p___e_e_p_r_o_m_b.html" title="Object for reading and writing to the EEPROM.">AP_EEPROMB</a>{
<a name="l00015"></a>00015 <span class="keyword">public</span>:
<a name="l00017"></a><a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a0562d6e851b3c251ef35da0f0406d673">00017</a> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a0562d6e851b3c251ef35da0f0406d673" title="Constructor.">AP_EEPROMB</a>(){}
<a name="l00018"></a>00018
<a name="l00019"></a>00019 <span class="keywordtype">int</span> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#af62dbf0e886e944c51892e7460c74f64">read_byte</a>(<span class="keywordtype">int</span> address);
<a name="l00020"></a>00020 <span class="keywordtype">int</span> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#ab705d4b2d44f7d4c27bb1a382e783885">read_int</a>(<span class="keywordtype">int</span> address);
<a name="l00021"></a>00021 <span class="keywordtype">long</span> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a9591ef3e3cbbc974ced715d8bd7f2887">read_long</a>(<span class="keywordtype">int</span> address);
<a name="l00022"></a>00022 <span class="keywordtype">float</span> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#ac868cc5ceaf3956ffb863ebbf87dc27d">read_float</a>(<span class="keywordtype">int</span> address);
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#acdb73c655cd5e5d69e22a9a15b819372">write_byte</a>(<span class="keywordtype">int</span> address, int8_t value);
<a name="l00025"></a>00025 <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a76a66afde2196114cc4fc1b30faea0e7">write_int</a>(<span class="keywordtype">int</span> address, int16_t value);
<a name="l00026"></a>00026 <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#acbc430dc9b77d0e40a89c67a50153043">write_long</a>(<span class="keywordtype">int</span> address, int32_t value);
<a name="l00027"></a>00027 <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_p_r_o_m_b.html#a2d9701f608bd3d49af1594e5ed33daa4">write_float</a>(<span class="keywordtype">int</span> address, <span class="keywordtype">float</span> value);
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="keyword">private</span>:
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="keyword">union </span>type_union {
<a name="l00032"></a>00032 int8_t bytes[4];
<a name="l00033"></a>00033 <span class="keywordtype">long</span> lvalue;
<a name="l00034"></a>00034 <span class="keywordtype">int</span> ivalue;
<a name="l00035"></a>00035 <span class="keywordtype">float</span> fvalue;
<a name="l00036"></a>00036 } _type_union;
<a name="l00037"></a>00037
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="preprocessor">#endif </span>
<a name="l00041"></a>00041 <span class="preprocessor"></span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,70 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_EEProm.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<h1>AP_EEProm.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_EEProm.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___e_e_prom_8cpp__incl.png" border="0" usemap="#_a_p___e_e_prom_8cpp" alt=""/></div>
<map name="_a_p___e_e_prom_8cpp" id="_a_p___e_e_prom_8cpp">
<area shape="rect" id="node3" href="_a_p___e_e_prom_8h.html" title="AP_EEProm.h" alt="" coords="643,83,749,112"/><area shape="rect" id="node5" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries." alt="" coords="283,160,400,189"/><area shape="rect" id="node13" href="_a_p___vector_8h.html" title="AP_Vector.h" alt="" coords="373,315,472,344"/><area shape="rect" id="node31" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="824,160,947,189"/><area shape="rect" id="node9" href="menu_8h.html" title="Simple commandline menu subsystem. &#160;The Menu class implements a simple CLI that accepts commands type..." alt="" coords="99,237,219,267"/><area shape="rect" id="node11" href="c_09_09_8h.html" title="c++.h" alt="" coords="243,237,304,267"/><area shape="rect" id="node21" href="_a_p___loop_8h.html" title="AP_Loop.h" alt="" coords="379,237,467,267"/><area shape="rect" id="node24" href="_a_p___var_8h.html" title="AP_Var.h" alt="" coords="491,237,568,267"/><area shape="rect" id="node19" href="_w_program_8h.html" title="WProgram.h" alt="" coords="489,392,588,421"/></map>
</div>
<p><a href="_a_p___e_e_prom_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_a_p___e_e_prom_registry.html">AP_EEPromRegistry</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8cpp.html#ab9f343c688a095f2819577da1f5c8269">eepromRegistry</a> (1024)</td></tr>
</table>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ab9f343c688a095f2819577da1f5c8269"></a><!-- doxytag: member="AP_EEProm.cpp::eepromRegistry" ref="ab9f343c688a095f2819577da1f5c8269" args="(1024)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_a_p___e_e_prom_registry.html">AP_EEPromRegistry</a> <a class="el" href="_a_p___e_e_prom_8h.html#ace5829ad43d9564a20756ac7ab33aebc">eepromRegistry</a>(1024)</td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,83 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_EEProm.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_EEProm.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___e_e_prom_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * AP_EEProm.cpp</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) James Goppert 2010 &lt;james.goppert@gmail.com&gt;</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * This file is free software: you can redistribute it and/or modify it</span>
<a name="l00006"></a>00006 <span class="comment"> * under the terms of the GNU General Public License as published by the</span>
<a name="l00007"></a>00007 <span class="comment"> * Free Software Foundation, either version 3 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment"> * (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * This file is distributed in the hope that it will be useful, but</span>
<a name="l00011"></a>00011 <span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span>
<a name="l00013"></a>00013 <span class="comment"> * See the GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
<a name="l00016"></a>00016 <span class="comment"> * with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00017"></a>00017 <span class="comment"> */</span>
<a name="l00018"></a>00018
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___e_e_prom_8h.html">AP_EEProm.h</a>&gt;</span>
<a name="l00020"></a><a class="code" href="class_a_p___e_e_prom_registry.html#a022d84aae5c08e2a99f5a87c13bc6702">00020</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_prom_registry.html#a022d84aae5c08e2a99f5a87c13bc6702" title="Print on desired serial port.">AP_EEPromRegistry::print</a>(<a class="code" href="class_better_stream.html">BetterStream</a> &amp; stream)
<a name="l00021"></a>00021 {
<a name="l00022"></a>00022 stream.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;\nEEPROM Registry\n&quot;</span>);
<a name="l00023"></a>00023 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="class_vector.html#a63d372a3caf5492712708ca15da7ac1c">getSize</a>();i++)
<a name="l00024"></a>00024 {
<a name="l00025"></a>00025 stream.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;id:\t%u\t%s\t%s\tval:\t%10.4f\taddr:\t%u\t\n&quot;</span>,
<a name="l00026"></a>00026 (*<span class="keyword">this</span>)[i]-&gt;getEntryId(),
<a name="l00027"></a>00027 (*<span class="keyword">this</span>)[i]-&gt;getEntryParentName(),
<a name="l00028"></a>00028 (*<span class="keyword">this</span>)[i]-&gt;getEntryName(),
<a name="l00029"></a>00029 (*<span class="keyword">this</span>)[i]-&gt;getEntry(),
<a name="l00030"></a>00030 (*<span class="keyword">this</span>)[i]-&gt;getEntryAddress());
<a name="l00031"></a>00031 }
<a name="l00032"></a>00032 }
<a name="l00033"></a>00033
<a name="l00034"></a>00034
<a name="l00035"></a><a class="code" href="class_a_p___e_e_prom_registry.html#a3085f6bb3cd5c2ec3d40fecb13632845">00035</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_prom_registry.html#a3085f6bb3cd5c2ec3d40fecb13632845" title="Add an entry to the registry.">AP_EEPromRegistry::add</a>(<a class="code" href="class_a_p___e_e_prom_entry_i.html" title="The interface for data entries in the eeprom registry.">AP_EEPromEntryI</a> * entry, uint16_t &amp; <span class="keywordtype">id</span>, uint16_t &amp; address, <span class="keywordtype">size_t</span> size)
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 <span class="keywordflow">if</span> (_newAddress + size &gt; _maxSize) <span class="keywordflow">return</span>;
<a name="l00038"></a>00038 address = _newAddress;
<a name="l00039"></a>00039 _newAddress += size;
<a name="l00040"></a>00040 <span class="keywordtype">id</span> = _newId++;
<a name="l00041"></a>00041 <a class="code" href="class_vector.html#ad58756ac50551a81d7c2b0d8ae075f76">push_back</a>(entry);
<a name="l00042"></a>00042 }
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keyword">extern</span> <a class="code" href="class_a_p___e_e_prom_registry.html" title="The main EEProm Registry class.">AP_EEPromRegistry</a> <a class="code" href="_a_p___e_e_prom_8cpp.html#ab9f343c688a095f2819577da1f5c8269">eepromRegistry</a>(1024);
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,224 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_EEProm.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<h1>AP_EEProm.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___vector_8h_source.html">AP_Vector.h</a>&gt;</code><br/>
<code>#include &lt;avr/eeprom.h&gt;</code><br/>
<code>#include &lt;avr/pgmspace.h&gt;</code><br/>
<code>#include &lt;<a class="el" href="_better_stream_8h_source.html">BetterStream.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_EEProm.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___e_e_prom_8h__incl.png" border="0" usemap="#_a_p___e_e_prom_8h" alt=""/></div>
<map name="_a_p___e_e_prom_8h" id="_a_p___e_e_prom_8h">
<area shape="rect" id="node3" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries." alt="" coords="283,83,400,112"/><area shape="rect" id="node11" href="_a_p___vector_8h.html" title="AP_Vector.h" alt="" coords="373,237,472,267"/><area shape="rect" id="node29" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="824,83,947,112"/><area shape="rect" id="node7" href="menu_8h.html" title="Simple commandline menu subsystem. &#160;The Menu class implements a simple CLI that accepts commands type..." alt="" coords="99,160,219,189"/><area shape="rect" id="node9" href="c_09_09_8h.html" title="c++.h" alt="" coords="243,160,304,189"/><area shape="rect" id="node19" href="_a_p___loop_8h.html" title="AP_Loop.h" alt="" coords="379,160,467,189"/><area shape="rect" id="node22" href="_a_p___var_8h.html" title="AP_Var.h" alt="" coords="491,160,568,189"/><area shape="rect" id="node17" href="_w_program_8h.html" title="WProgram.h" alt="" coords="489,315,588,344"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___e_e_prom_8h__dep__incl.png" border="0" usemap="#_a_p___e_e_prom_8hdep" alt=""/></div>
<map name="_a_p___e_e_prom_8hdep" id="_a_p___e_e_prom_8hdep">
<area shape="rect" id="node3" href="_a_p___e_e_prom_8cpp.html" title="AP_EEProm.cpp" alt="" coords="5,83,128,112"/><area shape="rect" id="node5" href="_a_p___rc_channel_8h.html" title="AP_RcChannel manager." alt="" coords="152,83,277,112"/><area shape="rect" id="node7" href="_a_p___rc_channel_8cpp.html" title="AP_RcChannel.cpp" alt="" coords="145,160,284,189"/></map>
</div>
<p><a href="_a_p___e_e_prom_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___e_e_prom_entry_i.html">AP_EEPromEntryI</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The interface for data entries in the eeprom registry. <a href="class_a_p___e_e_prom_entry_i.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___e_e_prom_registry.html">AP_EEPromRegistry</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The main EEProm Registry class. <a href="class_a_p___e_e_prom_registry.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt; type &gt;</a></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt; float &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#a0d0d0cad20c7b73603be5f142fb38080">AP_EEPROM_Float</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt; int8_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#a154b1f7e5b76606083ef0d01cd9fe55b">AP_EEPROM_Int8</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt; uint8_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#a18b11beb7551ba693aa020423edb3923">AP_EEPROM_Uint8</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt; int16_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#ae8098e90c74a8434a2969f42099b2e73">AP_EEPROM_Int16</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt; uint16_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#aa23279a53fa9e42e6beb24da77258e8f">AP_EEPROM_Uint16</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt; int32_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#a3b5a6138f526b51cb099decc2f43d46a">AP_EEPROM_Int32</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt; uint32_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#affc9d2cc12c9bb7ff00de0e5c2526c6e">AP_EEPROM_Unt32</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt; bool &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#a5ae48094725dd607362f165e72aef23e">AP_EEPROM_Bool</a></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_a_p___e_e_prom_registry.html">AP_EEPromRegistry</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___e_e_prom_8h.html#ace5829ad43d9564a20756ac7ab33aebc">eepromRegistry</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Global eepromRegistry declaration. <a href="#ace5829ad43d9564a20756ac7ab33aebc"></a><br/></td></tr>
</table>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="a5ae48094725dd607362f165e72aef23e"></a><!-- doxytag: member="AP_EEProm.h::AP_EEPROM_Bool" ref="a5ae48094725dd607362f165e72aef23e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt;bool&gt; <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Bool</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___e_e_prom_8h_source.html#l00118">118</a> of file <a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0d0d0cad20c7b73603be5f142fb38080"></a><!-- doxytag: member="AP_EEProm.h::AP_EEPROM_Float" ref="a0d0d0cad20c7b73603be5f142fb38080" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt;float&gt; <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Float</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___e_e_prom_8h_source.html#l00111">111</a> of file <a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae8098e90c74a8434a2969f42099b2e73"></a><!-- doxytag: member="AP_EEProm.h::AP_EEPROM_Int16" ref="ae8098e90c74a8434a2969f42099b2e73" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt;int16_t&gt; <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Int16</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___e_e_prom_8h_source.html#l00114">114</a> of file <a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3b5a6138f526b51cb099decc2f43d46a"></a><!-- doxytag: member="AP_EEProm.h::AP_EEPROM_Int32" ref="a3b5a6138f526b51cb099decc2f43d46a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt;int32_t&gt; <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Int32</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___e_e_prom_8h_source.html#l00116">116</a> of file <a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a154b1f7e5b76606083ef0d01cd9fe55b"></a><!-- doxytag: member="AP_EEProm.h::AP_EEPROM_Int8" ref="a154b1f7e5b76606083ef0d01cd9fe55b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt;int8_t&gt; <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Int8</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___e_e_prom_8h_source.html#l00112">112</a> of file <a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa23279a53fa9e42e6beb24da77258e8f"></a><!-- doxytag: member="AP_EEProm.h::AP_EEPROM_Uint16" ref="aa23279a53fa9e42e6beb24da77258e8f" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt;uint16_t&gt; <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Uint16</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___e_e_prom_8h_source.html#l00115">115</a> of file <a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>.</p>
</div>
</div>
<a class="anchor" id="a18b11beb7551ba693aa020423edb3923"></a><!-- doxytag: member="AP_EEProm.h::AP_EEPROM_Uint8" ref="a18b11beb7551ba693aa020423edb3923" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt;uint8_t&gt; <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Uint8</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___e_e_prom_8h_source.html#l00113">113</a> of file <a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>.</p>
</div>
</div>
<a class="anchor" id="affc9d2cc12c9bb7ff00de0e5c2526c6e"></a><!-- doxytag: member="AP_EEProm.h::AP_EEPROM_Unt32" ref="affc9d2cc12c9bb7ff00de0e5c2526c6e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a>&lt;uint32_t&gt; <a class="el" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Unt32</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___e_e_prom_8h_source.html#l00117">117</a> of file <a class="el" href="_a_p___e_e_prom_8h_source.html">AP_EEProm.h</a>.</p>
</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ace5829ad43d9564a20756ac7ab33aebc"></a><!-- doxytag: member="AP_EEProm.h::eepromRegistry" ref="ace5829ad43d9564a20756ac7ab33aebc" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_a_p___e_e_prom_registry.html">AP_EEPromRegistry</a> <a class="el" href="_a_p___e_e_prom_8h.html#ace5829ad43d9564a20756ac7ab33aebc">eepromRegistry</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Global eepromRegistry declaration. </p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,138 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_EEProm.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_EEProm.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___e_e_prom_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef AP_EEProm_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define AP_EEProm_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="comment">/*</span>
<a name="l00005"></a>00005 <span class="comment"> * AP_EEProm.h</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright (C) James Goppert 2010 &lt;james.goppert@gmail.com&gt;</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This file is free software: you can redistribute it and/or modify it</span>
<a name="l00009"></a>00009 <span class="comment"> * under the terms of the GNU General Public License as published by the</span>
<a name="l00010"></a>00010 <span class="comment"> * Free Software Foundation, either version 3 of the License, or</span>
<a name="l00011"></a>00011 <span class="comment"> * (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This file is distributed in the hope that it will be useful, but</span>
<a name="l00014"></a>00014 <span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span>
<a name="l00016"></a>00016 <span class="comment"> * See the GNU General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
<a name="l00019"></a>00019 <span class="comment"> * with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00020"></a>00020 <span class="comment"> */</span>
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries.">AP_Common.h</a>&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___vector_8h.html">AP_Vector.h</a>&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;avr/eeprom.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;avr/pgmspace.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;<a class="code" href="_better_stream_8h.html">BetterStream.h</a>&gt;</span>
<a name="l00027"></a>00027
<a name="l00029"></a><a class="code" href="class_a_p___e_e_prom_entry_i.html">00029</a> <span class="keyword">class </span><a class="code" href="class_a_p___e_e_prom_entry_i.html" title="The interface for data entries in the eeprom registry.">AP_EEPromEntryI</a>
<a name="l00030"></a>00030 {
<a name="l00031"></a>00031 <span class="keyword">public</span>:
<a name="l00035"></a>00035 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_prom_entry_i.html#a2332d2003572df70c939d6a38e5a2b59">setEntry</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> &amp; val) = 0;
<a name="l00036"></a>00036
<a name="l00040"></a>00040 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="class_a_p___e_e_prom_entry_i.html#ab4c26ba698e724285eda2c579869e704">getEntry</a>() = 0;
<a name="l00041"></a>00041
<a name="l00043"></a>00043 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="class_a_p___e_e_prom_entry_i.html#a28cdd9d0b0301c4e5130f4578367add8" title="Pure virtual function for getting entry name.">getEntryName</a>() = 0;
<a name="l00044"></a>00044
<a name="l00046"></a>00046 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="class_a_p___e_e_prom_entry_i.html#a94b21fed51d071e079f89eca9dde6093" title="Pure virtual function for getting entry parent name.">getEntryParentName</a>() = 0;
<a name="l00047"></a>00047
<a name="l00049"></a>00049 <span class="keyword">virtual</span> <span class="keyword">const</span> uint16_t &amp; <a class="code" href="class_a_p___e_e_prom_entry_i.html#a46f615ceaa6c4f2ed6bc30239213d350" title="Get the id of the variable.">getEntryId</a>() = 0;
<a name="l00050"></a>00050
<a name="l00052"></a>00052 <span class="keyword">virtual</span> <span class="keyword">const</span> uint16_t &amp; <a class="code" href="class_a_p___e_e_prom_entry_i.html#a517ccf3764b745512ae4ea5906102159" title="Get the address of the variable.">getEntryAddress</a>() = 0;
<a name="l00053"></a>00053 };
<a name="l00054"></a>00054
<a name="l00056"></a><a class="code" href="class_a_p___e_e_prom_registry.html">00056</a> <span class="keyword">class </span><a class="code" href="class_a_p___e_e_prom_registry.html" title="The main EEProm Registry class.">AP_EEPromRegistry</a> : <span class="keyword">public</span> <a class="code" href="class_vector.html">Vector</a>&lt;AP_EEPromEntryI *&gt;
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 <span class="keyword">public</span>:
<a name="l00059"></a>00059
<a name="l00061"></a><a class="code" href="class_a_p___e_e_prom_registry.html#af14f86b2ebd197b4d8631bf13b1405dd">00061</a> <a class="code" href="class_a_p___e_e_prom_registry.html#af14f86b2ebd197b4d8631bf13b1405dd" title="Default constructor.">AP_EEPromRegistry</a>(uint16_t maxSize) :
<a name="l00062"></a>00062 _newAddress(0), _newId(0), _maxSize(maxSize)
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064 }
<a name="l00065"></a>00065
<a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_prom_registry.html#a3085f6bb3cd5c2ec3d40fecb13632845" title="Add an entry to the registry.">add</a>(<a class="code" href="class_a_p___e_e_prom_entry_i.html" title="The interface for data entries in the eeprom registry.">AP_EEPromEntryI</a> * entry, uint16_t &amp; <span class="keywordtype">id</span>, uint16_t &amp; address, <span class="keywordtype">size_t</span> size);
<a name="l00068"></a>00068
<a name="l00070"></a>00070 <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_prom_registry.html#a022d84aae5c08e2a99f5a87c13bc6702" title="Print on desired serial port.">print</a>(<a class="code" href="class_better_stream.html">BetterStream</a> &amp; stream);
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="keyword">private</span>:
<a name="l00073"></a>00073 uint16_t _newAddress;
<a name="l00074"></a>00074 uint16_t _newId;
<a name="l00075"></a>00075 uint16_t _maxSize;
<a name="l00076"></a>00076 };
<a name="l00077"></a>00077
<a name="l00079"></a>00079 <span class="keyword">extern</span> <a class="code" href="class_a_p___e_e_prom_registry.html" title="The main EEProm Registry class.">AP_EEPromRegistry</a> <a class="code" href="_a_p___e_e_prom_8cpp.html#ab9f343c688a095f2819577da1f5c8269">eepromRegistry</a>;
<a name="l00080"></a>00080
<a name="l00084"></a>00084 <span class="keyword">template</span> &lt;<span class="keyword">class</span> type&gt;
<a name="l00085"></a><a class="code" href="class_a_p___e_e_prom_var.html">00085</a> <span class="keyword">class </span><a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar</a> : <span class="keyword">public</span> <a class="code" href="class_a_p___e_e_prom_entry_i.html" title="The interface for data entries in the eeprom registry.">AP_EEPromEntryI</a>, <span class="keyword">public</span> <a class="code" href="class_a_p___var.html">AP_Var</a>&lt;type&gt;
<a name="l00086"></a>00086 {
<a name="l00087"></a>00087 <span class="keyword">public</span>:
<a name="l00089"></a><a class="code" href="class_a_p___e_e_prom_var.html#a91a9017701b772d8aa42bdca3a7ead9f">00089</a> <a class="code" href="class_a_p___e_e_prom_var.html#a91a9017701b772d8aa42bdca3a7ead9f" title="The default constrcutor.">AP_EEPromVar</a>(type data = 0, <span class="keyword">const</span> <span class="keywordtype">char</span> * name = <span class="stringliteral">&quot;&quot;</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> * parentName = <span class="stringliteral">&quot;&quot;</span>, <span class="keywordtype">bool</span> sync=<span class="keyword">false</span>) :
<a name="l00090"></a>00090 <a class="code" href="class_a_p___var.html">AP_Var</a>&lt;type&gt;(data,name,parentName,sync)
<a name="l00091"></a>00091 {
<a name="l00092"></a>00092 eepromRegistry.<a class="code" href="class_a_p___e_e_prom_registry.html#a3085f6bb3cd5c2ec3d40fecb13632845" title="Add an entry to the registry.">add</a>(<span class="keyword">this</span>,_id,_address,<span class="keyword">sizeof</span>(type));
<a name="l00093"></a>00093 }
<a name="l00094"></a>00094
<a name="l00095"></a><a class="code" href="class_a_p___e_e_prom_var.html#a0aec2967e8ff2eac215e332604bcc55e">00095</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___e_e_prom_var.html#a0aec2967e8ff2eac215e332604bcc55e">setEntry</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> &amp; val) { this-&gt;<a class="code" href="class_a_p___var.html#ae67a45d5b0ab1b2156e67635d39574ed" title="Set the variable value as a float.">setF</a>(val); }
<a name="l00096"></a><a class="code" href="class_a_p___e_e_prom_var.html#ac9cbbb48da0c6aa8fa9afb617c36d246">00096</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="class_a_p___e_e_prom_var.html#ac9cbbb48da0c6aa8fa9afb617c36d246">getEntry</a>() { <span class="keywordflow">return</span> this-&gt;<a class="code" href="class_a_p___var.html#adcc758d2c9fde9cadf7503ce39d9ed8e" title="Get the variable as a float.">getF</a>(); }
<a name="l00097"></a><a class="code" href="class_a_p___e_e_prom_var.html#aaed7e0df09242c4f1d04f00371ce4588">00097</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="class_a_p___e_e_prom_var.html#aaed7e0df09242c4f1d04f00371ce4588">getEntryName</a>() { <span class="keywordflow">return</span> this-&gt;<a class="code" href="class_a_p___var.html#a90ee0ac1b5c782c90573bb6ab80e6e99" title="Get the name. This is useful for ground stations.">getName</a>(); }
<a name="l00098"></a><a class="code" href="class_a_p___e_e_prom_var.html#a74bc14d56744cecea370ad241daeeb12">00098</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="class_a_p___e_e_prom_var.html#a74bc14d56744cecea370ad241daeeb12">getEntryParentName</a>() { <span class="keywordflow">return</span> this-&gt;<a class="code" href="class_a_p___var.html#a1a0a5e721b352ffd92bf59edadfed130" title="Get the parent name. This is also useful for ground stations.">getParentName</a>(); }
<a name="l00099"></a>00099
<a name="l00101"></a><a class="code" href="class_a_p___e_e_prom_var.html#a1fe97ba68a3b80fc40891353e6ed85bf">00101</a> <span class="keyword">virtual</span> <span class="keyword">const</span> uint16_t &amp; <a class="code" href="class_a_p___e_e_prom_var.html#a1fe97ba68a3b80fc40891353e6ed85bf" title="Get the id of the variable.">getEntryId</a>() { <span class="keywordflow">return</span> _id; }
<a name="l00102"></a>00102
<a name="l00104"></a><a class="code" href="class_a_p___e_e_prom_var.html#a9362edcb0c46cdaa04bf06f04ab274b5">00104</a> <span class="keyword">virtual</span> <span class="keyword">const</span> uint16_t &amp; <a class="code" href="class_a_p___e_e_prom_var.html#a9362edcb0c46cdaa04bf06f04ab274b5" title="Get the address of the variable.">getEntryAddress</a>() { <span class="keywordflow">return</span> _address; }
<a name="l00105"></a>00105
<a name="l00106"></a>00106 <span class="keyword">private</span>:
<a name="l00107"></a>00107 uint16_t _id;
<a name="l00108"></a>00108 uint16_t _address;
<a name="l00109"></a>00109 };
<a name="l00110"></a>00110
<a name="l00111"></a><a class="code" href="_a_p___e_e_prom_8h.html#a0d0d0cad20c7b73603be5f142fb38080">00111</a> <span class="keyword">typedef</span> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt;float&gt;</a> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Float</a>;
<a name="l00112"></a><a class="code" href="_a_p___e_e_prom_8h.html#a154b1f7e5b76606083ef0d01cd9fe55b">00112</a> <span class="keyword">typedef</span> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt;int8_t&gt;</a> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Int8</a>;
<a name="l00113"></a><a class="code" href="_a_p___e_e_prom_8h.html#a18b11beb7551ba693aa020423edb3923">00113</a> <span class="keyword">typedef</span> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt;uint8_t&gt;</a> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Uint8</a>;
<a name="l00114"></a><a class="code" href="_a_p___e_e_prom_8h.html#ae8098e90c74a8434a2969f42099b2e73">00114</a> <span class="keyword">typedef</span> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt;int16_t&gt;</a> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Int16</a>;
<a name="l00115"></a><a class="code" href="_a_p___e_e_prom_8h.html#aa23279a53fa9e42e6beb24da77258e8f">00115</a> <span class="keyword">typedef</span> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt;uint16_t&gt;</a> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Uint16</a>;
<a name="l00116"></a><a class="code" href="_a_p___e_e_prom_8h.html#a3b5a6138f526b51cb099decc2f43d46a">00116</a> <span class="keyword">typedef</span> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt;int32_t&gt;</a> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Int32</a>;
<a name="l00117"></a><a class="code" href="_a_p___e_e_prom_8h.html#affc9d2cc12c9bb7ff00de0e5c2526c6e">00117</a> <span class="keyword">typedef</span> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt;uint32_t&gt;</a> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Unt32</a>;
<a name="l00118"></a><a class="code" href="_a_p___e_e_prom_8h.html#a5ae48094725dd607362f165e72aef23e">00118</a> <span class="keyword">typedef</span> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPromVar&lt;bool&gt;</a> <a class="code" href="class_a_p___e_e_prom_var.html">AP_EEPROM_Bool</a>;
<a name="l00119"></a>00119
<a name="l00120"></a>00120
<a name="l00121"></a>00121 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,74 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS.h File Reference</h1> </div>
</div>
<div class="contents">
<p>Catch-all header that defines all supported <a class="el" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> classes.
<a href="#_details">More...</a></p>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___s_i_r_f_8h_source.html">AP_GPS_SIRF.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s__406_8h_source.html">AP_GPS_406.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___u_b_l_o_x_8h_source.html">AP_GPS_UBLOX.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___m_t_k_8h_source.html">AP_GPS_MTK.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___m_t_k16_8h_source.html">AP_GPS_MTK16.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___none_8h_source.html">AP_GPS_None.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___auto_8h_source.html">AP_GPS_Auto.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___h_i_l_8h_source.html">AP_GPS_HIL.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___shim_8h_source.html">AP_GPS_Shim.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s_8h__incl.png" border="0" usemap="#_a_p___g_p_s_8h" alt=""/></div>
<map name="_a_p___g_p_s_8h" id="_a_p___g_p_s_8h">
<area shape="rect" id="node3" href="_a_p___g_p_s___n_m_e_a_8h.html" title="AP_GPS_NMEA.h" alt="" coords="436,160,567,189"/><area shape="rect" id="node11" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="900,160,1017,189"/><area shape="rect" id="node14" href="_a_p___g_p_s__406_8h.html" title="AP_GPS_406.h" alt="" coords="977,83,1092,112"/><area shape="rect" id="node17" href="_a_p___g_p_s___u_b_l_o_x_8h.html" title="AP_GPS_UBLOX.h" alt="" coords="1041,160,1175,189"/><area shape="rect" id="node20" href="_a_p___g_p_s___m_t_k_8h.html" title="AP_GPS_MTK.h" alt="" coords="628,83,745,112"/><area shape="rect" id="node25" href="_a_p___g_p_s___m_t_k16_8h.html" title="AP_GPS_MTK16.h" alt="" coords="769,83,903,112"/><area shape="rect" id="node29" href="_a_p___g_p_s___none_8h.html" title="AP_GPS_None.h" alt="" coords="1199,160,1324,189"/><area shape="rect" id="node32" href="_a_p___g_p_s___auto_8h.html" title="AP_GPS_Auto.h" alt="" coords="145,83,268,112"/><area shape="rect" id="node49" href="_a_p___g_p_s___h_i_l_8h.html" title="AP_GPS_HIL.h" alt="" coords="292,83,404,112"/><area shape="rect" id="node52" href="_a_p___g_p_s___shim_8h.html" title="AP_GPS_Shim.h" alt="" coords="428,83,553,112"/><area shape="rect" id="node5" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="523,237,584,267"/><area shape="rect" id="node23" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="641,160,825,189"/><area shape="rect" id="node35" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="160,160,256,189"/><area shape="rect" id="node44" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="235,237,357,267"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s_8hdep" alt=""/></div>
<map name="_a_p___g_p_s_8hdep" id="_a_p___g_p_s_8hdep">
<area shape="rect" id="node3" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,83,208,112"/><area shape="rect" id="node5" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,160,100,189"/><area shape="rect" id="node12" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,83,368,112"/><area shape="rect" id="node9" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,160,255,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,237,107,267"/></map>
</div>
<p><a href="_a_p___g_p_s_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Catch-all header that defines all supported <a class="el" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> classes. </p>
<p>Definition in file <a class="el" href="_a_p___g_p_s_8h_source.html">AP_GPS.h</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html">AP_GPS_NMEA.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___s_i_r_f_8h.html">AP_GPS_SIRF.h</a>&quot;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s__406_8h.html">AP_GPS_406.h</a>&quot;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___u_b_l_o_x_8h.html">AP_GPS_UBLOX.h</a>&quot;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___m_t_k_8h.html">AP_GPS_MTK.h</a>&quot;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___m_t_k16_8h.html">AP_GPS_MTK16.h</a>&quot;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___none_8h.html">AP_GPS_None.h</a>&quot;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___auto_8h.html">AP_GPS_Auto.h</a>&quot;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___h_i_l_8h.html">AP_GPS_HIL.h</a>&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___shim_8h.html">AP_GPS_Shim.h</a>&quot;</span> <span class="comment">// obsoletes AP_GPS_HIL, use in preference</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,53 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_406.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_406.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_fast_serial_8h_source.html">../FastSerial/FastSerial.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s__406_8h_source.html">AP_GPS_406.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_w_program_8h_source.html">WProgram.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_406.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s__406_8cpp__incl.png" border="0" usemap="#_a_p___g_p_s__406_8cpp" alt=""/></div>
<map name="_a_p___g_p_s__406_8cpp" id="_a_p___g_p_s__406_8cpp">
<area shape="rect" id="node3" href="_fast_serial_8h.html" title="../FastSerial/FastSerial.h" alt="" coords="157,160,331,189"/><area shape="rect" id="node19" href="_a_p___g_p_s__406_8h.html" title="AP_GPS_406.h" alt="" coords="337,83,452,112"/><area shape="rect" id="node27" href="_w_program_8h.html" title="WProgram.h" alt="" coords="476,83,575,112"/><area shape="rect" id="node13" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="464,237,587,267"/><area shape="rect" id="node21" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="355,160,472,189"/><area shape="rect" id="node23" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="379,237,440,267"/></map>
</div>
<p><a href="_a_p___g_p_s__406_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,120 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_406.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_406.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s__406_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// GPS_406.cpp - 406 GPS library for Arduino</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jason Short, Jordi Muñoz and Jose Julio. DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">// This code works with boards based on ATMega168/328 ATMega1280 (Serial port 1)</span>
<a name="l00006"></a>00006 <span class="comment">//</span>
<a name="l00007"></a>00007 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00008"></a>00008 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00009"></a>00009 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00010"></a>00010 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00011"></a>00011
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;../FastSerial/FastSerial.h&quot;</span> <span class="comment">// because we need to change baud rates... ugh.</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s__406_8h.html">AP_GPS_406.h</a>&quot;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;<a class="code" href="_w_program_8h.html">WProgram.h</a>&quot;</span>
<a name="l00015"></a>00015
<a name="l00016"></a>00016 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> init_str[] = <span class="stringliteral">&quot;$PSRF100,0,57600,8,1,0*37&quot;</span>;
<a name="l00017"></a>00017
<a name="l00018"></a>00018 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00019"></a><a class="code" href="class_a_p___g_p_s__406.html#a358334e34bc532842ce9c28f5eb8d761">00019</a> <a class="code" href="class_a_p___g_p_s__406.html#a358334e34bc532842ce9c28f5eb8d761">AP_GPS_406::AP_GPS_406</a>(<a class="code" href="class_stream.html">Stream</a> *s) : <a class="code" href="class_a_p___g_p_s___s_i_r_f.html">AP_GPS_SIRF</a>(s)
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021 }
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="comment">// Public Methods ////////////////////////////////////////////////////////////////////</span>
<a name="l00024"></a><a class="code" href="class_a_p___g_p_s__406.html#a2a1df4b306a9579c666d1ada55541943">00024</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s__406.html#a2a1df4b306a9579c666d1ada55541943">AP_GPS_406::init</a>(<span class="keywordtype">void</span>)
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026 _change_to_sirf_protocol(); <span class="comment">// Changes to SIRF protocol and sets baud rate</span>
<a name="l00027"></a>00027 _configure_gps(); <span class="comment">// Function to configure GPS, to output only the desired msg&#39;s</span>
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <a class="code" href="class_a_p___g_p_s__406.html#a2a1df4b306a9579c666d1ada55541943">AP_GPS_SIRF::init</a>(); <span class="comment">// let the superclass do anything it might need here</span>
<a name="l00030"></a>00030 }
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="comment">// Private Methods //////////////////////////////////////////////////////////////</span>
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="keywordtype">void</span>
<a name="l00035"></a>00035 AP_GPS_406::_configure_gps(<span class="keywordtype">void</span>)
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 <span class="keyword">const</span> uint8_t gps_header[] = {0xA0, 0xA2, 0x00, 0x08, 0xA6, 0x00};
<a name="l00038"></a>00038 <span class="keyword">const</span> uint8_t gps_payload[] = {0x02, 0x04, 0x07, 0x09, 0x1B};
<a name="l00039"></a>00039 <span class="keyword">const</span> uint8_t gps_checksum[] = {0xA8, 0xAA, 0xAD, 0xAF, 0xC1};
<a name="l00040"></a>00040 <span class="keyword">const</span> uint8_t gps_ender[] = {0xB0, 0xB3};
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> z = 0; z &lt; 2; z++){
<a name="l00043"></a>00043 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> x = 0; x &lt; 5; x++){
<a name="l00044"></a>00044 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a46cd2d80c276134f30300d619416d5c8">write</a>(gps_header, <span class="keyword">sizeof</span>(gps_header)); <span class="comment">// Prints the msg header, is the same header for all msg..</span>
<a name="l00045"></a>00045 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a46cd2d80c276134f30300d619416d5c8">write</a>(gps_payload[x]); <span class="comment">// Prints the payload, is not the same for every msg</span>
<a name="l00046"></a>00046 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> y = 0; y &lt; 6; y++) <span class="comment">// Prints 6 zeros</span>
<a name="l00047"></a>00047 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a46cd2d80c276134f30300d619416d5c8">write</a>((uint8_t)0);
<a name="l00048"></a>00048 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a46cd2d80c276134f30300d619416d5c8">write</a>(gps_checksum[x]); <span class="comment">// Print the Checksum</span>
<a name="l00049"></a>00049 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a46cd2d80c276134f30300d619416d5c8">write</a>(gps_ender[0]); <span class="comment">// Print the Ender of the string, is same on all msg&#39;s. </span>
<a name="l00050"></a>00050 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a46cd2d80c276134f30300d619416d5c8">write</a>(gps_ender[1]); <span class="comment">// ender </span>
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="comment">// The EM406 defalts to NMEA at 4800bps. We want to switch it to SiRF binary</span>
<a name="l00056"></a>00056 <span class="comment">// mode at a higher rate.</span>
<a name="l00057"></a>00057 <span class="comment">//</span>
<a name="l00058"></a>00058 <span class="comment">// The change is sticky, but only for as long as the internal supercap holds</span>
<a name="l00059"></a>00059 <span class="comment">// settings (usually less than a week).</span>
<a name="l00060"></a>00060 <span class="comment">//</span>
<a name="l00061"></a>00061 <span class="keywordtype">void</span>
<a name="l00062"></a>00062 AP_GPS_406::_change_to_sirf_protocol(<span class="keywordtype">void</span>)
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064 <a class="code" href="class_fast_serial.html">FastSerial</a> *fs = (<a class="code" href="class_fast_serial.html">FastSerial</a> *)<a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>; <span class="comment">// this is a bit grody...</span>
<a name="l00065"></a>00065
<a name="l00066"></a>00066 fs-&gt;<a class="code" href="class_fast_serial.html#a1ae3f5f5649d7a72daf2806a6ec1cf45">begin</a>(4800);
<a name="l00067"></a>00067 delay(300);
<a name="l00068"></a>00068 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(init_str);
<a name="l00069"></a>00069 delay(300);
<a name="l00070"></a>00070
<a name="l00071"></a>00071 fs-&gt;<a class="code" href="class_fast_serial.html#a1ae3f5f5649d7a72daf2806a6ec1cf45">begin</a>(9600);
<a name="l00072"></a>00072 delay(300);
<a name="l00073"></a>00073 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(init_str);
<a name="l00074"></a>00074 delay(300);
<a name="l00075"></a>00075
<a name="l00076"></a>00076 fs-&gt;<a class="code" href="class_fast_serial.html#a1ae3f5f5649d7a72daf2806a6ec1cf45">begin</a>(<a class="code" href="_a_p___g_p_s__406_8h.html#a14696c7fcf7f91645d9bac757ce6677b">GPS_406_BITRATE</a>);
<a name="l00077"></a>00077 delay(300);
<a name="l00078"></a>00078 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(init_str);
<a name="l00079"></a>00079 delay(300);
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,83 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_406.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_GPS_406.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___g_p_s___s_i_r_f_8h_source.html">AP_GPS_SIRF.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_406.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s__406_8h__incl.png" border="0" usemap="#_a_p___g_p_s__406_8h" alt=""/></div>
<map name="_a_p___g_p_s__406_8h" id="_a_p___g_p_s__406_8h">
<area shape="rect" id="node3" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="43,83,160,112"/><area shape="rect" id="node5" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,160,132,189"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s__406_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s__406_8hdep" alt=""/></div>
<map name="_a_p___g_p_s__406_8hdep" id="_a_p___g_p_s__406_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node16" href="_a_p___g_p_s__406_8cpp.html" title="AP_GPS_406.cpp" alt="" coords="217,83,348,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s__406_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s__406.html">AP_GPS_406</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s__406_8h.html#a14696c7fcf7f91645d9bac757ce6677b">GPS_406_BITRATE</a>&nbsp;&nbsp;&nbsp;57600</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a14696c7fcf7f91645d9bac757ce6677b"></a><!-- doxytag: member="AP_GPS_406.h::GPS_406_BITRATE" ref="a14696c7fcf7f91645d9bac757ce6677b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GPS_406_BITRATE&nbsp;&nbsp;&nbsp;57600</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s__406_8h_source.html#l00017">17</a> of file <a class="el" href="_a_p___g_p_s__406_8h_source.html">AP_GPS_406.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,71 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_406.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_406.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s__406_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// EM406 GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jason Short, Jordi Muñoz and Jose Julio. DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef AP_GPS_406_h</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_406_h</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___s_i_r_f_8h.html">AP_GPS_SIRF.h</a>&quot;</span>
<a name="l00016"></a>00016
<a name="l00017"></a><a class="code" href="_a_p___g_p_s__406_8h.html#a14696c7fcf7f91645d9bac757ce6677b">00017</a> <span class="preprocessor">#define GPS_406_BITRATE 57600</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a><a class="code" href="class_a_p___g_p_s__406.html">00019</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s__406.html">AP_GPS_406</a> : <span class="keyword">public</span> <a class="code" href="class_a_p___g_p_s___s_i_r_f.html">AP_GPS_SIRF</a>
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021 <span class="keyword">public</span>:
<a name="l00022"></a>00022 <span class="comment">// Methods</span>
<a name="l00023"></a>00023 <a class="code" href="class_a_p___g_p_s__406.html#a358334e34bc532842ce9c28f5eb8d761">AP_GPS_406</a>(<a class="code" href="class_stream.html">Stream</a> *<a class="code" href="test_8cpp.html#aa9d3949e4023e37adada0665a885faef">port</a>);
<a name="l00024"></a>00024 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s__406.html#a2a1df4b306a9579c666d1ada55541943">init</a>(<span class="keywordtype">void</span>);
<a name="l00025"></a>00025
<a name="l00026"></a>00026 <span class="keyword">private</span>:
<a name="l00027"></a>00027 <span class="keywordtype">void</span> _change_to_sirf_protocol(<span class="keywordtype">void</span>);
<a name="l00028"></a>00028 <span class="keywordtype">void</span> _configure_gps(<span class="keywordtype">void</span>);
<a name="l00029"></a>00029 };
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="preprocessor">#endif</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_Auto.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_Auto.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___g_p_s_8h_source.html">AP_GPS.h</a>&quot;</code><br/>
<code>#include &lt;wiring.h&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_Auto.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___auto_8cpp__incl.png" border="0" usemap="#_a_p___g_p_s___auto_8cpp" alt=""/></div>
<map name="_a_p___g_p_s___auto_8cpp" id="_a_p___g_p_s___auto_8cpp">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="719,83,804,112"/><area shape="rect" id="node5" href="_a_p___g_p_s___n_m_e_a_8h.html" title="AP_GPS_NMEA.h" alt="" coords="436,237,567,267"/><area shape="rect" id="node13" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="900,237,1017,267"/><area shape="rect" id="node16" href="_a_p___g_p_s__406_8h.html" title="AP_GPS_406.h" alt="" coords="977,160,1092,189"/><area shape="rect" id="node19" href="_a_p___g_p_s___u_b_l_o_x_8h.html" title="AP_GPS_UBLOX.h" alt="" coords="1041,237,1175,267"/><area shape="rect" id="node22" href="_a_p___g_p_s___m_t_k_8h.html" title="AP_GPS_MTK.h" alt="" coords="628,160,745,189"/><area shape="rect" id="node27" href="_a_p___g_p_s___m_t_k16_8h.html" title="AP_GPS_MTK16.h" alt="" coords="769,160,903,189"/><area shape="rect" id="node31" href="_a_p___g_p_s___none_8h.html" title="AP_GPS_None.h" alt="" coords="1199,237,1324,267"/><area shape="rect" id="node34" href="_a_p___g_p_s___auto_8h.html" title="AP_GPS_Auto.h" alt="" coords="145,160,268,189"/><area shape="rect" id="node51" href="_a_p___g_p_s___h_i_l_8h.html" title="AP_GPS_HIL.h" alt="" coords="292,160,404,189"/><area shape="rect" id="node54" href="_a_p___g_p_s___shim_8h.html" title="AP_GPS_Shim.h" alt="" coords="428,160,553,189"/><area shape="rect" id="node7" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="523,315,584,344"/><area shape="rect" id="node25" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="641,237,825,267"/><area shape="rect" id="node37" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="160,237,256,267"/><area shape="rect" id="node46" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="235,315,357,344"/></map>
</div>
<p><a href="_a_p___g_p_s___auto_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,221 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_Auto.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_Auto.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___auto_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// Auto-detecting pseudo-GPS driver</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s_8h.html" title="Catch-all header that defines all supported GPS classes.">AP_GPS.h</a>&quot;</span> <span class="comment">// includes AP_GPS_Auto.h</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;wiring.h&gt;</span>
<a name="l00008"></a>00008
<a name="l00009"></a>00009 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> baudrates[] = {38400U, 57600U, 9600U, 4800U};
<a name="l00010"></a>00010
<a name="l00011"></a><a class="code" href="class_a_p___g_p_s___auto.html#a1edc0269719478f4e978ec0f6375f413">00011</a> <a class="code" href="class_a_p___g_p_s___auto.html#a1edc0269719478f4e978ec0f6375f413">AP_GPS_Auto::AP_GPS_Auto</a>(<a class="code" href="class_fast_serial.html">FastSerial</a> *<a class="code" href="test_8cpp.html#aa9d3949e4023e37adada0665a885faef">port</a>, <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> **gps) :
<a name="l00012"></a>00012 <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(port),
<a name="l00013"></a>00013 _FSport(port), <span class="comment">// do we need this, or can we cast _port up?</span>
<a name="l00014"></a>00014 _gps(gps)
<a name="l00015"></a>00015 {
<a name="l00016"></a>00016 }
<a name="l00017"></a>00017
<a name="l00018"></a>00018
<a name="l00019"></a>00019 <span class="comment">// Do nothing at init time - it may be too early to try detecting the GPS</span>
<a name="l00020"></a>00020 <span class="keywordtype">void</span>
<a name="l00021"></a><a class="code" href="class_a_p___g_p_s___auto.html#a3f06de0c1b55f44c33f9269ec60ac710">00021</a> <a class="code" href="class_a_p___g_p_s___auto.html#a3f06de0c1b55f44c33f9269ec60ac710" title="Dummy init routine, does nothing.">AP_GPS_Auto::init</a>(<span class="keywordtype">void</span>)
<a name="l00022"></a>00022 {
<a name="l00023"></a>00023 }
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="comment">//</span>
<a name="l00026"></a>00026 <span class="comment">// Called the first time that a client tries to kick the GPS to update.</span>
<a name="l00027"></a>00027 <span class="comment">//</span>
<a name="l00028"></a>00028 <span class="comment">// We detect the real GPS, then update the pointer we have been called through</span>
<a name="l00029"></a>00029 <span class="comment">// and return.</span>
<a name="l00030"></a>00030 <span class="keywordtype">bool</span>
<a name="l00031"></a><a class="code" href="class_a_p___g_p_s___auto.html#ab5b8f8c2fa48c301ffaa1edd150fd0f8">00031</a> <a class="code" href="class_a_p___g_p_s___auto.html#ab5b8f8c2fa48c301ffaa1edd150fd0f8">AP_GPS_Auto::read</a>(<span class="keywordtype">void</span>)
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> *gps;
<a name="l00034"></a>00034 <span class="keywordtype">int</span> i;
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="comment">// loop trying to find a GPS</span>
<a name="l00037"></a>00037 <span class="keywordflow">for</span> (;;) {
<a name="l00038"></a>00038 <span class="comment">// loop through possible baudrates</span>
<a name="l00039"></a>00039 <span class="keywordflow">for</span> (i = 0; i &lt; (<span class="keyword">sizeof</span>(baudrates) / <span class="keyword">sizeof</span>(baudrates[0])); i++) {
<a name="l00040"></a>00040 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;GPS autodetect at %d:%u\n&quot;</span>, i, baudrates[i]);
<a name="l00041"></a>00041 _FSport-&gt;<a class="code" href="class_fast_serial.html#a1ae3f5f5649d7a72daf2806a6ec1cf45">begin</a>(baudrates[i]);
<a name="l00042"></a>00042 <span class="keywordflow">if</span> (NULL != (gps = _detect())) {
<a name="l00043"></a>00043 <span class="comment">// make the detected GPS the default</span>
<a name="l00044"></a>00044 *_gps = gps;
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="comment">// configure the detected GPS and run one update</span>
<a name="l00047"></a>00047 gps-&gt;<a class="code" href="class_g_p_s.html#ab75d2968105736833a2e852a797c52a6" title="deprecated">print_errors</a> = <span class="keyword">true</span>; <span class="comment">// XXX</span>
<a name="l00048"></a>00048 gps-&gt;<a class="code" href="class_g_p_s.html#a2aecc2de1271d131b132ad2e259101ad">init</a>();
<a name="l00049"></a>00049 gps-&gt;<a class="code" href="class_g_p_s.html#a05a534e0c72a450d6c9ae6207513e59a">update</a>();
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="comment">// Drop back to our caller - subsequent calls through</span>
<a name="l00052"></a>00052 <span class="comment">// _gps will not come here.</span>
<a name="l00053"></a>00053 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00054"></a>00054 }
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056 }
<a name="l00057"></a>00057 }
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="comment">//</span>
<a name="l00060"></a>00060 <span class="comment">// Perform one iteration of the auto-detection process.</span>
<a name="l00061"></a>00061 <span class="comment">//</span>
<a name="l00062"></a>00062 <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> *
<a name="l00063"></a>00063 AP_GPS_Auto::_detect(<span class="keywordtype">void</span>)
<a name="l00064"></a>00064 {
<a name="l00065"></a>00065 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> then;
<a name="l00066"></a>00066 <span class="keywordtype">int</span> fingerprint[4];
<a name="l00067"></a>00067 <span class="keywordtype">int</span> tries;
<a name="l00068"></a>00068 <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> *gps;
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="comment">//</span>
<a name="l00071"></a>00071 <span class="comment">// Loop attempting to detect a recognised GPS</span>
<a name="l00072"></a>00072 <span class="comment">//</span>
<a name="l00073"></a>00073 gps = NULL;
<a name="l00074"></a>00074 <span class="keywordflow">for</span> (tries = 0; tries &lt; 2; tries++) {
<a name="l00075"></a>00075
<a name="l00076"></a>00076 <span class="comment">//</span>
<a name="l00077"></a>00077 <span class="comment">// Empty the serial buffer and wait for 50ms of quiet.</span>
<a name="l00078"></a>00078 <span class="comment">//</span>
<a name="l00079"></a>00079 <span class="comment">// XXX We can detect babble by counting incoming characters, but</span>
<a name="l00080"></a>00080 <span class="comment">// what would we do about it?</span>
<a name="l00081"></a>00081 <span class="comment">//</span>
<a name="l00082"></a>00082 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot;draining and waiting&quot;</span>);
<a name="l00083"></a>00083 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;flush();
<a name="l00084"></a>00084 then = <a class="code" href="test_8cpp.html#a941a22cb7e0f6429fe40f91e83ead3d9">millis</a>();
<a name="l00085"></a>00085 <span class="keywordflow">do</span> {
<a name="l00086"></a>00086 <span class="keywordflow">if</span> (<a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#adb912146b71c46ce62d22412b819adcb">available</a>()) {
<a name="l00087"></a>00087 then = <a class="code" href="test_8cpp.html#a941a22cb7e0f6429fe40f91e83ead3d9">millis</a>();
<a name="l00088"></a>00088 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a4de9545ea7065d408c3efdb97f55dc2b">read</a>();
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090 } <span class="keywordflow">while</span> ((<a class="code" href="test_8cpp.html#a941a22cb7e0f6429fe40f91e83ead3d9">millis</a>() - then) &lt; 50);
<a name="l00091"></a>00091
<a name="l00092"></a>00092 <span class="comment">//</span>
<a name="l00093"></a>00093 <span class="comment">// Collect four characters to fingerprint a device</span>
<a name="l00094"></a>00094 <span class="comment">//</span>
<a name="l00095"></a>00095 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot;collecting fingerprint&quot;</span>);
<a name="l00096"></a>00096 fingerprint[0] = _getc();
<a name="l00097"></a>00097 fingerprint[1] = _getc();
<a name="l00098"></a>00098 fingerprint[2] = _getc();
<a name="l00099"></a>00099 fingerprint[3] = _getc();
<a name="l00100"></a>00100 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;fingerprints 0x%02x 0x%02x 0x%02x 0x%02x\n&quot;</span>,
<a name="l00101"></a>00101 fingerprint[0],
<a name="l00102"></a>00102 fingerprint[1],
<a name="l00103"></a>00103 fingerprint[2],
<a name="l00104"></a>00104 fingerprint[3]);
<a name="l00105"></a>00105
<a name="l00106"></a>00106 <span class="comment">//</span>
<a name="l00107"></a>00107 <span class="comment">// u-blox or MTK in DIYD binary mode (whose smart idea was</span>
<a name="l00108"></a>00108 <span class="comment">// it to make the MTK look sort-of like it was talking UBX?)</span>
<a name="l00109"></a>00109 <span class="comment">//</span>
<a name="l00110"></a>00110 <span class="keywordflow">if</span> ((0xb5 == fingerprint[0]) &amp;&amp;
<a name="l00111"></a>00111 (0x62 == fingerprint[1]) &amp;&amp;
<a name="l00112"></a>00112 (0x01 == fingerprint[2])) {
<a name="l00113"></a>00113
<a name="l00114"></a>00114 <span class="comment">// message 5 is MTK pretending to talk UBX</span>
<a name="l00115"></a>00115 <span class="keywordflow">if</span> (0x05 == fingerprint[3]) {
<a name="l00116"></a>00116 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;detected MTK in binary mode\n&quot;</span>);
<a name="l00117"></a>00117 gps = <span class="keyword">new</span> <a class="code" href="class_a_p___g_p_s___m_t_k.html">AP_GPS_MTK</a>(<a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>);
<a name="l00118"></a>00118 <span class="keywordflow">break</span>;
<a name="l00119"></a>00119 }
<a name="l00120"></a>00120
<a name="l00121"></a>00121 <span class="comment">// any other message is u-blox</span>
<a name="l00122"></a>00122 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;detected u-blox in binary mode\n&quot;</span>);
<a name="l00123"></a>00123 gps = <span class="keyword">new</span> <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html">AP_GPS_UBLOX</a>(<a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>);
<a name="l00124"></a>00124 <span class="keywordflow">break</span>;
<a name="l00125"></a>00125 }
<a name="l00126"></a>00126
<a name="l00127"></a>00127 <span class="comment">//</span>
<a name="l00128"></a>00128 <span class="comment">// MTK v1.6</span>
<a name="l00129"></a>00129 <span class="comment">//</span>
<a name="l00130"></a>00130 <span class="keywordflow">if</span> ((0xd0 == fingerprint[0]) &amp;&amp;
<a name="l00131"></a>00131 (0xdd == fingerprint[1]) &amp;&amp;
<a name="l00132"></a>00132 (0x20 == fingerprint[2])) {
<a name="l00133"></a>00133 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;detected MTK v1.6\n&quot;</span>);
<a name="l00134"></a>00134 gps = <span class="keyword">new</span> <a class="code" href="class_a_p___g_p_s___m_t_k16.html">AP_GPS_MTK16</a>(<a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>);
<a name="l00135"></a>00135 <span class="keywordflow">break</span>;
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <span class="comment">//</span>
<a name="l00139"></a>00139 <span class="comment">// SIRF in binary mode</span>
<a name="l00140"></a>00140 <span class="comment">//</span>
<a name="l00141"></a>00141 <span class="keywordflow">if</span> ((0xa0 == fingerprint[0]) &amp;&amp;
<a name="l00142"></a>00142 (0xa2 == fingerprint[1])) {
<a name="l00143"></a>00143 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;detected SIRF in binary mode\n&quot;</span>);
<a name="l00144"></a>00144 gps = <span class="keyword">new</span> <a class="code" href="class_a_p___g_p_s___s_i_r_f.html">AP_GPS_SIRF</a>(<a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>);
<a name="l00145"></a>00145 <span class="keywordflow">break</span>;
<a name="l00146"></a>00146 }
<a name="l00147"></a>00147
<a name="l00148"></a>00148 <span class="comment">//</span>
<a name="l00149"></a>00149 <span class="comment">// If we haven&#39;t spammed the various init strings, send them now</span>
<a name="l00150"></a>00150 <span class="comment">// and retry to avoid a false-positive on the NMEA detector.</span>
<a name="l00151"></a>00151 <span class="comment">//</span>
<a name="l00152"></a>00152 <span class="keywordflow">if</span> (0 == tries) {
<a name="l00153"></a>00153 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;sending setup strings and trying again\n&quot;</span>);
<a name="l00154"></a>00154 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;println(<a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a33cc37eaf57637b4b2476d9efcf6611a">MTK_SET_BINARY</a>);
<a name="l00155"></a>00155 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;println(<a class="code" href="_a_p___g_p_s___u_b_l_o_x_8h.html#ab01245792ac1376be9de89e35cdc6690">UBLOX_SET_BINARY</a>);
<a name="l00156"></a>00156 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;println(<a class="code" href="_a_p___g_p_s___s_i_r_f_8h.html#a688aa025e0239993674de15fccc32285">SIRF_SET_BINARY</a>);
<a name="l00157"></a>00157 <span class="keywordflow">continue</span>;
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159
<a name="l00160"></a>00160 <span class="comment">//</span>
<a name="l00161"></a>00161 <span class="comment">// Something talking NMEA</span>
<a name="l00162"></a>00162 <span class="comment">//</span>
<a name="l00163"></a>00163 <span class="keywordflow">if</span> ((<span class="charliteral">&#39;$&#39;</span> == fingerprint[0]) &amp;&amp;
<a name="l00164"></a>00164 ((<span class="charliteral">&#39;G&#39;</span> == fingerprint[1]) || (<span class="charliteral">&#39;P&#39;</span> == fingerprint[1]))) {
<a name="l00165"></a>00165
<a name="l00166"></a>00166 <span class="comment">// XXX this may be a bit presumptive, might want to give the GPS a couple of</span>
<a name="l00167"></a>00167 <span class="comment">// iterations around the loop to react to init strings?</span>
<a name="l00168"></a>00168 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.<a class="code" href="class_better_stream.html#aa735777635173dca53f4d9a4f6a1e0b8">printf</a>(<span class="stringliteral">&quot;detected NMEA\n&quot;</span>);
<a name="l00169"></a>00169 gps = <span class="keyword">new</span> <a class="code" href="class_a_p___g_p_s___n_m_e_a.html">AP_GPS_NMEA</a>(<a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>);
<a name="l00170"></a>00170 <span class="keywordflow">break</span>;
<a name="l00171"></a>00171 }
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173 <span class="keywordflow">return</span>(gps);
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175
<a name="l00176"></a>00176 <span class="keywordtype">int</span>
<a name="l00177"></a>00177 AP_GPS_Auto::_getc(<span class="keywordtype">void</span>)
<a name="l00178"></a>00178 {
<a name="l00179"></a>00179 <span class="keywordflow">while</span> (0 == <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#adb912146b71c46ce62d22412b819adcb">available</a>())
<a name="l00180"></a>00180 ;
<a name="l00181"></a>00181 <span class="keywordflow">return</span>(<a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a4de9545ea7065d408c3efdb97f55dc2b">read</a>());
<a name="l00182"></a>00182 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,64 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_Auto.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_GPS_Auto.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_fast_serial_8h_source.html">FastSerial.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_Auto.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___auto_8h__incl.png" border="0" usemap="#_a_p___g_p_s___auto_8h" alt=""/></div>
<map name="_a_p___g_p_s___auto_8h" id="_a_p___g_p_s___auto_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="35,83,96,112"/><area shape="rect" id="node9" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="164,83,260,112"/><area shape="rect" id="node18" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="452,160,575,189"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___auto_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___auto_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___auto_8hdep" id="_a_p___g_p_s___auto_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s___auto_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___auto.html">AP_GPS_Auto</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,69 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_Auto.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_Auto.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___auto_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// Auto-detecting pseudo-GPS driver</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#ifndef AP_GPS_Auto_h</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_Auto_h</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;<a class="code" href="_fast_serial_8h.html">FastSerial.h</a>&gt;</span>
<a name="l00011"></a>00011
<a name="l00012"></a><a class="code" href="class_a_p___g_p_s___auto.html">00012</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___auto.html">AP_GPS_Auto</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>
<a name="l00013"></a>00013 {
<a name="l00014"></a>00014 <span class="keyword">public</span>:
<a name="l00024"></a>00024 <a class="code" href="class_a_p___g_p_s___auto.html#a1edc0269719478f4e978ec0f6375f413">AP_GPS_Auto</a>(<a class="code" href="class_fast_serial.html">FastSerial</a> *<a class="code" href="test_8cpp.html#aa9d3949e4023e37adada0665a885faef">port</a>, <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> **gps);
<a name="l00025"></a>00025
<a name="l00027"></a>00027 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___auto.html#a3f06de0c1b55f44c33f9269ec60ac710" title="Dummy init routine, does nothing.">init</a>(<span class="keywordtype">void</span>);
<a name="l00028"></a>00028
<a name="l00032"></a>00032 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___auto.html#ab5b8f8c2fa48c301ffaa1edd150fd0f8">read</a>(<span class="keywordtype">void</span>);
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="keyword">private</span>:
<a name="l00036"></a>00036 <a class="code" href="class_fast_serial.html">FastSerial</a> *_FSport;
<a name="l00037"></a>00037
<a name="l00040"></a>00040 <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> **_gps;
<a name="l00041"></a>00041
<a name="l00044"></a>00044 <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> *_detect(<span class="keywordtype">void</span>);
<a name="l00045"></a>00045
<a name="l00048"></a>00048 <span class="keywordtype">int</span> _getc(<span class="keywordtype">void</span>);
<a name="l00049"></a>00049 };
<a name="l00050"></a>00050 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_HIL.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_HIL.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___g_p_s___h_i_l_8h_source.html">AP_GPS_HIL.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_w_program_8h_source.html">WProgram.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_HIL.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___h_i_l_8cpp__incl.png" border="0" usemap="#_a_p___g_p_s___h_i_l_8cpp" alt=""/></div>
<map name="_a_p___g_p_s___h_i_l_8cpp" id="_a_p___g_p_s___h_i_l_8cpp">
<area shape="rect" id="node3" href="_a_p___g_p_s___h_i_l_8h.html" title="AP_GPS_HIL.h" alt="" coords="45,83,157,112"/><area shape="rect" id="node11" href="_w_program_8h.html" title="WProgram.h" alt="" coords="181,83,280,112"/><area shape="rect" id="node5" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,160,132,189"/></map>
</div>
<p><a href="_a_p___g_p_s___h_i_l_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,89 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_HIL.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_HIL.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___h_i_l_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// Hardware in the loop gps class.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by James Goppert</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// GPS configuration : Custom protocol per &quot;DIYDrones Custom Binary Sentence Specification V1.1&quot;</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___h_i_l_8h.html">AP_GPS_HIL.h</a>&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;<a class="code" href="_w_program_8h.html">WProgram.h</a>&quot;</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00018"></a><a class="code" href="class_a_p___g_p_s___h_i_l.html#a4e20d6130de679aaeff57bc028daafe8">00018</a> <a class="code" href="class_a_p___g_p_s___h_i_l.html#a4e20d6130de679aaeff57bc028daafe8">AP_GPS_HIL::AP_GPS_HIL</a>(<a class="code" href="class_stream.html">Stream</a> *s) : <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(s)
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020 }
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00023"></a><a class="code" href="class_a_p___g_p_s___h_i_l.html#af693ab47d930e11299798c0b5ac82e0d">00023</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___h_i_l.html#af693ab47d930e11299798c0b5ac82e0d">AP_GPS_HIL::init</a>(<span class="keywordtype">void</span>)
<a name="l00024"></a>00024 {
<a name="l00025"></a>00025 }
<a name="l00026"></a>00026
<a name="l00027"></a><a class="code" href="class_a_p___g_p_s___h_i_l.html#a23dbfd67e4f1d21bea02a4de604d511a">00027</a> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___h_i_l.html#a23dbfd67e4f1d21bea02a4de604d511a">AP_GPS_HIL::read</a>(<span class="keywordtype">void</span>)
<a name="l00028"></a>00028 {
<a name="l00029"></a>00029 <span class="keywordtype">bool</span> result = _updated;
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="comment">// return true once for each update pushed in</span>
<a name="l00032"></a>00032 _updated = <span class="keyword">false</span>;
<a name="l00033"></a>00033 <span class="keywordflow">return</span> result;
<a name="l00034"></a>00034 }
<a name="l00035"></a>00035
<a name="l00036"></a><a class="code" href="class_a_p___g_p_s___h_i_l.html#a11627ea1018d6ba502dcf2bf6a632436">00036</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___h_i_l.html#a11627ea1018d6ba502dcf2bf6a632436">AP_GPS_HIL::setHIL</a>(<span class="keywordtype">long</span> _time, <span class="keywordtype">float</span> _latitude, <span class="keywordtype">float</span> _longitude, <span class="keywordtype">float</span> _altitude,
<a name="l00037"></a>00037 <span class="keywordtype">float</span> _ground_speed, <span class="keywordtype">float</span> _ground_course, <span class="keywordtype">float</span> _speed_3d, uint8_t _num_sats)
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039 <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a> = _time;
<a name="l00040"></a>00040 <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a> = _latitude*1.0e7;
<a name="l00041"></a>00041 <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a> = _longitude*1.0e7;
<a name="l00042"></a>00042 <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a> = _altitude*1.0e2;
<a name="l00043"></a>00043 <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> = _ground_speed*1.0e2;
<a name="l00044"></a>00044 <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a> = _ground_course*1.0e2;
<a name="l00045"></a>00045 <a class="code" href="class_g_p_s.html#a39fa3ac4a5d784f63c934cdc37eac8b6" title="3D speed in cm/sec (not always available)">speed_3d</a> = _speed_3d*1.0e2;
<a name="l00046"></a>00046 <a class="code" href="class_g_p_s.html#ada1d7424a7a9afa17cfffcd73f741971" title="Number of visible satelites.">num_sats</a> = _num_sats;
<a name="l00047"></a>00047 <a class="code" href="class_g_p_s.html#a0b2a93a9f1d0e234d791177ea5f42078" title="true if we have a position fix (use status instead)">fix</a> = <span class="keyword">true</span>;
<a name="l00048"></a>00048 _updated = <span class="keyword">true</span>;
<a name="l00049"></a>00049 }
<a name="l00050"></a>00050
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,63 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_HIL.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_GPS_HIL.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_HIL.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___h_i_l_8h__incl.png" border="0" usemap="#_a_p___g_p_s___h_i_l_8h" alt=""/></div>
<map name="_a_p___g_p_s___h_i_l_8h" id="_a_p___g_p_s___h_i_l_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,83,132,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___h_i_l_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___h_i_l_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___h_i_l_8hdep" id="_a_p___g_p_s___h_i_l_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node16" href="_a_p___g_p_s___h_i_l_8cpp.html" title="AP_GPS_HIL.cpp" alt="" coords="217,83,343,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s___h_i_l_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___h_i_l.html">AP_GPS_HIL</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,69 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_HIL.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_HIL.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___h_i_l_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// Hardware in the loop gps class.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by James Goppert</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">//</span>
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef AP_GPS_HIL_h</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_HIL_h</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00016"></a>00016
<a name="l00017"></a><a class="code" href="class_a_p___g_p_s___h_i_l.html">00017</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___h_i_l.html">AP_GPS_HIL</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> {
<a name="l00018"></a>00018 <span class="keyword">public</span>:
<a name="l00019"></a>00019 <a class="code" href="class_a_p___g_p_s___h_i_l.html#a4e20d6130de679aaeff57bc028daafe8">AP_GPS_HIL</a>(<a class="code" href="class_stream.html">Stream</a> *s);
<a name="l00020"></a>00020 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___h_i_l.html#af693ab47d930e11299798c0b5ac82e0d">init</a>(<span class="keywordtype">void</span>);
<a name="l00021"></a>00021 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___h_i_l.html#a23dbfd67e4f1d21bea02a4de604d511a">read</a>(<span class="keywordtype">void</span>);
<a name="l00022"></a>00022
<a name="l00033"></a>00033 <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___h_i_l.html#a11627ea1018d6ba502dcf2bf6a632436">setHIL</a>(<span class="keywordtype">long</span> <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a>, <span class="keywordtype">float</span> <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a>, <span class="keywordtype">float</span> <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a>, <span class="keywordtype">float</span> <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a>,
<a name="l00034"></a>00034 <span class="keywordtype">float</span> <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a>, <span class="keywordtype">float</span> <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>, <span class="keywordtype">float</span> <a class="code" href="class_g_p_s.html#a39fa3ac4a5d784f63c934cdc37eac8b6" title="3D speed in cm/sec (not always available)">speed_3d</a>, uint8_t <a class="code" href="class_g_p_s.html#ada1d7424a7a9afa17cfffcd73f741971" title="Number of visible satelites.">num_sats</a>);
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="keyword">private</span>:
<a name="l00037"></a>00037 <span class="keywordtype">bool</span> _updated;
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="preprocessor">#endif // AP_GPS_HIL_H</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK16.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_MTK16.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___g_p_s___m_t_k16_8h_source.html">AP_GPS_MTK16.h</a>&quot;</code><br/>
<code>#include &lt;stdint.h&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_MTK16.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___m_t_k16_8cpp__incl.png" border="0" usemap="#_a_p___g_p_s___m_t_k16_8cpp" alt=""/></div>
<map name="_a_p___g_p_s___m_t_k16_8cpp" id="_a_p___g_p_s___m_t_k16_8cpp">
<area shape="rect" id="node3" href="_a_p___g_p_s___m_t_k16_8h.html" title="AP_GPS_MTK16.h" alt="" coords="108,83,241,112"/><area shape="rect" id="node5" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,160,132,189"/><area shape="rect" id="node11" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="156,160,340,189"/></map>
</div>
<p><a href="_a_p___g_p_s___m_t_k16_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,172 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK16.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_MTK16.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___m_t_k16_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// DIYDrones Custom Mediatek GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jordi Munoz and Jose Julio, DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// GPS configuration : Custom protocol per &quot;DIYDrones Custom Binary Sentence Specification V1.1&quot;</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___m_t_k16_8h.html">AP_GPS_MTK16.h</a>&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00018"></a><a class="code" href="class_a_p___g_p_s___m_t_k16.html#a893a3b3da1dd0cbeede23a5900e61de6">00018</a> <a class="code" href="class_a_p___g_p_s___m_t_k16.html#a893a3b3da1dd0cbeede23a5900e61de6">AP_GPS_MTK16::AP_GPS_MTK16</a>(<a class="code" href="class_stream.html">Stream</a> *s) : <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(s)
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020 }
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00023"></a>00023 <span class="keywordtype">void</span>
<a name="l00024"></a><a class="code" href="class_a_p___g_p_s___m_t_k16.html#ab4d596d3b7f462d8c95db8778ea0c3e6">00024</a> <a class="code" href="class_a_p___g_p_s___m_t_k16.html#ab4d596d3b7f462d8c95db8778ea0c3e6">AP_GPS_MTK16::init</a>(<span class="keywordtype">void</span>)
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;flush();
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="comment">// initialize serial port for binary protocol use</span>
<a name="l00029"></a>00029 <span class="comment">// XXX should assume binary, let GPS_AUTO handle dynamic config?</span>
<a name="l00030"></a>00030 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a33cc37eaf57637b4b2476d9efcf6611a">MTK_SET_BINARY</a>);
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="comment">// set 4Hz update rate</span>
<a name="l00033"></a>00033 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a54cef66684bbf4dcc1693e23d1e1f68a">MTK_OUTPUT_4HZ</a>);
<a name="l00034"></a>00034 }
<a name="l00035"></a>00035
<a name="l00036"></a>00036 <span class="comment">// Process bytes available from the stream</span>
<a name="l00037"></a>00037 <span class="comment">//</span>
<a name="l00038"></a>00038 <span class="comment">// The stream is assumed to contain only our custom message. If it</span>
<a name="l00039"></a>00039 <span class="comment">// contains other messages, and those messages contain the preamble bytes,</span>
<a name="l00040"></a>00040 <span class="comment">// it is possible for this code to become de-synchronised. Without</span>
<a name="l00041"></a>00041 <span class="comment">// buffering the entire message and re-processing it from the top,</span>
<a name="l00042"></a>00042 <span class="comment">// this is unavoidable.</span>
<a name="l00043"></a>00043 <span class="comment">//</span>
<a name="l00044"></a>00044 <span class="comment">// The lack of a standard header length field makes it impossible to skip</span>
<a name="l00045"></a>00045 <span class="comment">// unrecognised messages.</span>
<a name="l00046"></a>00046 <span class="comment">//</span>
<a name="l00047"></a>00047 <span class="keywordtype">bool</span>
<a name="l00048"></a><a class="code" href="class_a_p___g_p_s___m_t_k16.html#a220d9ec5c9e1ce6836508688c050f161">00048</a> <a class="code" href="class_a_p___g_p_s___m_t_k16.html#a220d9ec5c9e1ce6836508688c050f161">AP_GPS_MTK16::read</a>(<span class="keywordtype">void</span>)
<a name="l00049"></a>00049 {
<a name="l00050"></a>00050 uint8_t data;
<a name="l00051"></a>00051 <span class="keywordtype">int</span> numc;
<a name="l00052"></a>00052 <span class="keywordtype">bool</span> parsed = <span class="keyword">false</span>;
<a name="l00053"></a>00053
<a name="l00054"></a>00054 numc = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#adb912146b71c46ce62d22412b819adcb">available</a>();
<a name="l00055"></a>00055 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; numc; i++) { <span class="comment">// Process bytes received</span>
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="comment">// read the next byte</span>
<a name="l00058"></a>00058 data = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a4de9545ea7065d408c3efdb97f55dc2b">read</a>();
<a name="l00059"></a>00059
<a name="l00060"></a>00060 restart:
<a name="l00061"></a>00061 <span class="keywordflow">switch</span>(_step){
<a name="l00062"></a>00062
<a name="l00063"></a>00063 <span class="comment">// Message preamble, class, ID detection</span>
<a name="l00064"></a>00064 <span class="comment">//</span>
<a name="l00065"></a>00065 <span class="comment">// If we fail to match any of the expected bytes, we</span>
<a name="l00066"></a>00066 <span class="comment">// reset the state machine and re-consider the failed</span>
<a name="l00067"></a>00067 <span class="comment">// byte as the first byte of the preamble. This </span>
<a name="l00068"></a>00068 <span class="comment">// improves our chances of recovering from a mismatch</span>
<a name="l00069"></a>00069 <span class="comment">// and makes it less likely that we will be fooled by</span>
<a name="l00070"></a>00070 <span class="comment">// the preamble appearing as data in some other message.</span>
<a name="l00071"></a>00071 <span class="comment">//</span>
<a name="l00072"></a>00072 <span class="keywordflow">case</span> 0:
<a name="l00073"></a>00073 <span class="keywordflow">if</span>(PREAMBLE1 == data)
<a name="l00074"></a>00074 _step++;
<a name="l00075"></a>00075 <span class="keywordflow">break</span>;
<a name="l00076"></a>00076 <span class="keywordflow">case</span> 1:
<a name="l00077"></a>00077 <span class="keywordflow">if</span> (PREAMBLE2 == data) {
<a name="l00078"></a>00078 _step++;
<a name="l00079"></a>00079 <span class="keywordflow">break</span>;
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081 _step = 0;
<a name="l00082"></a>00082 <span class="keywordflow">goto</span> restart;
<a name="l00083"></a>00083 <span class="keywordflow">case</span> 2:
<a name="l00084"></a>00084 <span class="keywordflow">if</span> (<span class="keyword">sizeof</span>(_buffer) == data) {
<a name="l00085"></a>00085 _step++;
<a name="l00086"></a>00086 _ck_b = _ck_a = data; <span class="comment">// reset the checksum accumulators</span>
<a name="l00087"></a>00087 _payload_counter = 0;
<a name="l00088"></a>00088 } <span class="keywordflow">else</span> {
<a name="l00089"></a>00089 _step = 0; <span class="comment">// reset and wait for a message of the right class</span>
<a name="l00090"></a>00090 <span class="keywordflow">goto</span> restart;
<a name="l00091"></a>00091 }
<a name="l00092"></a>00092 <span class="keywordflow">break</span>;
<a name="l00093"></a>00093
<a name="l00094"></a>00094 <span class="comment">// Receive message data</span>
<a name="l00095"></a>00095 <span class="comment">//</span>
<a name="l00096"></a>00096 <span class="keywordflow">case</span> 3:
<a name="l00097"></a>00097 _buffer.bytes[_payload_counter++] = data;
<a name="l00098"></a>00098 _ck_b += (_ck_a += data);
<a name="l00099"></a>00099 <span class="keywordflow">if</span> (_payload_counter == <span class="keyword">sizeof</span>(_buffer))
<a name="l00100"></a>00100 _step++;
<a name="l00101"></a>00101 <span class="keywordflow">break</span>;
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="comment">// Checksum and message processing</span>
<a name="l00104"></a>00104 <span class="comment">//</span>
<a name="l00105"></a>00105 <span class="keywordflow">case</span> 4:
<a name="l00106"></a>00106 _step++;
<a name="l00107"></a>00107 <span class="keywordflow">if</span> (_ck_a != data) {
<a name="l00108"></a>00108 _step = 0;
<a name="l00109"></a>00109 }
<a name="l00110"></a>00110 <span class="keywordflow">break</span>;
<a name="l00111"></a>00111 <span class="keywordflow">case</span> 5:
<a name="l00112"></a>00112 _step = 0;
<a name="l00113"></a>00113 <span class="keywordflow">if</span> (_ck_b != data) {
<a name="l00114"></a>00114 <span class="keywordflow">break</span>;
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116
<a name="l00117"></a>00117 <a class="code" href="class_g_p_s.html#a0b2a93a9f1d0e234d791177ea5f42078" title="true if we have a position fix (use status instead)">fix</a> = _buffer.msg.fix_type == FIX_3D;
<a name="l00118"></a>00118 <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a> = _buffer.msg.latitude * 10; <span class="comment">// XXX doc says *10e7 but device says otherwise</span>
<a name="l00119"></a>00119 <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a> = _buffer.msg.longitude * 10; <span class="comment">// XXX doc says *10e7 but device says otherwise</span>
<a name="l00120"></a>00120 <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a> = _buffer.msg.altitude;
<a name="l00121"></a>00121 <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> = _buffer.msg.ground_speed;
<a name="l00122"></a>00122 <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a> = _buffer.msg.ground_course;
<a name="l00123"></a>00123 <a class="code" href="class_g_p_s.html#ada1d7424a7a9afa17cfffcd73f741971" title="Number of visible satelites.">num_sats</a> = _buffer.msg.satellites;
<a name="l00124"></a>00124 <a class="code" href="class_g_p_s.html#a354808671a37cd3d8681e51a7d809bcb" title="horizontal dilution of precision in cm">hdop</a> = _buffer.msg.hdop;
<a name="l00125"></a>00125
<a name="l00126"></a>00126 <span class="comment">// XXX docs say this is UTC, but our clients expect msToW</span>
<a name="l00127"></a>00127 <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.msg.utc_time);
<a name="l00128"></a>00128
<a name="l00129"></a>00129 parsed = <span class="keyword">true</span>;
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131 }
<a name="l00132"></a>00132 <span class="keywordflow">return</span> parsed;
<a name="l00133"></a>00133 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,65 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK16.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_GPS_MTK16.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_MTK16.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___m_t_k16_8h__incl.png" border="0" usemap="#_a_p___g_p_s___m_t_k16_8h" alt=""/></div>
<map name="_a_p___g_p_s___m_t_k16_8h" id="_a_p___g_p_s___m_t_k16_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,83,132,112"/><area shape="rect" id="node9" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="156,83,340,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___m_t_k16_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___m_t_k16_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___m_t_k16_8hdep" id="_a_p___g_p_s___m_t_k16_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node16" href="_a_p___g_p_s___m_t_k16_8cpp.html" title="AP_GPS_MTK16.cpp" alt="" coords="217,83,367,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s___m_t_k16_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___m_t_k16.html">AP_GPS_MTK16</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>AP_GPS_MTK16::diyd_mtk_msg</b></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,105 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK16.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_MTK16.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___m_t_k16_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// DIYDrones Custom Mediatek GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jordi Munoz and Jose Julio, DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// GPS configuration : Custom protocol per &quot;Customize Function Specification, 3D Robotics, v1.6&quot;</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef AP_GPS_MTK16_h</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_MTK16_h</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html">AP_GPS_MTK_Common.h</a>&quot;</span>
<a name="l00018"></a>00018
<a name="l00019"></a><a class="code" href="class_a_p___g_p_s___m_t_k16.html">00019</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___m_t_k16.html">AP_GPS_MTK16</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> {
<a name="l00020"></a>00020 <span class="keyword">public</span>:
<a name="l00021"></a>00021 <a class="code" href="class_a_p___g_p_s___m_t_k16.html#a893a3b3da1dd0cbeede23a5900e61de6">AP_GPS_MTK16</a>(<a class="code" href="class_stream.html">Stream</a> *s);
<a name="l00022"></a>00022 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___m_t_k16.html#ab4d596d3b7f462d8c95db8778ea0c3e6">init</a>(<span class="keywordtype">void</span>);
<a name="l00023"></a>00023 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___m_t_k16.html#a220d9ec5c9e1ce6836508688c050f161">read</a>(<span class="keywordtype">void</span>);
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="keyword">private</span>:
<a name="l00026"></a>00026 <span class="preprocessor">#pragma pack(1)</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span> <span class="keyword">struct </span>diyd_mtk_msg {
<a name="l00028"></a>00028 int32_t <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a>;
<a name="l00029"></a>00029 int32_t <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a>;
<a name="l00030"></a>00030 int32_t <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a>;
<a name="l00031"></a>00031 int32_t <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a>;
<a name="l00032"></a>00032 int32_t <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>;
<a name="l00033"></a>00033 uint8_t satellites;
<a name="l00034"></a>00034 uint8_t fix_type;
<a name="l00035"></a>00035 uint32_t utc_date;
<a name="l00036"></a>00036 uint32_t utc_time;
<a name="l00037"></a>00037 uint16_t <a class="code" href="class_g_p_s.html#a354808671a37cd3d8681e51a7d809bcb" title="horizontal dilution of precision in cm">hdop</a>;
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039 <span class="preprocessor">#pragma pack(pop)</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span> <span class="keyword">enum</span> diyd_mtk_fix_type {
<a name="l00041"></a>00041 FIX_NONE = 1,
<a name="l00042"></a>00042 FIX_2D = 2,
<a name="l00043"></a>00043 FIX_3D = 3
<a name="l00044"></a>00044 };
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="keyword">enum</span> diyd_mtk_protocol_bytes {
<a name="l00047"></a>00047 PREAMBLE1 = 0xd0,
<a name="l00048"></a>00048 PREAMBLE2 = 0xdd,
<a name="l00049"></a>00049 };
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="comment">// Packet checksum accumulators</span>
<a name="l00052"></a>00052 uint8_t _ck_a;
<a name="l00053"></a>00053 uint8_t _ck_b;
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="comment">// State machine state</span>
<a name="l00056"></a>00056 uint8_t _step;
<a name="l00057"></a>00057 uint8_t _payload_counter;
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="comment">// Receive buffer</span>
<a name="l00060"></a>00060 <span class="keyword">union </span>{
<a name="l00061"></a><a class="code" href="class_a_p___g_p_s___m_t_k16.html#adf5e7724ec86eae37e7e775ee52def40">00061</a> diyd_mtk_msg <a class="code" href="class_a_p___g_p_s___m_t_k16.html#adf5e7724ec86eae37e7e775ee52def40">msg</a>;
<a name="l00062"></a><a class="code" href="class_a_p___g_p_s___m_t_k16.html#ac7471f982fa8b1cf703ff472acff1d28">00062</a> uint8_t <a class="code" href="class_a_p___g_p_s___m_t_k16.html#ac7471f982fa8b1cf703ff472acff1d28">bytes</a>[];
<a name="l00063"></a>00063 } _buffer;
<a name="l00064"></a>00064 };
<a name="l00065"></a>00065
<a name="l00066"></a>00066 <span class="preprocessor">#endif // AP_GPS_MTK16_H</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_MTK.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___g_p_s___m_t_k_8h_source.html">AP_GPS_MTK.h</a>&quot;</code><br/>
<code>#include &lt;stdint.h&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_MTK.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___m_t_k_8cpp__incl.png" border="0" usemap="#_a_p___g_p_s___m_t_k_8cpp" alt=""/></div>
<map name="_a_p___g_p_s___m_t_k_8cpp" id="_a_p___g_p_s___m_t_k_8cpp">
<area shape="rect" id="node3" href="_a_p___g_p_s___m_t_k_8h.html" title="AP_GPS_MTK.h" alt="" coords="116,83,233,112"/><area shape="rect" id="node5" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,160,132,189"/><area shape="rect" id="node11" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="156,160,340,189"/></map>
</div>
<p><a href="_a_p___g_p_s___m_t_k_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,181 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_MTK.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___m_t_k_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// DIYDrones Custom Mediatek GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jordi Munoz and Jose Julio, DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// GPS configuration : Custom protocol per &quot;DIYDrones Custom Binary Sentence Specification V1.1&quot;</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013
<a name="l00014"></a>00014 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___m_t_k_8h.html">AP_GPS_MTK.h</a>&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00018"></a><a class="code" href="class_a_p___g_p_s___m_t_k.html#acea7f1f7e379e51190e89ea683815219">00018</a> <a class="code" href="class_a_p___g_p_s___m_t_k.html#acea7f1f7e379e51190e89ea683815219">AP_GPS_MTK::AP_GPS_MTK</a>(<a class="code" href="class_stream.html">Stream</a> *s) : <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(s)
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020 }
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00023"></a>00023 <span class="keywordtype">void</span>
<a name="l00024"></a><a class="code" href="class_a_p___g_p_s___m_t_k.html#ace24c8150a65d0c33bbb052e45a2ea14">00024</a> <a class="code" href="class_a_p___g_p_s___m_t_k.html#ace24c8150a65d0c33bbb052e45a2ea14">AP_GPS_MTK::init</a>(<span class="keywordtype">void</span>)
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;flush();
<a name="l00027"></a>00027 <span class="comment">// initialize serial port for binary protocol use</span>
<a name="l00028"></a>00028 <span class="comment">// XXX should assume binary, let GPS_AUTO handle dynamic config?</span>
<a name="l00029"></a>00029 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a33cc37eaf57637b4b2476d9efcf6611a">MTK_SET_BINARY</a>);
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="comment">// set 4Hz update rate</span>
<a name="l00032"></a>00032 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a54cef66684bbf4dcc1693e23d1e1f68a">MTK_OUTPUT_4HZ</a>);
<a name="l00033"></a>00033 }
<a name="l00034"></a>00034
<a name="l00035"></a>00035 <span class="comment">// Process bytes available from the stream</span>
<a name="l00036"></a>00036 <span class="comment">//</span>
<a name="l00037"></a>00037 <span class="comment">// The stream is assumed to contain only our custom message. If it</span>
<a name="l00038"></a>00038 <span class="comment">// contains other messages, and those messages contain the preamble bytes,</span>
<a name="l00039"></a>00039 <span class="comment">// it is possible for this code to become de-synchronised. Without</span>
<a name="l00040"></a>00040 <span class="comment">// buffering the entire message and re-processing it from the top,</span>
<a name="l00041"></a>00041 <span class="comment">// this is unavoidable.</span>
<a name="l00042"></a>00042 <span class="comment">//</span>
<a name="l00043"></a>00043 <span class="comment">// The lack of a standard header length field makes it impossible to skip</span>
<a name="l00044"></a>00044 <span class="comment">// unrecognised messages.</span>
<a name="l00045"></a>00045 <span class="comment">//</span>
<a name="l00046"></a>00046 <span class="keywordtype">bool</span>
<a name="l00047"></a><a class="code" href="class_a_p___g_p_s___m_t_k.html#a92d23465c7b621f93040fd304e9519ce">00047</a> <a class="code" href="class_a_p___g_p_s___m_t_k.html#a92d23465c7b621f93040fd304e9519ce">AP_GPS_MTK::read</a>(<span class="keywordtype">void</span>)
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 uint8_t data;
<a name="l00050"></a>00050 <span class="keywordtype">int</span> numc;
<a name="l00051"></a>00051 <span class="keywordtype">bool</span> parsed = <span class="keyword">false</span>;
<a name="l00052"></a>00052
<a name="l00053"></a>00053 numc = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#adb912146b71c46ce62d22412b819adcb">available</a>();
<a name="l00054"></a>00054 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; numc; i++){ <span class="comment">// Process bytes received</span>
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="comment">// read the next byte</span>
<a name="l00057"></a>00057 data = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a4de9545ea7065d408c3efdb97f55dc2b">read</a>();
<a name="l00058"></a>00058
<a name="l00059"></a>00059 restart:
<a name="l00060"></a>00060 <span class="keywordflow">switch</span>(_step){
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <span class="comment">// Message preamble, class, ID detection</span>
<a name="l00063"></a>00063 <span class="comment">//</span>
<a name="l00064"></a>00064 <span class="comment">// If we fail to match any of the expected bytes, we</span>
<a name="l00065"></a>00065 <span class="comment">// reset the state machine and re-consider the failed</span>
<a name="l00066"></a>00066 <span class="comment">// byte as the first byte of the preamble. This </span>
<a name="l00067"></a>00067 <span class="comment">// improves our chances of recovering from a mismatch</span>
<a name="l00068"></a>00068 <span class="comment">// and makes it less likely that we will be fooled by</span>
<a name="l00069"></a>00069 <span class="comment">// the preamble appearing as data in some other message.</span>
<a name="l00070"></a>00070 <span class="comment">//</span>
<a name="l00071"></a>00071 <span class="keywordflow">case</span> 0:
<a name="l00072"></a>00072 <span class="keywordflow">if</span>(PREAMBLE1 == data)
<a name="l00073"></a>00073 _step++;
<a name="l00074"></a>00074 <span class="keywordflow">break</span>;
<a name="l00075"></a>00075 <span class="keywordflow">case</span> 1:
<a name="l00076"></a>00076 <span class="keywordflow">if</span> (PREAMBLE2 == data) {
<a name="l00077"></a>00077 _step++;
<a name="l00078"></a>00078 <span class="keywordflow">break</span>;
<a name="l00079"></a>00079 }
<a name="l00080"></a>00080 _step = 0;
<a name="l00081"></a>00081 <span class="keywordflow">goto</span> restart;
<a name="l00082"></a>00082 <span class="keywordflow">case</span> 2:
<a name="l00083"></a>00083 <span class="keywordflow">if</span> (MESSAGE_CLASS == data) {
<a name="l00084"></a>00084 _step++;
<a name="l00085"></a>00085 _ck_b = _ck_a = data; <span class="comment">// reset the checksum accumulators</span>
<a name="l00086"></a>00086 } <span class="keywordflow">else</span> {
<a name="l00087"></a>00087 _step = 0; <span class="comment">// reset and wait for a message of the right class</span>
<a name="l00088"></a>00088 <span class="keywordflow">goto</span> restart;
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090 <span class="keywordflow">break</span>;
<a name="l00091"></a>00091 <span class="keywordflow">case</span> 3:
<a name="l00092"></a>00092 <span class="keywordflow">if</span> (MESSAGE_ID == data) {
<a name="l00093"></a>00093 _step++;
<a name="l00094"></a>00094 _ck_b += (_ck_a += data);
<a name="l00095"></a>00095 _payload_counter = 0;
<a name="l00096"></a>00096 } <span class="keywordflow">else</span> {
<a name="l00097"></a>00097 _step = 0;
<a name="l00098"></a>00098 <span class="keywordflow">goto</span> restart;
<a name="l00099"></a>00099 }
<a name="l00100"></a>00100 <span class="keywordflow">break</span>;
<a name="l00101"></a>00101
<a name="l00102"></a>00102 <span class="comment">// Receive message data</span>
<a name="l00103"></a>00103 <span class="comment">//</span>
<a name="l00104"></a>00104 <span class="keywordflow">case</span> 4:
<a name="l00105"></a>00105 _buffer.bytes[_payload_counter++] = data;
<a name="l00106"></a>00106 _ck_b += (_ck_a += data);
<a name="l00107"></a>00107 <span class="keywordflow">if</span> (_payload_counter == <span class="keyword">sizeof</span>(_buffer))
<a name="l00108"></a>00108 _step++;
<a name="l00109"></a>00109 <span class="keywordflow">break</span>;
<a name="l00110"></a>00110
<a name="l00111"></a>00111 <span class="comment">// Checksum and message processing</span>
<a name="l00112"></a>00112 <span class="comment">//</span>
<a name="l00113"></a>00113 <span class="keywordflow">case</span> 5:
<a name="l00114"></a>00114 _step++;
<a name="l00115"></a>00115 <span class="keywordflow">if</span> (_ck_a != data) {
<a name="l00116"></a>00116 <a class="code" href="class_g_p_s.html#acfd79aa1f9bcad32c0b89c2b16d150cf">_error</a>(<span class="stringliteral">&quot;GPS_MTK: checksum error\n&quot;</span>);
<a name="l00117"></a>00117 _step = 0;
<a name="l00118"></a>00118 }
<a name="l00119"></a>00119 <span class="keywordflow">break</span>;
<a name="l00120"></a>00120 <span class="keywordflow">case</span> 6:
<a name="l00121"></a>00121 _step = 0;
<a name="l00122"></a>00122 <span class="keywordflow">if</span> (_ck_b != data) {
<a name="l00123"></a>00123 <a class="code" href="class_g_p_s.html#acfd79aa1f9bcad32c0b89c2b16d150cf">_error</a>(<span class="stringliteral">&quot;GPS_MTK: checksum error\n&quot;</span>);
<a name="l00124"></a>00124 <span class="keywordflow">break</span>;
<a name="l00125"></a>00125 }
<a name="l00126"></a>00126
<a name="l00127"></a>00127 <a class="code" href="class_g_p_s.html#a0b2a93a9f1d0e234d791177ea5f42078" title="true if we have a position fix (use status instead)">fix</a> = (_buffer.msg.fix_type == FIX_3D);
<a name="l00128"></a>00128 <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.msg.latitude) * 10;
<a name="l00129"></a>00129 <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.msg.longitude) * 10;
<a name="l00130"></a>00130 <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.msg.altitude);
<a name="l00131"></a>00131 <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.msg.ground_speed);
<a name="l00132"></a>00132 <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.msg.ground_course) / 10000;
<a name="l00133"></a>00133 <a class="code" href="class_g_p_s.html#ada1d7424a7a9afa17cfffcd73f741971" title="Number of visible satelites.">num_sats</a> = _buffer.msg.satellites;
<a name="l00134"></a>00134
<a name="l00135"></a>00135 <span class="comment">// XXX docs say this is UTC, but our clients expect msToW</span>
<a name="l00136"></a>00136 <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.msg.utc_time);
<a name="l00137"></a>00137
<a name="l00138"></a>00138 parsed = <span class="keyword">true</span>;
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140 }
<a name="l00141"></a>00141 <span class="keywordflow">return</span> parsed;
<a name="l00142"></a>00142 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,65 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_GPS_MTK.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_MTK.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___m_t_k_8h__incl.png" border="0" usemap="#_a_p___g_p_s___m_t_k_8h" alt=""/></div>
<map name="_a_p___g_p_s___m_t_k_8h" id="_a_p___g_p_s___m_t_k_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,83,132,112"/><area shape="rect" id="node9" href="_a_p___g_p_s___m_t_k___common_8h.html" title="AP_GPS_MTK_Common.h" alt="" coords="156,83,340,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___m_t_k_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___m_t_k_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___m_t_k_8hdep" id="_a_p___g_p_s___m_t_k_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node16" href="_a_p___g_p_s___m_t_k_8cpp.html" title="AP_GPS_MTK.cpp" alt="" coords="217,83,351,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s___m_t_k_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___m_t_k.html">AP_GPS_MTK</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>AP_GPS_MTK::diyd_mtk_msg</b></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,110 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_MTK.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___m_t_k_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// DIYDrones Custom Mediatek GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jordi Munoz and Jose Julio, DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// GPS configuration : Custom protocol per &quot;DIYDrones Custom Binary Sentence Specification V1.1&quot;</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013 <span class="comment">// Note - see AP_GPS_MTK16.h for firmware 1.6 and later.</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 <span class="preprocessor">#ifndef AP_GPS_MTK_h</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_MTK_h</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html">AP_GPS_MTK_Common.h</a>&quot;</span>
<a name="l00020"></a>00020
<a name="l00021"></a><a class="code" href="class_a_p___g_p_s___m_t_k.html">00021</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___m_t_k.html">AP_GPS_MTK</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> {
<a name="l00022"></a>00022 <span class="keyword">public</span>:
<a name="l00023"></a>00023 <a class="code" href="class_a_p___g_p_s___m_t_k.html#acea7f1f7e379e51190e89ea683815219">AP_GPS_MTK</a>(<a class="code" href="class_stream.html">Stream</a> *s);
<a name="l00024"></a>00024 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___m_t_k.html#ace24c8150a65d0c33bbb052e45a2ea14">init</a>(<span class="keywordtype">void</span>);
<a name="l00025"></a>00025 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___m_t_k.html#a92d23465c7b621f93040fd304e9519ce">read</a>(<span class="keywordtype">void</span>);
<a name="l00026"></a>00026
<a name="l00027"></a>00027 <span class="keyword">private</span>:
<a name="l00028"></a>00028 <span class="preprocessor">#pragma pack(1)</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span> <span class="keyword">struct </span>diyd_mtk_msg {
<a name="l00030"></a>00030 int32_t <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a>;
<a name="l00031"></a>00031 int32_t <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a>;
<a name="l00032"></a>00032 int32_t <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a>;
<a name="l00033"></a>00033 int32_t <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a>;
<a name="l00034"></a>00034 int32_t <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>;
<a name="l00035"></a>00035 uint8_t satellites;
<a name="l00036"></a>00036 uint8_t fix_type;
<a name="l00037"></a>00037 uint32_t utc_time;
<a name="l00038"></a>00038 };
<a name="l00039"></a>00039 <span class="preprocessor">#pragma pack(pop)</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span> <span class="keyword">enum</span> diyd_mtk_fix_type {
<a name="l00041"></a>00041 FIX_NONE = 1,
<a name="l00042"></a>00042 FIX_2D = 2,
<a name="l00043"></a>00043 FIX_3D = 3
<a name="l00044"></a>00044 };
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="keyword">enum</span> diyd_mtk_protocol_bytes {
<a name="l00047"></a>00047 PREAMBLE1 = 0xb5,
<a name="l00048"></a>00048 PREAMBLE2 = 0x62,
<a name="l00049"></a>00049 MESSAGE_CLASS = 1,
<a name="l00050"></a>00050 MESSAGE_ID = 5
<a name="l00051"></a>00051 };
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="comment">// Packet checksum accumulators</span>
<a name="l00054"></a>00054 uint8_t _ck_a;
<a name="l00055"></a>00055 uint8_t _ck_b;
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="comment">// State machine state</span>
<a name="l00058"></a>00058 uint8_t _step;
<a name="l00059"></a>00059 uint8_t _payload_counter;
<a name="l00060"></a>00060
<a name="l00061"></a>00061 <span class="comment">// Receive buffer</span>
<a name="l00062"></a>00062 <span class="keyword">union </span>{
<a name="l00063"></a><a class="code" href="class_a_p___g_p_s___m_t_k.html#a1663dcbab2187728dd8ecd39cd68de50">00063</a> diyd_mtk_msg <a class="code" href="class_a_p___g_p_s___m_t_k.html#a1663dcbab2187728dd8ecd39cd68de50">msg</a>;
<a name="l00064"></a><a class="code" href="class_a_p___g_p_s___m_t_k.html#ac4e18f9915ebee2d7c787dbfd92499f0">00064</a> uint8_t <a class="code" href="class_a_p___g_p_s___m_t_k.html#ac4e18f9915ebee2d7c787dbfd92499f0">bytes</a>[];
<a name="l00065"></a>00065 } _buffer;
<a name="l00066"></a>00066
<a name="l00067"></a>00067 <span class="comment">// Buffer parse &amp; GPS state update</span>
<a name="l00068"></a>00068 <span class="keywordtype">void</span> _parse_gps();
<a name="l00069"></a>00069 };
<a name="l00070"></a>00070
<a name="l00071"></a>00071 <span class="preprocessor">#endif // AP_GPS_MTK_H</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,247 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK_Common.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_GPS_MTK_Common.h File Reference</h1> </div>
</div>
<div class="contents">
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___m_t_k___common_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___m_t_k___common_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___m_t_k___common_8hdep" id="_a_p___g_p_s___m_t_k___common_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s___m_t_k_8h.html" title="AP_GPS_MTK.h" alt="" coords="76,83,193,112"/><area shape="rect" id="node20" href="_a_p___g_p_s___m_t_k16_8h.html" title="AP_GPS_MTK16.h" alt="" coords="217,83,351,112"/><area shape="rect" id="node5" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="163,160,248,189"/><area shape="rect" id="node18" href="_a_p___g_p_s___m_t_k_8cpp.html" title="AP_GPS_MTK.cpp" alt="" coords="5,160,139,189"/><area shape="rect" id="node7" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="148,237,263,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="67,315,155,344"/><area shape="rect" id="node16" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="287,237,423,267"/><area shape="rect" id="node13" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="179,315,309,344"/><area shape="rect" id="node11" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="60,392,161,421"/><area shape="rect" id="node23" href="_a_p___g_p_s___m_t_k16_8cpp.html" title="AP_GPS_MTK16.cpp" alt="" coords="272,160,421,189"/></map>
</div>
<p><a href="_a_p___g_p_s___m_t_k___common_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#a33cc37eaf57637b4b2476d9efcf6611a">MTK_SET_BINARY</a>&nbsp;&nbsp;&nbsp;&quot;$PGCMD,16,0,0,0,0,0*6A\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#a1d8c9039d61b415a699e08d7f965525d">MTK_SET_NMEA</a>&nbsp;&nbsp;&nbsp;&quot;$PGCMD,16,1,1,1,1,1*6B\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#a613830cf3fe62639d0a9edb14d38244b">MTK_OUTPUT_1HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,1000*1F\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#ae2c8279f7d8bfc17ccd15aea7ca177d6">MTK_OUTPUT_2HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,500*2B\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#a54cef66684bbf4dcc1693e23d1e1f68a">MTK_OUTPUT_4HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,250*29\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#a524ebabec6ecd0d3f892318075333f10">MTK_OTUPUT_5HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,200*2C\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#aac8aa7839b9abb253517bc84dfb81b4c">MTK_OUTPUT_10HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,100*2F\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#a1adeed67d3b5e94343d275ec37031b74">MTK_BAUD_RATE_38400</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK251,38400*27\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#a941458433c2133250d9c607620b0d84d">SBAS_ON</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK313,1*2E\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#af8439fe2e67b33cf6979cfcc7d243123">SBAS_OFF</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK313,0*2F\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#ac01972b6ab1ea0348819a7201e3429b8">WAAS_ON</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF151,1*3F\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___m_t_k___common_8h.html#af331fb3f9871b06d501c3b0025bbeca7">WAAS_OFF</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF151,0*3E\r\n&quot;</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a1adeed67d3b5e94343d275ec37031b74"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::MTK_BAUD_RATE_38400" ref="a1adeed67d3b5e94343d275ec37031b74" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MTK_BAUD_RATE_38400&nbsp;&nbsp;&nbsp;&quot;$PMTK251,38400*27\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00025">25</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a524ebabec6ecd0d3f892318075333f10"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::MTK_OTUPUT_5HZ" ref="a524ebabec6ecd0d3f892318075333f10" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MTK_OTUPUT_5HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,200*2C\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00022">22</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="aac8aa7839b9abb253517bc84dfb81b4c"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::MTK_OUTPUT_10HZ" ref="aac8aa7839b9abb253517bc84dfb81b4c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MTK_OUTPUT_10HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,100*2F\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00023">23</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a613830cf3fe62639d0a9edb14d38244b"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::MTK_OUTPUT_1HZ" ref="a613830cf3fe62639d0a9edb14d38244b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MTK_OUTPUT_1HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,1000*1F\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00019">19</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="ae2c8279f7d8bfc17ccd15aea7ca177d6"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::MTK_OUTPUT_2HZ" ref="ae2c8279f7d8bfc17ccd15aea7ca177d6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MTK_OUTPUT_2HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,500*2B\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00020">20</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a54cef66684bbf4dcc1693e23d1e1f68a"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::MTK_OUTPUT_4HZ" ref="a54cef66684bbf4dcc1693e23d1e1f68a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MTK_OUTPUT_4HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,250*29\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00021">21</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a33cc37eaf57637b4b2476d9efcf6611a"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::MTK_SET_BINARY" ref="a33cc37eaf57637b4b2476d9efcf6611a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MTK_SET_BINARY&nbsp;&nbsp;&nbsp;&quot;$PGCMD,16,0,0,0,0,0*6A\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00016">16</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a1d8c9039d61b415a699e08d7f965525d"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::MTK_SET_NMEA" ref="a1d8c9039d61b415a699e08d7f965525d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MTK_SET_NMEA&nbsp;&nbsp;&nbsp;&quot;$PGCMD,16,1,1,1,1,1*6B\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00017">17</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="af8439fe2e67b33cf6979cfcc7d243123"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::SBAS_OFF" ref="af8439fe2e67b33cf6979cfcc7d243123" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SBAS_OFF&nbsp;&nbsp;&nbsp;&quot;$PMTK313,0*2F\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00028">28</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="a941458433c2133250d9c607620b0d84d"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::SBAS_ON" ref="a941458433c2133250d9c607620b0d84d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SBAS_ON&nbsp;&nbsp;&nbsp;&quot;$PMTK313,1*2E\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00027">27</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="af331fb3f9871b06d501c3b0025bbeca7"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::WAAS_OFF" ref="af331fb3f9871b06d501c3b0025bbeca7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define WAAS_OFF&nbsp;&nbsp;&nbsp;&quot;$PSRF151,0*3E\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00031">31</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac01972b6ab1ea0348819a7201e3429b8"></a><!-- doxytag: member="AP_GPS_MTK_Common.h::WAAS_ON" ref="ac01972b6ab1ea0348819a7201e3429b8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define WAAS_ON&nbsp;&nbsp;&nbsp;&quot;$PSRF151,1*3F\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html#l00030">30</a> of file <a class="el" href="_a_p___g_p_s___m_t_k___common_8h_source.html">AP_GPS_MTK_Common.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,72 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_MTK_Common.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_MTK_Common.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___m_t_k___common_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// DIYDrones Custom Mediatek GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jordi Munoz and Jose Julio, DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// Common definitions for MediaTek GPS modules.</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef AP_GPS_MTK_Common_h</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_MTK_Common_h</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a33cc37eaf57637b4b2476d9efcf6611a">00016</a> <span class="preprocessor">#define MTK_SET_BINARY &quot;$PGCMD,16,0,0,0,0,0*6A\r\n&quot;</span>
<a name="l00017"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a1d8c9039d61b415a699e08d7f965525d">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define MTK_SET_NMEA &quot;$PGCMD,16,1,1,1,1,1*6B\r\n&quot;</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a613830cf3fe62639d0a9edb14d38244b">00019</a> <span class="preprocessor">#define MTK_OUTPUT_1HZ &quot;$PMTK220,1000*1F\r\n&quot;</span>
<a name="l00020"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#ae2c8279f7d8bfc17ccd15aea7ca177d6">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define MTK_OUTPUT_2HZ &quot;$PMTK220,500*2B\r\n&quot;</span>
<a name="l00021"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a54cef66684bbf4dcc1693e23d1e1f68a">00021</a> <span class="preprocessor"></span><span class="preprocessor">#define MTK_OUTPUT_4HZ &quot;$PMTK220,250*29\r\n&quot;</span>
<a name="l00022"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a524ebabec6ecd0d3f892318075333f10">00022</a> <span class="preprocessor"></span><span class="preprocessor">#define MTK_OTUPUT_5HZ &quot;$PMTK220,200*2C\r\n&quot;</span>
<a name="l00023"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#aac8aa7839b9abb253517bc84dfb81b4c">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define MTK_OUTPUT_10HZ &quot;$PMTK220,100*2F\r\n&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a1adeed67d3b5e94343d275ec37031b74">00025</a> <span class="preprocessor">#define MTK_BAUD_RATE_38400 &quot;$PMTK251,38400*27\r\n&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a941458433c2133250d9c607620b0d84d">00027</a> <span class="preprocessor">#define SBAS_ON &quot;$PMTK313,1*2E\r\n&quot;</span>
<a name="l00028"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#af8439fe2e67b33cf6979cfcc7d243123">00028</a> <span class="preprocessor"></span><span class="preprocessor">#define SBAS_OFF &quot;$PMTK313,0*2F\r\n&quot;</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00030"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#ac01972b6ab1ea0348819a7201e3429b8">00030</a> <span class="preprocessor">#define WAAS_ON &quot;$PSRF151,1*3F\r\n&quot;</span>
<a name="l00031"></a><a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#af331fb3f9871b06d501c3b0025bbeca7">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define WAAS_OFF &quot;$PSRF151,0*3E\r\n&quot;</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#endif // AP_GPS_MTK_Common_h</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,51 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_NMEA.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_NMEA.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_NMEA.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___n_m_e_a_8cpp__incl.png" border="0" usemap="#_a_p___g_p_s___n_m_e_a_8cpp" alt=""/></div>
<map name="_a_p___g_p_s___n_m_e_a_8cpp" id="_a_p___g_p_s___n_m_e_a_8cpp">
<area shape="rect" id="node3" href="_a_p___g_p_s___n_m_e_a_8h.html" title="AP_GPS_NMEA.h" alt="" coords="36,83,167,112"/><area shape="rect" id="node5" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,160,132,189"/></map>
</div>
<p><a href="_a_p___g_p_s___n_m_e_a_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,283 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_NMEA.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_NMEA.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___n_m_e_a_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> GPS_NMEA.cpp - Generic NMEA GPS library for Arduino</span>
<a name="l00004"></a>00004 <span class="comment"> Code by Jordi Muñoz and Jose Julio. DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment"> Edits by HappyKillmore</span>
<a name="l00006"></a>00006 <span class="comment"> This code works with boards based on ATMega168 / 328 and ATMega1280 (Serial port 1)</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment"> This library is free software; you can redistribute it and / or</span>
<a name="l00009"></a>00009 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00010"></a>00010 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00011"></a>00011 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"></span>
<a name="l00013"></a>00013 <span class="comment"> GPS configuration : NMEA protocol</span>
<a name="l00014"></a>00014 <span class="comment"> Baud rate : 38400</span>
<a name="l00015"></a>00015 <span class="comment"> NMEA Sentences : </span>
<a name="l00016"></a>00016 <span class="comment"> $GPGGA : Global Positioning System fix Data</span>
<a name="l00017"></a>00017 <span class="comment"> $GPVTG : Ttack and Ground Speed</span>
<a name="l00018"></a>00018 <span class="comment"> </span>
<a name="l00019"></a>00019 <span class="comment"> Methods:</span>
<a name="l00020"></a>00020 <span class="comment"> init() : GPS Initialization</span>
<a name="l00021"></a>00021 <span class="comment"> read() : Call this funcion as often as you want to ensure you read the incomming gps data</span>
<a name="l00022"></a>00022 <span class="comment"> </span>
<a name="l00023"></a>00023 <span class="comment"> Properties:</span>
<a name="l00024"></a>00024 <span class="comment"> latitude : latitude * 10000000 (long value)</span>
<a name="l00025"></a>00025 <span class="comment"> longitude : longitude * 10000000 (long value)</span>
<a name="l00026"></a>00026 <span class="comment"> altitude : altitude * 1000 (milimeters) (long value)</span>
<a name="l00027"></a>00027 <span class="comment"> ground_speed : Speed (m / s) * 100 (long value)</span>
<a name="l00028"></a>00028 <span class="comment"> ground_course : Course (degrees) * 100 (long value)</span>
<a name="l00029"></a>00029 <span class="comment"> Type : 2 (This indicate that we are using the Generic NMEA library)</span>
<a name="l00030"></a>00030 <span class="comment"> new_data : 1 when a new data is received.</span>
<a name="l00031"></a>00031 <span class="comment"> You need to write a 0 to new_data when you read the data</span>
<a name="l00032"></a>00032 <span class="comment"> fix : &gt; = 1: GPS FIX, 0: No fix (normal logic)</span>
<a name="l00033"></a>00033 <span class="comment"> quality : 0 = No fix</span>
<a name="l00034"></a>00034 <span class="comment"> 1 = Bad (Num sats &lt; 5)</span>
<a name="l00035"></a>00035 <span class="comment"> 2 = Poor</span>
<a name="l00036"></a>00036 <span class="comment"> 3 = Medium</span>
<a name="l00037"></a>00037 <span class="comment"> 4 = Good</span>
<a name="l00038"></a>00038 <span class="comment"></span>
<a name="l00039"></a>00039 <span class="comment"> NOTE : This code has been tested on a Locosys 20031 GPS receiver (MTK chipset)</span>
<a name="l00040"></a>00040 <span class="comment">*/</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html">AP_GPS_NMEA.h</a>&quot;</span>
<a name="l00042"></a>00042
<a name="l00043"></a>00043 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00044"></a><a class="code" href="class_a_p___g_p_s___n_m_e_a.html#a4eaa6fe5af28b47aef39796145569bac">00044</a> <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#a4eaa6fe5af28b47aef39796145569bac">AP_GPS_NMEA::AP_GPS_NMEA</a>(<a class="code" href="class_stream.html">Stream</a> *s) : <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(s)
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046 }
<a name="l00047"></a>00047
<a name="l00048"></a>00048 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00049"></a>00049 <span class="keywordtype">void</span>
<a name="l00050"></a><a class="code" href="class_a_p___g_p_s___n_m_e_a.html#aea405b874a1b9921d51662e43f02316f">00050</a> <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#aea405b874a1b9921d51662e43f02316f">AP_GPS_NMEA::init</a>(<span class="keywordtype">void</span>)
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052 <span class="comment">//Type = 2;</span>
<a name="l00053"></a>00053 <span class="comment">// initialize serial port for binary protocol use</span>
<a name="l00054"></a>00054 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a5cee86e94ddffcfc20038cb24234d0ed">NMEA_OUTPUT_SENTENCES</a>);
<a name="l00055"></a>00055 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a18015ef9d3d983ac528eacc209ad90db">NMEA_OUTPUT_4HZ</a>);
<a name="l00056"></a>00056 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___m_t_k___common_8h.html#a941458433c2133250d9c607620b0d84d">SBAS_ON</a>);
<a name="l00057"></a>00057 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#ac4ef59e225a9c2940a8f5ae9ca35c82d">DGPS_SBAS</a>);
<a name="l00058"></a>00058 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;print(<a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a2a059dfbb7f68edfbbd6d5b42fa07ad4">DATUM_GOOGLE</a>);
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060
<a name="l00061"></a>00061 <span class="comment">// This code don´t wait for data, only proccess the data available on serial port</span>
<a name="l00062"></a>00062 <span class="comment">// We can call this function on the main loop (50Hz loop)</span>
<a name="l00063"></a>00063 <span class="comment">// If we get a complete packet this function call parse_nmea_gps() to parse and update the GPS info.</span>
<a name="l00064"></a>00064 <span class="keywordtype">bool</span>
<a name="l00065"></a><a class="code" href="class_a_p___g_p_s___n_m_e_a.html#a57afd3ecfcdc92db462c09e55399fa91">00065</a> <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#a57afd3ecfcdc92db462c09e55399fa91">AP_GPS_NMEA::read</a>(<span class="keywordtype">void</span>)
<a name="l00066"></a>00066 {
<a name="l00067"></a>00067 <span class="keywordtype">char</span> c;
<a name="l00068"></a>00068 <span class="keywordtype">int</span> numc;
<a name="l00069"></a>00069 <span class="keywordtype">int</span> i;
<a name="l00070"></a>00070 <span class="keywordtype">bool</span> parsed = <span class="keyword">false</span>;
<a name="l00071"></a>00071
<a name="l00072"></a>00072 numc = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#adb912146b71c46ce62d22412b819adcb">available</a>();
<a name="l00073"></a>00073
<a name="l00074"></a>00074 <span class="keywordflow">if</span> (numc &gt; 0){
<a name="l00075"></a>00075 <span class="keywordflow">for</span> (i = 0; i &lt; numc; i++){
<a name="l00076"></a>00076 c = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a4de9545ea7065d408c3efdb97f55dc2b">read</a>();
<a name="l00077"></a>00077 <span class="keywordflow">if</span> (c == <span class="charliteral">&#39;$&#39;</span>){ <span class="comment">// NMEA Start</span>
<a name="l00078"></a>00078 bufferidx = 0;
<a name="l00079"></a>00079 buffer[bufferidx++] = c;
<a name="l00080"></a>00080 GPS_checksum = 0;
<a name="l00081"></a>00081 GPS_checksum_calc = <span class="keyword">true</span>;
<a name="l00082"></a>00082 <span class="keywordflow">continue</span>;
<a name="l00083"></a>00083 }
<a name="l00084"></a>00084 <span class="keywordflow">if</span> (c == <span class="charliteral">&#39;\r&#39;</span>){ <span class="comment">// NMEA End</span>
<a name="l00085"></a>00085 buffer[bufferidx++] = 0;
<a name="l00086"></a>00086 parsed = parse_nmea_gps();
<a name="l00087"></a>00087 } <span class="keywordflow">else</span> {
<a name="l00088"></a>00088 <span class="keywordflow">if</span> (bufferidx &lt; (<a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a6486b66235cb53c791764d04331fdeca">GPS_BUFFERSIZE</a> - 1)){
<a name="l00089"></a>00089 <span class="keywordflow">if</span> (c == <span class="charliteral">&#39;*&#39;</span>)
<a name="l00090"></a>00090 GPS_checksum_calc = <span class="keyword">false</span>; <span class="comment">// Checksum calculation end</span>
<a name="l00091"></a>00091 buffer[bufferidx++] = c;
<a name="l00092"></a>00092 <span class="keywordflow">if</span> (GPS_checksum_calc){
<a name="l00093"></a>00093 GPS_checksum ^= c; <span class="comment">// XOR </span>
<a name="l00094"></a>00094 }
<a name="l00095"></a>00095 } <span class="keywordflow">else</span> {
<a name="l00096"></a>00096 bufferidx = 0; <span class="comment">// Buffer overflow : restart</span>
<a name="l00097"></a>00097 }
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099 }
<a name="l00100"></a>00100 }
<a name="l00101"></a>00101 }
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="comment">/****************************************************************</span>
<a name="l00104"></a>00104 <span class="comment"> * </span>
<a name="l00105"></a>00105 <span class="comment"> * * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * ** * **/</span>
<a name="l00106"></a>00106 <span class="comment">// Private Methods //////////////////////////////////////////////////////////////</span>
<a name="l00107"></a>00107 <span class="keywordtype">bool</span>
<a name="l00108"></a>00108 AP_GPS_NMEA::parse_nmea_gps(<span class="keywordtype">void</span>)
<a name="l00109"></a>00109 {
<a name="l00110"></a>00110 uint8_t NMEA_check;
<a name="l00111"></a>00111 <span class="keywordtype">long</span> aux_deg;
<a name="l00112"></a>00112 <span class="keywordtype">long</span> aux_min;
<a name="l00113"></a>00113 <span class="keywordtype">char</span> *parseptr;
<a name="l00114"></a>00114
<a name="l00115"></a>00115 <span class="keywordflow">if</span> (strncmp(buffer,<span class="stringliteral">&quot;$GPGGA&quot;</span>,6)==0){ <span class="comment">// Check if sentence begins with $GPGGA</span>
<a name="l00116"></a>00116 <span class="keywordflow">if</span> (buffer[bufferidx-4]==<span class="charliteral">&#39;*&#39;</span>){ <span class="comment">// Check for the &quot;*&quot; character</span>
<a name="l00117"></a>00117 NMEA_check = parseHex(buffer[bufferidx - 3]) * 16 + parseHex(buffer[bufferidx - 2]); <span class="comment">// Read the checksums characters</span>
<a name="l00118"></a>00118 <span class="keywordflow">if</span> (GPS_checksum == NMEA_check){ <span class="comment">// Checksum validation</span>
<a name="l00119"></a>00119 <span class="comment">//Serial.println(&quot;buffer&quot;);</span>
<a name="l00120"></a>00120 parseptr = strchr(buffer, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00121"></a>00121 <span class="comment">//parseptr = strchr(parseptr, &#39;,&#39;)+1;</span>
<a name="l00122"></a>00122 <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a> = parsenumber(parseptr, 2); <span class="comment">// GPS UTC time hhmmss.ss</span>
<a name="l00123"></a>00123 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00124"></a>00124 aux_deg = parsedecimal(parseptr, 2); <span class="comment">// degrees</span>
<a name="l00125"></a>00125 aux_min = parsenumber(parseptr + 2, 4); <span class="comment">// minutes (sexagesimal) =&gt; Convert to decimal</span>
<a name="l00126"></a>00126 <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a> = aux_deg * 10000000 + (aux_min * 50) / 3; <span class="comment">// degrees + minutes / 0.6 ( * 10000000) (0.6 = 3 / 5)</span>
<a name="l00127"></a>00127 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00128"></a>00128 <span class="keywordflow">if</span> ( * parseptr == <span class="charliteral">&#39;S&#39;</span>)
<a name="l00129"></a>00129 <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a> = -1 * <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a>; <span class="comment">// South latitudes are negative</span>
<a name="l00130"></a>00130 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00131"></a>00131 <span class="comment">// W longitudes are Negative</span>
<a name="l00132"></a>00132 aux_deg = parsedecimal(parseptr, 3); <span class="comment">// degrees</span>
<a name="l00133"></a>00133 aux_min = parsenumber(parseptr + 3, 4); <span class="comment">// minutes (sexagesimal)</span>
<a name="l00134"></a>00134 <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a> = aux_deg * 10000000 + (aux_min * 50) / 3; <span class="comment">// degrees + minutes / 0.6 ( * 10000000)</span>
<a name="l00135"></a>00135 <span class="comment">//longitude = -1*longitude; // This Assumes that we are in W longitudes...</span>
<a name="l00136"></a>00136 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00137"></a>00137 <span class="keywordflow">if</span> ( * parseptr == <span class="charliteral">&#39;W&#39;</span>)
<a name="l00138"></a>00138 <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a> = -1 * <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a>; <span class="comment">// West longitudes are negative</span>
<a name="l00139"></a>00139 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00140"></a>00140 <a class="code" href="class_g_p_s.html#a0b2a93a9f1d0e234d791177ea5f42078" title="true if we have a position fix (use status instead)">fix</a> = parsedecimal(parseptr, 1);
<a name="l00141"></a>00141 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00142"></a>00142 <a class="code" href="class_g_p_s.html#ada1d7424a7a9afa17cfffcd73f741971" title="Number of visible satelites.">num_sats</a> = parsedecimal(parseptr, 2);
<a name="l00143"></a>00143 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00144"></a>00144 <a class="code" href="class_g_p_s.html#a354808671a37cd3d8681e51a7d809bcb" title="horizontal dilution of precision in cm">hdop</a> = parsenumber(parseptr, 1); <span class="comment">// HDOP * 10</span>
<a name="l00145"></a>00145 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00146"></a>00146 <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a> = parsenumber(parseptr, 1) * 100; <span class="comment">// altitude in decimeters * 100 = milimeters</span>
<a name="l00147"></a>00147 <span class="keywordflow">if</span> (<a class="code" href="class_g_p_s.html#a0b2a93a9f1d0e234d791177ea5f42078" title="true if we have a position fix (use status instead)">fix</a> &lt; 1)
<a name="l00148"></a>00148 <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#af97219537af4a5437b30c968abf7fad0">quality</a> = 0; <span class="comment">// No FIX</span>
<a name="l00149"></a>00149 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="class_g_p_s.html#ada1d7424a7a9afa17cfffcd73f741971" title="Number of visible satelites.">num_sats</a> &lt; 5)
<a name="l00150"></a>00150 <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#af97219537af4a5437b30c968abf7fad0">quality</a> = 1; <span class="comment">// Bad (Num sats &lt; 5)</span>
<a name="l00151"></a>00151 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="class_g_p_s.html#a354808671a37cd3d8681e51a7d809bcb" title="horizontal dilution of precision in cm">hdop</a> &gt; 30)
<a name="l00152"></a>00152 <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#af97219537af4a5437b30c968abf7fad0">quality</a> = 2; <span class="comment">// Poor (HDOP &gt; 30)</span>
<a name="l00153"></a>00153 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="class_g_p_s.html#a354808671a37cd3d8681e51a7d809bcb" title="horizontal dilution of precision in cm">hdop</a> &gt; 25)
<a name="l00154"></a>00154 <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#af97219537af4a5437b30c968abf7fad0">quality</a> = 3; <span class="comment">// Medium (HDOP &gt; 25)</span>
<a name="l00155"></a>00155 <span class="keywordflow">else</span>
<a name="l00156"></a>00156 <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#af97219537af4a5437b30c968abf7fad0">quality</a> = 4; <span class="comment">// Good (HDOP &lt; 25)</span>
<a name="l00157"></a>00157 } <span class="keywordflow">else</span> {
<a name="l00158"></a>00158 <a class="code" href="class_g_p_s.html#acfd79aa1f9bcad32c0b89c2b16d150cf">_error</a>(<span class="stringliteral">&quot;GPSERR: Checksum error!!\n&quot;</span>);
<a name="l00159"></a>00159 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161 }
<a name="l00162"></a>00162 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(buffer,<span class="stringliteral">&quot;$GPVTG&quot;</span>,6)==0){ <span class="comment">// Check if sentence begins with $GPVTG</span>
<a name="l00163"></a>00163 <span class="comment">//Serial.println(buffer);</span>
<a name="l00164"></a>00164 <span class="keywordflow">if</span> (buffer[bufferidx-4]==<span class="charliteral">&#39;*&#39;</span>){ <span class="comment">// Check for the &quot;*&quot; character</span>
<a name="l00165"></a>00165 NMEA_check = parseHex(buffer[bufferidx - 3]) * 16 + parseHex(buffer[bufferidx - 2]); <span class="comment">// Read the checksums characters</span>
<a name="l00166"></a>00166 <span class="keywordflow">if</span> (GPS_checksum == NMEA_check){ <span class="comment">// Checksum validation</span>
<a name="l00167"></a>00167 parseptr = strchr(buffer, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00168"></a>00168 <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a> = parsenumber(parseptr, 1) * 10; <span class="comment">// Ground course in degrees * 100</span>
<a name="l00169"></a>00169 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00170"></a>00170 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00171"></a>00171 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00172"></a>00172 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00173"></a>00173 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00174"></a>00174 parseptr = strchr(parseptr, <span class="charliteral">&#39;,&#39;</span>)+1;
<a name="l00175"></a>00175 <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> = parsenumber(parseptr, 1) * 100 / 36; <span class="comment">// Convert Km / h to m / s ( * 100)</span>
<a name="l00176"></a>00176 <span class="comment">//GPS_line = true;</span>
<a name="l00177"></a>00177 } <span class="keywordflow">else</span> {
<a name="l00178"></a>00178 <a class="code" href="class_g_p_s.html#acfd79aa1f9bcad32c0b89c2b16d150cf">_error</a>(<span class="stringliteral">&quot;GPSERR: Checksum error!!\n&quot;</span>);
<a name="l00179"></a>00179 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182 } <span class="keywordflow">else</span> {
<a name="l00183"></a>00183 bufferidx = 0;
<a name="l00184"></a>00184 <a class="code" href="class_g_p_s.html#acfd79aa1f9bcad32c0b89c2b16d150cf">_error</a>(<span class="stringliteral">&quot;GPSERR: Bad sentence!!\n&quot;</span>);
<a name="l00185"></a>00185 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00186"></a>00186 }
<a name="l00187"></a>00187 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <span class="comment">// Parse hexadecimal numbers</span>
<a name="l00192"></a>00192 uint8_t
<a name="l00193"></a>00193 AP_GPS_NMEA::parseHex(<span class="keywordtype">char</span> c) {
<a name="l00194"></a>00194 <span class="keywordflow">if</span> (c &lt; <span class="charliteral">&#39;0&#39;</span>)
<a name="l00195"></a>00195 <span class="keywordflow">return</span> (0);
<a name="l00196"></a>00196 <span class="keywordflow">if</span> (c &lt;= <span class="charliteral">&#39;9&#39;</span>)
<a name="l00197"></a>00197 <span class="keywordflow">return</span> (c - <span class="charliteral">&#39;0&#39;</span>);
<a name="l00198"></a>00198 <span class="keywordflow">if</span> (c &lt; <span class="charliteral">&#39;A&#39;</span>)
<a name="l00199"></a>00199 <span class="keywordflow">return</span> (0);
<a name="l00200"></a>00200 <span class="keywordflow">if</span> (c &lt;= <span class="charliteral">&#39;F&#39;</span>)
<a name="l00201"></a>00201 <span class="keywordflow">return</span> ((c - <span class="charliteral">&#39;A&#39;</span>)+10);
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203
<a name="l00204"></a>00204 <span class="comment">// Decimal number parser</span>
<a name="l00205"></a>00205 <span class="keywordtype">long</span>
<a name="l00206"></a>00206 AP_GPS_NMEA::parsedecimal(<span class="keywordtype">char</span> *str, uint8_t num_car) {
<a name="l00207"></a>00207 <span class="keywordtype">long</span> d = 0;
<a name="l00208"></a>00208 uint8_t i;
<a name="l00209"></a>00209
<a name="l00210"></a>00210 i = num_car;
<a name="l00211"></a>00211 <span class="keywordflow">while</span> ((str[0] != 0) &amp;&amp; (i &gt; 0)) {
<a name="l00212"></a>00212 <span class="keywordflow">if</span> ((str[0] &gt; <span class="charliteral">&#39;9&#39;</span>) || (str[0] &lt; <span class="charliteral">&#39;0&#39;</span>))
<a name="l00213"></a>00213 <span class="keywordflow">return</span> d;
<a name="l00214"></a>00214 d *= 10;
<a name="l00215"></a>00215 d += str[0] - <span class="charliteral">&#39;0&#39;</span>;
<a name="l00216"></a>00216 str++;
<a name="l00217"></a>00217 i--;
<a name="l00218"></a>00218 }
<a name="l00219"></a>00219 <span class="keywordflow">return</span> d;
<a name="l00220"></a>00220 }
<a name="l00221"></a>00221
<a name="l00222"></a>00222 <span class="comment">// Function to parse fixed point numbers (numdec=number of decimals)</span>
<a name="l00223"></a>00223 <span class="keywordtype">long</span>
<a name="l00224"></a>00224 AP_GPS_NMEA::parsenumber(<span class="keywordtype">char</span> *str, uint8_t numdec) {
<a name="l00225"></a>00225 <span class="keywordtype">long</span> d = 0;
<a name="l00226"></a>00226 uint8_t ndec = 0;
<a name="l00227"></a>00227
<a name="l00228"></a>00228 <span class="keywordflow">while</span> (str[0] != 0) {
<a name="l00229"></a>00229 <span class="keywordflow">if</span> (str[0] == <span class="charliteral">&#39;.&#39;</span>){
<a name="l00230"></a>00230 ndec = 1;
<a name="l00231"></a>00231 } <span class="keywordflow">else</span> {
<a name="l00232"></a>00232 <span class="keywordflow">if</span> ((str[0] &gt; <span class="charliteral">&#39;9&#39;</span>) || (str[0] &lt; <span class="charliteral">&#39;0&#39;</span>))
<a name="l00233"></a>00233 <span class="keywordflow">return</span> d;
<a name="l00234"></a>00234 d *= 10;
<a name="l00235"></a>00235 d += str[0] - <span class="charliteral">&#39;0&#39;</span>;
<a name="l00236"></a>00236 <span class="keywordflow">if</span> (ndec &gt; 0)
<a name="l00237"></a>00237 ndec++;
<a name="l00238"></a>00238 <span class="keywordflow">if</span> (ndec &gt; numdec) <span class="comment">// we reach the number of decimals...</span>
<a name="l00239"></a>00239 <span class="keywordflow">return</span> d;
<a name="l00240"></a>00240 }
<a name="l00241"></a>00241 str++;
<a name="l00242"></a>00242 }
<a name="l00243"></a>00243 <span class="keywordflow">return</span> d;
<a name="l00244"></a>00244 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,387 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_NMEA.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_GPS_NMEA.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_NMEA.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___n_m_e_a_8h__incl.png" border="0" usemap="#_a_p___g_p_s___n_m_e_a_8h" alt=""/></div>
<map name="_a_p___g_p_s___n_m_e_a_8h" id="_a_p___g_p_s___n_m_e_a_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,83,132,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___n_m_e_a_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___n_m_e_a_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___n_m_e_a_8hdep" id="_a_p___g_p_s___n_m_e_a_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node16" href="_a_p___g_p_s___n_m_e_a_8cpp.html" title="AP_GPS_NMEA.cpp" alt="" coords="217,83,361,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s___n_m_e_a_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___n_m_e_a.html">AP_GPS_NMEA</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a6486b66235cb53c791764d04331fdeca">GPS_BUFFERSIZE</a>&nbsp;&nbsp;&nbsp;120</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a5cee86e94ddffcfc20038cb24234d0ed">NMEA_OUTPUT_SENTENCES</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK314,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a0919db8449a7077d3acfcc8e1a300d8a">NMEA_BAUD_RATE_4800</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,4800,8,1,0*0E\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a6c196175c4a3d09ec72eeafb178dc96e">NMEA_BAUD_RATE_9600</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,9600,8,1,0*0D\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a3eb3a75fad3a924c8e3d4528a9529a87">NMEA_BAUD_RATE_19200</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,19200,8,1,0*38\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a4292948f1ac7375919d50c73eab7ed1a">NMEA_BAUD_RATE_38400</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,38400,8,1,0*3D\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a9e97dee8dfd24df1485e929edf649061">NMEA_BAUD_RATE_57600</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,57600,8,1,0*36\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#ad50e3481327a98377b8988c1337a234f">NMEA_OUTPUT_1HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,1000*1F\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#aadfecc7b51d009907a9ce4193ef867ab">NMEA_OUTPUT_2HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,500*2B\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a18015ef9d3d983ac528eacc209ad90db">NMEA_OUTPUT_4HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,250*29\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a0b2b9b42d34ce26a4a5a60adbb3c8912">NMEA_OTUPUT_5HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,200*2C\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a64483c0bf780dbf01bf2a98dc8e30eac">NMEA_OUTPUT_10HZ</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK220,100*2F\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a941458433c2133250d9c607620b0d84d">SBAS_ON</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK313,1*2E\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#af8439fe2e67b33cf6979cfcc7d243123">SBAS_OFF</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK313,0*2F\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#ac01972b6ab1ea0348819a7201e3429b8">WAAS_ON</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF151,1*3F\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#af331fb3f9871b06d501c3b0025bbeca7">WAAS_OFF</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF151,0*3E\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#aa3b46aca7b8acaa7bfd18c7b24785cc6">DGPS_OFF</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK301,0*2C\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a5b2aace4c3f45fa434f9c9354bc532fb">DGPS_RTCM</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK301,1*2D\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#ac4ef59e225a9c2940a8f5ae9ca35c82d">DGPS_SBAS</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK301,2*2E\r\n&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___n_m_e_a_8h.html#a2a059dfbb7f68edfbbd6d5b42fa07ad4">DATUM_GOOGLE</a>&nbsp;&nbsp;&nbsp;&quot;$PMTK330,0*2E\r\n&quot;</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a2a059dfbb7f68edfbbd6d5b42fa07ad4"></a><!-- doxytag: member="AP_GPS_NMEA.h::DATUM_GOOGLE" ref="a2a059dfbb7f68edfbbd6d5b42fa07ad4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DATUM_GOOGLE&nbsp;&nbsp;&nbsp;&quot;$PMTK330,0*2E\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00032">32</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="aa3b46aca7b8acaa7bfd18c7b24785cc6"></a><!-- doxytag: member="AP_GPS_NMEA.h::DGPS_OFF" ref="aa3b46aca7b8acaa7bfd18c7b24785cc6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DGPS_OFF&nbsp;&nbsp;&nbsp;&quot;$PMTK301,0*2C\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00028">28</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5b2aace4c3f45fa434f9c9354bc532fb"></a><!-- doxytag: member="AP_GPS_NMEA.h::DGPS_RTCM" ref="a5b2aace4c3f45fa434f9c9354bc532fb" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DGPS_RTCM&nbsp;&nbsp;&nbsp;&quot;$PMTK301,1*2D\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00029">29</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac4ef59e225a9c2940a8f5ae9ca35c82d"></a><!-- doxytag: member="AP_GPS_NMEA.h::DGPS_SBAS" ref="ac4ef59e225a9c2940a8f5ae9ca35c82d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DGPS_SBAS&nbsp;&nbsp;&nbsp;&quot;$PMTK301,2*2E\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00030">30</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6486b66235cb53c791764d04331fdeca"></a><!-- doxytag: member="AP_GPS_NMEA.h::GPS_BUFFERSIZE" ref="a6486b66235cb53c791764d04331fdeca" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GPS_BUFFERSIZE&nbsp;&nbsp;&nbsp;120</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00006">6</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3eb3a75fad3a924c8e3d4528a9529a87"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_BAUD_RATE_19200" ref="a3eb3a75fad3a924c8e3d4528a9529a87" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_BAUD_RATE_19200&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,19200,8,1,0*38\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00012">12</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4292948f1ac7375919d50c73eab7ed1a"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_BAUD_RATE_38400" ref="a4292948f1ac7375919d50c73eab7ed1a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_BAUD_RATE_38400&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,38400,8,1,0*3D\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00013">13</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0919db8449a7077d3acfcc8e1a300d8a"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_BAUD_RATE_4800" ref="a0919db8449a7077d3acfcc8e1a300d8a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_BAUD_RATE_4800&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,4800,8,1,0*0E\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00010">10</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a9e97dee8dfd24df1485e929edf649061"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_BAUD_RATE_57600" ref="a9e97dee8dfd24df1485e929edf649061" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_BAUD_RATE_57600&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,57600,8,1,0*36\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00014">14</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6c196175c4a3d09ec72eeafb178dc96e"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_BAUD_RATE_9600" ref="a6c196175c4a3d09ec72eeafb178dc96e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_BAUD_RATE_9600&nbsp;&nbsp;&nbsp;&quot;$PSRF100,1,9600,8,1,0*0D\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00011">11</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a0b2b9b42d34ce26a4a5a60adbb3c8912"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_OTUPUT_5HZ" ref="a0b2b9b42d34ce26a4a5a60adbb3c8912" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_OTUPUT_5HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,200*2C\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00019">19</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a64483c0bf780dbf01bf2a98dc8e30eac"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_OUTPUT_10HZ" ref="a64483c0bf780dbf01bf2a98dc8e30eac" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_OUTPUT_10HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,100*2F\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00020">20</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="ad50e3481327a98377b8988c1337a234f"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_OUTPUT_1HZ" ref="ad50e3481327a98377b8988c1337a234f" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_OUTPUT_1HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,1000*1F\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00016">16</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="aadfecc7b51d009907a9ce4193ef867ab"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_OUTPUT_2HZ" ref="aadfecc7b51d009907a9ce4193ef867ab" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_OUTPUT_2HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,500*2B\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00017">17</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a18015ef9d3d983ac528eacc209ad90db"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_OUTPUT_4HZ" ref="a18015ef9d3d983ac528eacc209ad90db" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_OUTPUT_4HZ&nbsp;&nbsp;&nbsp;&quot;$PMTK220,250*29\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00018">18</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5cee86e94ddffcfc20038cb24234d0ed"></a><!-- doxytag: member="AP_GPS_NMEA.h::NMEA_OUTPUT_SENTENCES" ref="a5cee86e94ddffcfc20038cb24234d0ed" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NMEA_OUTPUT_SENTENCES&nbsp;&nbsp;&nbsp;&quot;$PMTK314,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00008">8</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="af8439fe2e67b33cf6979cfcc7d243123"></a><!-- doxytag: member="AP_GPS_NMEA.h::SBAS_OFF" ref="af8439fe2e67b33cf6979cfcc7d243123" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SBAS_OFF&nbsp;&nbsp;&nbsp;&quot;$PMTK313,0*2F\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00023">23</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="a941458433c2133250d9c607620b0d84d"></a><!-- doxytag: member="AP_GPS_NMEA.h::SBAS_ON" ref="a941458433c2133250d9c607620b0d84d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SBAS_ON&nbsp;&nbsp;&nbsp;&quot;$PMTK313,1*2E\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00022">22</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="af331fb3f9871b06d501c3b0025bbeca7"></a><!-- doxytag: member="AP_GPS_NMEA.h::WAAS_OFF" ref="af331fb3f9871b06d501c3b0025bbeca7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define WAAS_OFF&nbsp;&nbsp;&nbsp;&quot;$PSRF151,0*3E\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00026">26</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac01972b6ab1ea0348819a7201e3429b8"></a><!-- doxytag: member="AP_GPS_NMEA.h::WAAS_ON" ref="ac01972b6ab1ea0348819a7201e3429b8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define WAAS_ON&nbsp;&nbsp;&nbsp;&quot;$PSRF151,1*3F\r\n&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html#l00025">25</a> of file <a class="el" href="_a_p___g_p_s___n_m_e_a_8h_source.html">AP_GPS_NMEA.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,98 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_NMEA.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_NMEA.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___n_m_e_a_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="preprocessor">#ifndef AP_GPS_NMEA_h</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_NMEA_h</span>
<a name="l00004"></a>00004 <span class="preprocessor"></span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00006"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a6486b66235cb53c791764d04331fdeca">00006</a> <span class="preprocessor">#define GPS_BUFFERSIZE 120 </span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a5cee86e94ddffcfc20038cb24234d0ed">00008</a> <span class="preprocessor">#define NMEA_OUTPUT_SENTENCES &quot;$PMTK314,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n&quot; //Set GPGGA and GPVTG</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span>
<a name="l00010"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a0919db8449a7077d3acfcc8e1a300d8a">00010</a> <span class="preprocessor">#define NMEA_BAUD_RATE_4800 &quot;$PSRF100,1,4800,8,1,0*0E\r\n&quot;</span>
<a name="l00011"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a6c196175c4a3d09ec72eeafb178dc96e">00011</a> <span class="preprocessor"></span><span class="preprocessor">#define NMEA_BAUD_RATE_9600 &quot;$PSRF100,1,9600,8,1,0*0D\r\n&quot;</span>
<a name="l00012"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a3eb3a75fad3a924c8e3d4528a9529a87">00012</a> <span class="preprocessor"></span><span class="preprocessor">#define NMEA_BAUD_RATE_19200 &quot;$PSRF100,1,19200,8,1,0*38\r\n&quot;</span>
<a name="l00013"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a4292948f1ac7375919d50c73eab7ed1a">00013</a> <span class="preprocessor"></span><span class="preprocessor">#define NMEA_BAUD_RATE_38400 &quot;$PSRF100,1,38400,8,1,0*3D\r\n&quot; </span>
<a name="l00014"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a9e97dee8dfd24df1485e929edf649061">00014</a> <span class="preprocessor"></span><span class="preprocessor">#define NMEA_BAUD_RATE_57600 &quot;$PSRF100,1,57600,8,1,0*36\r\n&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#ad50e3481327a98377b8988c1337a234f">00016</a> <span class="preprocessor">#define NMEA_OUTPUT_1HZ &quot;$PMTK220,1000*1F\r\n&quot;</span>
<a name="l00017"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#aadfecc7b51d009907a9ce4193ef867ab">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define NMEA_OUTPUT_2HZ &quot;$PMTK220,500*2B\r\n&quot;</span>
<a name="l00018"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a18015ef9d3d983ac528eacc209ad90db">00018</a> <span class="preprocessor"></span><span class="preprocessor">#define NMEA_OUTPUT_4HZ &quot;$PMTK220,250*29\r\n&quot;</span>
<a name="l00019"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a0b2b9b42d34ce26a4a5a60adbb3c8912">00019</a> <span class="preprocessor"></span><span class="preprocessor">#define NMEA_OTUPUT_5HZ &quot;$PMTK220,200*2C\r\n&quot;</span>
<a name="l00020"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a64483c0bf780dbf01bf2a98dc8e30eac">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define NMEA_OUTPUT_10HZ &quot;$PMTK220,100*2F\r\n&quot;</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a941458433c2133250d9c607620b0d84d">00022</a> <span class="preprocessor">#define SBAS_ON &quot;$PMTK313,1*2E\r\n&quot;</span>
<a name="l00023"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#af8439fe2e67b33cf6979cfcc7d243123">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define SBAS_OFF &quot;$PMTK313,0*2F\r\n&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#ac01972b6ab1ea0348819a7201e3429b8">00025</a> <span class="preprocessor">#define WAAS_ON &quot;$PSRF151,1*3F\r\n&quot;</span>
<a name="l00026"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#af331fb3f9871b06d501c3b0025bbeca7">00026</a> <span class="preprocessor"></span><span class="preprocessor">#define WAAS_OFF &quot;$PSRF151,0*3E\r\n&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#aa3b46aca7b8acaa7bfd18c7b24785cc6">00028</a> <span class="preprocessor">#define DGPS_OFF &quot;$PMTK301,0*2C\r\n&quot;</span>
<a name="l00029"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a5b2aace4c3f45fa434f9c9354bc532fb">00029</a> <span class="preprocessor"></span><span class="preprocessor">#define DGPS_RTCM &quot;$PMTK301,1*2D\r\n&quot;</span>
<a name="l00030"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#ac4ef59e225a9c2940a8f5ae9ca35c82d">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define DGPS_SBAS &quot;$PMTK301,2*2E\r\n&quot;</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a><a class="code" href="_a_p___g_p_s___n_m_e_a_8h.html#a2a059dfbb7f68edfbbd6d5b42fa07ad4">00032</a> <span class="preprocessor">#define DATUM_GOOGLE &quot;$PMTK330,0*2E\r\n&quot;</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a><a class="code" href="class_a_p___g_p_s___n_m_e_a.html">00034</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___n_m_e_a.html">AP_GPS_NMEA</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>
<a name="l00035"></a>00035 {
<a name="l00036"></a>00036 <span class="keyword">public</span>:
<a name="l00037"></a>00037 <span class="comment">// Methods</span>
<a name="l00038"></a>00038 <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#a4eaa6fe5af28b47aef39796145569bac">AP_GPS_NMEA</a>(<a class="code" href="class_stream.html">Stream</a> *s);
<a name="l00039"></a>00039 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#aea405b874a1b9921d51662e43f02316f">init</a>();
<a name="l00040"></a>00040 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#a57afd3ecfcdc92db462c09e55399fa91">read</a>();
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="comment">// Properties</span>
<a name="l00043"></a><a class="code" href="class_a_p___g_p_s___n_m_e_a.html#af97219537af4a5437b30c968abf7fad0">00043</a> uint8_t <a class="code" href="class_a_p___g_p_s___n_m_e_a.html#af97219537af4a5437b30c968abf7fad0">quality</a>; <span class="comment">// GPS Signal quality</span>
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <span class="keyword">private</span>:
<a name="l00046"></a>00046 <span class="comment">// Internal variables</span>
<a name="l00047"></a>00047 uint8_t GPS_checksum;
<a name="l00048"></a>00048 uint8_t GPS_checksum_calc;
<a name="l00049"></a>00049 <span class="keywordtype">char</span> buffer[GPS_BUFFERSIZE];
<a name="l00050"></a>00050 <span class="keywordtype">int</span> bufferidx;
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="keywordtype">bool</span> parse_nmea_gps(<span class="keywordtype">void</span>);
<a name="l00053"></a>00053 uint8_t parseHex(<span class="keywordtype">char</span> c);
<a name="l00054"></a>00054 <span class="keywordtype">long</span> parsedecimal(<span class="keywordtype">char</span> *str,uint8_t num_car);
<a name="l00055"></a>00055 <span class="keywordtype">long</span> parsenumber(<span class="keywordtype">char</span> *str,uint8_t numdec);
<a name="l00056"></a>00056
<a name="l00057"></a>00057 };
<a name="l00058"></a>00058
<a name="l00059"></a>00059 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,63 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_None.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_GPS_None.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_None.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___none_8h__incl.png" border="0" usemap="#_a_p___g_p_s___none_8h" alt=""/></div>
<map name="_a_p___g_p_s___none_8h" id="_a_p___g_p_s___none_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,83,132,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___none_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___none_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___none_8hdep" id="_a_p___g_p_s___none_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s___none_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___none.html">AP_GPS_None</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,54 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_None.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_None.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___none_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="preprocessor">#ifndef AP_GPS_None_h</span>
<a name="l00004"></a>00004 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_None_h</span>
<a name="l00005"></a>00005 <span class="preprocessor"></span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00007"></a>00007
<a name="l00008"></a><a class="code" href="class_a_p___g_p_s___none.html">00008</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___none.html">AP_GPS_None</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>
<a name="l00009"></a>00009 {
<a name="l00010"></a>00010 <span class="keyword">public</span>:
<a name="l00011"></a><a class="code" href="class_a_p___g_p_s___none.html#a3a75b584108045956a28d7da5674e343">00011</a> <a class="code" href="class_a_p___g_p_s___none.html#a3a75b584108045956a28d7da5674e343">AP_GPS_None</a>(<a class="code" href="class_stream.html">Stream</a> *s) : <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(s) {}
<a name="l00012"></a><a class="code" href="class_a_p___g_p_s___none.html#a6b7235233d8b6703ded9d1293907ddf7">00012</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___none.html#a6b7235233d8b6703ded9d1293907ddf7">init</a>(<span class="keywordtype">void</span>) {};
<a name="l00013"></a><a class="code" href="class_a_p___g_p_s___none.html#a3a39bc8c0803948e35effe14ffb521d7">00013</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___none.html#a3a39bc8c0803948e35effe14ffb521d7">read</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> <span class="keyword">false</span>; };
<a name="l00014"></a>00014 };
<a name="l00015"></a>00015 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_SIRF.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_SIRF.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___g_p_s___s_i_r_f_8h_source.html">AP_GPS_SIRF.h</a>&quot;</code><br/>
<code>#include &lt;stdint.h&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_SIRF.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___s_i_r_f_8cpp__incl.png" border="0" usemap="#_a_p___g_p_s___s_i_r_f_8cpp" alt=""/></div>
<map name="_a_p___g_p_s___s_i_r_f_8cpp" id="_a_p___g_p_s___s_i_r_f_8cpp">
<area shape="rect" id="node3" href="_a_p___g_p_s___s_i_r_f_8h.html" title="AP_GPS_SIRF.h" alt="" coords="43,83,160,112"/><area shape="rect" id="node5" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,160,132,189"/></map>
</div>
<p><a href="_a_p___g_p_s___s_i_r_f_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,235 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_SIRF.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_SIRF.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___s_i_r_f_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// SiRF Binary GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith.</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___s_i_r_f_8h.html">AP_GPS_SIRF.h</a>&quot;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="comment">// Initialisation messages</span>
<a name="l00016"></a>00016 <span class="comment">//</span>
<a name="l00017"></a>00017 <span class="comment">// Turn off all messages except for 0x29.</span>
<a name="l00018"></a>00018 <span class="comment">//</span>
<a name="l00019"></a>00019 <span class="comment">// XXX the bytes show up on the wire, but at least my test unit (EM-411) seems to ignore them.</span>
<a name="l00020"></a>00020 <span class="comment">//</span>
<a name="l00021"></a>00021 <span class="keyword">static</span> uint8_t init_messages[] = {
<a name="l00022"></a>00022 0xa0, 0xa2, 0x00, 0x08, 0xa6, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xb0, 0xb3,
<a name="l00023"></a>00023 0xa0, 0xa2, 0x00, 0x08, 0xa6, 0x00, 0x29, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xb0, 0xb3
<a name="l00024"></a>00024 };
<a name="l00025"></a>00025
<a name="l00026"></a>00026 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00027"></a><a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a5d1a0dd250e9d711d9e07504b0b418b6">00027</a> <a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a5d1a0dd250e9d711d9e07504b0b418b6">AP_GPS_SIRF::AP_GPS_SIRF</a>(<a class="code" href="class_stream.html">Stream</a> *s) : <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(s)
<a name="l00028"></a>00028 {
<a name="l00029"></a>00029 }
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00032"></a>00032 <span class="keywordtype">void</span>
<a name="l00033"></a><a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a3598e3b7f9d4baf95973d2a8390b99e8">00033</a> <a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a3598e3b7f9d4baf95973d2a8390b99e8">AP_GPS_SIRF::init</a>(<span class="keywordtype">void</span>)
<a name="l00034"></a>00034 {
<a name="l00035"></a>00035 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;flush();
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="comment">// For modules that default to something other than SiRF binary,</span>
<a name="l00038"></a>00038 <span class="comment">// the module-specific subclass should take care of switching to binary mode</span>
<a name="l00039"></a>00039 <span class="comment">// before calling us.</span>
<a name="l00040"></a>00040
<a name="l00041"></a>00041 <span class="comment">// send SiRF binary setup messages</span>
<a name="l00042"></a>00042 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a46cd2d80c276134f30300d619416d5c8">write</a>(init_messages, <span class="keyword">sizeof</span>(init_messages));
<a name="l00043"></a>00043 }
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <span class="comment">// Process bytes available from the stream</span>
<a name="l00046"></a>00046 <span class="comment">//</span>
<a name="l00047"></a>00047 <span class="comment">// The stream is assumed to contain only messages we recognise. If it</span>
<a name="l00048"></a>00048 <span class="comment">// contains other messages, and those messages contain the preamble</span>
<a name="l00049"></a>00049 <span class="comment">// bytes, it is possible for this code to fail to synchronise to the</span>
<a name="l00050"></a>00050 <span class="comment">// stream immediately. Without buffering the entire message and</span>
<a name="l00051"></a>00051 <span class="comment">// re-processing it from the top, this is unavoidable. The parser</span>
<a name="l00052"></a>00052 <span class="comment">// attempts to avoid this when possible.</span>
<a name="l00053"></a>00053 <span class="comment">//</span>
<a name="l00054"></a>00054 <span class="keywordtype">bool</span>
<a name="l00055"></a><a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a8ce1b69e02ab95da6f4deff7abcf51b3">00055</a> <a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a8ce1b69e02ab95da6f4deff7abcf51b3">AP_GPS_SIRF::read</a>(<span class="keywordtype">void</span>)
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057 uint8_t data;
<a name="l00058"></a>00058 <span class="keywordtype">int</span> numc;
<a name="l00059"></a>00059 <span class="keywordtype">bool</span> parsed = <span class="keyword">false</span>;
<a name="l00060"></a>00060
<a name="l00061"></a>00061 numc = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#adb912146b71c46ce62d22412b819adcb">available</a>();
<a name="l00062"></a>00062 <span class="keywordflow">while</span>(numc--) {
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <span class="comment">// read the next byte</span>
<a name="l00065"></a>00065 data = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a4de9545ea7065d408c3efdb97f55dc2b">read</a>();
<a name="l00066"></a>00066
<a name="l00067"></a>00067 <span class="keywordflow">switch</span>(_step){
<a name="l00068"></a>00068
<a name="l00069"></a>00069 <span class="comment">// Message preamble detection</span>
<a name="l00070"></a>00070 <span class="comment">//</span>
<a name="l00071"></a>00071 <span class="comment">// If we fail to match any of the expected bytes, we reset</span>
<a name="l00072"></a>00072 <span class="comment">// the state machine and re-consider the failed byte as</span>
<a name="l00073"></a>00073 <span class="comment">// the first byte of the preamble. This improves our</span>
<a name="l00074"></a>00074 <span class="comment">// chances of recovering from a mismatch and makes it less</span>
<a name="l00075"></a>00075 <span class="comment">// likely that we will be fooled by the preamble appearing</span>
<a name="l00076"></a>00076 <span class="comment">// as data in some other message.</span>
<a name="l00077"></a>00077 <span class="comment">//</span>
<a name="l00078"></a>00078 <span class="keywordflow">case</span> 1:
<a name="l00079"></a>00079 <span class="keywordflow">if</span> (PREAMBLE2 == data) {
<a name="l00080"></a>00080 _step++;
<a name="l00081"></a>00081 <span class="keywordflow">break</span>;
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083 _step = 0;
<a name="l00084"></a>00084 <span class="comment">// FALLTHROUGH</span>
<a name="l00085"></a>00085 <span class="keywordflow">case</span> 0:
<a name="l00086"></a>00086 <span class="keywordflow">if</span>(PREAMBLE1 == data)
<a name="l00087"></a>00087 _step++;
<a name="l00088"></a>00088 <span class="keywordflow">break</span>;
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <span class="comment">// Message length</span>
<a name="l00091"></a>00091 <span class="comment">//</span>
<a name="l00092"></a>00092 <span class="comment">// We always collect the length so that we can avoid being</span>
<a name="l00093"></a>00093 <span class="comment">// fooled by preamble bytes in messages.</span>
<a name="l00094"></a>00094 <span class="comment">//</span>
<a name="l00095"></a>00095 <span class="keywordflow">case</span> 2:
<a name="l00096"></a>00096 _step++;
<a name="l00097"></a>00097 _payload_length = (uint16_t)data &lt;&lt; 8;
<a name="l00098"></a>00098 <span class="keywordflow">break</span>;
<a name="l00099"></a>00099 <span class="keywordflow">case</span> 3:
<a name="l00100"></a>00100 _step++;
<a name="l00101"></a>00101 _payload_length |= data;
<a name="l00102"></a>00102 _payload_counter = 0;
<a name="l00103"></a>00103 _checksum = 0;
<a name="l00104"></a>00104 <span class="keywordflow">break</span>;
<a name="l00105"></a>00105
<a name="l00106"></a>00106 <span class="comment">// Message header processing</span>
<a name="l00107"></a>00107 <span class="comment">//</span>
<a name="l00108"></a>00108 <span class="comment">// We sniff the message ID to determine whether we are going</span>
<a name="l00109"></a>00109 <span class="comment">// to gather the message bytes or just discard them.</span>
<a name="l00110"></a>00110 <span class="comment">//</span>
<a name="l00111"></a>00111 <span class="keywordflow">case</span> 4:
<a name="l00112"></a>00112 _step++;
<a name="l00113"></a>00113 _accumulate(data);
<a name="l00114"></a>00114 _payload_length--;
<a name="l00115"></a>00115 _gather = <span class="keyword">false</span>;
<a name="l00116"></a>00116 <span class="keywordflow">switch</span>(data) {
<a name="l00117"></a>00117 <span class="keywordflow">case</span> MSG_GEONAV:
<a name="l00118"></a>00118 <span class="keywordflow">if</span> (_payload_length == <span class="keyword">sizeof</span>(sirf_geonav)) {
<a name="l00119"></a>00119 _gather = <span class="keyword">true</span>;
<a name="l00120"></a>00120 _msg_id = data;
<a name="l00121"></a>00121 }
<a name="l00122"></a>00122 <span class="keywordflow">break</span>;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 <span class="keywordflow">break</span>;
<a name="l00125"></a>00125
<a name="l00126"></a>00126 <span class="comment">// Receive message data</span>
<a name="l00127"></a>00127 <span class="comment">//</span>
<a name="l00128"></a>00128 <span class="comment">// Note that we are effectively guaranteed by the protocol</span>
<a name="l00129"></a>00129 <span class="comment">// that the checksum and postamble cannot be mistaken for</span>
<a name="l00130"></a>00130 <span class="comment">// the preamble, so if we are discarding bytes in this</span>
<a name="l00131"></a>00131 <span class="comment">// message when the payload is done we return directly</span>
<a name="l00132"></a>00132 <span class="comment">// to the preamble detector rather than bothering with</span>
<a name="l00133"></a>00133 <span class="comment">// the checksum logic.</span>
<a name="l00134"></a>00134 <span class="comment">//</span>
<a name="l00135"></a>00135 <span class="keywordflow">case</span> 5:
<a name="l00136"></a>00136 <span class="keywordflow">if</span> (_gather) { <span class="comment">// gather data if requested</span>
<a name="l00137"></a>00137 _accumulate(data);
<a name="l00138"></a>00138 _buffer.bytes[_payload_counter] = data;
<a name="l00139"></a>00139 <span class="keywordflow">if</span> (++_payload_counter == _payload_length)
<a name="l00140"></a>00140 _step++;
<a name="l00141"></a>00141 } <span class="keywordflow">else</span> {
<a name="l00142"></a>00142 <span class="keywordflow">if</span> (++_payload_counter == _payload_length)
<a name="l00143"></a>00143 _step = 0;
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 <span class="keywordflow">break</span>;
<a name="l00146"></a>00146
<a name="l00147"></a>00147 <span class="comment">// Checksum and message processing</span>
<a name="l00148"></a>00148 <span class="comment">//</span>
<a name="l00149"></a>00149 <span class="keywordflow">case</span> 6:
<a name="l00150"></a>00150 _step++;
<a name="l00151"></a>00151 <span class="keywordflow">if</span> ((_checksum &gt;&gt; 8) != data) {
<a name="l00152"></a>00152 <a class="code" href="class_g_p_s.html#acfd79aa1f9bcad32c0b89c2b16d150cf">_error</a>(<span class="stringliteral">&quot;GPS_SIRF: checksum error\n&quot;</span>);
<a name="l00153"></a>00153 _step = 0;
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155 <span class="keywordflow">break</span>;
<a name="l00156"></a>00156 <span class="keywordflow">case</span> 7:
<a name="l00157"></a>00157 _step = 0;
<a name="l00158"></a>00158 <span class="keywordflow">if</span> ((_checksum &amp; 0xff) != data) {
<a name="l00159"></a>00159 <a class="code" href="class_g_p_s.html#acfd79aa1f9bcad32c0b89c2b16d150cf">_error</a>(<span class="stringliteral">&quot;GPS_SIRF: checksum error\n&quot;</span>);
<a name="l00160"></a>00160 <span class="keywordflow">break</span>;
<a name="l00161"></a>00161 }
<a name="l00162"></a>00162 <span class="keywordflow">if</span> (_gather) {
<a name="l00163"></a>00163 parsed = _parse_gps(); <span class="comment">// Parse the new GPS packet</span>
<a name="l00164"></a>00164 }
<a name="l00165"></a>00165 }
<a name="l00166"></a>00166 }
<a name="l00167"></a>00167 <span class="keywordflow">return</span>(parsed);
<a name="l00168"></a>00168 }
<a name="l00169"></a>00169
<a name="l00170"></a>00170 <span class="keywordtype">bool</span>
<a name="l00171"></a>00171 AP_GPS_SIRF::_parse_gps(<span class="keywordtype">void</span>)
<a name="l00172"></a>00172 {
<a name="l00173"></a>00173 <span class="keywordflow">switch</span>(_msg_id) {
<a name="l00174"></a>00174 <span class="keywordflow">case</span> MSG_GEONAV:
<a name="l00175"></a>00175 <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.nav.time);
<a name="l00176"></a>00176 <span class="comment">//fix = (0 == _buffer.nav.fix_invalid) &amp;&amp; (FIX_3D == (_buffer.nav.fix_type &amp; FIX_MASK));</span>
<a name="l00177"></a>00177 <a class="code" href="class_g_p_s.html#a0b2a93a9f1d0e234d791177ea5f42078" title="true if we have a position fix (use status instead)">fix</a> = (0 == _buffer.nav.fix_invalid);
<a name="l00178"></a>00178 <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.nav.latitude);
<a name="l00179"></a>00179 <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.nav.longitude);
<a name="l00180"></a>00180 <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a> = <a class="code" href="class_g_p_s.html#aed9c2c8d88047b0fea17f690f9ef107f">_swapl</a>(&amp;_buffer.nav.altitude_msl);
<a name="l00181"></a>00181 <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> = <a class="code" href="class_g_p_s.html#af4358672ea2ce3a4d48f365c92aeb120">_swapi</a>(&amp;_buffer.nav.ground_speed);
<a name="l00182"></a>00182 <span class="comment">// at low speeds, ground course wanders wildly; suppress changes if we are not moving</span>
<a name="l00183"></a>00183 <span class="keywordflow">if</span> (<a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> &gt; 50)
<a name="l00184"></a>00184 <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a> = <a class="code" href="class_g_p_s.html#af4358672ea2ce3a4d48f365c92aeb120">_swapi</a>(&amp;_buffer.nav.ground_course);
<a name="l00185"></a>00185 <a class="code" href="class_g_p_s.html#ada1d7424a7a9afa17cfffcd73f741971" title="Number of visible satelites.">num_sats</a> = _buffer.nav.satellites;
<a name="l00186"></a>00186
<a name="l00187"></a>00187 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00190"></a>00190 }
<a name="l00191"></a>00191
<a name="l00192"></a>00192 <span class="keywordtype">void</span>
<a name="l00193"></a>00193 AP_GPS_SIRF::_accumulate(uint8_t val)
<a name="l00194"></a>00194 {
<a name="l00195"></a>00195 _checksum = (_checksum + val) &amp; 0x7fff;
<a name="l00196"></a>00196 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,84 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_SIRF.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_GPS_SIRF.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_SIRF.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___s_i_r_f_8h__incl.png" border="0" usemap="#_a_p___g_p_s___s_i_r_f_8h" alt=""/></div>
<map name="_a_p___g_p_s___s_i_r_f_8h" id="_a_p___g_p_s___s_i_r_f_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,83,132,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___s_i_r_f_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___s_i_r_f_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___s_i_r_f_8hdep" id="_a_p___g_p_s___s_i_r_f_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,160,193,189"/><area shape="rect" id="node16" href="_a_p___g_p_s__406_8h.html" title="AP_GPS_406.h" alt="" coords="188,83,303,112"/><area shape="rect" id="node21" href="_a_p___g_p_s___s_i_r_f_8cpp.html" title="AP_GPS_SIRF.cpp" alt="" coords="327,83,457,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,237,208,267"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,315,100,344"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,237,368,267"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,315,255,344"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,392,107,421"/><area shape="rect" id="node19" href="_a_p___g_p_s__406_8cpp.html" title="AP_GPS_406.cpp" alt="" coords="217,160,348,189"/></map>
</div>
<p><a href="_a_p___g_p_s___s_i_r_f_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___s_i_r_f.html">AP_GPS_SIRF</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>AP_GPS_SIRF::sirf_geonav</b></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___s_i_r_f_8h.html#a688aa025e0239993674de15fccc32285">SIRF_SET_BINARY</a>&nbsp;&nbsp;&nbsp;&quot;$PSRF100,0,38400,8,1,0*3C&quot;</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a688aa025e0239993674de15fccc32285"></a><!-- doxytag: member="AP_GPS_SIRF.h::SIRF_SET_BINARY" ref="a688aa025e0239993674de15fccc32285" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SIRF_SET_BINARY&nbsp;&nbsp;&nbsp;&quot;$PSRF100,0,38400,8,1,0*3C&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___s_i_r_f_8h_source.html#l00016">16</a> of file <a class="el" href="_a_p___g_p_s___s_i_r_f_8h_source.html">AP_GPS_SIRF.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,135 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_SIRF.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_SIRF.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___s_i_r_f_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// SiRF Binary GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith.</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="preprocessor">#ifndef AP_GPS_SIRF_h</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_SIRF_h</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="_a_p___g_p_s___s_i_r_f_8h.html#a688aa025e0239993674de15fccc32285">00016</a> <span class="preprocessor">#define SIRF_SET_BINARY &quot;$PSRF100,0,38400,8,1,0*3C&quot;</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a><a class="code" href="class_a_p___g_p_s___s_i_r_f.html">00018</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___s_i_r_f.html">AP_GPS_SIRF</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a> {
<a name="l00019"></a>00019 <span class="keyword">public</span>:
<a name="l00020"></a>00020 <a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a5d1a0dd250e9d711d9e07504b0b418b6">AP_GPS_SIRF</a>(<a class="code" href="class_stream.html">Stream</a> *s);
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a3598e3b7f9d4baf95973d2a8390b99e8">init</a>();
<a name="l00023"></a>00023 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a8ce1b69e02ab95da6f4deff7abcf51b3">read</a>();
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="keyword">private</span>:
<a name="l00026"></a>00026 <span class="preprocessor">#pragma pack(1)</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span> <span class="keyword">struct </span>sirf_geonav {
<a name="l00028"></a>00028 uint16_t fix_invalid;
<a name="l00029"></a>00029 uint16_t fix_type;
<a name="l00030"></a>00030 uint16_t week;
<a name="l00031"></a>00031 uint32_t <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a>;
<a name="l00032"></a>00032 uint16_t year;
<a name="l00033"></a>00033 uint8_t month;
<a name="l00034"></a>00034 uint8_t day;
<a name="l00035"></a>00035 uint8_t hour;
<a name="l00036"></a>00036 uint8_t minute;
<a name="l00037"></a>00037 uint16_t second;
<a name="l00038"></a>00038 uint32_t satellites_used;
<a name="l00039"></a>00039 int32_t <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a>;
<a name="l00040"></a>00040 int32_t <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a>;
<a name="l00041"></a>00041 int32_t altitude_ellipsoid;
<a name="l00042"></a>00042 int32_t altitude_msl;
<a name="l00043"></a>00043 int8_t map_datum;
<a name="l00044"></a>00044 int16_t <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a>;
<a name="l00045"></a>00045 int16_t <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>;
<a name="l00046"></a>00046 int16_t res1;
<a name="l00047"></a>00047 int16_t climb_rate;
<a name="l00048"></a>00048 uint16_t heading_rate;
<a name="l00049"></a>00049 uint32_t horizontal_position_error;
<a name="l00050"></a>00050 uint32_t vertical_position_error;
<a name="l00051"></a>00051 uint32_t time_error;
<a name="l00052"></a>00052 int16_t horizontal_velocity_error;
<a name="l00053"></a>00053 int32_t clock_bias;
<a name="l00054"></a>00054 uint32_t clock_bias_error;
<a name="l00055"></a>00055 int32_t clock_drift;
<a name="l00056"></a>00056 uint32_t clock_drift_error;
<a name="l00057"></a>00057 uint32_t distance;
<a name="l00058"></a>00058 uint16_t distance_error;
<a name="l00059"></a>00059 uint16_t heading_error;
<a name="l00060"></a>00060 uint8_t satellites;
<a name="l00061"></a>00061 uint8_t <a class="code" href="class_g_p_s.html#a354808671a37cd3d8681e51a7d809bcb" title="horizontal dilution of precision in cm">hdop</a>;
<a name="l00062"></a>00062 uint8_t mode_info;
<a name="l00063"></a>00063 };
<a name="l00064"></a>00064 <span class="preprocessor">#pragma pack(pop)</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span> <span class="keyword">enum</span> sirf_protocol_bytes {
<a name="l00066"></a>00066 PREAMBLE1 = 0xa0,
<a name="l00067"></a>00067 PREAMBLE2 = 0xa2,
<a name="l00068"></a>00068 POSTAMBLE1 = 0xb0,
<a name="l00069"></a>00069 POSTAMBLE2 = 0xb3,
<a name="l00070"></a>00070 MSG_GEONAV = 0x29
<a name="l00071"></a>00071 };
<a name="l00072"></a>00072 <span class="keyword">enum</span> sirf_fix_type {
<a name="l00073"></a>00073 FIX_3D = 0x6,
<a name="l00074"></a>00074 FIX_MASK = 0x7
<a name="l00075"></a>00075 };
<a name="l00076"></a>00076
<a name="l00077"></a>00077
<a name="l00078"></a>00078 <span class="comment">// State machine state</span>
<a name="l00079"></a>00079 uint8_t _step;
<a name="l00080"></a>00080 uint16_t _checksum;
<a name="l00081"></a>00081 <span class="keywordtype">bool</span> _gather;
<a name="l00082"></a>00082 uint16_t _payload_length;
<a name="l00083"></a>00083 uint16_t _payload_counter;
<a name="l00084"></a>00084 uint8_t _msg_id;
<a name="l00085"></a>00085
<a name="l00086"></a>00086 <span class="comment">// Message buffer</span>
<a name="l00087"></a>00087 <span class="keyword">union </span>{
<a name="l00088"></a><a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a12299b0ecfffaaa84ba963902eec5005">00088</a> sirf_geonav <a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a12299b0ecfffaaa84ba963902eec5005">nav</a>;
<a name="l00089"></a><a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a5bced5c2214d518ab4b88fda78ae743e">00089</a> uint8_t <a class="code" href="class_a_p___g_p_s___s_i_r_f.html#a5bced5c2214d518ab4b88fda78ae743e">bytes</a>[];
<a name="l00090"></a>00090 } _buffer;
<a name="l00091"></a>00091
<a name="l00092"></a>00092 <span class="keywordtype">bool</span> _parse_gps(<span class="keywordtype">void</span>);
<a name="l00093"></a>00093 <span class="keywordtype">void</span> _accumulate(uint8_t val);
<a name="l00094"></a>00094 };
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="preprocessor">#endif // AP_GPS_SIRF_h</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,98 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_Shim.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_GPS_Shim.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_Shim.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___shim_8h__incl.png" border="0" usemap="#_a_p___g_p_s___shim_8h" alt=""/></div>
<map name="_a_p___g_p_s___shim_8h" id="_a_p___g_p_s___shim_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,83,132,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___shim_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___shim_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___shim_8hdep" id="_a_p___g_p_s___shim_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s___shim_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___shim.html">AP_GPS_Shim</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___shim_8h.html#a29b9e62a891826a06460e53fbd5da76d">__GPS_SHIM_SET</a>(__type, __name)&nbsp;&nbsp;&nbsp;void set_##__name(__type v) { __name = v; _updated = true; }</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a29b9e62a891826a06460e53fbd5da76d"></a><!-- doxytag: member="AP_GPS_Shim.h::__GPS_SHIM_SET" ref="a29b9e62a891826a06460e53fbd5da76d" args="(__type, __name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define __GPS_SHIM_SET</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">__type, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">__name</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td>&nbsp;&nbsp;&nbsp;void set_##__name(__type v) { __name = v; _updated = true; }</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set-and-mark-updated macro for the public member variables; each instance defines a member function set_&lt;variable&gt;(&lt;type&gt;) </p>
<p>Definition at line <a class="el" href="_a_p___g_p_s___shim_8h_source.html#l00032">32</a> of file <a class="el" href="_a_p___g_p_s___shim_8h_source.html">AP_GPS_Shim.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,83 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_Shim.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_Shim.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___shim_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// Shim GPS driver, for use when the actual GPS data is coming from somewhere else.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Mike Smith</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">//</span>
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef AP_GPS_Shim_h</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_Shim_h</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00016"></a>00016
<a name="l00017"></a><a class="code" href="class_a_p___g_p_s___shim.html">00017</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___shim.html">AP_GPS_Shim</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>
<a name="l00018"></a>00018 {
<a name="l00019"></a>00019 <span class="keyword">public</span>:
<a name="l00020"></a><a class="code" href="class_a_p___g_p_s___shim.html#a3eea7f9ae07e9f4ed536a3d5c314fc9c">00020</a> <a class="code" href="class_a_p___g_p_s___shim.html#a3eea7f9ae07e9f4ed536a3d5c314fc9c">AP_GPS_Shim</a>() : <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(NULL) {}
<a name="l00021"></a>00021
<a name="l00022"></a><a class="code" href="class_a_p___g_p_s___shim.html#a47becfc7f88ff5690718c1e73f738d42">00022</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___shim.html#a47becfc7f88ff5690718c1e73f738d42">init</a>(<span class="keywordtype">void</span>) {};
<a name="l00023"></a><a class="code" href="class_a_p___g_p_s___shim.html#acfa0308ba1a622a80a8b96edaeeabea9">00023</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___shim.html#acfa0308ba1a622a80a8b96edaeeabea9">read</a>(<span class="keywordtype">void</span>) {
<a name="l00024"></a>00024 <span class="keywordtype">bool</span> updated = _updated;
<a name="l00025"></a>00025 _updated = <span class="keyword">false</span>;
<a name="l00026"></a>00026 <span class="keywordflow">return</span> _updated;
<a name="l00027"></a>00027 }
<a name="l00028"></a>00028
<a name="l00032"></a><a class="code" href="_a_p___g_p_s___shim_8h.html#a29b9e62a891826a06460e53fbd5da76d">00032</a> <span class="preprocessor">#define __GPS_SHIM_SET(__type, __name) void set_##__name(__type v) { __name = v; _updated = true; }</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span> <a class="code" href="class_a_p___g_p_s___shim.html#a545d123a1bf7191d1400d291bd3020e0">__GPS_SHIM_SET</a>(<span class="keywordtype">long</span>, <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a>);
<a name="l00034"></a>00034 <a class="code" href="class_a_p___g_p_s___shim.html#a545d123a1bf7191d1400d291bd3020e0">__GPS_SHIM_SET</a>(<span class="keywordtype">long</span>, <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a>);
<a name="l00035"></a>00035 <a class="code" href="class_a_p___g_p_s___shim.html#a545d123a1bf7191d1400d291bd3020e0">__GPS_SHIM_SET</a>(<span class="keywordtype">long</span>, <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a>);
<a name="l00036"></a>00036 <a class="code" href="class_a_p___g_p_s___shim.html#a545d123a1bf7191d1400d291bd3020e0">__GPS_SHIM_SET</a>(<span class="keywordtype">long</span>, <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a>);
<a name="l00037"></a>00037 <a class="code" href="class_a_p___g_p_s___shim.html#a545d123a1bf7191d1400d291bd3020e0">__GPS_SHIM_SET</a>(<span class="keywordtype">long</span>, <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a>);
<a name="l00038"></a>00038 <a class="code" href="class_a_p___g_p_s___shim.html#a545d123a1bf7191d1400d291bd3020e0">__GPS_SHIM_SET</a>(<span class="keywordtype">long</span>, <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a>);
<a name="l00039"></a>00039 <a class="code" href="class_a_p___g_p_s___shim.html#a545d123a1bf7191d1400d291bd3020e0">__GPS_SHIM_SET</a>(<span class="keywordtype">long</span>, <a class="code" href="class_g_p_s.html#a39fa3ac4a5d784f63c934cdc37eac8b6" title="3D speed in cm/sec (not always available)">speed_3d</a>);
<a name="l00040"></a>00040 <a class="code" href="class_a_p___g_p_s___shim.html#a545d123a1bf7191d1400d291bd3020e0">__GPS_SHIM_SET</a>(<span class="keywordtype">int</span>, <a class="code" href="class_g_p_s.html#a354808671a37cd3d8681e51a7d809bcb" title="horizontal dilution of precision in cm">hdop</a>);
<a name="l00041"></a>00041 <span class="preprocessor">#undef __GPS_SHIM_SET</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span>
<a name="l00043"></a>00043 <span class="keyword">private</span>:
<a name="l00044"></a>00044 <span class="keywordtype">bool</span> _updated;
<a name="l00045"></a>00045 };
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <span class="preprocessor">#endif // AP_GPS_HIL_H</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,52 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_UBLOX.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_UBLOX.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___g_p_s___u_b_l_o_x_8h_source.html">AP_GPS_UBLOX.h</a>&quot;</code><br/>
<code>#include &lt;stdint.h&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_UBLOX.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___u_b_l_o_x_8cpp__incl.png" border="0" usemap="#_a_p___g_p_s___u_b_l_o_x_8cpp" alt=""/></div>
<map name="_a_p___g_p_s___u_b_l_o_x_8cpp" id="_a_p___g_p_s___u_b_l_o_x_8cpp">
<area shape="rect" id="node3" href="_a_p___g_p_s___u_b_l_o_x_8h.html" title="AP_GPS_UBLOX.h" alt="" coords="35,83,168,112"/><area shape="rect" id="node5" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,160,132,189"/></map>
</div>
<p><a href="_a_p___g_p_s___u_b_l_o_x_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,229 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_UBLOX.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_UBLOX.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___u_b_l_o_x_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// u-blox UBX GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jordi Munoz and Jose Julio, DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___g_p_s___u_b_l_o_x_8h.html">AP_GPS_UBLOX.h</a>&quot;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="comment">// Constructors ////////////////////////////////////////////////////////////////</span>
<a name="l00016"></a>00016
<a name="l00017"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#ae9fb4a8dad01cffb9d6596bae90713c5">00017</a> <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#ae9fb4a8dad01cffb9d6596bae90713c5">AP_GPS_UBLOX::AP_GPS_UBLOX</a>(<a class="code" href="class_stream.html">Stream</a> *s) : <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>(s)
<a name="l00018"></a>00018 {
<a name="l00019"></a>00019 }
<a name="l00020"></a>00020
<a name="l00021"></a>00021 <span class="comment">// Public Methods //////////////////////////////////////////////////////////////</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="keywordtype">void</span>
<a name="l00024"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a65b970c80810a684a7b9435c7116c6fc">00024</a> <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a65b970c80810a684a7b9435c7116c6fc">AP_GPS_UBLOX::init</a>(<span class="keywordtype">void</span>)
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026 <span class="comment">// XXX it might make sense to send some CFG_MSG,CFG_NMEA messages to get the </span>
<a name="l00027"></a>00027 <span class="comment">// right reporting configuration.</span>
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;flush();
<a name="l00030"></a>00030 }
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="comment">// Process bytes available from the stream</span>
<a name="l00033"></a>00033 <span class="comment">//</span>
<a name="l00034"></a>00034 <span class="comment">// The stream is assumed to contain only messages we recognise. If it</span>
<a name="l00035"></a>00035 <span class="comment">// contains other messages, and those messages contain the preamble</span>
<a name="l00036"></a>00036 <span class="comment">// bytes, it is possible for this code to fail to synchronise to the</span>
<a name="l00037"></a>00037 <span class="comment">// stream immediately. Without buffering the entire message and</span>
<a name="l00038"></a>00038 <span class="comment">// re-processing it from the top, this is unavoidable. The parser</span>
<a name="l00039"></a>00039 <span class="comment">// attempts to avoid this when possible.</span>
<a name="l00040"></a>00040 <span class="comment">//</span>
<a name="l00041"></a>00041 <span class="keywordtype">bool</span>
<a name="l00042"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a09825f5ca37ee9bdb5e0939a4073a84e">00042</a> <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a09825f5ca37ee9bdb5e0939a4073a84e">AP_GPS_UBLOX::read</a>(<span class="keywordtype">void</span>)
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044 uint8_t data;
<a name="l00045"></a>00045 <span class="keywordtype">int</span> numc;
<a name="l00046"></a>00046 <span class="keywordtype">bool</span> parsed = <span class="keyword">false</span>;
<a name="l00047"></a>00047
<a name="l00048"></a>00048 numc = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#adb912146b71c46ce62d22412b819adcb">available</a>();
<a name="l00049"></a>00049 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; numc; i++){ <span class="comment">// Process bytes received</span>
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="comment">// read the next byte</span>
<a name="l00052"></a>00052 data = <a class="code" href="class_g_p_s.html#ab534b33b2596f63c716744b6e258c6ee" title="port the GPS is attached to">_port</a>-&gt;<a class="code" href="class_stream.html#a4de9545ea7065d408c3efdb97f55dc2b">read</a>();
<a name="l00053"></a>00053
<a name="l00054"></a>00054 <span class="keywordflow">switch</span>(_step){
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="comment">// Message preamble detection</span>
<a name="l00057"></a>00057 <span class="comment">//</span>
<a name="l00058"></a>00058 <span class="comment">// If we fail to match any of the expected bytes, we reset</span>
<a name="l00059"></a>00059 <span class="comment">// the state machine and re-consider the failed byte as</span>
<a name="l00060"></a>00060 <span class="comment">// the first byte of the preamble. This improves our</span>
<a name="l00061"></a>00061 <span class="comment">// chances of recovering from a mismatch and makes it less</span>
<a name="l00062"></a>00062 <span class="comment">// likely that we will be fooled by the preamble appearing</span>
<a name="l00063"></a>00063 <span class="comment">// as data in some other message.</span>
<a name="l00064"></a>00064 <span class="comment">//</span>
<a name="l00065"></a>00065 <span class="keywordflow">case</span> 1:
<a name="l00066"></a>00066 <span class="keywordflow">if</span> (PREAMBLE2 == data) {
<a name="l00067"></a>00067 _step++;
<a name="l00068"></a>00068 <span class="keywordflow">break</span>;
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070 _step = 0;
<a name="l00071"></a>00071 <span class="comment">// FALLTHROUGH</span>
<a name="l00072"></a>00072 <span class="keywordflow">case</span> 0:
<a name="l00073"></a>00073 <span class="keywordflow">if</span>(PREAMBLE1 == data)
<a name="l00074"></a>00074 _step++;
<a name="l00075"></a>00075 <span class="keywordflow">break</span>;
<a name="l00076"></a>00076
<a name="l00077"></a>00077 <span class="comment">// Message header processing</span>
<a name="l00078"></a>00078 <span class="comment">//</span>
<a name="l00079"></a>00079 <span class="comment">// We sniff the class and message ID to decide whether we</span>
<a name="l00080"></a>00080 <span class="comment">// are going to gather the message bytes or just discard</span>
<a name="l00081"></a>00081 <span class="comment">// them.</span>
<a name="l00082"></a>00082 <span class="comment">//</span>
<a name="l00083"></a>00083 <span class="comment">// We always collect the length so that we can avoid being</span>
<a name="l00084"></a>00084 <span class="comment">// fooled by preamble bytes in messages.</span>
<a name="l00085"></a>00085 <span class="comment">//</span>
<a name="l00086"></a>00086 <span class="keywordflow">case</span> 2:
<a name="l00087"></a>00087 _step++;
<a name="l00088"></a>00088 <span class="keywordflow">if</span> (CLASS_NAV == data) {
<a name="l00089"></a>00089 _gather = <span class="keyword">true</span>; <span class="comment">// class is interesting, maybe gather</span>
<a name="l00090"></a>00090 _ck_b = _ck_a = data; <span class="comment">// reset the checksum accumulators</span>
<a name="l00091"></a>00091 } <span class="keywordflow">else</span> {
<a name="l00092"></a>00092 _gather = <span class="keyword">false</span>; <span class="comment">// class is not interesting, discard</span>
<a name="l00093"></a>00093 }
<a name="l00094"></a>00094 <span class="keywordflow">break</span>;
<a name="l00095"></a>00095 <span class="keywordflow">case</span> 3:
<a name="l00096"></a>00096 _step++;
<a name="l00097"></a>00097 _ck_b += (_ck_a += data); <span class="comment">// checksum byte</span>
<a name="l00098"></a>00098 _msg_id = data;
<a name="l00099"></a>00099 <span class="keywordflow">if</span> (_gather) { <span class="comment">// if class was interesting</span>
<a name="l00100"></a>00100 <span class="keywordflow">switch</span>(data) {
<a name="l00101"></a>00101 <span class="keywordflow">case</span> MSG_POSLLH: <span class="comment">// message is interesting</span>
<a name="l00102"></a>00102 _expect = <span class="keyword">sizeof</span>(ubx_nav_posllh);
<a name="l00103"></a>00103 <span class="keywordflow">break</span>;
<a name="l00104"></a>00104 <span class="keywordflow">case</span> MSG_STATUS:
<a name="l00105"></a>00105 _expect = <span class="keyword">sizeof</span>(ubx_nav_status);
<a name="l00106"></a>00106 <span class="keywordflow">break</span>;
<a name="l00107"></a>00107 <span class="keywordflow">case</span> MSG_SOL:
<a name="l00108"></a>00108 _expect = <span class="keyword">sizeof</span>(ubx_nav_solution);
<a name="l00109"></a>00109 <span class="keywordflow">break</span>;
<a name="l00110"></a>00110 <span class="keywordflow">case</span> MSG_VELNED:
<a name="l00111"></a>00111 _expect = <span class="keyword">sizeof</span>(ubx_nav_velned);
<a name="l00112"></a>00112 <span class="keywordflow">break</span>;
<a name="l00113"></a>00113 <span class="keywordflow">default</span>:
<a name="l00114"></a>00114 _gather = <span class="keyword">false</span>; <span class="comment">// message is not interesting</span>
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 }
<a name="l00117"></a>00117 <span class="keywordflow">break</span>;
<a name="l00118"></a>00118 <span class="keywordflow">case</span> 4:
<a name="l00119"></a>00119 _step++;
<a name="l00120"></a>00120 _ck_b += (_ck_a += data); <span class="comment">// checksum byte</span>
<a name="l00121"></a>00121 _payload_length = data; <span class="comment">// payload length low byte</span>
<a name="l00122"></a>00122 <span class="keywordflow">break</span>;
<a name="l00123"></a>00123 <span class="keywordflow">case</span> 5:
<a name="l00124"></a>00124 _step++;
<a name="l00125"></a>00125 _ck_b += (_ck_a += data); <span class="comment">// checksum byte</span>
<a name="l00126"></a>00126 _payload_length += (uint16_t)data; <span class="comment">// payload length high byte</span>
<a name="l00127"></a>00127 _payload_counter = 0; <span class="comment">// prepare to receive payload</span>
<a name="l00128"></a>00128 <span class="keywordflow">if</span> (_payload_length != _expect)
<a name="l00129"></a>00129 _gather = <span class="keyword">false</span>;
<a name="l00130"></a>00130 <span class="keywordflow">break</span>;
<a name="l00131"></a>00131
<a name="l00132"></a>00132 <span class="comment">// Receive message data</span>
<a name="l00133"></a>00133 <span class="comment">//</span>
<a name="l00134"></a>00134 <span class="keywordflow">case</span> 6:
<a name="l00135"></a>00135 _ck_b += (_ck_a += data); <span class="comment">// checksum byte</span>
<a name="l00136"></a>00136 <span class="keywordflow">if</span> (_gather) <span class="comment">// gather data if requested</span>
<a name="l00137"></a>00137 _buffer.bytes[_payload_counter] = data;
<a name="l00138"></a>00138 <span class="keywordflow">if</span> (++_payload_counter == _payload_length)
<a name="l00139"></a>00139 _step++;
<a name="l00140"></a>00140 <span class="keywordflow">break</span>;
<a name="l00141"></a>00141
<a name="l00142"></a>00142 <span class="comment">// Checksum and message processing</span>
<a name="l00143"></a>00143 <span class="comment">//</span>
<a name="l00144"></a>00144 <span class="keywordflow">case</span> 7:
<a name="l00145"></a>00145 _step++;
<a name="l00146"></a>00146 <span class="keywordflow">if</span> (_ck_a != data)
<a name="l00147"></a>00147 _step = 0; <span class="comment">// bad checksum</span>
<a name="l00148"></a>00148 <span class="keywordflow">break</span>;
<a name="l00149"></a>00149 <span class="keywordflow">case</span> 8:
<a name="l00150"></a>00150 _step = 0;
<a name="l00151"></a>00151 <span class="keywordflow">if</span> (_ck_b != data)
<a name="l00152"></a>00152 <span class="keywordflow">break</span>; <span class="comment">// bad checksum</span>
<a name="l00153"></a>00153
<a name="l00154"></a>00154 <span class="keywordflow">if</span> (_gather) {
<a name="l00155"></a>00155 parsed = _parse_gps(); <span class="comment">// Parse the new GPS packet</span>
<a name="l00156"></a>00156 }
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159 <span class="keywordflow">return</span> parsed;
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161
<a name="l00162"></a>00162 <span class="comment">// Private Methods /////////////////////////////////////////////////////////////</span>
<a name="l00163"></a>00163
<a name="l00164"></a>00164 <span class="keywordtype">bool</span>
<a name="l00165"></a>00165 AP_GPS_UBLOX::_parse_gps(<span class="keywordtype">void</span>)
<a name="l00166"></a>00166 {
<a name="l00167"></a>00167 <span class="keywordflow">switch</span> (_msg_id) {
<a name="l00168"></a>00168 <span class="keywordflow">case</span> MSG_POSLLH:
<a name="l00169"></a>00169 <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a> = _buffer.posllh.time;
<a name="l00170"></a>00170 <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a> = _buffer.posllh.longitude;
<a name="l00171"></a>00171 <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a> = _buffer.posllh.latitude;
<a name="l00172"></a>00172 <a class="code" href="class_g_p_s.html#aaf73c8b7f3a10e7c37432448ad6582b2" title="altitude in cm">altitude</a> = _buffer.posllh.altitude_msl / 10;
<a name="l00173"></a>00173 <span class="keywordflow">break</span>;
<a name="l00174"></a>00174 <span class="keywordflow">case</span> MSG_STATUS:
<a name="l00175"></a>00175 <a class="code" href="class_g_p_s.html#a0b2a93a9f1d0e234d791177ea5f42078" title="true if we have a position fix (use status instead)">fix</a> = (_buffer.status.fix_status &amp; NAV_STATUS_FIX_VALID) &amp;&amp; (_buffer.status.fix_type == FIX_3D);
<a name="l00176"></a>00176 <span class="keywordflow">break</span>;
<a name="l00177"></a>00177 <span class="keywordflow">case</span> MSG_SOL:
<a name="l00178"></a>00178 <a class="code" href="class_g_p_s.html#a0b2a93a9f1d0e234d791177ea5f42078" title="true if we have a position fix (use status instead)">fix</a> = (_buffer.solution.fix_status &amp; NAV_STATUS_FIX_VALID) &amp;&amp; (_buffer.solution.fix_type == FIX_3D);
<a name="l00179"></a>00179 <a class="code" href="class_g_p_s.html#ada1d7424a7a9afa17cfffcd73f741971" title="Number of visible satelites.">num_sats</a> = _buffer.solution.satellites;
<a name="l00180"></a>00180 <span class="keywordflow">break</span>;
<a name="l00181"></a>00181 <span class="keywordflow">case</span> MSG_VELNED:
<a name="l00182"></a>00182 <a class="code" href="class_g_p_s.html#a39fa3ac4a5d784f63c934cdc37eac8b6" title="3D speed in cm/sec (not always available)">speed_3d</a> = _buffer.velned.speed_3d; <span class="comment">// cm/s</span>
<a name="l00183"></a>00183 <a class="code" href="class_g_p_s.html#aba8ad9c8dd3aac81d0e3e2b25ef304c0" title="ground speed in cm/sec">ground_speed</a> = _buffer.velned.speed_2d; <span class="comment">// cm/s</span>
<a name="l00184"></a>00184 <a class="code" href="class_g_p_s.html#a223b8bf1d912252c15aff621c37d00e3" title="ground course in 100ths of a degree">ground_course</a> = _buffer.velned.heading_2d / 1000; <span class="comment">// Heading 2D deg * 100000 rescaled to deg * 100</span>
<a name="l00185"></a>00185 <span class="keywordflow">break</span>;
<a name="l00186"></a>00186 <span class="keywordflow">default</span>:
<a name="l00187"></a>00187 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00190"></a>00190 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,87 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_UBLOX.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_GPS_UBLOX.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_g_p_s_8h_source.html">GPS.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_GPS_UBLOX.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___u_b_l_o_x_8h__incl.png" border="0" usemap="#_a_p___g_p_s___u_b_l_o_x_8h" alt=""/></div>
<map name="_a_p___g_p_s___u_b_l_o_x_8h" id="_a_p___g_p_s___u_b_l_o_x_8h">
<area shape="rect" id="node3" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers." alt="" coords="71,83,132,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___g_p_s___u_b_l_o_x_8h__dep__incl.png" border="0" usemap="#_a_p___g_p_s___u_b_l_o_x_8hdep" alt=""/></div>
<map name="_a_p___g_p_s___u_b_l_o_x_8hdep" id="_a_p___g_p_s___u_b_l_o_x_8hdep">
<area shape="rect" id="node3" href="_a_p___g_p_s_8h.html" title="Catch&#45;all header that defines all supported GPS classes." alt="" coords="108,83,193,112"/><area shape="rect" id="node16" href="_a_p___g_p_s___u_b_l_o_x_8cpp.html" title="AP_GPS_UBLOX.cpp" alt="" coords="217,83,367,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node14" href="_a_p___g_p_s___auto_8cpp.html" title="AP_GPS_Auto.cpp" alt="" coords="232,160,368,189"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___g_p_s___u_b_l_o_x_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___g_p_s___u_b_l_o_x.html">AP_GPS_UBLOX</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>AP_GPS_UBLOX::ubx_nav_posllh</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>AP_GPS_UBLOX::ubx_nav_status</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>AP_GPS_UBLOX::ubx_nav_solution</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>AP_GPS_UBLOX::ubx_nav_velned</b></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___g_p_s___u_b_l_o_x_8h.html#ab01245792ac1376be9de89e35cdc6690">UBLOX_SET_BINARY</a>&nbsp;&nbsp;&nbsp;&quot;$PUBX,41,1,0003,0001,38400,0*26&quot;</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ab01245792ac1376be9de89e35cdc6690"></a><!-- doxytag: member="AP_GPS_UBLOX.h::UBLOX_SET_BINARY" ref="ab01245792ac1376be9de89e35cdc6690" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define UBLOX_SET_BINARY&nbsp;&nbsp;&nbsp;&quot;$PUBX,41,1,0003,0001,38400,0*26&quot;</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___g_p_s___u_b_l_o_x_8h_source.html#l00016">16</a> of file <a class="el" href="_a_p___g_p_s___u_b_l_o_x_8h_source.html">AP_GPS_UBLOX.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,163 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_GPS_UBLOX.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_GPS_UBLOX.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___g_p_s___u_b_l_o_x_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// u-blox UBX GPS driver for ArduPilot and ArduPilotMega.</span>
<a name="l00004"></a>00004 <span class="comment">// Code by Michael Smith, Jordi Munoz and Jose Julio, DIYDrones.com</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// This library is free software; you can redistribute it and / or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="preprocessor">#ifndef AP_GPS_UBLOX_h</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define AP_GPS_UBLOX_h</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;<a class="code" href="_g_p_s_8h.html" title="Interface definition for the various GPS drivers.">GPS.h</a>&gt;</span>
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="_a_p___g_p_s___u_b_l_o_x_8h.html#ab01245792ac1376be9de89e35cdc6690">00016</a> <span class="preprocessor">#define UBLOX_SET_BINARY &quot;$PUBX,41,1,0003,0001,38400,0*26&quot;</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html">00018</a> <span class="keyword">class </span><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html">AP_GPS_UBLOX</a> : <span class="keyword">public</span> <a class="code" href="class_g_p_s.html" title="Abstract base class for GPS receiver drivers.">GPS</a>
<a name="l00019"></a>00019 {
<a name="l00020"></a>00020 <span class="keyword">public</span>:
<a name="l00021"></a>00021 <span class="comment">// Methods</span>
<a name="l00022"></a>00022 <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#ae9fb4a8dad01cffb9d6596bae90713c5">AP_GPS_UBLOX</a>(<a class="code" href="class_stream.html">Stream</a> *s);
<a name="l00023"></a>00023 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a65b970c80810a684a7b9435c7116c6fc">init</a>();
<a name="l00024"></a>00024 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a09825f5ca37ee9bdb5e0939a4073a84e">read</a>();
<a name="l00025"></a>00025
<a name="l00026"></a>00026 <span class="keyword">private</span>:
<a name="l00027"></a>00027 <span class="comment">// u-blox UBX protocol essentials</span>
<a name="l00028"></a>00028 <span class="preprocessor">#pragma pack(1)</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span> <span class="keyword">struct </span>ubx_nav_posllh {
<a name="l00030"></a>00030 uint32_t <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a>; <span class="comment">// GPS msToW</span>
<a name="l00031"></a>00031 int32_t <a class="code" href="class_g_p_s.html#ae64cbfd073326bd5ec8a6d0a1bae2746" title="longitude in degrees * 10,000,000">longitude</a>;
<a name="l00032"></a>00032 int32_t <a class="code" href="class_g_p_s.html#aa5df9c7bd452a9689054e55ec90dfef1" title="latitude in degrees * 10,000,000">latitude</a>;
<a name="l00033"></a>00033 int32_t altitude_ellipsoid;
<a name="l00034"></a>00034 int32_t altitude_msl;
<a name="l00035"></a>00035 uint32_t horizontal_accuracy;
<a name="l00036"></a>00036 uint32_t vertical_accuracy;
<a name="l00037"></a>00037 };
<a name="l00038"></a>00038 <span class="keyword">struct </span>ubx_nav_status {
<a name="l00039"></a>00039 uint32_t <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a>; <span class="comment">// GPS msToW</span>
<a name="l00040"></a>00040 uint8_t fix_type;
<a name="l00041"></a>00041 uint8_t fix_status;
<a name="l00042"></a>00042 uint8_t differential_status;
<a name="l00043"></a>00043 uint8_t res;
<a name="l00044"></a>00044 uint32_t time_to_first_fix;
<a name="l00045"></a>00045 uint32_t uptime; <span class="comment">// milliseconds</span>
<a name="l00046"></a>00046 };
<a name="l00047"></a>00047 <span class="keyword">struct </span>ubx_nav_solution {
<a name="l00048"></a>00048 uint32_t <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a>;
<a name="l00049"></a>00049 int32_t time_nsec;
<a name="l00050"></a>00050 int16_t week;
<a name="l00051"></a>00051 uint8_t fix_type;
<a name="l00052"></a>00052 uint8_t fix_status;
<a name="l00053"></a>00053 int32_t ecef_x;
<a name="l00054"></a>00054 int32_t ecef_y;
<a name="l00055"></a>00055 int32_t ecef_z;
<a name="l00056"></a>00056 uint32_t position_accuracy_3d;
<a name="l00057"></a>00057 int32_t ecef_x_velocity;
<a name="l00058"></a>00058 int32_t ecef_y_velocity;
<a name="l00059"></a>00059 int32_t ecef_z_velocity;
<a name="l00060"></a>00060 uint32_t speed_accuracy;
<a name="l00061"></a>00061 uint16_t position_DOP;
<a name="l00062"></a>00062 uint8_t res;
<a name="l00063"></a>00063 uint8_t satellites;
<a name="l00064"></a>00064 uint32_t res2;
<a name="l00065"></a>00065 };
<a name="l00066"></a>00066 <span class="keyword">struct </span>ubx_nav_velned {
<a name="l00067"></a>00067 uint32_t <a class="code" href="class_g_p_s.html#a5400664cf0d912138e91260cbd2b3fa0" title="GPS time in milliseconds from the start of the week.">time</a>; <span class="comment">// GPS msToW</span>
<a name="l00068"></a>00068 int32_t ned_north;
<a name="l00069"></a>00069 int32_t ned_east;
<a name="l00070"></a>00070 int32_t ned_down;
<a name="l00071"></a>00071 uint32_t <a class="code" href="class_g_p_s.html#a39fa3ac4a5d784f63c934cdc37eac8b6" title="3D speed in cm/sec (not always available)">speed_3d</a>;
<a name="l00072"></a>00072 uint32_t speed_2d;
<a name="l00073"></a>00073 int32_t heading_2d;
<a name="l00074"></a>00074 uint32_t speed_accuracy;
<a name="l00075"></a>00075 uint32_t heading_accuracy;
<a name="l00076"></a>00076 };
<a name="l00077"></a>00077 <span class="preprocessor">#pragma pack(pop)</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span> <span class="keyword">enum</span> ubs_protocol_bytes {
<a name="l00079"></a>00079 PREAMBLE1 = 0xb5,
<a name="l00080"></a>00080 PREAMBLE2 = 0x62,
<a name="l00081"></a>00081 CLASS_NAV = 0x1,
<a name="l00082"></a>00082 MSG_POSLLH = 0x2,
<a name="l00083"></a>00083 MSG_STATUS = 0x3,
<a name="l00084"></a>00084 MSG_SOL = 0x6,
<a name="l00085"></a>00085 MSG_VELNED = 0x12
<a name="l00086"></a>00086 };
<a name="l00087"></a>00087 <span class="keyword">enum</span> ubs_nav_fix_type {
<a name="l00088"></a>00088 FIX_NONE = 0,
<a name="l00089"></a>00089 FIX_DEAD_RECKONING = 1,
<a name="l00090"></a>00090 FIX_2D = 2,
<a name="l00091"></a>00091 FIX_3D = 3,
<a name="l00092"></a>00092 FIX_GPS_DEAD_RECKONING = 4,
<a name="l00093"></a>00093 FIX_TIME = 5
<a name="l00094"></a>00094 };
<a name="l00095"></a>00095 <span class="keyword">enum</span> ubx_nav_status_bits {
<a name="l00096"></a>00096 NAV_STATUS_FIX_VALID = 1
<a name="l00097"></a>00097 };
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="comment">// Packet checksum accumulators</span>
<a name="l00100"></a>00100 uint8_t _ck_a;
<a name="l00101"></a>00101 uint8_t _ck_b;
<a name="l00102"></a>00102
<a name="l00103"></a>00103 <span class="comment">// State machine state</span>
<a name="l00104"></a>00104 uint8_t _step;
<a name="l00105"></a>00105 uint8_t _msg_id;
<a name="l00106"></a>00106 <span class="keywordtype">bool</span> _gather;
<a name="l00107"></a>00107 uint16_t _expect;
<a name="l00108"></a>00108 uint16_t _payload_length;
<a name="l00109"></a>00109 uint16_t _payload_counter;
<a name="l00110"></a>00110
<a name="l00111"></a>00111 <span class="comment">// Receive buffer</span>
<a name="l00112"></a>00112 <span class="keyword">union </span>{
<a name="l00113"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a2e4a2afafb7437f96054a5038c654322">00113</a> ubx_nav_posllh <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a2e4a2afafb7437f96054a5038c654322">posllh</a>;
<a name="l00114"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a4c87e15241d4257eb4701bd4d28a6aab">00114</a> ubx_nav_status <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a4c87e15241d4257eb4701bd4d28a6aab">status</a>;
<a name="l00115"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a646e239ba336b76ce553d3ef20fce0ed">00115</a> ubx_nav_solution <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a646e239ba336b76ce553d3ef20fce0ed">solution</a>;
<a name="l00116"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#ad3780dab049655f5cb09c9b86da5f862">00116</a> ubx_nav_velned <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#ad3780dab049655f5cb09c9b86da5f862">velned</a>;
<a name="l00117"></a><a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a5df4a4b65ed909aeb1b29ba199ffe5ec">00117</a> uint8_t <a class="code" href="class_a_p___g_p_s___u_b_l_o_x.html#a5df4a4b65ed909aeb1b29ba199ffe5ec">bytes</a>[];
<a name="l00118"></a>00118 } _buffer;
<a name="l00119"></a>00119
<a name="l00120"></a>00120 <span class="comment">// Buffer parse &amp; GPS state update</span>
<a name="l00121"></a>00121 <span class="keywordtype">bool</span> _parse_gps();
<a name="l00122"></a>00122 };
<a name="l00123"></a>00123
<a name="l00124"></a>00124 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,230 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: /home/jgoppert/Projects/ap/libraries/AP_IMU/AP_IMU.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>/home/jgoppert/Projects/ap/libraries/AP_IMU/AP_IMU.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_a_p___i_m_u_8h_source.html">AP_IMU.h</a>&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_IMU.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___i_m_u_8cpp__incl.png" border="0" usemap="#_2home_2jgoppert_2_projects_2ap_2libraries_2_a_p___i_m_u_2_a_p___i_m_u_8cpp" alt=""/></div>
<map name="_2home_2jgoppert_2_projects_2ap_2libraries_2_a_p___i_m_u_2_a_p___i_m_u_8cpp" id="_2home_2jgoppert_2_projects_2ap_2libraries_2_a_p___i_m_u_2_a_p___i_m_u_8cpp">
<area shape="rect" id="node3" href="_a_p___i_m_u_8h.html" title="AP_IMU.h" alt="" coords="663,83,745,112"/><area shape="rect" id="node5" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="268,160,364,189"/><area shape="rect" id="node21" href="_a_p___math_8h.html" title="AP_Math.h" alt="" coords="853,160,944,189"/><area shape="rect" id="node36" href="_w_program_8h.html" title="WProgram.h" alt="" coords="713,160,812,189"/><area shape="rect" id="node38" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="604,160,689,189"/><area shape="rect" id="node15" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="325,237,448,267"/><area shape="rect" id="node23" href="vector2_8h.html" title="vector2.h" alt="" coords="1015,315,1097,344"/><area shape="rect" id="node27" href="vector3_8h.html" title="vector3.h" alt="" coords="908,315,991,344"/><area shape="rect" id="node32" href="matrix3_8h.html" title="matrix3.h" alt="" coords="936,237,1019,267"/><area shape="rect" id="node40" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="709,237,861,267"/><area shape="rect" id="node43" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="573,237,685,267"/></map>
</div>
<p><a href="_a_p___i_m_u_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>&nbsp;&nbsp;&nbsp;37</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>&nbsp;&nbsp;&nbsp;35</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#a6801baa546c6112d19eb095111d24720">GRAVITY</a>&nbsp;&nbsp;&nbsp;418</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">accel_scale</a>(x)&nbsp;&nbsp;&nbsp;(x*9.80665/GRAVITY)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(x)&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">ToDeg</a>(x)&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#a0faaa1abe1ae542341b8d9bd7ce54d99">_gyro_gain_x</a>&nbsp;&nbsp;&nbsp;0.4</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#afc839d9b91d74b4baffdde51408108b5">_gyro_gain_y</a>&nbsp;&nbsp;&nbsp;0.41</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#aee78c6ea2bb7b6e8a9d967d4fc7fe127">_gyro_gain_z</a>&nbsp;&nbsp;&nbsp;0.41</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>&nbsp;&nbsp;&nbsp;900</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a0faaa1abe1ae542341b8d9bd7ce54d99"></a><!-- doxytag: member="AP_IMU.cpp::_gyro_gain_x" ref="a0faaa1abe1ae542341b8d9bd7ce54d99" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _gyro_gain_x&nbsp;&nbsp;&nbsp;0.4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00037">37</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="afc839d9b91d74b4baffdde51408108b5"></a><!-- doxytag: member="AP_IMU.cpp::_gyro_gain_y" ref="afc839d9b91d74b4baffdde51408108b5" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _gyro_gain_y&nbsp;&nbsp;&nbsp;0.41</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00038">38</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aee78c6ea2bb7b6e8a9d967d4fc7fe127"></a><!-- doxytag: member="AP_IMU.cpp::_gyro_gain_z" ref="aee78c6ea2bb7b6e8a9d967d4fc7fe127" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _gyro_gain_z&nbsp;&nbsp;&nbsp;0.41</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00039">39</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a89a26b9d37cc51864764942700a2fc15"></a><!-- doxytag: member="AP_IMU.cpp::A_LED_PIN" ref="a89a26b9d37cc51864764942700a2fc15" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define A_LED_PIN&nbsp;&nbsp;&nbsp;37</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00023">23</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a13e740232f35f26c07b1b915cab9d4bc"></a><!-- doxytag: member="AP_IMU.cpp::accel_scale" ref="a13e740232f35f26c07b1b915cab9d4bc" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define accel_scale</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*9.80665/GRAVITY)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00030">30</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae4132efd8235f9b057b6b1d24272dd79"></a><!-- doxytag: member="AP_IMU.cpp::ADC_CONSTRAINT" ref="ae4132efd8235f9b057b6b1d24272dd79" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ADC_CONSTRAINT&nbsp;&nbsp;&nbsp;900</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00041">41</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a48fee4bef9f91c681247a9858c246b78"></a><!-- doxytag: member="AP_IMU.cpp::C_LED_PIN" ref="a48fee4bef9f91c681247a9858c246b78" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define C_LED_PIN&nbsp;&nbsp;&nbsp;35</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00024">24</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6801baa546c6112d19eb095111d24720"></a><!-- doxytag: member="AP_IMU.cpp::GRAVITY" ref="a6801baa546c6112d19eb095111d24720" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GRAVITY&nbsp;&nbsp;&nbsp;418</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00029">29</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a3c9d151923236c7e8ccccf86f131e550"></a><!-- doxytag: member="AP_IMU.cpp::ToDeg" ref="a3c9d151923236c7e8ccccf86f131e550" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToDeg</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*57.2957795131)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00033">33</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a728f9499baea61e7df3ae70a374f2512"></a><!-- doxytag: member="AP_IMU.cpp::ToRad" ref="a728f9499baea61e7df3ae70a374f2512" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ToRad</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*0.01745329252)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u_8cpp_source.html#l00032">32</a> of file <a class="el" href="_a_p___i_m_u_8cpp_source.html">AP_IMU.cpp</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,371 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: /home/jgoppert/Projects/ap/libraries/AP_IMU/AP_IMU.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>/home/jgoppert/Projects/ap/libraries/AP_IMU/AP_IMU.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___i_m_u_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> AP_IMU.cpp - IMU Sensor Library for Ardupilot Mega</span>
<a name="l00003"></a>00003 <span class="comment"> Code by Doug Weibel, Jordi Muñoz and Jose Julio. DIYDrones.com</span>
<a name="l00004"></a>00004 <span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment"> This library works with the ArduPilot Mega and &quot;Oilpan&quot;</span>
<a name="l00006"></a>00006 <span class="comment"> </span>
<a name="l00007"></a>00007 <span class="comment"> This library is free software; you can redistribute it and/or</span>
<a name="l00008"></a>00008 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00009"></a>00009 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00010"></a>00010 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00011"></a>00011 <span class="comment"></span>
<a name="l00012"></a>00012 <span class="comment"> Methods:</span>
<a name="l00013"></a>00013 <span class="comment"> quick_init() : For air restart</span>
<a name="l00014"></a>00014 <span class="comment"> init() : Calibration</span>
<a name="l00015"></a>00015 <span class="comment"> gyro_init() : For ground start using saved accel offsets</span>
<a name="l00016"></a>00016 <span class="comment"> get_gyro() : Returns gyro vector. Elements in radians/second</span>
<a name="l00017"></a>00017 <span class="comment"> get_accel() : Returns acceleration vector. Elements in meters/seconds squared</span>
<a name="l00018"></a>00018 <span class="comment"></span>
<a name="l00019"></a>00019 <span class="comment">*/</span>
<a name="l00020"></a>00020
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___i_m_u_8h.html">AP_IMU.h</a>&gt;</span>
<a name="l00022"></a>00022
<a name="l00023"></a><a class="code" href="_a_p___i_m_u_8cpp.html#a89a26b9d37cc51864764942700a2fc15">00023</a> <span class="preprocessor">#define A_LED_PIN 37 //37 = A, 35 = C</span>
<a name="l00024"></a><a class="code" href="_a_p___i_m_u_8cpp.html#a48fee4bef9f91c681247a9858c246b78">00024</a> <span class="preprocessor"></span><span class="preprocessor">#define C_LED_PIN 35</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="comment">// ADC : Voltage reference 3.3v / 12bits(4096 steps) =&gt; 0.8mV/ADC step</span>
<a name="l00027"></a>00027 <span class="comment">// ADXL335 Sensitivity(from datasheet) =&gt; 330mV/g, 0.8mV/ADC step =&gt; 330/0.8 = 412</span>
<a name="l00028"></a>00028 <span class="comment">// Tested value : 418</span>
<a name="l00029"></a><a class="code" href="_a_p___i_m_u_8cpp.html#a6801baa546c6112d19eb095111d24720">00029</a> <span class="preprocessor">#define GRAVITY 418 //this equivalent to 1G in the raw data coming from the accelerometer </span>
<a name="l00030"></a><a class="code" href="_a_p___i_m_u_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define accel_scale(x) (x*9.80665/GRAVITY)//Scaling the raw data of the accel to actual acceleration in meters per second squared</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a><a class="code" href="_a_p___i_m_u_8cpp.html#a728f9499baea61e7df3ae70a374f2512">00032</a> <span class="preprocessor">#define ToRad(x) (x*0.01745329252) // *pi/180</span>
<a name="l00033"></a><a class="code" href="_a_p___i_m_u_8cpp.html#a3c9d151923236c7e8ccccf86f131e550">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define ToDeg(x) (x*57.2957795131) // *180/pi</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="comment">// IDG500 Sensitivity (from datasheet) =&gt; 2.0mV/º/s, 0.8mV/ADC step =&gt; 0.8/3.33 = 0.4</span>
<a name="l00036"></a>00036 <span class="comment">// Tested values : 0.4026, ?, 0.4192</span>
<a name="l00037"></a><a class="code" href="_a_p___i_m_u_8cpp.html#a0faaa1abe1ae542341b8d9bd7ce54d99">00037</a> <span class="preprocessor">#define _gyro_gain_x 0.4 //X axis Gyro gain</span>
<a name="l00038"></a><a class="code" href="_a_p___i_m_u_8cpp.html#afc839d9b91d74b4baffdde51408108b5">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define _gyro_gain_y 0.41 //Y axis Gyro gain</span>
<a name="l00039"></a><a class="code" href="_a_p___i_m_u_8cpp.html#aee78c6ea2bb7b6e8a9d967d4fc7fe127">00039</a> <span class="preprocessor"></span><span class="preprocessor">#define _gyro_gain_z 0.41 //Z axis Gyro </span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a><a class="code" href="_a_p___i_m_u_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">00041</a> <span class="preprocessor">#define ADC_CONSTRAINT 900</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span>
<a name="l00043"></a>00043 <span class="comment">// Sensor: GYROX, GYROY, GYROZ, ACCELX, ACCELY, ACCELZ</span>
<a name="l00044"></a>00044 <span class="keyword">const</span> uint8_t AP_IMU::_sensors[6] = {1,2,0,4,5,6}; <span class="comment">// For ArduPilot Mega Sensor Shield Hardware</span>
<a name="l00045"></a>00045 <span class="keyword">const</span> <span class="keywordtype">int</span> AP_IMU::_sensor_signs[] = { 1, -1, -1,
<a name="l00046"></a>00046 1, -1, -1};
<a name="l00047"></a>00047
<a name="l00048"></a>00048 <span class="comment">// Temp compensation curve constants</span>
<a name="l00049"></a>00049 <span class="comment">// These must be produced by measuring data and curve fitting</span>
<a name="l00050"></a>00050 <span class="comment">// [X/Y/Z gyro][A/B/C or 0 order/1st order/2nd order constants]</span>
<a name="l00051"></a>00051 <span class="keyword">const</span> <span class="keywordtype">float</span> AP_IMU::_gyro_temp_curve[3][3] = {
<a name="l00052"></a>00052 {1665,0,0},
<a name="l00053"></a>00053 {1665,0,0},
<a name="l00054"></a>00054 {1665,0,0}
<a name="l00055"></a>00055 }; <span class="comment">// To Do - make additional constructors to pass this in.</span>
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keywordtype">void</span>
<a name="l00058"></a><a class="code" href="class_a_p___i_m_u.html#a9a11140ed95ac3c9897bc2febe26eb77">00058</a> <a class="code" href="class_a_p___i_m_u.html#a9a11140ed95ac3c9897bc2febe26eb77">AP_IMU::init</a>(<span class="keywordtype">void</span>)
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060 <a class="code" href="class_a_p___i_m_u.html#a4b0359c017c12d4fbfedebff4e87cdf1">init_gyro</a>();
<a name="l00061"></a>00061 <a class="code" href="class_a_p___i_m_u.html#aa3f086a668117214ba9853e6365e3d0a">init_accel</a>();
<a name="l00062"></a>00062 }
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <span class="comment">/**************************************************/</span>
<a name="l00065"></a>00065
<a name="l00066"></a>00066 <span class="keywordtype">void</span>
<a name="l00067"></a><a class="code" href="class_a_p___i_m_u.html#a4b0359c017c12d4fbfedebff4e87cdf1">00067</a> <a class="code" href="class_a_p___i_m_u.html#a4b0359c017c12d4fbfedebff4e87cdf1">AP_IMU::init_gyro</a>(<span class="keywordtype">void</span>)
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="keywordtype">float</span> temp;
<a name="l00071"></a>00071 <span class="keywordtype">int</span> flashcount = 0;
<a name="l00072"></a>00072 <span class="keywordtype">int</span> tc_temp = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_gyro_temp_ch);
<a name="l00073"></a>00073 delay(500);
<a name="l00074"></a>00074 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot;Init Gyro&quot;</span>);
<a name="l00075"></a>00075
<a name="l00076"></a>00076 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> c = 0; c &lt; 200; c++){
<a name="l00077"></a>00077 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, LOW);
<a name="l00078"></a>00078 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, HIGH);
<a name="l00079"></a>00079 delay(20);
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 6; i++)
<a name="l00082"></a>00082 _adc_in[i] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[i]);
<a name="l00083"></a>00083
<a name="l00084"></a>00084 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, HIGH);
<a name="l00085"></a>00085 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, LOW);
<a name="l00086"></a>00086 delay(20);
<a name="l00087"></a>00087 }
<a name="l00088"></a>00088
<a name="l00089"></a>00089 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; 200; i++){
<a name="l00090"></a>00090 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt;= 2; j++){
<a name="l00091"></a>00091 _adc_in[j] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[j]);
<a name="l00092"></a>00092
<a name="l00093"></a>00093 <span class="comment">// Subtract temp compensated typical gyro bias</span>
<a name="l00094"></a>00094 _adc_in[j] -= gyro_temp_comp(j, tc_temp);
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="comment">// filter</span>
<a name="l00097"></a>00097 _adc_offset[j] = _adc_offset[j] * 0.9 + _adc_in[j] * 0.1;
<a name="l00098"></a>00098 <span class="comment">//Serial.print(_adc_offset[j], 1);</span>
<a name="l00099"></a>00099 <span class="comment">//Serial.print(&quot;, &quot;);</span>
<a name="l00100"></a>00100 }
<a name="l00101"></a>00101 <span class="comment">//Serial.println(&quot; &quot;);</span>
<a name="l00102"></a>00102
<a name="l00103"></a>00103 delay(20);
<a name="l00104"></a>00104 <span class="keywordflow">if</span>(flashcount == 5) {
<a name="l00105"></a>00105 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;*&quot;</span>);
<a name="l00106"></a>00106 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, LOW);
<a name="l00107"></a>00107 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, HIGH);
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109
<a name="l00110"></a>00110 <span class="keywordflow">if</span>(flashcount &gt;= 10) {
<a name="l00111"></a>00111 flashcount = 0;
<a name="l00112"></a>00112 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, LOW);
<a name="l00113"></a>00113 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, HIGH);
<a name="l00114"></a>00114 }
<a name="l00115"></a>00115 flashcount++;
<a name="l00116"></a>00116 }
<a name="l00117"></a>00117 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot; &quot;</span>);
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <a class="code" href="class_a_p___i_m_u.html#a8ac2bdf10de028677126ddb8e19d1461">save_gyro_eeprom</a>();
<a name="l00120"></a>00120 }
<a name="l00121"></a>00121
<a name="l00122"></a>00122
<a name="l00123"></a>00123 <span class="keywordtype">void</span>
<a name="l00124"></a><a class="code" href="class_a_p___i_m_u.html#aa3f086a668117214ba9853e6365e3d0a">00124</a> <a class="code" href="class_a_p___i_m_u.html#aa3f086a668117214ba9853e6365e3d0a">AP_IMU::init_accel</a>(<span class="keywordtype">void</span>) <span class="comment">// 3, 4, 5</span>
<a name="l00125"></a>00125 {
<a name="l00126"></a>00126 <span class="keywordtype">float</span> temp;
<a name="l00127"></a>00127 <span class="keywordtype">int</span> flashcount = 0;
<a name="l00128"></a>00128 delay(500);
<a name="l00129"></a>00129
<a name="l00130"></a>00130 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot;Init Accel&quot;</span>);
<a name="l00131"></a>00131
<a name="l00132"></a>00132 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 3; j &lt;= 5; j++){
<a name="l00133"></a>00133 _adc_in[j] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[j]);
<a name="l00134"></a>00134 _adc_in[j] -= 2025;
<a name="l00135"></a>00135 _adc_offset[j] = _adc_in[j];
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; 200; i++){ <span class="comment">// We take some readings...</span>
<a name="l00139"></a>00139
<a name="l00140"></a>00140 delay(20);
<a name="l00141"></a>00141
<a name="l00142"></a>00142 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 3; j &lt;= 5; j++){
<a name="l00143"></a>00143 _adc_in[j] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[j]);
<a name="l00144"></a>00144 _adc_in[j] -= 2025;
<a name="l00145"></a>00145 _adc_offset[j] = _adc_offset[j] * 0.9 + _adc_in[j] * 0.1;
<a name="l00146"></a>00146 <span class="comment">//Serial.print(j);</span>
<a name="l00147"></a>00147 <span class="comment">//Serial.print(&quot;: &quot;);</span>
<a name="l00148"></a>00148 <span class="comment">//Serial.print(_adc_in[j], 1);</span>
<a name="l00149"></a>00149 <span class="comment">//Serial.print(&quot; | &quot;);</span>
<a name="l00150"></a>00150 <span class="comment">//Serial.print(_adc_offset[j], 1);</span>
<a name="l00151"></a>00151 <span class="comment">//Serial.print(&quot;, &quot;);</span>
<a name="l00152"></a>00152 }
<a name="l00153"></a>00153
<a name="l00154"></a>00154 <span class="comment">//Serial.println(&quot; &quot;);</span>
<a name="l00155"></a>00155
<a name="l00156"></a>00156 <span class="keywordflow">if</span>(flashcount == 5) {
<a name="l00157"></a>00157 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;*&quot;</span>);
<a name="l00158"></a>00158 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, LOW);
<a name="l00159"></a>00159 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, HIGH);
<a name="l00160"></a>00160 }
<a name="l00161"></a>00161
<a name="l00162"></a>00162 <span class="keywordflow">if</span>(flashcount &gt;= 10) {
<a name="l00163"></a>00163 flashcount = 0;
<a name="l00164"></a>00164 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, LOW);
<a name="l00165"></a>00165 digitalWrite(<a class="code" href="_a_p___i_m_u_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, HIGH);
<a name="l00166"></a>00166 }
<a name="l00167"></a>00167 flashcount++;
<a name="l00168"></a>00168 }
<a name="l00169"></a>00169 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot; &quot;</span>);
<a name="l00170"></a>00170 _adc_offset[5] += <a class="code" href="_a_p___i_m_u_8cpp.html#a6801baa546c6112d19eb095111d24720">GRAVITY</a> * _sensor_signs[5];
<a name="l00171"></a>00171 <a class="code" href="class_a_p___i_m_u.html#a9009257aec9cdd8e0f2366b0ad74ecfd">save_accel_eeprom</a>();
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173
<a name="l00174"></a>00174 <span class="keywordtype">void</span>
<a name="l00175"></a><a class="code" href="class_a_p___i_m_u.html#a972d41a2a9fef4c5ba11d411ab4b5905">00175</a> <a class="code" href="class_a_p___i_m_u.html#a972d41a2a9fef4c5ba11d411ab4b5905">AP_IMU::zero_accel</a>(<span class="keywordtype">void</span>) <span class="comment">// 3, 4, 5</span>
<a name="l00176"></a>00176 {
<a name="l00177"></a>00177 _adc_offset[3] = 0;
<a name="l00178"></a>00178 _adc_offset[4] = 0;
<a name="l00179"></a>00179 _adc_offset[5] = 0;
<a name="l00180"></a>00180 <a class="code" href="class_a_p___i_m_u.html#a9009257aec9cdd8e0f2366b0ad74ecfd">save_accel_eeprom</a>();
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182 <span class="comment">/**************************************************/</span>
<a name="l00183"></a>00183 <span class="comment">// Returns the temperature compensated raw gyro value</span>
<a name="l00184"></a>00184 <span class="comment">//---------------------------------------------------</span>
<a name="l00185"></a>00185 <span class="keywordtype">float</span>
<a name="l00186"></a>00186 AP_IMU::gyro_temp_comp(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> temp)<span class="keyword"> const</span>
<a name="l00187"></a>00187 <span class="keyword"></span>{
<a name="l00188"></a>00188 <span class="comment">// We use a 2nd order curve of the form Gtc = A + B * Graw + C * (Graw)**2</span>
<a name="l00189"></a>00189 <span class="comment">//------------------------------------------------------------------------</span>
<a name="l00190"></a>00190 <span class="keywordflow">return</span> _gyro_temp_curve[i][0] + _gyro_temp_curve[i][1] * temp + _gyro_temp_curve[i][2] * temp * temp;
<a name="l00191"></a>00191 }
<a name="l00192"></a>00192
<a name="l00193"></a>00193 <span class="comment">/**************************************************/</span>
<a name="l00194"></a>00194 <a class="code" href="class_vector3.html">Vector3f</a>
<a name="l00195"></a><a class="code" href="class_a_p___i_m_u.html#ae3d7b3a78a8720c9a7ca2c85402c7638">00195</a> <a class="code" href="class_a_p___i_m_u.html#ae3d7b3a78a8720c9a7ca2c85402c7638">AP_IMU::get_gyro</a>(<span class="keywordtype">void</span>)
<a name="l00196"></a>00196 {
<a name="l00197"></a>00197 <span class="keywordtype">int</span> tc_temp = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_gyro_temp_ch);
<a name="l00198"></a>00198
<a name="l00199"></a>00199 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 3; i++) {
<a name="l00200"></a>00200 _adc_in[i] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[i]);
<a name="l00201"></a>00201 _adc_in[i] -= gyro_temp_comp(i,tc_temp); <span class="comment">// Subtract temp compensated typical gyro bias</span>
<a name="l00202"></a>00202 <span class="keywordflow">if</span> (_sensor_signs[i] &lt; 0)
<a name="l00203"></a>00203 _adc_in[i] = (_adc_offset[i] - _adc_in[i]);
<a name="l00204"></a>00204 <span class="keywordflow">else</span>
<a name="l00205"></a>00205 _adc_in[i] = (_adc_in[i] - _adc_offset[i]);
<a name="l00206"></a>00206
<a name="l00207"></a>00207 <span class="keywordflow">if</span> (fabs(_adc_in[i]) &gt; ADC_CONSTRAINT) {
<a name="l00208"></a>00208 <a class="code" href="class_a_p___i_m_u.html#ad26b4707a58e838f2684d335374c34aa">adc_constraints</a>++; <span class="comment">// We keep track of the number of times </span>
<a name="l00209"></a>00209 _adc_in[i] = constrain(_adc_in[i], -<a class="code" href="_a_p___i_m_u_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>, <a class="code" href="_a_p___i_m_u_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>); <span class="comment">// Throw out nonsensical values</span>
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211 }
<a name="l00212"></a>00212
<a name="l00213"></a>00213 _gyro_vector.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = <a class="code" href="_a_p___i_m_u_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(<a class="code" href="_a_p___i_m_u_8cpp.html#a0faaa1abe1ae542341b8d9bd7ce54d99">_gyro_gain_x</a>) * _adc_in[0];
<a name="l00214"></a>00214 _gyro_vector.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = <a class="code" href="_a_p___i_m_u_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(<a class="code" href="_a_p___i_m_u_8cpp.html#afc839d9b91d74b4baffdde51408108b5">_gyro_gain_y</a>) * _adc_in[1];
<a name="l00215"></a>00215 _gyro_vector.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = <a class="code" href="_a_p___i_m_u_8cpp.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(<a class="code" href="_a_p___i_m_u_8cpp.html#aee78c6ea2bb7b6e8a9d967d4fc7fe127">_gyro_gain_z</a>) * _adc_in[2];
<a name="l00216"></a>00216
<a name="l00217"></a>00217 <span class="keywordflow">return</span> _gyro_vector;
<a name="l00218"></a>00218 }
<a name="l00219"></a>00219
<a name="l00220"></a>00220 <span class="comment">/**************************************************/</span>
<a name="l00221"></a>00221 <a class="code" href="class_vector3.html">Vector3f</a>
<a name="l00222"></a><a class="code" href="class_a_p___i_m_u.html#a6e9be9f56658410ac972d66b8985de6b">00222</a> <a class="code" href="class_a_p___i_m_u.html#a6e9be9f56658410ac972d66b8985de6b">AP_IMU::get_accel</a>(<span class="keywordtype">void</span>)
<a name="l00223"></a>00223 {
<a name="l00224"></a>00224 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 3; i &lt; 6; i++) {
<a name="l00225"></a>00225 _adc_in[i] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[i]);
<a name="l00226"></a>00226 _adc_in[i] -= 2025; <span class="comment">// Subtract typical accel bias</span>
<a name="l00227"></a>00227
<a name="l00228"></a>00228 <span class="keywordflow">if</span> (_sensor_signs[i] &lt; 0)
<a name="l00229"></a>00229 _adc_in[i] = _adc_offset[i] - _adc_in[i];
<a name="l00230"></a>00230 <span class="keywordflow">else</span>
<a name="l00231"></a>00231 _adc_in[i] = _adc_in[i] - _adc_offset[i];
<a name="l00232"></a>00232
<a name="l00233"></a>00233 <span class="keywordflow">if</span> (fabs(_adc_in[i]) &gt; <a class="code" href="_a_p___i_m_u_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>) {
<a name="l00234"></a>00234 <a class="code" href="class_a_p___i_m_u.html#ad26b4707a58e838f2684d335374c34aa">adc_constraints</a>++; <span class="comment">// We keep track of the number of times </span>
<a name="l00235"></a>00235 _adc_in[i] = constrain(_adc_in[i], -<a class="code" href="_a_p___i_m_u_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>, <a class="code" href="_a_p___i_m_u_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>); <span class="comment">// Throw out nonsensical values</span>
<a name="l00236"></a>00236 }
<a name="l00237"></a>00237 }
<a name="l00238"></a>00238
<a name="l00239"></a>00239 _accel_vector.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = <a class="code" href="_a_p___i_m_u_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">accel_scale</a>(_adc_in[3]);
<a name="l00240"></a>00240 _accel_vector.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = <a class="code" href="_a_p___i_m_u_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">accel_scale</a>(_adc_in[4]);
<a name="l00241"></a>00241 _accel_vector.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = <a class="code" href="_a_p___i_m_u_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">accel_scale</a>(_adc_in[5]);
<a name="l00242"></a>00242
<a name="l00243"></a>00243 <span class="keywordflow">return</span> _accel_vector;
<a name="l00244"></a>00244 }
<a name="l00245"></a>00245
<a name="l00246"></a>00246 <span class="comment">/********************************************************************************/</span>
<a name="l00247"></a>00247
<a name="l00248"></a>00248 <span class="keywordtype">void</span>
<a name="l00249"></a><a class="code" href="class_a_p___i_m_u.html#ad10efda15dac602284616a6e56800efb">00249</a> <a class="code" href="class_a_p___i_m_u.html#ad10efda15dac602284616a6e56800efb">AP_IMU::load_gyro_eeprom</a>(<span class="keywordtype">void</span>)
<a name="l00250"></a>00250 {
<a name="l00251"></a>00251 _adc_offset[0] = read_EE_float(_address );
<a name="l00252"></a>00252 _adc_offset[1] = read_EE_float(_address + 4);
<a name="l00253"></a>00253 _adc_offset[2] = read_EE_float(_address + 8);
<a name="l00254"></a>00254 }
<a name="l00255"></a>00255
<a name="l00256"></a>00256 <span class="keywordtype">void</span>
<a name="l00257"></a><a class="code" href="class_a_p___i_m_u.html#a8ac2bdf10de028677126ddb8e19d1461">00257</a> <a class="code" href="class_a_p___i_m_u.html#a8ac2bdf10de028677126ddb8e19d1461">AP_IMU::save_gyro_eeprom</a>(<span class="keywordtype">void</span>)
<a name="l00258"></a>00258 {
<a name="l00259"></a>00259 write_EE_float(_adc_offset[0], _address);
<a name="l00260"></a>00260 write_EE_float(_adc_offset[1], _address + 4);
<a name="l00261"></a>00261 write_EE_float(_adc_offset[2], _address + 8);
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263
<a name="l00264"></a>00264 <span class="comment">/********************************************************************************/</span>
<a name="l00265"></a>00265
<a name="l00266"></a>00266 <span class="keywordtype">void</span>
<a name="l00267"></a><a class="code" href="class_a_p___i_m_u.html#a4616301dc3a4cb739d3b62dd9bdc83d2">00267</a> <a class="code" href="class_a_p___i_m_u.html#a4616301dc3a4cb739d3b62dd9bdc83d2">AP_IMU::load_accel_eeprom</a>(<span class="keywordtype">void</span>)
<a name="l00268"></a>00268 {
<a name="l00269"></a>00269 _adc_offset[3] = read_EE_float(_address + 12);
<a name="l00270"></a>00270 _adc_offset[4] = read_EE_float(_address + 16);
<a name="l00271"></a>00271 _adc_offset[5] = read_EE_float(_address + 20);
<a name="l00272"></a>00272 }
<a name="l00273"></a>00273
<a name="l00274"></a>00274 <span class="keywordtype">void</span>
<a name="l00275"></a><a class="code" href="class_a_p___i_m_u.html#a9009257aec9cdd8e0f2366b0ad74ecfd">00275</a> <a class="code" href="class_a_p___i_m_u.html#a9009257aec9cdd8e0f2366b0ad74ecfd">AP_IMU::save_accel_eeprom</a>(<span class="keywordtype">void</span>)
<a name="l00276"></a>00276 {
<a name="l00277"></a>00277 write_EE_float(_adc_offset[3], _address + 12);
<a name="l00278"></a>00278 write_EE_float(_adc_offset[4], _address + 16);
<a name="l00279"></a>00279 write_EE_float(_adc_offset[5], _address + 20);
<a name="l00280"></a>00280 }
<a name="l00281"></a>00281
<a name="l00282"></a>00282 <span class="keywordtype">void</span>
<a name="l00283"></a><a class="code" href="class_a_p___i_m_u.html#aae1c9f706c123b598ea503edb85e232e">00283</a> <a class="code" href="class_a_p___i_m_u.html#aae1c9f706c123b598ea503edb85e232e">AP_IMU::print_accel_offsets</a>(<span class="keywordtype">void</span>)
<a name="l00284"></a>00284 {
<a name="l00285"></a>00285 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;Accel offsets: &quot;</span>);
<a name="l00286"></a>00286 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(_adc_offset[3], 2);
<a name="l00287"></a>00287 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;, &quot;</span>);
<a name="l00288"></a>00288 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(_adc_offset[4], 2);
<a name="l00289"></a>00289 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;, &quot;</span>);
<a name="l00290"></a>00290 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(_adc_offset[5], 2);
<a name="l00291"></a>00291 }
<a name="l00292"></a>00292
<a name="l00293"></a>00293 <span class="keywordtype">void</span>
<a name="l00294"></a><a class="code" href="class_a_p___i_m_u.html#a2acce1a94d9f8cb636682b2526006007">00294</a> <a class="code" href="class_a_p___i_m_u.html#a2acce1a94d9f8cb636682b2526006007">AP_IMU::print_gyro_offsets</a>(<span class="keywordtype">void</span>)
<a name="l00295"></a>00295 {
<a name="l00296"></a>00296 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;Gyro offsets: &quot;</span>);
<a name="l00297"></a>00297 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(_adc_offset[0], 2);
<a name="l00298"></a>00298 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;, &quot;</span>);
<a name="l00299"></a>00299 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(_adc_offset[1], 2);
<a name="l00300"></a>00300 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;, &quot;</span>);
<a name="l00301"></a>00301 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(_adc_offset[2], 2);
<a name="l00302"></a>00302 }
<a name="l00303"></a>00303
<a name="l00304"></a>00304
<a name="l00305"></a>00305
<a name="l00306"></a>00306 <span class="comment">/********************************************************************************/</span>
<a name="l00307"></a>00307
<a name="l00308"></a>00308 <span class="keywordtype">float</span>
<a name="l00309"></a>00309 AP_IMU::read_EE_float(<span class="keywordtype">int</span> address)
<a name="l00310"></a>00310 {
<a name="l00311"></a>00311 <span class="keyword">union </span>{
<a name="l00312"></a>00312 byte bytes[4];
<a name="l00313"></a>00313 <span class="keywordtype">float</span> value;
<a name="l00314"></a>00314 } _floatOut;
<a name="l00315"></a>00315
<a name="l00316"></a>00316 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 4; i++)
<a name="l00317"></a>00317 _floatOut.bytes[i] = eeprom_read_byte((uint8_t *) (address + i));
<a name="l00318"></a>00318 <span class="keywordflow">return</span> _floatOut.value;
<a name="l00319"></a>00319 }
<a name="l00320"></a>00320
<a name="l00321"></a>00321 <span class="keywordtype">void</span>
<a name="l00322"></a>00322 AP_IMU::write_EE_float(<span class="keywordtype">float</span> value, <span class="keywordtype">int</span> address)
<a name="l00323"></a>00323 {
<a name="l00324"></a>00324 <span class="keyword">union </span>{
<a name="l00325"></a>00325 byte bytes[4];
<a name="l00326"></a>00326 <span class="keywordtype">float</span> value;
<a name="l00327"></a>00327 } _floatIn;
<a name="l00328"></a>00328
<a name="l00329"></a>00329 _floatIn.value = value;
<a name="l00330"></a>00330 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 4; i++)
<a name="l00331"></a>00331 eeprom_write_byte((uint8_t *) (address + i), _floatIn.bytes[i]);
<a name="l00332"></a>00332 }
<a name="l00333"></a>00333
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,67 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_IMU.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_IMU.h File Reference</h1> </div>
</div>
<div class="contents">
<p>Catch-all header that defines all supported <a class="el" href="class_i_m_u.html">IMU</a> classes.
<a href="#_details">More...</a></p>
<code>#include &quot;<a class="el" href="_a_p___i_m_u___oilpan_8h_source.html">AP_IMU_Oilpan.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___i_m_u___shim_8h_source.html">AP_IMU_Shim.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_IMU.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___i_m_u_8h__incl.png" border="0" usemap="#_a_p___i_m_u_8h" alt=""/></div>
<map name="_a_p___i_m_u_8h" id="_a_p___i_m_u_8h">
<area shape="rect" id="node3" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="160,83,288,112"/><area shape="rect" id="node34" href="_a_p___i_m_u___shim_8h.html" title="IMU shim driver, used when the IMU data is coming from somewhere else." alt="" coords="312,83,435,112"/><area shape="rect" id="node5" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit." alt="" coords="161,160,220,189"/><area shape="rect" id="node7" href="_a_p___math_8h.html" title="AP_Math.h" alt="" coords="79,237,169,267"/><area shape="rect" id="node24" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="328,160,413,189"/><area shape="rect" id="node9" href="vector2_8h.html" title="vector2.h" alt="" coords="5,392,88,421"/><area shape="rect" id="node13" href="vector3_8h.html" title="vector3.h" alt="" coords="112,392,195,421"/><area shape="rect" id="node18" href="matrix3_8h.html" title="matrix3.h" alt="" coords="135,315,217,344"/><area shape="rect" id="node26" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="295,237,447,267"/><area shape="rect" id="node29" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="471,237,583,267"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___i_m_u_8h__dep__incl.png" border="0" usemap="#_a_p___i_m_u_8hdep" alt=""/></div>
<map name="_a_p___i_m_u_8hdep" id="_a_p___i_m_u_8hdep">
<area shape="rect" id="node3" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,83,208,112"/><area shape="rect" id="node5" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,160,100,189"/><area shape="rect" id="node9" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,160,255,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,237,107,267"/></map>
</div>
<p><a href="_a_p___i_m_u_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Catch-all header that defines all supported <a class="el" href="class_i_m_u.html">IMU</a> classes. </p>
<p><a class="el" href="class_i_m_u.html">IMU</a> driver for the APM oilpan.</p>
<p>Definition in file <a class="el" href="_a_p___i_m_u_8h_source.html">AP_IMU.h</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,44 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_IMU.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_IMU.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___i_m_u_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan.">AP_IMU_Oilpan.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___i_m_u___shim_8h.html" title="IMU shim driver, used when the IMU data is coming from somewhere else.">AP_IMU_Shim.h</a>&quot;</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,192 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_IMU_Oilpan.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>AP_IMU_Oilpan.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &lt;<a class="el" href="_fast_serial_8h_source.html">FastSerial.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___common_8h_source.html">AP_Common.h</a>&gt;</code><br/>
<code>#include &lt;avr/eeprom.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_a_p___i_m_u___oilpan_8h_source.html">AP_IMU_Oilpan.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_IMU_Oilpan.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___i_m_u___oilpan_8cpp__incl.png" border="0" usemap="#_a_p___i_m_u___oilpan_8cpp" alt=""/></div>
<map name="_a_p___i_m_u___oilpan_8cpp" id="_a_p___i_m_u___oilpan_8cpp">
<area shape="rect" id="node3" href="_fast_serial_8h.html" title="FastSerial.h" alt="" coords="236,237,332,267"/><area shape="rect" id="node19" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries." alt="" coords="501,83,619,112"/><area shape="rect" id="node40" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="972,83,1100,112"/><area shape="rect" id="node13" href="_better_stream_8h.html" title="BetterStream.h" alt="" coords="235,315,357,344"/><area shape="rect" id="node23" href="menu_8h.html" title="Simple commandline menu subsystem. &#160;The Menu class implements a simple CLI that accepts commands type..." alt="" coords="668,160,788,189"/><area shape="rect" id="node25" href="c_09_09_8h.html" title="c++.h" alt="" coords="812,160,873,189"/><area shape="rect" id="node27" href="_a_p___vector_8h.html" title="AP_Vector.h" alt="" coords="387,237,485,267"/><area shape="rect" id="node33" href="_a_p___loop_8h.html" title="AP_Loop.h" alt="" coords="311,160,399,189"/><area shape="rect" id="node36" href="_a_p___var_8h.html" title="AP_Var.h" alt="" coords="473,160,551,189"/><area shape="rect" id="node31" href="_w_program_8h.html" title="WProgram.h" alt="" coords="472,315,571,344"/><area shape="rect" id="node42" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit." alt="" coords="1197,160,1256,189"/><area shape="rect" id="node44" href="_a_p___math_8h.html" title="AP_Math.h" alt="" coords="1264,237,1355,267"/><area shape="rect" id="node60" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="993,160,1079,189"/><area shape="rect" id="node46" href="vector2_8h.html" title="vector2.h" alt="" coords="1189,392,1272,421"/><area shape="rect" id="node50" href="vector3_8h.html" title="vector3.h" alt="" coords="1296,392,1379,421"/><area shape="rect" id="node55" href="matrix3_8h.html" title="matrix3.h" alt="" coords="1268,315,1351,344"/><area shape="rect" id="node62" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="1037,237,1189,267"/><area shape="rect" id="node65" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="901,237,1013,267"/></map>
</div>
<p><a href="_a_p___i_m_u___oilpan_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u___oilpan_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>&nbsp;&nbsp;&nbsp;37</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u___oilpan_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>&nbsp;&nbsp;&nbsp;35</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u___oilpan_8cpp.html#a6801baa546c6112d19eb095111d24720">GRAVITY</a>&nbsp;&nbsp;&nbsp;418.0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u___oilpan_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">accel_scale</a>(x)&nbsp;&nbsp;&nbsp;(x*9.80665/GRAVITY)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u___oilpan_8cpp.html#a0faaa1abe1ae542341b8d9bd7ce54d99">_gyro_gain_x</a>&nbsp;&nbsp;&nbsp;0.4</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u___oilpan_8cpp.html#afc839d9b91d74b4baffdde51408108b5">_gyro_gain_y</a>&nbsp;&nbsp;&nbsp;0.41</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u___oilpan_8cpp.html#aee78c6ea2bb7b6e8a9d967d4fc7fe127">_gyro_gain_z</a>&nbsp;&nbsp;&nbsp;0.41</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>&nbsp;&nbsp;&nbsp;900</td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a0faaa1abe1ae542341b8d9bd7ce54d99"></a><!-- doxytag: member="AP_IMU_Oilpan.cpp::_gyro_gain_x" ref="a0faaa1abe1ae542341b8d9bd7ce54d99" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _gyro_gain_x&nbsp;&nbsp;&nbsp;0.4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html#l00036">36</a> of file <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html">AP_IMU_Oilpan.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="afc839d9b91d74b4baffdde51408108b5"></a><!-- doxytag: member="AP_IMU_Oilpan.cpp::_gyro_gain_y" ref="afc839d9b91d74b4baffdde51408108b5" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _gyro_gain_y&nbsp;&nbsp;&nbsp;0.41</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html#l00037">37</a> of file <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html">AP_IMU_Oilpan.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aee78c6ea2bb7b6e8a9d967d4fc7fe127"></a><!-- doxytag: member="AP_IMU_Oilpan.cpp::_gyro_gain_z" ref="aee78c6ea2bb7b6e8a9d967d4fc7fe127" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _gyro_gain_z&nbsp;&nbsp;&nbsp;0.41</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html#l00038">38</a> of file <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html">AP_IMU_Oilpan.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a89a26b9d37cc51864764942700a2fc15"></a><!-- doxytag: member="AP_IMU_Oilpan.cpp::A_LED_PIN" ref="a89a26b9d37cc51864764942700a2fc15" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define A_LED_PIN&nbsp;&nbsp;&nbsp;37</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html#l00025">25</a> of file <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html">AP_IMU_Oilpan.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a13e740232f35f26c07b1b915cab9d4bc"></a><!-- doxytag: member="AP_IMU_Oilpan.cpp::accel_scale" ref="a13e740232f35f26c07b1b915cab9d4bc" args="(x)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define accel_scale</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">x</td>
<td>&nbsp;)&nbsp;</td>
<td>&nbsp;&nbsp;&nbsp;(x*9.80665/GRAVITY)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html#l00032">32</a> of file <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html">AP_IMU_Oilpan.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae4132efd8235f9b057b6b1d24272dd79"></a><!-- doxytag: member="AP_IMU_Oilpan.cpp::ADC_CONSTRAINT" ref="ae4132efd8235f9b057b6b1d24272dd79" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ADC_CONSTRAINT&nbsp;&nbsp;&nbsp;900</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html#l00040">40</a> of file <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html">AP_IMU_Oilpan.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a48fee4bef9f91c681247a9858c246b78"></a><!-- doxytag: member="AP_IMU_Oilpan.cpp::C_LED_PIN" ref="a48fee4bef9f91c681247a9858c246b78" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define C_LED_PIN&nbsp;&nbsp;&nbsp;35</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html#l00026">26</a> of file <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html">AP_IMU_Oilpan.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6801baa546c6112d19eb095111d24720"></a><!-- doxytag: member="AP_IMU_Oilpan.cpp::GRAVITY" ref="a6801baa546c6112d19eb095111d24720" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GRAVITY&nbsp;&nbsp;&nbsp;418.0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html#l00031">31</a> of file <a class="el" href="_a_p___i_m_u___oilpan_8cpp_source.html">AP_IMU_Oilpan.cpp</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,415 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_IMU_Oilpan.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_IMU_Oilpan.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___i_m_u___oilpan_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">//</span>
<a name="l00004"></a>00004 <span class="comment">// AP_IMU.cpp - IMU Sensor Library for Ardupilot Mega</span>
<a name="l00005"></a>00005 <span class="comment">// Code by Doug Weibel, Jordi Muñoz and Jose Julio. DIYDrones.com</span>
<a name="l00006"></a>00006 <span class="comment">//</span>
<a name="l00007"></a>00007 <span class="comment">// This library works with the ArduPilot Mega and &quot;Oilpan&quot;</span>
<a name="l00008"></a>00008 <span class="comment">//</span>
<a name="l00009"></a>00009 <span class="comment">// This library is free software; you can redistribute it and/or</span>
<a name="l00010"></a>00010 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00011"></a>00011 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00012"></a>00012 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment">//</span>
<a name="l00014"></a>00014
<a name="l00017"></a>00017
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;<a class="code" href="_fast_serial_8h.html">FastSerial.h</a>&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries.">AP_Common.h</a>&gt;</span>
<a name="l00020"></a>00020
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;avr/eeprom.h&gt;</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan.">AP_IMU_Oilpan.h</a>&quot;</span>
<a name="l00024"></a>00024
<a name="l00025"></a><a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a89a26b9d37cc51864764942700a2fc15">00025</a> <span class="preprocessor">#define A_LED_PIN 37 //37 = A, 35 = C</span>
<a name="l00026"></a><a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a48fee4bef9f91c681247a9858c246b78">00026</a> <span class="preprocessor"></span><span class="preprocessor">#define C_LED_PIN 35</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="comment">// ADC : Voltage reference 3.3v / 12bits(4096 steps) =&gt; 0.8mV/ADC step</span>
<a name="l00029"></a>00029 <span class="comment">// ADXL335 Sensitivity(from datasheet) =&gt; 330mV/g, 0.8mV/ADC step =&gt; 330/0.8 = 412</span>
<a name="l00030"></a>00030 <span class="comment">// Tested value : 418</span>
<a name="l00031"></a><a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a6801baa546c6112d19eb095111d24720">00031</a> <span class="preprocessor">#define GRAVITY 418.0 // 1G in the raw data coming from the accelerometer</span>
<a name="l00032"></a><a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define accel_scale(x) (x*9.80665/GRAVITY) // Scaling the raw data of the accel to actual acceleration in m/s/s</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="comment">// IDG500 Sensitivity (from datasheet) =&gt; 2.0mV/º/s, 0.8mV/ADC step =&gt; 0.8/3.33 = 0.4</span>
<a name="l00035"></a>00035 <span class="comment">// Tested values : 0.4026, ?, 0.4192</span>
<a name="l00036"></a><a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a0faaa1abe1ae542341b8d9bd7ce54d99">00036</a> <span class="preprocessor">#define _gyro_gain_x 0.4 //X axis Gyro gain</span>
<a name="l00037"></a><a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#afc839d9b91d74b4baffdde51408108b5">00037</a> <span class="preprocessor"></span><span class="preprocessor">#define _gyro_gain_y 0.41 //Y axis Gyro gain</span>
<a name="l00038"></a><a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#aee78c6ea2bb7b6e8a9d967d4fc7fe127">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define _gyro_gain_z 0.41 //Z axis Gyro</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a><a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">00040</a> <span class="preprocessor">#define ADC_CONSTRAINT 900</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span>
<a name="l00042"></a>00042 <span class="comment">// Sensors: GYROX, GYROY, GYROZ, ACCELX, ACCELY, ACCELZ</span>
<a name="l00043"></a>00043 <span class="keyword">const</span> uint8_t AP_IMU_Oilpan::_sensors[6] = { 1, 2, 0, 4, 5, 6}; <span class="comment">// For ArduPilot Mega Sensor Shield Hardware</span>
<a name="l00044"></a>00044 <span class="keyword">const</span> int8_t AP_IMU_Oilpan::_sensor_signs[6] = { 1,-1,-1, 1,-1,-1};
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="comment">// Temp compensation curve constants</span>
<a name="l00047"></a>00047 <span class="comment">// These must be produced by measuring data and curve fitting</span>
<a name="l00048"></a>00048 <span class="comment">// [X/Y/Z gyro][A/B/C or 0 order/1st order/2nd order constants]</span>
<a name="l00049"></a>00049 <span class="keyword">const</span> <span class="keywordtype">float</span> AP_IMU_Oilpan::_gyro_temp_curve[3][3] = {
<a name="l00050"></a>00050 {1665,0,0},
<a name="l00051"></a>00051 {1665,0,0},
<a name="l00052"></a>00052 {1665,0,0}
<a name="l00053"></a>00053 }; <span class="comment">// To Do - make additional constructors to pass this in.</span>
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="keywordtype">void</span>
<a name="l00056"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#abc3ac9bdd9c8fb93e9dda339ae66ea71">00056</a> <a class="code" href="class_a_p___i_m_u___oilpan.html#abc3ac9bdd9c8fb93e9dda339ae66ea71">AP_IMU_Oilpan::init</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style)
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 <a class="code" href="class_a_p___i_m_u___oilpan.html#a21fdbf920ac0697dfe97b8f2d138bda0">init_gyro</a>(style);
<a name="l00059"></a>00059 <a class="code" href="class_a_p___i_m_u___oilpan.html#a8f258421660cdd01fbf945108514d657">init_accel</a>(style);
<a name="l00060"></a>00060 }
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <span class="comment">/**************************************************/</span>
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <span class="keywordtype">void</span>
<a name="l00065"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#a21fdbf920ac0697dfe97b8f2d138bda0">00065</a> <a class="code" href="class_a_p___i_m_u___oilpan.html#a21fdbf920ac0697dfe97b8f2d138bda0">AP_IMU_Oilpan::init_gyro</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style)
<a name="l00066"></a>00066 {
<a name="l00067"></a>00067 <span class="keywordtype">float</span> temp;
<a name="l00068"></a>00068 <span class="keywordtype">int</span> flashcount = 0;
<a name="l00069"></a>00069 <span class="keywordtype">int</span> tc_temp;
<a name="l00070"></a>00070 <span class="keywordtype">float</span> adc_in[6];
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="comment">// warm start, load saved cal from EEPROM</span>
<a name="l00073"></a>00073 <span class="keywordflow">if</span> ((<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7a966ab2a7917892dd74154eae066f6838">WARM_START</a> == style) &amp;&amp; (0 != _address)) {
<a name="l00074"></a>00074 _adc_offset[0] = read_EE_float(_address );
<a name="l00075"></a>00075 _adc_offset[1] = read_EE_float(_address + 4);
<a name="l00076"></a>00076 _adc_offset[2] = read_EE_float(_address + 8);
<a name="l00077"></a>00077 <span class="keywordflow">return</span>;
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079
<a name="l00080"></a>00080 <span class="comment">// cold start</span>
<a name="l00081"></a>00081 tc_temp = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_gyro_temp_ch);
<a name="l00082"></a>00082 delay(500);
<a name="l00083"></a>00083 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot;Init Gyro&quot;</span>);
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> c = 0; c &lt; 200; c++){
<a name="l00086"></a>00086 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, LOW);
<a name="l00087"></a>00087 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, HIGH);
<a name="l00088"></a>00088 delay(20);
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 6; i++)
<a name="l00091"></a>00091 adc_in[i] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[i]);
<a name="l00092"></a>00092
<a name="l00093"></a>00093 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, HIGH);
<a name="l00094"></a>00094 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, LOW);
<a name="l00095"></a>00095 delay(20);
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097
<a name="l00098"></a>00098 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; 200; i++){
<a name="l00099"></a>00099 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt;= 2; j++){
<a name="l00100"></a>00100 adc_in[j] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[j]);
<a name="l00101"></a>00101
<a name="l00102"></a>00102 <span class="comment">// Subtract temp compensated typical gyro bias</span>
<a name="l00103"></a>00103 adc_in[j] -= _gyro_temp_comp(j, tc_temp);
<a name="l00104"></a>00104
<a name="l00105"></a>00105 <span class="comment">// filter</span>
<a name="l00106"></a>00106 _adc_offset[j] = _adc_offset[j] * 0.9 + adc_in[j] * 0.1;
<a name="l00107"></a>00107 <span class="comment">//Serial.print(_adc_offset[j], 1);</span>
<a name="l00108"></a>00108 <span class="comment">//Serial.print(&quot;, &quot;);</span>
<a name="l00109"></a>00109 }
<a name="l00110"></a>00110 <span class="comment">//Serial.println(&quot; &quot;);</span>
<a name="l00111"></a>00111
<a name="l00112"></a>00112 delay(20);
<a name="l00113"></a>00113 <span class="keywordflow">if</span>(flashcount == 5) {
<a name="l00114"></a>00114 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;*&quot;</span>);
<a name="l00115"></a>00115 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, LOW);
<a name="l00116"></a>00116 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, HIGH);
<a name="l00117"></a>00117 }
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <span class="keywordflow">if</span>(flashcount &gt;= 10) {
<a name="l00120"></a>00120 flashcount = 0;
<a name="l00121"></a>00121 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, LOW);
<a name="l00122"></a>00122 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, HIGH);
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 flashcount++;
<a name="l00125"></a>00125 }
<a name="l00126"></a>00126 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot; &quot;</span>);
<a name="l00127"></a>00127
<a name="l00128"></a>00128 _save_gyro_cal();
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130
<a name="l00131"></a>00131
<a name="l00132"></a>00132 <span class="keywordtype">void</span>
<a name="l00133"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#a8f258421660cdd01fbf945108514d657">00133</a> <a class="code" href="class_a_p___i_m_u___oilpan.html#a8f258421660cdd01fbf945108514d657">AP_IMU_Oilpan::init_accel</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style) <span class="comment">// 3, 4, 5</span>
<a name="l00134"></a>00134 {
<a name="l00135"></a>00135 <span class="keywordtype">float</span> temp;
<a name="l00136"></a>00136 <span class="keywordtype">int</span> flashcount = 0;
<a name="l00137"></a>00137 <span class="keywordtype">float</span> adc_in[6];
<a name="l00138"></a>00138
<a name="l00139"></a>00139 <span class="comment">// warm start, load our saved cal from EEPROM</span>
<a name="l00140"></a>00140 <span class="keywordflow">if</span> ((<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7a966ab2a7917892dd74154eae066f6838">WARM_START</a> == style) &amp;&amp; (0 != _address)) {
<a name="l00141"></a>00141 _adc_offset[3] = read_EE_float(_address + 12);
<a name="l00142"></a>00142 _adc_offset[4] = read_EE_float(_address + 16);
<a name="l00143"></a>00143 _adc_offset[5] = read_EE_float(_address + 20);
<a name="l00144"></a>00144 <span class="keywordflow">return</span>;
<a name="l00145"></a>00145 }
<a name="l00146"></a>00146
<a name="l00147"></a>00147 <span class="comment">// cold start</span>
<a name="l00148"></a>00148 delay(500);
<a name="l00149"></a>00149
<a name="l00150"></a>00150 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot;Init Accel&quot;</span>);
<a name="l00151"></a>00151
<a name="l00152"></a>00152 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 3; j &lt;= 5; j++){
<a name="l00153"></a>00153 adc_in[j] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[j]);
<a name="l00154"></a>00154 adc_in[j] -= 2025; <span class="comment">// XXX bias value?</span>
<a name="l00155"></a>00155 _adc_offset[j] = adc_in[j];
<a name="l00156"></a>00156 }
<a name="l00157"></a>00157
<a name="l00158"></a>00158 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; 200; i++){ <span class="comment">// We take some readings...</span>
<a name="l00159"></a>00159
<a name="l00160"></a>00160 delay(20);
<a name="l00161"></a>00161
<a name="l00162"></a>00162 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 3; j &lt;= 5; j++){
<a name="l00163"></a>00163 adc_in[j] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[j]);
<a name="l00164"></a>00164 adc_in[j] -= 2025;
<a name="l00165"></a>00165 _adc_offset[j] = _adc_offset[j] * 0.9 + adc_in[j] * 0.1;
<a name="l00166"></a>00166 <span class="comment">//Serial.print(j);</span>
<a name="l00167"></a>00167 <span class="comment">//Serial.print(&quot;: &quot;);</span>
<a name="l00168"></a>00168 <span class="comment">//Serial.print(adc_in[j], 1);</span>
<a name="l00169"></a>00169 <span class="comment">//Serial.print(&quot; | &quot;);</span>
<a name="l00170"></a>00170 <span class="comment">//Serial.print(_adc_offset[j], 1);</span>
<a name="l00171"></a>00171 <span class="comment">//Serial.print(&quot;, &quot;);</span>
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173
<a name="l00174"></a>00174 <span class="comment">//Serial.println(&quot; &quot;);</span>
<a name="l00175"></a>00175
<a name="l00176"></a>00176 <span class="keywordflow">if</span>(flashcount == 5) {
<a name="l00177"></a>00177 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;*&quot;</span>);
<a name="l00178"></a>00178 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, LOW);
<a name="l00179"></a>00179 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, HIGH);
<a name="l00180"></a>00180 }
<a name="l00181"></a>00181
<a name="l00182"></a>00182 <span class="keywordflow">if</span>(flashcount &gt;= 10) {
<a name="l00183"></a>00183 flashcount = 0;
<a name="l00184"></a>00184 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a48fee4bef9f91c681247a9858c246b78">C_LED_PIN</a>, LOW);
<a name="l00185"></a>00185 digitalWrite(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a89a26b9d37cc51864764942700a2fc15">A_LED_PIN</a>, HIGH);
<a name="l00186"></a>00186 }
<a name="l00187"></a>00187 flashcount++;
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(<span class="stringliteral">&quot; &quot;</span>);
<a name="l00190"></a>00190 _adc_offset[5] += <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a6801baa546c6112d19eb095111d24720">GRAVITY</a> * _sensor_signs[5];
<a name="l00191"></a>00191
<a name="l00192"></a>00192 _save_accel_cal();
<a name="l00193"></a>00193 }
<a name="l00194"></a>00194
<a name="l00195"></a>00195 <span class="keywordtype">void</span>
<a name="l00196"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#a58cfd66961c2c798db47808135a18714">00196</a> <a class="code" href="class_a_p___i_m_u___oilpan.html#a58cfd66961c2c798db47808135a18714">AP_IMU_Oilpan::zero_accel</a>(<span class="keywordtype">void</span>) <span class="comment">// 3, 4, 5</span>
<a name="l00197"></a>00197 {
<a name="l00198"></a>00198 _adc_offset[3] = 0;
<a name="l00199"></a>00199 _adc_offset[4] = 0;
<a name="l00200"></a>00200 _adc_offset[5] = 0;
<a name="l00201"></a>00201 _save_accel_cal();
<a name="l00202"></a>00202 }
<a name="l00203"></a>00203
<a name="l00204"></a>00204 <span class="keywordtype">void</span>
<a name="l00205"></a>00205 AP_IMU_Oilpan::_save_gyro_cal(<span class="keywordtype">void</span>)
<a name="l00206"></a>00206 {
<a name="l00207"></a>00207 <span class="comment">// save cal to EEPROM for warm start</span>
<a name="l00208"></a>00208 <span class="keywordflow">if</span> (0 != _address) {
<a name="l00209"></a>00209 write_EE_float(_adc_offset[0], _address);
<a name="l00210"></a>00210 write_EE_float(_adc_offset[1], _address + 4);
<a name="l00211"></a>00211 write_EE_float(_adc_offset[2], _address + 8);
<a name="l00212"></a>00212 }
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214
<a name="l00215"></a>00215 <span class="keywordtype">void</span>
<a name="l00216"></a>00216 AP_IMU_Oilpan::_save_accel_cal(<span class="keywordtype">void</span>)
<a name="l00217"></a>00217 {
<a name="l00218"></a>00218 <span class="comment">// save cal to EEPROM for warm start</span>
<a name="l00219"></a>00219 <span class="keywordflow">if</span> (0 != _address) {
<a name="l00220"></a>00220 write_EE_float(_adc_offset[3], _address + 12);
<a name="l00221"></a>00221 write_EE_float(_adc_offset[4], _address + 16);
<a name="l00222"></a>00222 write_EE_float(_adc_offset[5], _address + 20);
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224 }
<a name="l00225"></a>00225
<a name="l00226"></a>00226 <span class="comment">/**************************************************/</span>
<a name="l00227"></a>00227 <span class="comment">// Returns the temperature compensated raw gyro value</span>
<a name="l00228"></a>00228 <span class="comment">//---------------------------------------------------</span>
<a name="l00229"></a>00229 <span class="keywordtype">float</span>
<a name="l00230"></a>00230 AP_IMU_Oilpan::_gyro_temp_comp(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> temp)<span class="keyword"> const</span>
<a name="l00231"></a>00231 <span class="keyword"></span>{
<a name="l00232"></a>00232 <span class="comment">// We use a 2nd order curve of the form Gtc = A + B * Graw + C * (Graw)**2</span>
<a name="l00233"></a>00233 <span class="comment">//------------------------------------------------------------------------</span>
<a name="l00234"></a>00234 <span class="keywordflow">return</span> _gyro_temp_curve[i][0] + _gyro_temp_curve[i][1] * temp + _gyro_temp_curve[i][2] * temp * temp;
<a name="l00235"></a>00235 }
<a name="l00236"></a>00236
<a name="l00237"></a>00237 <span class="keywordtype">float</span>
<a name="l00238"></a>00238 AP_IMU_Oilpan::_gyro_in(uint8_t channel, <span class="keywordtype">int</span> temperature)
<a name="l00239"></a>00239 {
<a name="l00240"></a>00240 <span class="keywordtype">float</span> adc_in;
<a name="l00241"></a>00241
<a name="l00242"></a>00242 adc_in = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[channel]);
<a name="l00243"></a>00243 adc_in -= _gyro_temp_comp(channel, temperature); <span class="comment">// Subtract temp compensated typical gyro bias</span>
<a name="l00244"></a>00244 <span class="keywordflow">if</span> (_sensor_signs[channel] &lt; 0) {
<a name="l00245"></a>00245 adc_in = _adc_offset[channel] - adc_in;
<a name="l00246"></a>00246 } <span class="keywordflow">else</span> {
<a name="l00247"></a>00247 adc_in = adc_in - _adc_offset[channel];
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249
<a name="l00250"></a>00250 <span class="keywordflow">if</span> (fabs(adc_in) &gt; <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>) {
<a name="l00251"></a>00251 <a class="code" href="class_i_m_u.html#a1239aaa3224c964504f5ff1945950770">adc_constraints</a>++; <span class="comment">// We keep track of the number of times</span>
<a name="l00252"></a>00252 adc_in = constrain(adc_in, -<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>, <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>); <span class="comment">// Throw out nonsensical values</span>
<a name="l00253"></a>00253 }
<a name="l00254"></a>00254 <span class="keywordflow">return</span> adc_in;
<a name="l00255"></a>00255 }
<a name="l00256"></a>00256
<a name="l00257"></a>00257 <span class="keywordtype">float</span>
<a name="l00258"></a>00258 AP_IMU_Oilpan::_accel_in(uint8_t channel)
<a name="l00259"></a>00259 {
<a name="l00260"></a>00260 <span class="keywordtype">float</span> adc_in;
<a name="l00261"></a>00261
<a name="l00262"></a>00262 adc_in = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[channel]);
<a name="l00263"></a>00263 adc_in -= 2025; <span class="comment">// Subtract typical accel bias</span>
<a name="l00264"></a>00264
<a name="l00265"></a>00265 <span class="keywordflow">if</span> (_sensor_signs[channel] &lt; 0) {
<a name="l00266"></a>00266 adc_in = _adc_offset[channel] - adc_in;
<a name="l00267"></a>00267 } <span class="keywordflow">else</span> {
<a name="l00268"></a>00268 adc_in = adc_in - _adc_offset[channel];
<a name="l00269"></a>00269 }
<a name="l00270"></a>00270
<a name="l00271"></a>00271 <span class="keywordflow">if</span> (fabs(adc_in) &gt; <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>) {
<a name="l00272"></a>00272 <a class="code" href="class_i_m_u.html#a1239aaa3224c964504f5ff1945950770">adc_constraints</a>++; <span class="comment">// We keep track of the number of times</span>
<a name="l00273"></a>00273 adc_in = constrain(adc_in, -<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>, <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>); <span class="comment">// Throw out nonsensical values</span>
<a name="l00274"></a>00274 }
<a name="l00275"></a>00275 <span class="keywordflow">return</span> adc_in;
<a name="l00276"></a>00276 }
<a name="l00277"></a>00277
<a name="l00278"></a>00278 <span class="keywordtype">bool</span>
<a name="l00279"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#a766a65169e94a095c6194e511558717d">00279</a> <a class="code" href="class_a_p___i_m_u___oilpan.html#a766a65169e94a095c6194e511558717d">AP_IMU_Oilpan::update</a>(<span class="keywordtype">void</span>)
<a name="l00280"></a>00280 {
<a name="l00281"></a>00281 <span class="keywordtype">int</span> tc_temp = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_gyro_temp_ch);
<a name="l00282"></a>00282 <span class="keywordtype">float</span> adc_in[6];
<a name="l00283"></a>00283 <span class="preprocessor">#if 0</span>
<a name="l00284"></a>00284 <span class="preprocessor"></span> <span class="comment">// get current gyro readings</span>
<a name="l00285"></a>00285 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 3; i++) {
<a name="l00286"></a>00286 adc_in[i] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[i]);
<a name="l00287"></a>00287 adc_in[i] -= _gyro_temp_comp(i,tc_temp); <span class="comment">// Subtract temp compensated typical gyro bias</span>
<a name="l00288"></a>00288 <span class="keywordflow">if</span> (_sensor_signs[i] &lt; 0)
<a name="l00289"></a>00289 adc_in[i] = (_adc_offset[i] - adc_in[i]);
<a name="l00290"></a>00290 <span class="keywordflow">else</span>
<a name="l00291"></a>00291 adc_in[i] = (adc_in[i] - _adc_offset[i]);
<a name="l00292"></a>00292
<a name="l00293"></a>00293 <span class="keywordflow">if</span> (fabs(adc_in[i]) &gt; ADC_CONSTRAINT) {
<a name="l00294"></a>00294 <a class="code" href="class_i_m_u.html#a1239aaa3224c964504f5ff1945950770">adc_constraints</a>++; <span class="comment">// We keep track of the number of times</span>
<a name="l00295"></a>00295 adc_in[i] = constrain(adc_in[i], -<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>, <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>); <span class="comment">// Throw out nonsensical values</span>
<a name="l00296"></a>00296 }
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298 <span class="preprocessor">#endif</span>
<a name="l00299"></a>00299 <span class="preprocessor"></span> <a class="code" href="class_i_m_u.html#a33f0574d229be1b24acb99334e174709" title="Most recent gyro reading obtained by update.">_gyro</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = <a class="code" href="_a_p___common_8h.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a0faaa1abe1ae542341b8d9bd7ce54d99">_gyro_gain_x</a>) * _gyro_in(0, tc_temp);
<a name="l00300"></a>00300 <a class="code" href="class_i_m_u.html#a33f0574d229be1b24acb99334e174709" title="Most recent gyro reading obtained by update.">_gyro</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = <a class="code" href="_a_p___common_8h.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#afc839d9b91d74b4baffdde51408108b5">_gyro_gain_y</a>) * _gyro_in(1, tc_temp);
<a name="l00301"></a>00301 <a class="code" href="class_i_m_u.html#a33f0574d229be1b24acb99334e174709" title="Most recent gyro reading obtained by update.">_gyro</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = <a class="code" href="_a_p___common_8h.html#a728f9499baea61e7df3ae70a374f2512">ToRad</a>(<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#aee78c6ea2bb7b6e8a9d967d4fc7fe127">_gyro_gain_z</a>) * _gyro_in(2, tc_temp);
<a name="l00302"></a>00302 <span class="preprocessor">#if 0</span>
<a name="l00303"></a>00303 <span class="preprocessor"></span> <span class="comment">// get current accelerometer readings</span>
<a name="l00304"></a>00304 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 3; i &lt; 6; i++) {
<a name="l00305"></a>00305 adc_in[i] = _adc-&gt;<a class="code" href="class_a_p___a_d_c.html#a86463917e4e51400a0de3e12bb566c72">Ch</a>(_sensors[i]);
<a name="l00306"></a>00306 adc_in[i] -= 2025; <span class="comment">// Subtract typical accel bias</span>
<a name="l00307"></a>00307
<a name="l00308"></a>00308 <span class="keywordflow">if</span> (_sensor_signs[i] &lt; 0)
<a name="l00309"></a>00309 adc_in[i] = _adc_offset[i] - adc_in[i];
<a name="l00310"></a>00310 <span class="keywordflow">else</span>
<a name="l00311"></a>00311 adc_in[i] = adc_in[i] - _adc_offset[i];
<a name="l00312"></a>00312
<a name="l00313"></a>00313 <span class="keywordflow">if</span> (fabs(adc_in[i]) &gt; <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>) {
<a name="l00314"></a>00314 <a class="code" href="class_i_m_u.html#a1239aaa3224c964504f5ff1945950770">adc_constraints</a>++; <span class="comment">// We keep track of the number of times</span>
<a name="l00315"></a>00315 adc_in[i] = constrain(adc_in[i], -<a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>, <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#ae4132efd8235f9b057b6b1d24272dd79">ADC_CONSTRAINT</a>); <span class="comment">// Throw out nonsensical values</span>
<a name="l00316"></a>00316 }
<a name="l00317"></a>00317 }
<a name="l00318"></a>00318 <span class="preprocessor">#endif</span>
<a name="l00319"></a>00319 <span class="preprocessor"></span> <a class="code" href="class_i_m_u.html#aea1f8061c62fc5212895925157b06c74" title="Most recent accelerometer reading obtained by update.">_accel</a>.<a class="code" href="class_vector3.html#a1a0f7e168c71ca798099f0ba8a444244">x</a> = <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">accel_scale</a>(_accel_in(3));
<a name="l00320"></a>00320 <a class="code" href="class_i_m_u.html#aea1f8061c62fc5212895925157b06c74" title="Most recent accelerometer reading obtained by update.">_accel</a>.<a class="code" href="class_vector3.html#a561df88b28e106e337a25bb86554a569">y</a> = <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">accel_scale</a>(_accel_in(4));
<a name="l00321"></a>00321 <a class="code" href="class_i_m_u.html#aea1f8061c62fc5212895925157b06c74" title="Most recent accelerometer reading obtained by update.">_accel</a>.<a class="code" href="class_vector3.html#ab3e7f5401dd6e951978bfa746809f74f">z</a> = <a class="code" href="_a_p___i_m_u___oilpan_8cpp.html#a13e740232f35f26c07b1b915cab9d4bc">accel_scale</a>(_accel_in(5));
<a name="l00322"></a>00322
<a name="l00323"></a>00323 <span class="comment">// always updated</span>
<a name="l00324"></a>00324 <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00325"></a>00325 }
<a name="l00326"></a>00326
<a name="l00327"></a>00327 <span class="comment">/********************************************************************************/</span>
<a name="l00328"></a>00328
<a name="l00329"></a>00329 <span class="keywordtype">void</span>
<a name="l00330"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#acd8eef2327ac2aeb96397e343c18c8d6">00330</a> <a class="code" href="class_a_p___i_m_u___oilpan.html#acd8eef2327ac2aeb96397e343c18c8d6" title="XXX debug hack.">AP_IMU_Oilpan::print_accel_offsets</a>(<span class="keywordtype">void</span>)
<a name="l00331"></a>00331 {
<a name="l00332"></a>00332 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;Accel offsets: &quot;</span>);
<a name="l00333"></a>00333 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(_adc_offset[3], 2);
<a name="l00334"></a>00334 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;, &quot;</span>);
<a name="l00335"></a>00335 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(_adc_offset[4], 2);
<a name="l00336"></a>00336 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;, &quot;</span>);
<a name="l00337"></a>00337 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(_adc_offset[5], 2);
<a name="l00338"></a>00338 }
<a name="l00339"></a>00339
<a name="l00340"></a>00340 <span class="keywordtype">void</span>
<a name="l00341"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#a5ea5562c1913b8cd551522e65d816212">00341</a> <a class="code" href="class_a_p___i_m_u___oilpan.html#a5ea5562c1913b8cd551522e65d816212" title="XXX debug hack.">AP_IMU_Oilpan::print_gyro_offsets</a>(<span class="keywordtype">void</span>)
<a name="l00342"></a>00342 {
<a name="l00343"></a>00343 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;Gyro offsets: &quot;</span>);
<a name="l00344"></a>00344 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(_adc_offset[0], 2);
<a name="l00345"></a>00345 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;, &quot;</span>);
<a name="l00346"></a>00346 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(_adc_offset[1], 2);
<a name="l00347"></a>00347 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.print(<span class="stringliteral">&quot;, &quot;</span>);
<a name="l00348"></a>00348 <a class="code" href="_fast_serial_8h.html#a8e6f49b84135f0158fe250cb7338ddad">Serial</a>.println(_adc_offset[2], 2);
<a name="l00349"></a>00349 }
<a name="l00350"></a>00350
<a name="l00351"></a>00351 <span class="comment">/********************************************************************************/</span>
<a name="l00352"></a>00352
<a name="l00353"></a>00353 <span class="keywordtype">float</span>
<a name="l00354"></a>00354 AP_IMU_Oilpan::read_EE_float(<span class="keywordtype">int</span> address)
<a name="l00355"></a>00355 {
<a name="l00356"></a>00356 <span class="keyword">union </span>{
<a name="l00357"></a>00357 byte bytes[4];
<a name="l00358"></a>00358 <span class="keywordtype">float</span> value;
<a name="l00359"></a>00359 } _floatOut;
<a name="l00360"></a>00360
<a name="l00361"></a>00361 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 4; i++)
<a name="l00362"></a>00362 _floatOut.bytes[i] = eeprom_read_byte((uint8_t *) (address + i));
<a name="l00363"></a>00363 <span class="keywordflow">return</span> _floatOut.value;
<a name="l00364"></a>00364 }
<a name="l00365"></a>00365
<a name="l00366"></a>00366 <span class="keywordtype">void</span>
<a name="l00367"></a>00367 AP_IMU_Oilpan::write_EE_float(<span class="keywordtype">float</span> value, <span class="keywordtype">int</span> address)
<a name="l00368"></a>00368 {
<a name="l00369"></a>00369 <span class="keyword">union </span>{
<a name="l00370"></a>00370 byte bytes[4];
<a name="l00371"></a>00371 <span class="keywordtype">float</span> value;
<a name="l00372"></a>00372 } _floatIn;
<a name="l00373"></a>00373
<a name="l00374"></a>00374 _floatIn.value = value;
<a name="l00375"></a>00375 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 4; i++)
<a name="l00376"></a>00376 eeprom_write_byte((uint8_t *) (address + i), _floatIn.bytes[i]);
<a name="l00377"></a>00377 }
<a name="l00378"></a>00378
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,73 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_IMU_Oilpan.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_IMU_Oilpan.h File Reference</h1> </div>
</div>
<div class="contents">
<p><a class="el" href="class_i_m_u.html">IMU</a> driver for the APM oilpan.
<a href="#_details">More...</a></p>
<code>#include &quot;<a class="el" href="_i_m_u_8h_source.html">IMU.h</a>&quot;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___math_8h_source.html">AP_Math.h</a>&gt;</code><br/>
<code>#include &lt;<a class="el" href="_a_p___a_d_c_8h_source.html">AP_ADC.h</a>&gt;</code><br/>
<code>#include &lt;inttypes.h&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_IMU_Oilpan.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___i_m_u___oilpan_8h__incl.png" border="0" usemap="#_a_p___i_m_u___oilpan_8h" alt=""/></div>
<map name="_a_p___i_m_u___oilpan_8h" id="_a_p___i_m_u___oilpan_8h">
<area shape="rect" id="node3" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit." alt="" coords="161,83,220,112"/><area shape="rect" id="node5" href="_a_p___math_8h.html" title="AP_Math.h" alt="" coords="79,160,169,189"/><area shape="rect" id="node22" href="_a_p___a_d_c_8h.html" title="AP_ADC.h" alt="" coords="328,83,413,112"/><area shape="rect" id="node7" href="vector2_8h.html" title="vector2.h" alt="" coords="5,315,88,344"/><area shape="rect" id="node11" href="vector3_8h.html" title="vector3.h" alt="" coords="112,315,195,344"/><area shape="rect" id="node16" href="matrix3_8h.html" title="matrix3.h" alt="" coords="135,237,217,267"/><area shape="rect" id="node24" href="_a_p___a_d_c___a_d_s7844_8h.html" title="AP_ADC_ADS7844.h" alt="" coords="295,160,447,189"/><area shape="rect" id="node27" href="_a_p___a_d_c___h_i_l_8h.html" title="AP_ADC_HIL.h" alt="" coords="471,160,583,189"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___i_m_u___oilpan_8h__dep__incl.png" border="0" usemap="#_a_p___i_m_u___oilpan_8hdep" alt=""/></div>
<map name="_a_p___i_m_u___oilpan_8hdep" id="_a_p___i_m_u___oilpan_8hdep">
<area shape="rect" id="node3" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="61,83,144,112"/><area shape="rect" id="node14" href="_a_p___i_m_u___oilpan_8cpp.html" title="AP_IMU_Oilpan.cpp" alt="" coords="168,83,312,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___i_m_u___oilpan_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___i_m_u___oilpan.html">AP_IMU_Oilpan</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><a class="el" href="class_i_m_u.html">IMU</a> driver for the APM oilpan. </p>
<p>Definition in file <a class="el" href="_a_p___i_m_u___oilpan_8h_source.html">AP_IMU_Oilpan.h</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,99 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_IMU_Oilpan.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_IMU_Oilpan.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___i_m_u___oilpan_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#ifndef AP_IMU_Oilpan_h</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span><span class="preprocessor">#define AP_IMU_Oilpan_h</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit.">IMU.h</a>&quot;</span>
<a name="l00010"></a>00010
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___math_8h.html">AP_Math.h</a>&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;<a class="code" href="_a_p___a_d_c_8h.html">AP_ADC.h</a>&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00014"></a>00014
<a name="l00015"></a><a class="code" href="class_a_p___i_m_u___oilpan.html">00015</a> <span class="keyword">class </span><a class="code" href="class_a_p___i_m_u___oilpan.html">AP_IMU_Oilpan</a> : <span class="keyword">public</span> <a class="code" href="class_i_m_u.html">IMU</a>
<a name="l00016"></a>00016 {
<a name="l00017"></a>00017
<a name="l00018"></a>00018 <span class="keyword">public</span>:
<a name="l00019"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#a1c052aa18a95ef59ea63ee4e51e660c8">00019</a> <a class="code" href="class_a_p___i_m_u___oilpan.html#a1c052aa18a95ef59ea63ee4e51e660c8">AP_IMU_Oilpan</a>(<a class="code" href="class_a_p___a_d_c.html">AP_ADC</a> *adc, uint16_t address) :
<a name="l00020"></a>00020 _adc(adc),
<a name="l00021"></a>00021 _address(address)
<a name="l00022"></a>00022 {}
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#abc3ac9bdd9c8fb93e9dda339ae66ea71">init</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style = <a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7a424b5aaa81a970a788b293e6ae431d8a">COLD_START</a>);
<a name="l00025"></a>00025 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#a8f258421660cdd01fbf945108514d657">init_accel</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style = <a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7a424b5aaa81a970a788b293e6ae431d8a">COLD_START</a>);
<a name="l00026"></a>00026 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#a21fdbf920ac0697dfe97b8f2d138bda0">init_gyro</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style = <a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7a424b5aaa81a970a788b293e6ae431d8a">COLD_START</a>);
<a name="l00027"></a>00027 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#a766a65169e94a095c6194e511558717d">update</a>(<span class="keywordtype">void</span>);
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="comment">// XXX backwards compat hacks</span>
<a name="l00030"></a>00030 <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#a58cfd66961c2c798db47808135a18714">zero_accel</a>(<span class="keywordtype">void</span>);
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#acd8eef2327ac2aeb96397e343c18c8d6" title="XXX debug hack.">print_accel_offsets</a>(<span class="keywordtype">void</span>);
<a name="l00033"></a>00033 <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#a5ea5562c1913b8cd551522e65d816212" title="XXX debug hack.">print_gyro_offsets</a>(<span class="keywordtype">void</span>);
<a name="l00034"></a>00034
<a name="l00035"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#a1b06d4287bae84b6d0c8dcbb3346bef8">00035</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#a1b06d4287bae84b6d0c8dcbb3346bef8">ax</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> v) { _adc_offset[3] = v; }
<a name="l00036"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#a32ee20362392d6262e1b459765de5a97">00036</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#a32ee20362392d6262e1b459765de5a97">ay</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> v) { _adc_offset[4] = v; }
<a name="l00037"></a><a class="code" href="class_a_p___i_m_u___oilpan.html#aef91753e7d1429dc0238175020b58d77">00037</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___oilpan.html#aef91753e7d1429dc0238175020b58d77">az</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> v) { _adc_offset[5] = v; }
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="keyword">private</span>:
<a name="l00040"></a>00040 <span class="keywordtype">float</span> _gyro_temp_comp(<span class="keywordtype">int</span> i, <span class="keywordtype">int</span> temp) <span class="keyword">const</span>;
<a name="l00041"></a>00041 <span class="keywordtype">void</span> _save_gyro_cal(<span class="keywordtype">void</span>);
<a name="l00042"></a>00042 <span class="keywordtype">void</span> _save_accel_cal(<span class="keywordtype">void</span>);
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keywordtype">float</span> _gyro_in(uint8_t channel, <span class="keywordtype">int</span> temperature);
<a name="l00045"></a>00045 <span class="keywordtype">float</span> _accel_in(uint8_t channel);
<a name="l00046"></a>00046
<a name="l00047"></a>00047 <a class="code" href="class_a_p___a_d_c.html">AP_ADC</a> *_adc; <span class="comment">// Analog to digital converter pointer</span>
<a name="l00048"></a>00048 uint16_t _address; <span class="comment">// EEPROM start address for saving/retrieving offsets</span>
<a name="l00049"></a>00049 <span class="keywordtype">float</span> _adc_offset[6]; <span class="comment">// Array that store the Offset of the gyros and accelerometers</span>
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="comment">// XXX should not be implementing these here</span>
<a name="l00052"></a>00052 <span class="keywordtype">float</span> read_EE_float(<span class="keywordtype">int</span> address);
<a name="l00053"></a>00053 <span class="keywordtype">void</span> write_EE_float(<span class="keywordtype">float</span> value, <span class="keywordtype">int</span> address);
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="comment">// constants</span>
<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keyword">const</span> uint8_t _sensors[6];
<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keyword">const</span> int8_t _sensor_signs[6];
<a name="l00058"></a>00058 <span class="keyword">static</span> <span class="keyword">const</span> uint8_t _gyro_temp_ch = 3; <span class="comment">// The ADC channel reading the gyro temperature</span>
<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> _gyro_temp_curve[3][3];
<a name="l00060"></a>00060 };
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,62 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_IMU_Shim.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> </div>
<div class="headertitle">
<h1>AP_IMU_Shim.h File Reference</h1> </div>
</div>
<div class="contents">
<p><a class="el" href="class_i_m_u.html">IMU</a> shim driver, used when the <a class="el" href="class_i_m_u.html">IMU</a> data is coming from somewhere else.
<a href="#_details">More...</a></p>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___i_m_u___shim_8h__dep__incl.png" border="0" usemap="#_a_p___i_m_u___shim_8hdep" alt=""/></div>
<map name="_a_p___i_m_u___shim_8hdep" id="_a_p___i_m_u___shim_8hdep">
<area shape="rect" id="node3" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="61,83,144,112"/><area shape="rect" id="node5" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="93,160,208,189"/><area shape="rect" id="node7" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="12,237,100,267"/><area shape="rect" id="node11" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="124,237,255,267"/><area shape="rect" id="node9" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="5,315,107,344"/></map>
</div>
<p><a href="_a_p___i_m_u___shim_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_p___i_m_u___shim.html">AP_IMU_Shim</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><a class="el" href="class_i_m_u.html">IMU</a> shim driver, used when the <a class="el" href="class_i_m_u.html">IMU</a> data is coming from somewhere else. </p>
<p>Definition in file <a class="el" href="_a_p___i_m_u___shim_8h_source.html">AP_IMU_Shim.h</a>.</p>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,69 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_IMU_Shim.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_IMU_Shim.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___i_m_u___shim_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#ifndef AP_IMU_Shim_h</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span><span class="preprocessor">#define AP_IMU_Shim_h</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span>
<a name="l00009"></a><a class="code" href="class_a_p___i_m_u___shim.html">00009</a> <span class="keyword">class </span><a class="code" href="class_a_p___i_m_u___shim.html">AP_IMU_Shim</a> : <span class="keyword">public</span> <a class="code" href="class_i_m_u.html">IMU</a>
<a name="l00010"></a>00010 {
<a name="l00011"></a>00011 <span class="keyword">public</span>:
<a name="l00012"></a><a class="code" href="class_a_p___i_m_u___shim.html#aec820ee9ebcf27884168e20d4b03f757">00012</a> <a class="code" href="class_a_p___i_m_u___shim.html#aec820ee9ebcf27884168e20d4b03f757">AP_IMU_Shim</a>(<span class="keywordtype">void</span>) {}
<a name="l00013"></a>00013
<a name="l00015"></a>00015
<a name="l00016"></a><a class="code" href="class_a_p___i_m_u___shim.html#aeb4c1f84b7e00ba6112e75dd5c8a346b">00016</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___shim.html#aeb4c1f84b7e00ba6112e75dd5c8a346b">init</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style) {}
<a name="l00017"></a><a class="code" href="class_a_p___i_m_u___shim.html#ae49dccaf4fc2b3aa304a3769295f748e">00017</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___shim.html#ae49dccaf4fc2b3aa304a3769295f748e">init_accel</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style) {};
<a name="l00018"></a><a class="code" href="class_a_p___i_m_u___shim.html#a4e300b540ee13b6c62c996510a8c3ce2">00018</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___shim.html#a4e300b540ee13b6c62c996510a8c3ce2">init_gyro</a>(<a class="code" href="class_i_m_u.html#aa0586fbba61e2a982c8607171a03f5c7">Start_style</a> style) {};
<a name="l00019"></a><a class="code" href="class_a_p___i_m_u___shim.html#a548d3f60980363ada611cf0cb4da382a">00019</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="class_a_p___i_m_u___shim.html#a548d3f60980363ada611cf0cb4da382a">update</a>(<span class="keywordtype">void</span>) {
<a name="l00020"></a>00020 <span class="keywordtype">bool</span> updated = _updated;
<a name="l00021"></a>00021 _updated = <span class="keyword">false</span>;
<a name="l00022"></a>00022 <span class="keywordflow">return</span> updated;
<a name="l00023"></a>00023 }
<a name="l00025"></a>00025
<a name="l00031"></a><a class="code" href="class_a_p___i_m_u___shim.html#a890ea13076d7bfbf0bc72f86260a9141">00031</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___shim.html#a890ea13076d7bfbf0bc72f86260a9141">set_gyro</a>(<a class="code" href="class_vector3.html">Vector3f</a> v) { <a class="code" href="class_i_m_u.html#a33f0574d229be1b24acb99334e174709" title="Most recent gyro reading obtained by update.">_gyro</a> = v; _updated = <span class="keyword">true</span>; }
<a name="l00032"></a>00032
<a name="l00038"></a><a class="code" href="class_a_p___i_m_u___shim.html#a95349a4a1c392d021263839339e2a0a5">00038</a> <span class="keywordtype">void</span> <a class="code" href="class_a_p___i_m_u___shim.html#a95349a4a1c392d021263839339e2a0a5">set_accel</a>(<a class="code" href="class_vector3.html">Vector3f</a> v) { <a class="code" href="class_i_m_u.html#aea1f8061c62fc5212895925157b06c74" title="Most recent accelerometer reading obtained by update.">_accel</a> = v; _updated = <span class="keyword">true</span>; }
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="keyword">private</span>:
<a name="l00042"></a>00042 <span class="keywordtype">bool</span> _updated;
<a name="l00043"></a>00043 };
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,56 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Loop.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#namespaces">Namespaces</a> </div>
<div class="headertitle">
<h1>AP_Loop.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___loop_8h_source.html">AP_Loop.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Loop.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___loop_8cpp__incl.png" border="0" usemap="#_a_p___loop_8cpp" alt=""/></div>
<map name="_a_p___loop_8cpp" id="_a_p___loop_8cpp">
<area shape="rect" id="node3" href="_a_p___loop_8h.html" title="AP_Loop.h" alt="" coords="95,83,183,112"/><area shape="rect" id="node5" href="_a_p___vector_8h.html" title="AP_Vector.h" alt="" coords="89,160,188,189"/><area shape="rect" id="node11" href="_w_program_8h.html" title="WProgram.h" alt="" coords="205,237,304,267"/></map>
</div>
<p><a href="_a_p___loop_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">namespace &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceapo.html">apo</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,96 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Loop.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Loop.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___loop_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * AP_Loop.pde</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) James Goppert 2010 &lt;james.goppert@gmail.com&gt;</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * This file is free software: you can redistribute it and/or modify it</span>
<a name="l00006"></a>00006 <span class="comment"> * under the terms of the GNU General Public License as published by the</span>
<a name="l00007"></a>00007 <span class="comment"> * Free Software Foundation, either version 3 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment"> * (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * This file is distributed in the hope that it will be useful, but</span>
<a name="l00011"></a>00011 <span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span>
<a name="l00013"></a>00013 <span class="comment"> * See the GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
<a name="l00016"></a>00016 <span class="comment"> * with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00017"></a>00017 <span class="comment"> */</span>
<a name="l00018"></a>00018
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___loop_8h.html">AP_Loop.h</a>&quot;</span>
<a name="l00020"></a>00020
<a name="l00021"></a><a class="code" href="namespaceapo.html">00021</a> <span class="keyword">namespace </span>apo
<a name="l00022"></a>00022 {
<a name="l00023"></a>00023
<a name="l00024"></a><a class="code" href="classapo_1_1_loop.html#a75dc072e1d02ad2fe0cd56c6f3926ca3">00024</a> <a class="code" href="classapo_1_1_loop.html#a4a6ea4aeec32061bf86df9c9c32c5b24">Loop::Loop</a>(<span class="keywordtype">float</span> frequency, <span class="keywordtype">void</span> (*fptr)(<span class="keywordtype">void</span> *), <span class="keywordtype">void</span> * data) :
<a name="l00025"></a>00025 _fptr(fptr),
<a name="l00026"></a>00026 _data(data),
<a name="l00027"></a>00027 _period(1.0e6/frequency),
<a name="l00028"></a>00028 _timeStamp(micros()),
<a name="l00029"></a>00029 _subLoops(),
<a name="l00030"></a>00030 _load(0),
<a name="l00031"></a>00031 _dt(0)
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 }
<a name="l00034"></a>00034
<a name="l00035"></a><a class="code" href="classapo_1_1_loop.html#a9e46986a766ed78a9fff0667d9dcf813">00035</a> <span class="keywordtype">void</span> <a class="code" href="classapo_1_1_loop.html#a9e46986a766ed78a9fff0667d9dcf813">Loop::update</a>()
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 <span class="comment">// quick exit if not ready</span>
<a name="l00038"></a>00038 <span class="keywordflow">if</span> (micros() - _timeStamp &lt; _period) <span class="keywordflow">return</span>;
<a name="l00039"></a>00039
<a name="l00040"></a>00040 <span class="comment">// update time stamp</span>
<a name="l00041"></a>00041 uint32_t timeStamp0 = _timeStamp;
<a name="l00042"></a>00042 _timeStamp = micros();
<a name="l00043"></a>00043 _dt = (_timeStamp - timeStamp0)/1.0e6;
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <span class="comment">// update sub loops</span>
<a name="l00046"></a>00046 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i&lt;_subLoops.<a class="code" href="class_vector.html#a63d372a3caf5492712708ca15da7ac1c">getSize</a>(); i++) _subLoops[i]-&gt;<a class="code" href="classapo_1_1_loop.html#a9e46986a766ed78a9fff0667d9dcf813">update</a>();
<a name="l00047"></a>00047
<a name="l00048"></a>00048 <span class="comment">// callback function</span>
<a name="l00049"></a>00049 <span class="keywordflow">if</span> (_fptr) _fptr(_data);
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="comment">// calculated load with a low pass filter</span>
<a name="l00052"></a>00052 _load = 0.9*_load + 10*(float(micros()-_timeStamp)/(_timeStamp-timeStamp0));
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054
<a name="l00055"></a>00055 } <span class="comment">// apo</span>
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="comment">// vim:ts=4:sw=4:expandtab</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,67 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Loop.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> </div>
<div class="headertitle">
<h1>AP_Loop.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___vector_8h_source.html">AP_Vector.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Loop.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___loop_8h__incl.png" border="0" usemap="#_a_p___loop_8h" alt=""/></div>
<map name="_a_p___loop_8h" id="_a_p___loop_8h">
<area shape="rect" id="node3" href="_a_p___vector_8h.html" title="AP_Vector.h" alt="" coords="89,83,188,112"/><area shape="rect" id="node9" href="_w_program_8h.html" title="WProgram.h" alt="" coords="205,160,304,189"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___loop_8h__dep__incl.png" border="0" usemap="#_a_p___loop_8hdep" alt=""/></div>
<map name="_a_p___loop_8hdep" id="_a_p___loop_8hdep">
<area shape="rect" id="node3" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries." alt="" coords="309,83,427,112"/><area shape="rect" id="node21" href="_a_p___loop_8cpp.html" title="AP_Loop.cpp" alt="" coords="451,83,555,112"/><area shape="rect" id="node5" href="_a_p___common_8cpp.html" title="Common utility routines for the ArduPilot libraries." alt="" coords="5,160,136,189"/><area shape="rect" id="node7" href="menu_8cpp.html" title="menu.cpp" alt="" coords="160,160,245,189"/><area shape="rect" id="node9" href="_a_p___e_e_prom_8h.html" title="AP_EEProm.h" alt="" coords="269,160,376,189"/><area shape="rect" id="node13" href="_a_p___rc_channel_8h.html" title="AP_RcChannel manager." alt="" coords="301,237,427,267"/><area shape="rect" id="node15" href="_a_p___rc_channel_8cpp.html" title="AP_RcChannel.cpp" alt="" coords="344,315,483,344"/><area shape="rect" id="node17" href="_a_p___i_m_u___oilpan_8cpp.html" title="AP_IMU_Oilpan.cpp" alt="" coords="501,160,645,189"/><area shape="rect" id="node11" href="_a_p___e_e_prom_8cpp.html" title="AP_EEProm.cpp" alt="" coords="155,237,277,267"/></map>
</div>
<p><a href="_a_p___loop_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classapo_1_1_loop.html">apo::Loop</a></td></tr>
<tr><td colspan="2"><h2><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">namespace &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceapo.html">apo</a></td></tr>
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,107 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Loop.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Loop.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___loop_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * AP_Loop.h</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) James Goppert 2010 &lt;james.goppert@gmail.com&gt;</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * This file is free software: you can redistribute it and/or modify it</span>
<a name="l00006"></a>00006 <span class="comment"> * under the terms of the GNU General Public License as published by the</span>
<a name="l00007"></a>00007 <span class="comment"> * Free Software Foundation, either version 3 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment"> * (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * This file is distributed in the hope that it will be useful, but</span>
<a name="l00011"></a>00011 <span class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span>
<a name="l00013"></a>00013 <span class="comment"> * See the GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License along</span>
<a name="l00016"></a>00016 <span class="comment"> * with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00017"></a>00017 <span class="comment"> */</span>
<a name="l00018"></a>00018
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef AP_Loop_H</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define AP_Loop_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___vector_8h.html">AP_Vector.h</a>&quot;</span>
<a name="l00023"></a>00023
<a name="l00025"></a>00025 <span class="comment">// Start of apo namespace</span>
<a name="l00026"></a>00026 <span class="comment">// The above functions must be in the global</span>
<a name="l00027"></a>00027 <span class="comment">// namespace for c++ to function properly</span>
<a name="l00028"></a>00028 <span class="keyword">namespace </span>apo
<a name="l00029"></a>00029 {
<a name="l00030"></a>00030
<a name="l00031"></a><a class="code" href="classapo_1_1_loop.html">00031</a> <span class="keyword">class </span><a class="code" href="classapo_1_1_loop.html">Loop</a>
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 <span class="keyword">public</span>:
<a name="l00034"></a><a class="code" href="classapo_1_1_loop.html#a4a6ea4aeec32061bf86df9c9c32c5b24">00034</a> <a class="code" href="classapo_1_1_loop.html#a4a6ea4aeec32061bf86df9c9c32c5b24">Loop</a>() : _fptr(), _data(), _period(), _subLoops(), _timeStamp(), _load(), _dt() {};
<a name="l00035"></a>00035 <a class="code" href="classapo_1_1_loop.html#a4a6ea4aeec32061bf86df9c9c32c5b24">Loop</a>(<span class="keywordtype">float</span> <a class="code" href="classapo_1_1_loop.html#a6b88aae6e3f55895037ce5538f36076d">frequency</a>, <span class="keywordtype">void</span> (*fptr)(<span class="keywordtype">void</span> *) = NULL, <span class="keywordtype">void</span> * data = NULL);
<a name="l00036"></a>00036 <span class="keywordtype">void</span> <a class="code" href="classapo_1_1_loop.html#a9e46986a766ed78a9fff0667d9dcf813">update</a>();
<a name="l00037"></a><a class="code" href="classapo_1_1_loop.html#a35a3d49da20cbad8a4dc863228632a57">00037</a> <a class="code" href="class_vector.html">Vector&lt;Loop *&gt;</a> &amp; <a class="code" href="classapo_1_1_loop.html#a35a3d49da20cbad8a4dc863228632a57">subLoops</a>() {
<a name="l00038"></a>00038 <span class="keywordflow">return</span> _subLoops;
<a name="l00039"></a>00039 }
<a name="l00040"></a><a class="code" href="classapo_1_1_loop.html#a6b88aae6e3f55895037ce5538f36076d">00040</a> uint32_t <a class="code" href="classapo_1_1_loop.html#a6b88aae6e3f55895037ce5538f36076d">frequency</a>() {
<a name="l00041"></a>00041 <span class="keywordflow">return</span> 1.0e6/_period;
<a name="l00042"></a>00042 }
<a name="l00043"></a><a class="code" href="classapo_1_1_loop.html#aec93940b1c7ca50ebda47b7326c339ba">00043</a> <span class="keywordtype">void</span> <a class="code" href="classapo_1_1_loop.html#aec93940b1c7ca50ebda47b7326c339ba">frequency</a>(<span class="keywordtype">float</span> frequency) {
<a name="l00044"></a>00044 _period = 1e6/frequency;
<a name="l00045"></a>00045 }
<a name="l00046"></a><a class="code" href="classapo_1_1_loop.html#af6f23eac39d89deb194d3e3f5cdd8df1">00046</a> uint32_t <a class="code" href="classapo_1_1_loop.html#af6f23eac39d89deb194d3e3f5cdd8df1">timeStamp</a>() {
<a name="l00047"></a>00047 <span class="keywordflow">return</span> _timeStamp;
<a name="l00048"></a>00048 }
<a name="l00049"></a><a class="code" href="classapo_1_1_loop.html#a0dd58e809ffa1104cdd9e008918886aa">00049</a> <span class="keywordtype">float</span> <a class="code" href="classapo_1_1_loop.html#a0dd58e809ffa1104cdd9e008918886aa">dt</a>() {
<a name="l00050"></a>00050 <span class="keywordflow">return</span> _dt;
<a name="l00051"></a>00051 }
<a name="l00052"></a><a class="code" href="classapo_1_1_loop.html#af3017e1bf118c134e550cdda81c54d43">00052</a> uint8_t <a class="code" href="classapo_1_1_loop.html#af3017e1bf118c134e550cdda81c54d43">load</a>() {
<a name="l00053"></a>00053 <span class="keywordflow">return</span> _load;
<a name="l00054"></a>00054 }
<a name="l00055"></a>00055 <span class="keyword">private</span>:
<a name="l00056"></a>00056 void (*_fptr)(<span class="keywordtype">void</span> *);
<a name="l00057"></a>00057 <span class="keywordtype">void</span> * _data;
<a name="l00058"></a>00058 uint32_t _period;
<a name="l00059"></a>00059 <a class="code" href="class_vector.html">Vector&lt;Loop *&gt;</a> _subLoops;
<a name="l00060"></a>00060 uint32_t _timeStamp;
<a name="l00061"></a>00061 uint8_t _load;
<a name="l00062"></a>00062 <span class="keywordtype">float</span> _dt;
<a name="l00063"></a>00063 };
<a name="l00064"></a>00064
<a name="l00065"></a>00065 } <span class="comment">// apo</span>
<a name="l00066"></a>00066
<a name="l00067"></a>00067 <span class="preprocessor">#endif</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a>00069 <span class="comment">// vim:ts=4:sw=4:expandtab</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,60 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Math.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Math.h File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="vector2_8h_source.html">vector2.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="vector3_8h_source.html">vector3.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="matrix3_8h_source.html">matrix3.h</a>&quot;</code><br/>
<div class="dynheader">
Include dependency graph for AP_Math.h:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___math_8h__incl.png" border="0" usemap="#_a_p___math_8h" alt=""/></div>
<map name="_a_p___math_8h" id="_a_p___math_8h">
<area shape="rect" id="node3" href="vector2_8h.html" title="vector2.h" alt="" coords="5,160,88,189"/><area shape="rect" id="node7" href="vector3_8h.html" title="vector3.h" alt="" coords="112,160,195,189"/><area shape="rect" id="node12" href="matrix3_8h.html" title="matrix3.h" alt="" coords="135,83,217,112"/></map>
</div>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___math_8h__dep__incl.png" border="0" usemap="#_a_p___math_8hdep" alt=""/></div>
<map name="_a_p___math_8hdep" id="_a_p___math_8hdep">
<area shape="rect" id="node3" href="_compass_8h.html" title="Compass.h" alt="" coords="364,83,457,112"/><area shape="rect" id="node9" href="_a_p___d_c_m___h_i_l_8h.html" title="AP_DCM_HIL.h" alt="" coords="537,392,652,421"/><area shape="rect" id="node11" href="_a_p___d_c_m_8h.html" title="AP_DCM.h" alt="" coords="349,469,437,499"/><area shape="rect" id="node28" href="_i_m_u_8h.html" title="Abstract class defining the interface to a real or virtual Inertial Measurement Unit." alt="" coords="532,83,591,112"/><area shape="rect" id="node30" href="_a_p___i_m_u___oilpan_8h.html" title="IMU driver for the APM oilpan." alt="" coords="497,160,625,189"/><area shape="rect" id="node5" href="_a_p___compass___h_m_c5843_8h.html" title="AP_Compass_HMC5843.h" alt="" coords="188,160,375,189"/><area shape="rect" id="node18" href="_a_p___compass___h_i_l_8h.html" title="AP_Compass_HIL.h" alt="" coords="320,237,464,267"/><area shape="rect" id="node7" href="_a_p___compass_8h.html" title="Catch&#45;all header that defines all supported compass classes." alt="" coords="249,315,367,344"/><area shape="rect" id="node23" href="_a_p___compass___h_m_c5843_8cpp.html" title="AP_Compass_HMC5843.cpp" alt="" coords="43,237,245,267"/><area shape="rect" id="node15" href="_a_p___d_c_m___h_i_l_8cpp.html" title="AP_DCM_HIL.cpp" alt="" coords="529,469,660,499"/><area shape="rect" id="node13" href="_a_p___d_c_m_8cpp.html" title="AP_DCM.cpp" alt="" coords="343,547,444,576"/><area shape="rect" id="node21" href="_a_p___compass___h_i_l_8cpp.html" title="AP_Compass_HIL.cpp" alt="" coords="391,315,551,344"/><area shape="rect" id="node32" href="_a_p___i_m_u_8h.html" title="Catch&#45;all header that defines all supported IMU classes." alt="" coords="575,315,657,344"/><area shape="rect" id="node36" href="_a_p___i_m_u___oilpan_8cpp.html" title="AP_IMU_Oilpan.cpp" alt="" coords="488,237,632,267"/></map>
</div>
<p><a href="_a_p___math_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
</table>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,46 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_Math.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_Math.h</h1> </div>
</div>
<div class="contents">
<a href="_a_p___math_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-</span>
<a name="l00002"></a>00002
<a name="l00003"></a>00003 <span class="comment">// Assorted useful math operations for ArduPilot(Mega)</span>
<a name="l00004"></a>00004
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="vector2_8h.html">vector2.h</a>&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="vector3_8h.html">vector3.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="matrix3_8h.html">matrix3.h</a>&quot;</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,528 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_RC.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<h1>AP_RC.cpp File Reference</h1> </div>
</div>
<div class="contents">
<code>#include &quot;<a class="el" href="_a_p___r_c_8h_source.html">AP_RC.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_w_program_8h_source.html">WProgram.h</a>&quot;</code><br/>
<code>#include &lt;avr/interrupt.h&gt;</code><br/>
<div class="dynheader">
Include dependency graph for AP_RC.cpp:</div>
<div class="dyncontent">
<div class="center"><img src="_a_p___r_c_8cpp__incl.png" border="0" usemap="#_a_p___r_c_8cpp" alt=""/></div>
<map name="_a_p___r_c_8cpp" id="_a_p___r_c_8cpp">
<area shape="rect" id="node3" href="_a_p___r_c_8h.html" title="AP_RC.h" alt="" coords="11,83,85,112"/><area shape="rect" id="node7" href="_w_program_8h.html" title="WProgram.h" alt="" coords="109,83,208,112"/></map>
</div>
<p><a href="_a_p___r_c_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a32a0f011057e05c11f9d99244a818229">CH1_READ</a>&nbsp;&nbsp;&nbsp;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a8693af5a6853af6c4f9b8700b35f85ae">CH2_READ</a>&nbsp;&nbsp;&nbsp;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a6344322119ffff317eff2e2032e3d224">CH3_READ</a>&nbsp;&nbsp;&nbsp;4</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a5db92fecf8089f8aec8940c1baaa163c">CH4_READ</a>&nbsp;&nbsp;&nbsp;8</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#aab86c520cc9d1957c6f1229cb80e0499">CH_1</a>&nbsp;&nbsp;&nbsp;0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a17a3c4804de5f606a6e2f925c5494aac">CH_2</a>&nbsp;&nbsp;&nbsp;1</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a58eb12d8200b15aa83153f0461ad80b5">CH_3</a>&nbsp;&nbsp;&nbsp;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a4352dfb5bb425f7ff9a71a3f9ab4c65d">CH_4</a>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a9c4665742c6b6eb1f0bb9dde41f7cba3">ISR</a> (PCINT2_vect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#aa64c6dce15e9de9105b4ae9533c9a267">ISR</a> (PCINT0_vect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a5da59e05fa5ade4be7c7656aee78291a">ISR</a> (TIMER1_CAPT_vect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a> (TIMER2_OVF_vect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a5686c229bdef50123688ab6cb1404230">ISR</a> (TIMER2_COMPA_vect)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#aa282d056dc0e67857fc700fdce321f30">ISR</a> (TIMER2_COMPB_vect)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#ac1fd06c2ca9ab235e27496c8b6282863">timer1count</a> = 0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a627dc764a9d7836ecc6076644b0e82a0">timer2count</a> = 0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#ad406463c30b4092e56b230fbb2f86485">timer3count</a> = 0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#ab9d55690f9d9e675fcc0e17c7fccc3d4">timer4count</a> = 0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile int16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#abb789eecd1119cacc79cace26f2613e2">timer1diff</a> = 1500 * 2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile int16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a0d7931e5ade32095044973776943ccd7">timer2diff</a> = 1500 * 2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile int16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#adb4daa4166dade70952e88dd6d6cdf11">timer3diff</a> = 1100 * 2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile int16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a6ac05fcfb03cc66e71951b7ab4b08b6d">timer4diff</a> = 1500 * 2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#ab508649220495510dfe50ba9aa941492">_timer_ovf_a</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#ac18a366308c4077672a12bfb1e8284f1">_timer_ovf_b</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">volatile uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_p___r_c_8cpp.html#a11928678cfeec459f1361894b65113ec">_timer_ovf</a></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a32a0f011057e05c11f9d99244a818229"></a><!-- doxytag: member="AP_RC.cpp::CH1_READ" ref="a32a0f011057e05c11f9d99244a818229" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CH1_READ&nbsp;&nbsp;&nbsp;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00028">28</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a8693af5a6853af6c4f9b8700b35f85ae"></a><!-- doxytag: member="AP_RC.cpp::CH2_READ" ref="a8693af5a6853af6c4f9b8700b35f85ae" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CH2_READ&nbsp;&nbsp;&nbsp;2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00029">29</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6344322119ffff317eff2e2032e3d224"></a><!-- doxytag: member="AP_RC.cpp::CH3_READ" ref="a6344322119ffff317eff2e2032e3d224" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CH3_READ&nbsp;&nbsp;&nbsp;4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00030">30</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5db92fecf8089f8aec8940c1baaa163c"></a><!-- doxytag: member="AP_RC.cpp::CH4_READ" ref="a5db92fecf8089f8aec8940c1baaa163c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CH4_READ&nbsp;&nbsp;&nbsp;8</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00031">31</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aab86c520cc9d1957c6f1229cb80e0499"></a><!-- doxytag: member="AP_RC.cpp::CH_1" ref="aab86c520cc9d1957c6f1229cb80e0499" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CH_1&nbsp;&nbsp;&nbsp;0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00033">33</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a17a3c4804de5f606a6e2f925c5494aac"></a><!-- doxytag: member="AP_RC.cpp::CH_2" ref="a17a3c4804de5f606a6e2f925c5494aac" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CH_2&nbsp;&nbsp;&nbsp;1</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00034">34</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a58eb12d8200b15aa83153f0461ad80b5"></a><!-- doxytag: member="AP_RC.cpp::CH_3" ref="a58eb12d8200b15aa83153f0461ad80b5" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CH_3&nbsp;&nbsp;&nbsp;2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00035">35</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a4352dfb5bb425f7ff9a71a3f9ab4c65d"></a><!-- doxytag: member="AP_RC.cpp::CH_4" ref="a4352dfb5bb425f7ff9a71a3f9ab4c65d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CH_4&nbsp;&nbsp;&nbsp;3</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00036">36</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a9c4665742c6b6eb1f0bb9dde41f7cba3"></a><!-- doxytag: member="AP_RC.cpp::ISR" ref="a9c4665742c6b6eb1f0bb9dde41f7cba3" args="(PCINT2_vect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ISR </td>
<td>(</td>
<td class="paramtype">PCINT2_vect&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00148">148</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa282d056dc0e67857fc700fdce321f30"></a><!-- doxytag: member="AP_RC.cpp::ISR" ref="aa282d056dc0e67857fc700fdce321f30" args="(TIMER2_COMPB_vect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ISR </td>
<td>(</td>
<td class="paramtype">TIMER2_COMPB_vect&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00232">232</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5686c229bdef50123688ab6cb1404230"></a><!-- doxytag: member="AP_RC.cpp::ISR" ref="a5686c229bdef50123688ab6cb1404230" args="(TIMER2_COMPA_vect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ISR </td>
<td>(</td>
<td class="paramtype">TIMER2_COMPA_vect&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00225">225</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a7cfcbe42bd266750aeb6e5d71e5ea479"></a><!-- doxytag: member="AP_RC.cpp::ISR" ref="a7cfcbe42bd266750aeb6e5d71e5ea479" args="(TIMER2_OVF_vect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ISR </td>
<td>(</td>
<td class="paramtype">TIMER2_OVF_vect&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00220">220</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a5da59e05fa5ade4be7c7656aee78291a"></a><!-- doxytag: member="AP_RC.cpp::ISR" ref="a5da59e05fa5ade4be7c7656aee78291a" args="(TIMER1_CAPT_vect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ISR </td>
<td>(</td>
<td class="paramtype">TIMER1_CAPT_vect&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00211">211</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="aa64c6dce15e9de9105b4ae9533c9a267"></a><!-- doxytag: member="AP_RC.cpp::ISR" ref="aa64c6dce15e9de9105b4ae9533c9a267" args="(PCINT0_vect)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">ISR </td>
<td>(</td>
<td class="paramtype">PCINT0_vect&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00177">177</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ab750ea3dbe27a55b2e2678f2e1729e21"></a><!-- doxytag: member="AP_RC.cpp::_rc_ch_read" ref="ab750ea3dbe27a55b2e2678f2e1729e21" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile int8_t <a class="el" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00038">38</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ae1a50944c4cdb26d1dc6eac9be731aa8"></a><!-- doxytag: member="AP_RC.cpp::_timer_out" ref="ae1a50944c4cdb26d1dc6eac9be731aa8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile uint8_t <a class="el" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00039">39</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a11928678cfeec459f1361894b65113ec"></a><!-- doxytag: member="AP_RC.cpp::_timer_ovf" ref="a11928678cfeec459f1361894b65113ec" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile uint8_t <a class="el" href="_a_p___r_c_8cpp.html#a11928678cfeec459f1361894b65113ec">_timer_ovf</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00042">42</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab508649220495510dfe50ba9aa941492"></a><!-- doxytag: member="AP_RC.cpp::_timer_ovf_a" ref="ab508649220495510dfe50ba9aa941492" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile uint8_t <a class="el" href="_a_p___r_c_8cpp.html#ab508649220495510dfe50ba9aa941492">_timer_ovf_a</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00040">40</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac18a366308c4077672a12bfb1e8284f1"></a><!-- doxytag: member="AP_RC.cpp::_timer_ovf_b" ref="ac18a366308c4077672a12bfb1e8284f1" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile uint8_t <a class="el" href="_a_p___r_c_8cpp.html#ac18a366308c4077672a12bfb1e8284f1">_timer_ovf_b</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00041">41</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ac1fd06c2ca9ab235e27496c8b6282863"></a><!-- doxytag: member="AP_RC.cpp::timer1count" ref="ac1fd06c2ca9ab235e27496c8b6282863" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile uint16_t <a class="el" href="_a_p___r_c_8cpp.html#ac1fd06c2ca9ab235e27496c8b6282863">timer1count</a> = 0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00017">17</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="abb789eecd1119cacc79cace26f2613e2"></a><!-- doxytag: member="AP_RC.cpp::timer1diff" ref="abb789eecd1119cacc79cace26f2613e2" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile int16_t <a class="el" href="_a_p___r_c_8cpp.html#abb789eecd1119cacc79cace26f2613e2">timer1diff</a> = 1500 * 2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00022">22</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a627dc764a9d7836ecc6076644b0e82a0"></a><!-- doxytag: member="AP_RC.cpp::timer2count" ref="a627dc764a9d7836ecc6076644b0e82a0" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile uint16_t <a class="el" href="_a_p___r_c_8cpp.html#a627dc764a9d7836ecc6076644b0e82a0">timer2count</a> = 0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00018">18</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a0d7931e5ade32095044973776943ccd7"></a><!-- doxytag: member="AP_RC.cpp::timer2diff" ref="a0d7931e5ade32095044973776943ccd7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile int16_t <a class="el" href="_a_p___r_c_8cpp.html#a0d7931e5ade32095044973776943ccd7">timer2diff</a> = 1500 * 2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00023">23</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ad406463c30b4092e56b230fbb2f86485"></a><!-- doxytag: member="AP_RC.cpp::timer3count" ref="ad406463c30b4092e56b230fbb2f86485" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile uint16_t <a class="el" href="_a_p___r_c_8cpp.html#ad406463c30b4092e56b230fbb2f86485">timer3count</a> = 0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00019">19</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="adb4daa4166dade70952e88dd6d6cdf11"></a><!-- doxytag: member="AP_RC.cpp::timer3diff" ref="adb4daa4166dade70952e88dd6d6cdf11" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile int16_t <a class="el" href="_a_p___r_c_8cpp.html#adb4daa4166dade70952e88dd6d6cdf11">timer3diff</a> = 1100 * 2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00024">24</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="ab9d55690f9d9e675fcc0e17c7fccc3d4"></a><!-- doxytag: member="AP_RC.cpp::timer4count" ref="ab9d55690f9d9e675fcc0e17c7fccc3d4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile uint16_t <a class="el" href="_a_p___r_c_8cpp.html#ab9d55690f9d9e675fcc0e17c7fccc3d4">timer4count</a> = 0</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00020">20</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a6ac05fcfb03cc66e71951b7ab4b08b6d"></a><!-- doxytag: member="AP_RC.cpp::timer4diff" ref="a6ac05fcfb03cc66e71951b7ab4b08b6d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">volatile int16_t <a class="el" href="_a_p___r_c_8cpp.html#a6ac05fcfb03cc66e71951b7ab4b08b6d">timer4diff</a> = 1500 * 2</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="_a_p___r_c_8cpp_source.html#l00025">25</a> of file <a class="el" href="_a_p___r_c_8cpp_source.html">AP_RC.cpp</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -1,276 +0,0 @@
<!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/xhtml;charset=UTF-8"/>
<title>ArduPilot Libraries: AP_RC.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<h1>AP_RC.cpp</h1> </div>
</div>
<div class="contents">
<a href="_a_p___r_c_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> AP_RC.cpp - Radio library for Arduino</span>
<a name="l00003"></a>00003 <span class="comment"> Code by Jason Short. DIYDrones.com</span>
<a name="l00004"></a>00004 <span class="comment"> </span>
<a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and / or</span>
<a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span>
<a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">*/</span>
<a name="l00011"></a>00011
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;<a class="code" href="_a_p___r_c_8h.html">AP_RC.h</a>&quot;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &quot;<a class="code" href="_w_program_8h.html">WProgram.h</a>&quot;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;avr/interrupt.h&gt;</span>
<a name="l00015"></a>00015
<a name="l00016"></a>00016 <span class="comment">// Variable definition for interrupt</span>
<a name="l00017"></a><a class="code" href="_a_p___r_c_8cpp.html#ac1fd06c2ca9ab235e27496c8b6282863">00017</a> <span class="keyword">volatile</span> uint16_t <a class="code" href="_a_p___r_c_8cpp.html#ac1fd06c2ca9ab235e27496c8b6282863">timer1count</a> = 0;
<a name="l00018"></a><a class="code" href="_a_p___r_c_8cpp.html#a627dc764a9d7836ecc6076644b0e82a0">00018</a> <span class="keyword">volatile</span> uint16_t <a class="code" href="_a_p___r_c_8cpp.html#a627dc764a9d7836ecc6076644b0e82a0">timer2count</a> = 0;
<a name="l00019"></a><a class="code" href="_a_p___r_c_8cpp.html#ad406463c30b4092e56b230fbb2f86485">00019</a> <span class="keyword">volatile</span> uint16_t <a class="code" href="_a_p___r_c_8cpp.html#ad406463c30b4092e56b230fbb2f86485">timer3count</a> = 0;
<a name="l00020"></a><a class="code" href="_a_p___r_c_8cpp.html#ab9d55690f9d9e675fcc0e17c7fccc3d4">00020</a> <span class="keyword">volatile</span> uint16_t <a class="code" href="_a_p___r_c_8cpp.html#ab9d55690f9d9e675fcc0e17c7fccc3d4">timer4count</a> = 0;
<a name="l00021"></a>00021
<a name="l00022"></a><a class="code" href="_a_p___r_c_8cpp.html#abb789eecd1119cacc79cace26f2613e2">00022</a> <span class="keyword">volatile</span> int16_t <a class="code" href="_a_p___r_c_8cpp.html#abb789eecd1119cacc79cace26f2613e2">timer1diff</a> = 1500 * 2;
<a name="l00023"></a><a class="code" href="_a_p___r_c_8cpp.html#a0d7931e5ade32095044973776943ccd7">00023</a> <span class="keyword">volatile</span> int16_t <a class="code" href="_a_p___r_c_8cpp.html#a0d7931e5ade32095044973776943ccd7">timer2diff</a> = 1500 * 2;
<a name="l00024"></a><a class="code" href="_a_p___r_c_8cpp.html#adb4daa4166dade70952e88dd6d6cdf11">00024</a> <span class="keyword">volatile</span> int16_t <a class="code" href="_a_p___r_c_8cpp.html#adb4daa4166dade70952e88dd6d6cdf11">timer3diff</a> = 1100 * 2;
<a name="l00025"></a><a class="code" href="_a_p___r_c_8cpp.html#a6ac05fcfb03cc66e71951b7ab4b08b6d">00025</a> <span class="keyword">volatile</span> int16_t <a class="code" href="_a_p___r_c_8cpp.html#a6ac05fcfb03cc66e71951b7ab4b08b6d">timer4diff</a> = 1500 * 2;
<a name="l00026"></a>00026
<a name="l00027"></a>00027 <span class="comment">//volatile uint16_t raw[8];</span>
<a name="l00028"></a><a class="code" href="_a_p___r_c_8cpp.html#a32a0f011057e05c11f9d99244a818229">00028</a> <span class="preprocessor">#define CH1_READ 1</span>
<a name="l00029"></a><a class="code" href="_a_p___r_c_8cpp.html#a8693af5a6853af6c4f9b8700b35f85ae">00029</a> <span class="preprocessor"></span><span class="preprocessor">#define CH2_READ 2</span>
<a name="l00030"></a><a class="code" href="_a_p___r_c_8cpp.html#a6344322119ffff317eff2e2032e3d224">00030</a> <span class="preprocessor"></span><span class="preprocessor">#define CH3_READ 4</span>
<a name="l00031"></a><a class="code" href="_a_p___r_c_8cpp.html#a5db92fecf8089f8aec8940c1baaa163c">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define CH4_READ 8</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a><a class="code" href="_a_p___r_c_8cpp.html#aab86c520cc9d1957c6f1229cb80e0499">00033</a> <span class="preprocessor">#define CH_1 0</span>
<a name="l00034"></a><a class="code" href="_a_p___r_c_8cpp.html#a17a3c4804de5f606a6e2f925c5494aac">00034</a> <span class="preprocessor"></span><span class="preprocessor">#define CH_2 1</span>
<a name="l00035"></a><a class="code" href="_a_p___r_c_8cpp.html#a58eb12d8200b15aa83153f0461ad80b5">00035</a> <span class="preprocessor"></span><span class="preprocessor">#define CH_3 2</span>
<a name="l00036"></a><a class="code" href="_a_p___r_c_8cpp.html#a4352dfb5bb425f7ff9a71a3f9ab4c65d">00036</a> <span class="preprocessor"></span><span class="preprocessor">#define CH_4 3</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span>
<a name="l00038"></a><a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">00038</a> <span class="keyword">volatile</span> int8_t <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a>;
<a name="l00039"></a><a class="code" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">00039</a> <span class="keyword">volatile</span> uint8_t <a class="code" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a>;
<a name="l00040"></a><a class="code" href="_a_p___r_c_8cpp.html#ab508649220495510dfe50ba9aa941492">00040</a> <span class="keyword">volatile</span> uint8_t <a class="code" href="_a_p___r_c_8cpp.html#ab508649220495510dfe50ba9aa941492">_timer_ovf_a</a>;
<a name="l00041"></a><a class="code" href="_a_p___r_c_8cpp.html#ac18a366308c4077672a12bfb1e8284f1">00041</a> <span class="keyword">volatile</span> uint8_t <a class="code" href="_a_p___r_c_8cpp.html#ac18a366308c4077672a12bfb1e8284f1">_timer_ovf_b</a>;
<a name="l00042"></a><a class="code" href="_a_p___r_c_8cpp.html#a11928678cfeec459f1361894b65113ec">00042</a> <span class="keyword">volatile</span> uint8_t <a class="code" href="_a_p___r_c_8cpp.html#a11928678cfeec459f1361894b65113ec">_timer_ovf</a>;
<a name="l00043"></a>00043
<a name="l00044"></a>00044
<a name="l00045"></a><a class="code" href="class_a_p___r_c.html#a4bf529e482f77b04058b7c6644fa8087">00045</a> <a class="code" href="class_a_p___r_c.html#a4bf529e482f77b04058b7c6644fa8087">AP_RC::AP_RC</a>()
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 pinMode(2,INPUT); <span class="comment">// PD2 - INT0 - CH 1 in</span>
<a name="l00048"></a>00048 pinMode(3,INPUT); <span class="comment">// PD3 - INT1 - CH 2 in</span>
<a name="l00049"></a>00049 pinMode(11,INPUT); <span class="comment">// PB3 - MOSI/OC2 - CH 3 in</span>
<a name="l00050"></a>00050 pinMode(13,INPUT); <span class="comment">// PB5 - SCK - CH 4 in</span>
<a name="l00051"></a>00051
<a name="l00052"></a>00052 pinMode(10,OUTPUT); <span class="comment">// PB2 - OC1B - CH 1 out</span>
<a name="l00053"></a>00053 pinMode(8, OUTPUT); <span class="comment">// PB0 - AIN1 - CH 3 out</span>
<a name="l00054"></a>00054 pinMode(9, OUTPUT); <span class="comment">// PB1 - OC1A - CH 2 out</span>
<a name="l00055"></a>00055 DDRC |= B00010000; <span class="comment">// PC4 - - CH 4 out</span>
<a name="l00056"></a>00056 }
<a name="l00057"></a>00057
<a name="l00058"></a>00058 <span class="keywordtype">void</span>
<a name="l00059"></a><a class="code" href="class_a_p___r_c.html#a3b7d33ec1c1fb39de118fb6b99485e87">00059</a> <a class="code" href="class_a_p___r_c.html#a3b7d33ec1c1fb39de118fb6b99485e87">AP_RC::init</a>()
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061 <span class="comment">// enable pin change interrupt 2 - PCINT23..16</span>
<a name="l00062"></a>00062 PCICR = _BV(PCIE2);
<a name="l00063"></a>00063 <span class="comment">// enable pin change interrupt 0 - PCINT7..0</span>
<a name="l00064"></a>00064 PCICR |= _BV(PCIE0);
<a name="l00065"></a>00065 <span class="comment">// enable in change interrupt on PB5 (digital pin 13)</span>
<a name="l00066"></a>00066 PCMSK0 = _BV(PCINT3) | _BV(PCINT5);
<a name="l00067"></a>00067 <span class="comment">// enable pin change interrupt on PD2,PD3 (digital pin 2,3)</span>
<a name="l00068"></a>00068 PCMSK2 = _BV(PCINT18) | _BV(PCINT19);
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="comment">// Timer 1</span>
<a name="l00071"></a>00071 TCCR1A = ((1 &lt;&lt; WGM11) | (1 &lt;&lt; COM1B1) | (1 &lt;&lt; COM1A1));
<a name="l00072"></a>00072 TCCR1B = (1 &lt;&lt; WGM13) | (1 &lt;&lt; WGM12) | (1 &lt;&lt; CS11);
<a name="l00073"></a>00073 <span class="comment">// Loop value</span>
<a name="l00074"></a>00074 ICR1 = 40000;
<a name="l00075"></a>00075
<a name="l00076"></a>00076 <span class="comment">// Throttle;</span>
<a name="l00077"></a>00077 <span class="comment">// Setting up the Timer 2 - 8 bit timer</span>
<a name="l00078"></a>00078 TCCR2A = 0x0; <span class="comment">// Normal Mode </span>
<a name="l00079"></a>00079 TCCR2B = _BV(CS21) |_BV(CS20); <span class="comment">//prescaler 32, at 16mhz (32/16) = 2, the counter will increment 1 every 2us</span>
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <span class="comment">// enable throttle and Ch4 output</span>
<a name="l00082"></a>00082 TIMSK1 |= _BV(ICIE1); <span class="comment">// Timer / Counter1, Input Capture Interrupt Enable // PB0 - output throttle</span>
<a name="l00083"></a>00083 TIMSK2 = _BV(TOIE1) | _BV(OCIE2A) | _BV(OCIE2B); <span class="comment">// Timer / Counter2 Compare Match A</span>
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="comment">/* </span>
<a name="l00086"></a>00086 <span class="comment"> set_ch_pwm(0, 1500);</span>
<a name="l00087"></a>00087 <span class="comment"> set_ch_pwm(1, 1500);</span>
<a name="l00088"></a>00088 <span class="comment"> set_ch_pwm(2, 1500);</span>
<a name="l00089"></a>00089 <span class="comment"> set_ch_pwm(3, 1500);</span>
<a name="l00090"></a>00090 <span class="comment"> */</span>
<a name="l00091"></a>00091 }
<a name="l00092"></a>00092
<a name="l00093"></a>00093 uint16_t
<a name="l00094"></a><a class="code" href="class_a_p___r_c.html#a4d2ec9776434b7a8671da3c63045f301">00094</a> <a class="code" href="class_a_p___r_c.html#a4d2ec9776434b7a8671da3c63045f301">AP_RC::input_ch</a>(uint8_t ch)
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096 <span class="keywordflow">switch</span>(ch){
<a name="l00097"></a>00097 <span class="keywordflow">case</span> <a class="code" href="_a_p___r_c_8cpp.html#aab86c520cc9d1957c6f1229cb80e0499">CH_1</a>:
<a name="l00098"></a>00098 <span class="keywordflow">return</span> <a class="code" href="_a_p___r_c_8cpp.html#abb789eecd1119cacc79cace26f2613e2">timer1diff</a>;
<a name="l00099"></a>00099 <span class="keywordflow">break</span>;
<a name="l00100"></a>00100
<a name="l00101"></a>00101 <span class="keywordflow">case</span> <a class="code" href="_a_p___r_c_8cpp.html#a17a3c4804de5f606a6e2f925c5494aac">CH_2</a>:
<a name="l00102"></a>00102 <span class="keywordflow">return</span> <a class="code" href="_a_p___r_c_8cpp.html#a0d7931e5ade32095044973776943ccd7">timer2diff</a>;
<a name="l00103"></a>00103 <span class="keywordflow">break</span>;
<a name="l00104"></a>00104
<a name="l00105"></a>00105 <span class="keywordflow">case</span> <a class="code" href="_a_p___r_c_8cpp.html#a58eb12d8200b15aa83153f0461ad80b5">CH_3</a>:
<a name="l00106"></a>00106 <span class="keywordflow">return</span> <a class="code" href="_a_p___r_c_8cpp.html#adb4daa4166dade70952e88dd6d6cdf11">timer3diff</a>;
<a name="l00107"></a>00107 <span class="keywordflow">break</span>;
<a name="l00108"></a>00108
<a name="l00109"></a>00109 <span class="keywordflow">case</span> <a class="code" href="_a_p___r_c_8cpp.html#a4352dfb5bb425f7ff9a71a3f9ab4c65d">CH_4</a>:
<a name="l00110"></a>00110 <span class="keywordflow">return</span> <a class="code" href="_a_p___r_c_8cpp.html#a6ac05fcfb03cc66e71951b7ab4b08b6d">timer4diff</a>;
<a name="l00111"></a>00111 <span class="keywordflow">break</span>;
<a name="l00112"></a>00112 }
<a name="l00113"></a>00113 }
<a name="l00114"></a>00114
<a name="l00115"></a>00115 <span class="keywordtype">void</span>
<a name="l00116"></a><a class="code" href="class_a_p___r_c.html#af6f7a97160d51e05e62f491edf5e0fe1">00116</a> <a class="code" href="class_a_p___r_c.html#af6f7a97160d51e05e62f491edf5e0fe1">AP_RC::output_ch_pwm</a>(uint8_t ch, uint16_t pwm)
<a name="l00117"></a>00117 {
<a name="l00118"></a>00118 <span class="keywordflow">switch</span>(ch){
<a name="l00119"></a>00119 <span class="keywordflow">case</span> <a class="code" href="_a_p___r_c_8cpp.html#aab86c520cc9d1957c6f1229cb80e0499">CH_1</a>:
<a name="l00120"></a>00120 pwm &lt;&lt;= 1;
<a name="l00121"></a>00121 OCR1A = pwm;
<a name="l00122"></a>00122 <span class="keywordflow">break</span>;
<a name="l00123"></a>00123
<a name="l00124"></a>00124 <span class="keywordflow">case</span> <a class="code" href="_a_p___r_c_8cpp.html#a17a3c4804de5f606a6e2f925c5494aac">CH_2</a>:
<a name="l00125"></a>00125 pwm &lt;&lt;= 1;
<a name="l00126"></a>00126 OCR1B = pwm;
<a name="l00127"></a>00127 <span class="keywordflow">break</span>;
<a name="l00128"></a>00128
<a name="l00129"></a>00129 <span class="keywordflow">case</span> <a class="code" href="_a_p___r_c_8cpp.html#a58eb12d8200b15aa83153f0461ad80b5">CH_3</a>:
<a name="l00130"></a>00130 <a class="code" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a> = pwm % 512;
<a name="l00131"></a>00131 <a class="code" href="_a_p___r_c_8cpp.html#ab508649220495510dfe50ba9aa941492">_timer_ovf_a</a> = pwm / 512;
<a name="l00132"></a>00132 <a class="code" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a> &gt;&gt;= 1;
<a name="l00133"></a>00133 OCR2A = <a class="code" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a>;
<a name="l00134"></a>00134 <span class="keywordflow">break</span>;
<a name="l00135"></a>00135
<a name="l00136"></a>00136 <span class="keywordflow">case</span> <a class="code" href="_a_p___r_c_8cpp.html#a4352dfb5bb425f7ff9a71a3f9ab4c65d">CH_4</a>:
<a name="l00137"></a>00137 <a class="code" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a> = pwm % 512;
<a name="l00138"></a>00138 <a class="code" href="_a_p___r_c_8cpp.html#ac18a366308c4077672a12bfb1e8284f1">_timer_ovf_b</a> = pwm / 512;
<a name="l00139"></a>00139 <a class="code" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a> &gt;&gt;= 1;
<a name="l00140"></a>00140 OCR2B = <a class="code" href="_a_p___r_c_8cpp.html#ae1a50944c4cdb26d1dc6eac9be731aa8">_timer_out</a>;
<a name="l00141"></a>00141 <span class="keywordflow">break</span>;
<a name="l00142"></a>00142 }
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144
<a name="l00145"></a>00145
<a name="l00146"></a>00146
<a name="l00147"></a>00147 <span class="comment">// radio PWM input timers</span>
<a name="l00148"></a><a class="code" href="_a_p___r_c_8cpp.html#a9c4665742c6b6eb1f0bb9dde41f7cba3">00148</a> <a class="code" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a>(PCINT2_vect) {
<a name="l00149"></a>00149 <span class="keywordtype">int</span> cnt = TCNT1;
<a name="l00150"></a>00150 <span class="keywordflow">if</span>(PIND &amp; B00000100){ <span class="comment">// ch 1 (pin 2) is high</span>
<a name="l00151"></a>00151 <span class="keywordflow">if</span> ((<a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp; <a class="code" href="_a_p___r_c_8cpp.html#a32a0f011057e05c11f9d99244a818229">CH1_READ</a>) != CH1_READ){
<a name="l00152"></a>00152 <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> |= CH1_READ;
<a name="l00153"></a>00153 <a class="code" href="_a_p___r_c_8cpp.html#ac1fd06c2ca9ab235e27496c8b6282863">timer1count</a> = cnt;
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155 }<span class="keywordflow">else</span> <span class="keywordflow">if</span> ((<a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp; <a class="code" href="_a_p___r_c_8cpp.html#a32a0f011057e05c11f9d99244a818229">CH1_READ</a>) == CH1_READ){ <span class="comment">// ch 1 (pin 2) is Low, and we were reading</span>
<a name="l00156"></a>00156 <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp;= B11111110;
<a name="l00157"></a>00157 <span class="keywordflow">if</span> (cnt &lt; <a class="code" href="_a_p___r_c_8cpp.html#ac1fd06c2ca9ab235e27496c8b6282863">timer1count</a>) <span class="comment">// Timer1 reset during the read of this pulse</span>
<a name="l00158"></a>00158 <a class="code" href="_a_p___r_c_8cpp.html#abb789eecd1119cacc79cace26f2613e2">timer1diff</a> = (cnt + 40000 - <a class="code" href="_a_p___r_c_8cpp.html#ac1fd06c2ca9ab235e27496c8b6282863">timer1count</a>) &gt;&gt; 1; <span class="comment">// Timer1 TOP = 40000</span>
<a name="l00159"></a>00159 <span class="keywordflow">else</span>
<a name="l00160"></a>00160 <a class="code" href="_a_p___r_c_8cpp.html#abb789eecd1119cacc79cace26f2613e2">timer1diff</a> = (cnt - <a class="code" href="_a_p___r_c_8cpp.html#ac1fd06c2ca9ab235e27496c8b6282863">timer1count</a>) &gt;&gt; 1;
<a name="l00161"></a>00161 }
<a name="l00162"></a>00162
<a name="l00163"></a>00163 <span class="keywordflow">if</span>(PIND &amp; B00001000){ <span class="comment">// ch 2 (pin 3) is high</span>
<a name="l00164"></a>00164 <span class="keywordflow">if</span> ((<a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp; <a class="code" href="_a_p___r_c_8cpp.html#a8693af5a6853af6c4f9b8700b35f85ae">CH2_READ</a>) != CH2_READ){
<a name="l00165"></a>00165 <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> |= CH2_READ;
<a name="l00166"></a>00166 <a class="code" href="_a_p___r_c_8cpp.html#a627dc764a9d7836ecc6076644b0e82a0">timer2count</a> = cnt;
<a name="l00167"></a>00167 }
<a name="l00168"></a>00168 }<span class="keywordflow">else</span> <span class="keywordflow">if</span> ((<a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp; <a class="code" href="_a_p___r_c_8cpp.html#a8693af5a6853af6c4f9b8700b35f85ae">CH2_READ</a>) == CH2_READ){ <span class="comment">// ch 1 (pin 2) is Low</span>
<a name="l00169"></a>00169 <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp;= B11111101;
<a name="l00170"></a>00170 <span class="keywordflow">if</span> (cnt &lt; <a class="code" href="_a_p___r_c_8cpp.html#a627dc764a9d7836ecc6076644b0e82a0">timer2count</a>) <span class="comment">// Timer1 reset during the read of this pulse</span>
<a name="l00171"></a>00171 <a class="code" href="_a_p___r_c_8cpp.html#a0d7931e5ade32095044973776943ccd7">timer2diff</a> = (cnt + 40000 - <a class="code" href="_a_p___r_c_8cpp.html#a627dc764a9d7836ecc6076644b0e82a0">timer2count</a>) &gt;&gt; 1; <span class="comment">// Timer1 TOP = 40000</span>
<a name="l00172"></a>00172 <span class="keywordflow">else</span>
<a name="l00173"></a>00173 <a class="code" href="_a_p___r_c_8cpp.html#a0d7931e5ade32095044973776943ccd7">timer2diff</a> = (cnt - <a class="code" href="_a_p___r_c_8cpp.html#a627dc764a9d7836ecc6076644b0e82a0">timer2count</a>) &gt;&gt; 1;
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175 }
<a name="l00176"></a>00176
<a name="l00177"></a><a class="code" href="_a_p___r_c_8cpp.html#aa64c6dce15e9de9105b4ae9533c9a267">00177</a> <a class="code" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a>(PCINT0_vect)
<a name="l00178"></a>00178 {
<a name="l00179"></a>00179 <span class="keywordtype">int</span> cnt = TCNT1;
<a name="l00180"></a>00180 <span class="keywordflow">if</span>(PINB &amp; 8){ <span class="comment">// pin 11</span>
<a name="l00181"></a>00181 <span class="keywordflow">if</span> ((<a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp; <a class="code" href="_a_p___r_c_8cpp.html#a6344322119ffff317eff2e2032e3d224">CH3_READ</a>) != CH3_READ){
<a name="l00182"></a>00182 <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> |= CH3_READ;
<a name="l00183"></a>00183 <a class="code" href="_a_p___r_c_8cpp.html#ad406463c30b4092e56b230fbb2f86485">timer3count</a> = cnt;
<a name="l00184"></a>00184 }
<a name="l00185"></a>00185 }<span class="keywordflow">else</span> <span class="keywordflow">if</span> ((<a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp; <a class="code" href="_a_p___r_c_8cpp.html#a6344322119ffff317eff2e2032e3d224">CH3_READ</a>) == CH3_READ){ <span class="comment">// ch 1 (pin 2) is Low</span>
<a name="l00186"></a>00186 <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp;= B11111011;
<a name="l00187"></a>00187 <span class="keywordflow">if</span> (cnt &lt; <a class="code" href="_a_p___r_c_8cpp.html#ad406463c30b4092e56b230fbb2f86485">timer3count</a>) <span class="comment">// Timer1 reset during the read of this pulse</span>
<a name="l00188"></a>00188 <a class="code" href="_a_p___r_c_8cpp.html#adb4daa4166dade70952e88dd6d6cdf11">timer3diff</a> = (cnt + 40000 - <a class="code" href="_a_p___r_c_8cpp.html#ad406463c30b4092e56b230fbb2f86485">timer3count</a>) &gt;&gt; 1; <span class="comment">// Timer1 TOP = 40000</span>
<a name="l00189"></a>00189 <span class="keywordflow">else</span>
<a name="l00190"></a>00190 <a class="code" href="_a_p___r_c_8cpp.html#adb4daa4166dade70952e88dd6d6cdf11">timer3diff</a> = (cnt - <a class="code" href="_a_p___r_c_8cpp.html#ad406463c30b4092e56b230fbb2f86485">timer3count</a>) &gt;&gt; 1;
<a name="l00191"></a>00191 }
<a name="l00192"></a>00192
<a name="l00193"></a>00193 <span class="keywordflow">if</span>(PINB &amp; 32){ <span class="comment">// pin 13</span>
<a name="l00194"></a>00194 <span class="keywordflow">if</span> ((<a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp; <a class="code" href="_a_p___r_c_8cpp.html#a5db92fecf8089f8aec8940c1baaa163c">CH4_READ</a>) != CH4_READ){
<a name="l00195"></a>00195 <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> |= CH4_READ;
<a name="l00196"></a>00196 <a class="code" href="_a_p___r_c_8cpp.html#ab9d55690f9d9e675fcc0e17c7fccc3d4">timer4count</a> = cnt;
<a name="l00197"></a>00197 }
<a name="l00198"></a>00198 }<span class="keywordflow">else</span> <span class="keywordflow">if</span> ((<a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp; <a class="code" href="_a_p___r_c_8cpp.html#a5db92fecf8089f8aec8940c1baaa163c">CH4_READ</a>) == CH4_READ){ <span class="comment">// ch 1 (pin 2) is Low</span>
<a name="l00199"></a>00199 <a class="code" href="_a_p___r_c_8cpp.html#ab750ea3dbe27a55b2e2678f2e1729e21">_rc_ch_read</a> &amp;= B11110111;
<a name="l00200"></a>00200 <span class="keywordflow">if</span> (cnt &lt; <a class="code" href="_a_p___r_c_8cpp.html#ab9d55690f9d9e675fcc0e17c7fccc3d4">timer4count</a>) <span class="comment">// Timer1 reset during the read of this pulse</span>
<a name="l00201"></a>00201 <a class="code" href="_a_p___r_c_8cpp.html#a6ac05fcfb03cc66e71951b7ab4b08b6d">timer4diff</a> = (cnt + 40000 - <a class="code" href="_a_p___r_c_8cpp.html#ab9d55690f9d9e675fcc0e17c7fccc3d4">timer4count</a>) &gt;&gt; 1; <span class="comment">// Timer1 TOP = 40000</span>
<a name="l00202"></a>00202 <span class="keywordflow">else</span>
<a name="l00203"></a>00203 <a class="code" href="_a_p___r_c_8cpp.html#a6ac05fcfb03cc66e71951b7ab4b08b6d">timer4diff</a> = (cnt - <a class="code" href="_a_p___r_c_8cpp.html#ab9d55690f9d9e675fcc0e17c7fccc3d4">timer4count</a>) &gt;&gt; 1;
<a name="l00204"></a>00204 }
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206
<a name="l00207"></a>00207
<a name="l00208"></a>00208
<a name="l00209"></a>00209 <span class="comment">// Throttle Timer Interrupt</span>
<a name="l00210"></a>00210 <span class="comment">// ------------------------</span>
<a name="l00211"></a><a class="code" href="_a_p___r_c_8cpp.html#a5da59e05fa5ade4be7c7656aee78291a">00211</a> <a class="code" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a>(TIMER1_CAPT_vect) <span class="comment">// Timer/Counter1 Capture Event</span>
<a name="l00212"></a>00212 {
<a name="l00213"></a>00213 <span class="comment">//This is a timer 1 interrupts, executed every 20us </span>
<a name="l00214"></a>00214 PORTB |= B00000001; <span class="comment">//Putting the pin high!</span>
<a name="l00215"></a>00215 PORTC |= B00010000; <span class="comment">//Putting the pin high! </span>
<a name="l00216"></a>00216 TCNT2 = 0; <span class="comment">//restarting the counter of timer 2</span>
<a name="l00217"></a>00217 <a class="code" href="_a_p___r_c_8cpp.html#a11928678cfeec459f1361894b65113ec">_timer_ovf</a> = 0;
<a name="l00218"></a>00218 }
<a name="l00219"></a>00219
<a name="l00220"></a><a class="code" href="_a_p___r_c_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">00220</a> <a class="code" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a>(TIMER2_OVF_vect)
<a name="l00221"></a>00221 {
<a name="l00222"></a>00222 <a class="code" href="_a_p___r_c_8cpp.html#a11928678cfeec459f1361894b65113ec">_timer_ovf</a>++;
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224
<a name="l00225"></a><a class="code" href="_a_p___r_c_8cpp.html#a5686c229bdef50123688ab6cb1404230">00225</a> <a class="code" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a>(TIMER2_COMPA_vect) <span class="comment">// Timer/Counter2 Compare Match A</span>
<a name="l00226"></a>00226 {
<a name="l00227"></a>00227 <span class="keywordflow">if</span>(<a class="code" href="_a_p___r_c_8cpp.html#a11928678cfeec459f1361894b65113ec">_timer_ovf</a> == <a class="code" href="_a_p___r_c_8cpp.html#ab508649220495510dfe50ba9aa941492">_timer_ovf_a</a>){
<a name="l00228"></a>00228 PORTB &amp;= B11111110; <span class="comment">//Putting the pin low</span>
<a name="l00229"></a>00229 }
<a name="l00230"></a>00230 }
<a name="l00231"></a>00231
<a name="l00232"></a><a class="code" href="_a_p___r_c_8cpp.html#aa282d056dc0e67857fc700fdce321f30">00232</a> <a class="code" href="_a_p___a_d_c___a_d_s7844_8cpp.html#a7cfcbe42bd266750aeb6e5d71e5ea479">ISR</a>(TIMER2_COMPB_vect) <span class="comment">// Timer/Counter2 Compare Match B Rudder Servo</span>
<a name="l00233"></a>00233 {
<a name="l00234"></a>00234 <span class="keywordflow">if</span>(<a class="code" href="_a_p___r_c_8cpp.html#a11928678cfeec459f1361894b65113ec">_timer_ovf</a> == <a class="code" href="_a_p___r_c_8cpp.html#ac18a366308c4077672a12bfb1e8284f1">_timer_ovf_b</a>){
<a name="l00235"></a>00235 PORTC &amp;= B11101111; <span class="comment">//Putting the pin low!</span>
<a name="l00236"></a>00236 }
<a name="l00237"></a>00237 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More