ardupilot/libraries/doc/html/_range_finder_8h_source.html

76 lines
8.8 KiB
HTML
Raw Normal View History

<!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_RangeFinder/RangeFinder.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- 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_RangeFinder/RangeFinder.h</h1> </div>
</div>
<div class="contents">
<a href="_range_finder_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 RangeFinder_h</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define RangeFinder_h</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00005"></a>00005
<a name="l00006"></a><a class="code" href="_range_finder_8h.html#a3664dc7120b17dcc124ec379abb6f15e">00006</a> <span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_FRONT 0, 10, 0</span>
<a name="l00007"></a><a class="code" href="_range_finder_8h.html#afc87ce5f903d2ccfbee7063194bc9778">00007</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_RIGHT -10, 0, 0</span>
<a name="l00008"></a><a class="code" href="_range_finder_8h.html#a30110d0677414b96b895a22ba7403f48">00008</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_BACK 0,-10, 0</span>
<a name="l00009"></a><a class="code" href="_range_finder_8h.html#ac13d390c07e2054c06f6be0150928453">00009</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_LEFT 10, 0, 0</span>
<a name="l00010"></a><a class="code" href="_range_finder_8h.html#a5d70f6e4a63d6b4a595dc9a29454f6b7">00010</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_UP 0, 0,-10</span>
<a name="l00011"></a><a class="code" href="_range_finder_8h.html#a97a1e97ef7ed86a2cc6cd20c81941466">00011</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_DOWN 0, 0, 10</span>
<a name="l00012"></a><a class="code" href="_range_finder_8h.html#a6bdc734298ba0adb2443e7bc5aeaa578">00012</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_FRONT_RIGHT -5, -5, 0</span>
<a name="l00013"></a><a class="code" href="_range_finder_8h.html#a87184012a67ebacb16d2ac28bcca32bc">00013</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_BACK_RIGHT -5, -5, 0</span>
<a name="l00014"></a><a class="code" href="_range_finder_8h.html#a260ca6cfec672bbacd821ca9c372e1e3">00014</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_BACK_LEFT 5, -5, 0</span>
<a name="l00015"></a><a class="code" href="_range_finder_8h.html#abdcb676e63ccc42bd4116ca5d9e78e2c">00015</a> <span class="preprocessor"></span><span class="preprocessor">#define AP_RANGEFINDER_ORIENTATION_FRONT_LEFT 5, 5, 0</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a><a class="code" href="_range_finder_8h.html#a1147ca7cf8e4c7fffd466f82bc899234">00017</a> <span class="preprocessor">#define AP_RANGEFINDER_NUM_AVERAGES 4</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a><a class="code" href="class_range_finder.html">00019</a> <span class="keyword">class </span><a class="code" href="class_range_finder.html">RangeFinder</a>
<a name="l00020"></a>00020 {
<a name="l00021"></a>00021 <span class="keyword">public</span>:
<a name="l00022"></a><a class="code" href="class_range_finder.html#a93f1fae66bdb0f5b411a3f81e9edf138">00022</a> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#a93f1fae66bdb0f5b411a3f81e9edf138">_analogPort</a>; <span class="comment">// the port to which the sensor is connected</span>
<a name="l00023"></a><a class="code" href="class_range_finder.html#ab23a1a69f5b96fd791491f845ad1bfdb">00023</a> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#ab23a1a69f5b96fd791491f845ad1bfdb">_history_ptr</a>;
<a name="l00024"></a><a class="code" href="class_range_finder.html#a4f45693be996b3395f063a4624b853b4">00024</a> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#a4f45693be996b3395f063a4624b853b4">_history</a>[AP_RANGEFINDER_NUM_AVERAGES];
<a name="l00025"></a>00025 <span class="keyword">public</span>:
<a name="l00026"></a><a class="code" href="class_range_finder.html#a3302ba2e251a3837b031925e1d7da70a">00026</a> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#a3302ba2e251a3837b031925e1d7da70a">raw_value</a>; <span class="comment">// raw value from the sensor</span>
<a name="l00027"></a><a class="code" href="class_range_finder.html#aff9e96ba48f000d6b7db0770ee5d7026">00027</a> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#aff9e96ba48f000d6b7db0770ee5d7026">distance</a>; <span class="comment">// distance in cm</span>
<a name="l00028"></a><a class="code" href="class_range_finder.html#a6831ca88e4ca73e80f46fb252a786b5d">00028</a> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#a6831ca88e4ca73e80f46fb252a786b5d">max_distance</a>; <span class="comment">// maximum measurable distance (in cm)</span>
<a name="l00029"></a><a class="code" href="class_range_finder.html#abb14b4bcb72e92ff74ad4e6e17f5d460">00029</a> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#abb14b4bcb72e92ff74ad4e6e17f5d460">min_distance</a>; <span class="comment">// minimum measurable distance (in cm)</span>
<a name="l00030"></a><a class="code" href="class_range_finder.html#a559d092b3e3c550b4352d7c0ad3b6e84">00030</a> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#a8cb4faa15ec6ff0e3b36420d56affd22">orientation_x</a>, <a class="code" href="class_range_finder.html#a6541be7eef7c55b9c20b0de4bf5f88a5">orientation_y</a>, <a class="code" href="class_range_finder.html#a559d092b3e3c550b4352d7c0ad3b6e84">orientation_z</a>;
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#a833cdd23c2de887860e50e0180601add">filter</a>(<span class="keywordtype">int</span> latestValue); <span class="comment">// returns the average of the last AP_RANGEFINDER_NUM_AVERAGES values</span>
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_range_finder.html#a0f92e743905971f1807fc100f0b99218">init</a>(<span class="keywordtype">int</span> analogPort);
<a name="l00035"></a>00035 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_range_finder.html#a7d6aef1559f205bac93327078c58840a">set_orientation</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> z);
<a name="l00036"></a>00036 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="class_range_finder.html#a4dfe0b901e3551141dd08618219e037f">read</a>(); <span class="comment">// read value from analog port and return distance in cm</span>
<a name="l00037"></a>00037 };
<a name="l00038"></a>00038 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 26 2010 21:58:34 for ArduPilot Libraries by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>