⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classmems_1_1_m_a_g___extended_kalman.html

📁 很好的kalman程序。.zip文件包含了所有的用到kalman滤波的库和头文件。
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>ExtendedKalman: mems::MAG_ExtendedKalman Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.6 --><div class="navigation" id="top">  <div class="tabs">    <ul>      <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 class="current"><a href="annotated.html"><span>Classes</span></a></li>      <li><a href="files.html"><span>Files</span></a></li>    </ul>  </div>  <div class="tabs">    <ul>      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>    </ul>  </div>  <div class="navpath"><b>mems</b>::<a class="el" href="classmems_1_1_m_a_g___extended_kalman.html">MAG_ExtendedKalman</a>  </div></div><div class="contents"><h1>mems::MAG_ExtendedKalman Class Reference</h1><!-- doxytag: class="mems::MAG_ExtendedKalman" --><code>#include &lt;<a class="el" href="_m_a_g___extended_kalman_8h-source.html">MAG_ExtendedKalman.h</a>&gt;</code><p><p><a href="classmems_1_1_m_a_g___extended_kalman-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#a4c4ecb907d038d3a51f0f83eb8dc792">MAG_ExtendedKalman</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#4ba5a46366a0a90a837abeb1efa26304">~MAG_ExtendedKalman</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#4e62790d61e8d6ae306584c67612a058">reinitialize</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#fcca8ccb1bccfe3c3b9d493600e2b67b">setInitialEstimate</a> (double p, double q, double r, double w, double x, double y, double z)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#6147f28b3edbff169f10d4f58eae98ca">setEarthAccel</a> (double ax, double ay, double az)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#db0bb8ca580684967d1fea747f72c828">setEarthMag</a> (double mx, double my, double mz)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#e0222fd8a4bd0ecff4ba0fa656a9cef7">setProcessNoise</a> (double gx, double gy, double gz, double qw, double qx, double qy, double qz)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#61b82f4d1f28060d1152ecc9d7154f6a">setProcessNoise</a> (MEMS_STD_VECTOR &amp;noise)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">MEMS_STD_MATRIX&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#403fe58014be7e545e23a2b433170b98">getProcessNoiseCovariance</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#a3b25418b40488755857ffcf61d716c2">setMeasurementNoise</a> (double gx, double gy, double gz, double ax, double ay, double az, double mx, double my, double mz)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#a16e84464dfe63d5e7873899d8e3e50f">setMeasurementNoise</a> (MEMS_STD_VECTOR &amp;noise)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">MEMS_STD_MATRIX&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#9f47d249f62fdba6ed9efda0fe54fed3">getMeasurementNoiseCovariance</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">MEMS_STD_VECTOR&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#cb1896a97c0888efa1183a3a154e9088">processSample</a> (double delta, MEMS_STD_VECTOR &amp;sample)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">MEMS_STD_VECTOR&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#aa5f5755aa5f249cab5e60bffcae7d9e">processSample</a> (double delta, double gx, double gy, double gz, double ax, double ay, double az, double mx, double my, double mz)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">MEMS_STD_VECTOR&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#9ae86aed59bcb4be28436f14bbe82f2b">getResidual</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">MEMS_STD_VECTOR&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#360d4a7b1d98ac339fdd4dd2d4b4a15e">quat2Euler</a> (double w, double x, double y, double z)</td></tr><tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#4fbe655836b0fec482115056f83973e3">getVersion</a> ()</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Implementation class of Extended Kalman Filter.<p>This class, presents an interface to the extended Kalman filter. Processing of a sample is invoked via one of the processSample methods, each of which takes the resolution/difference between samples, and the actual sample itself. The sample consists of gyro x/y/z, accelerometer x/y/z and magnetometer x/y/z; stated formally it is &lt;gx, gy, gz, ax, ay, az, mx, my, mz&gt;. The return value is a vector consisting of corrected gyro values, a quaternion indicating the 'position' relative to canonical earth coordinate axes (explained later), and gyro bias. Again, formally stated the result is &lt;gx, gy, gz, qw, qx, qy, qz, bx, by, bz&gt;.<p>Two frames of reference, or coordinate systems, are used when discussing operation of the filter. The earth frame is fixed, and is aligned as follows: the positive x-axis points true north, the y-axis points east, and the z-axis points 'down' toward the earth. The body frame moves with the body being rotated/moved, and if using an airplane as the reference the coordinate system can visualized as follows: the positive x-axis (roll) points along the fuselage toward the cockpit, the positive y-axis (pitch) points down the right wing, and the positive z-axis (yaw) points out the bottom of the aircraft. The frames of reference are established such that if the body is synchronized with the earth, the two coordinate systems are perfectly aligned - earth x, y and z match and align with body x, y and z.<p>Various parameter tuning parameters can be set via the setProcessNoise and setMeasurementNoise methods. Measurement noise is defined as the variance between measured samples. Process noise is much more abstract, but can be thought of as the noise external to the system (e.g. vibration, shock, wind, etc.) that may in turn affect the quality of the measurement. The current implementation of the filter attempts to account for changing measurement noise characteristics by updating the measurement noise covariance matrix after each sample. Future implementations will also update the process noise covariance matrix in a similar manner.<p>Discussion of process and measurement noise can be found at the following:<ul><li><a href="http://www.andrew.cmu.edu/user/nsg/filter_parameters_theory.htm">http://www.andrew.cmu.edu/user/nsg/filter_parameters_theory.htm</a></li><li><a href="http://www.cs.unc.edu/~welch/kalman/">http://www.cs.unc.edu/~welch/kalman/</a></li></ul><p><dl class="user" compact><dt><b>Initialization</b></dt><dd>For the filter to perform well, at least one initialization method must first be called prior to library use:</dd></dl><dl class="user" compact><dt><b></b></dt><dd><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#db0bb8ca580684967d1fea747f72c828">setEarthMag()</a>: The Earth's magnetic field varies dramatically by location. As such, the components of the magnetic field at your location must be set prior to using the filter - the default values will likely be very different from your location.</dd></dl><dl class="user" compact><dt><b>Usage</b></dt><dd><a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#cb1896a97c0888efa1183a3a154e9088">processSample()</a> is called with each new sample. <a class="el" href="classmems_1_1_m_a_g___extended_kalman.html#cb1896a97c0888efa1183a3a154e9088">processSample()</a> is overloaded such that either the individual gyro, accel and magnetometer values may be passed in, or combined into a single vector. Please see the individual methods for additional information, including return values. </dd></dl><p>Definition at line <a class="el" href="_m_a_g___extended_kalman_8h-source.html#l00163">163</a> of file <a class="el" href="_m_a_g___extended_kalman_8h-source.html">MAG_ExtendedKalman.h</a>.</p><hr><h2>Constructor &amp; Destructor Documentation</h2><a class="anchor" name="a4c4ecb907d038d3a51f0f83eb8dc792"></a><!-- doxytag: member="mems::MAG_ExtendedKalman::MAG_ExtendedKalman" ref="a4c4ecb907d038d3a51f0f83eb8dc792" args="()" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">mems::MAG_ExtendedKalman::MAG_ExtendedKalman           </td>          <td>(</td>          <td class="paramname">          </td>          <td>&nbsp;)&nbsp;</td>          <td></td>        </tr>      </table></div><div class="memdoc"><p>'Do-nothing' constructor. </div></div><p><a class="anchor" name="4ba5a46366a0a90a837abeb1efa26304"></a><!-- doxytag: member="mems::MAG_ExtendedKalman::~MAG_ExtendedKalman" ref="4ba5a46366a0a90a837abeb1efa26304" args="(void)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">mems::MAG_ExtendedKalman::~MAG_ExtendedKalman           </td>          <td>(</td>          <td class="paramtype">void&nbsp;</td>          <td class="paramname">          </td>          <td>&nbsp;)&nbsp;</td>          <td></td>        </tr>      </table></div><div class="memdoc"><p>Destructor </div></div><p><hr><h2>Member Function Documentation</h2><a class="anchor" name="4fbe655836b0fec482115056f83973e3"></a><!-- doxytag: member="mems::MAG_ExtendedKalman::getVersion" ref="4fbe655836b0fec482115056f83973e3" args="()" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">static const char* mems::MAG_ExtendedKalman::getVersion           </td>          <td>(</td>          <td class="paramname">          </td>          <td>&nbsp;)&nbsp;</td>          <td><code> [static]</code></td>        </tr>      </table></div><div class="memdoc"><p>Returns library version. Note that the version returned by this method will contain additional release numbers indicating release and/or build sequences that will not be present in the library (Kalmanxxx.lib) name. </div></div><p><a class="anchor" name="4e62790d61e8d6ae306584c67612a058"></a><!-- doxytag: member="mems::MAG_ExtendedKalman::reinitialize" ref="4e62790d61e8d6ae306584c67612a058" args="()" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void mems::MAG_ExtendedKalman::reinitialize           </td>          <td>(</td>          <td class="paramname">          </td>          <td>&nbsp;)&nbsp;</td>          <td></td>        </tr>      </table></div><div class="memdoc"><p>Reinitialize the filter to NULL state. Reinitialization will reset the process and measurement noise covariance matrices to their respective default values, and all other internal vectors/matrices to default, initial values. </div></div><p><a class="anchor" name="fcca8ccb1bccfe3c3b9d493600e2b67b"></a><!-- doxytag: member="mems::MAG_ExtendedKalman::setInitialEstimate" ref="fcca8ccb1bccfe3c3b9d493600e2b67b" args="(double p, double q, double r, double w, double x, double y, double z)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void mems::MAG_ExtendedKalman::setInitialEstimate           </td>          <td>(</td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>p</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>q</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>r</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>w</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>x</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>y</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>z</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Set the initial a priori estimate of the measurement. Not necessary under normal conditions, but may be used to decrease time to filter convergence, if required. NOTE: Filter convergence is typically on the order of milliseconds assuming a standard IMU sample rate of 150Hz.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>p</em>&nbsp;</td><td>gyro x angular rate in deg/s </td></tr>    <tr><td valign="top"></td><td valign="top"><em>q</em>&nbsp;</td><td>gyro y angular rate in deg/s </td></tr>    <tr><td valign="top"></td><td valign="top"><em>r</em>&nbsp;</td><td>gyro z angular rate in deg/s </td></tr>    <tr><td valign="top"></td><td valign="top"><em>w</em>&nbsp;</td><td>quaternion w </td></tr>    <tr><td valign="top"></td><td valign="top"><em>x</em>&nbsp;</td><td>quaternion x </td></tr>    <tr><td valign="top"></td><td valign="top"><em>y</em>&nbsp;</td><td>quaternion y </td></tr>    <tr><td valign="top"></td><td valign="top"><em>z</em>&nbsp;</td><td>quaternion z </td></tr>  </table></dl></div></div><p><a class="anchor" name="6147f28b3edbff169f10d4f58eae98ca"></a><!-- doxytag: member="mems::MAG_ExtendedKalman::setEarthAccel" ref="6147f28b3edbff169f10d4f58eae98ca" args="(double ax, double ay, double az)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void mems::MAG_ExtendedKalman::setEarthAccel           </td>          <td>(</td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>ax</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>ay</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">double&nbsp;</td>          <td class="paramname"> <em>az</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td></td>        </tr>      </table></div><div class="memdoc"><p>Set the standard/canonical earth accelerations in G's. Under standard conditions - and preset by application upon startup - the +z-axis is +1.0, +x and +y are 0.0. May be used if unusual acceleration effects are seen, or standard &lt;0, 0, 1.0&gt; acceleration is atypical for the environment in which the filter is deployed.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td valign="top"></td><td valign="top"><em>ax</em>&nbsp;</td><td>x-component acceleration specified in G's </td></tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -