<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>CPtuHokuyo.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> > <b>C++ reference</b> </div> <div align="right"> <a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a> </div> <!-- Generated by Doxygen 1.7.5 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</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> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <div class="left"> <form id="FSearchBox" action="search.php" method="get"> <img id="MSearchSelect" src="search/mag.png" alt=""/> <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"/> </form> </div><div class="right"></div> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">CPtuHokuyo.h</div> </div> </div> <div class="contents"> <a href="_c_ptu_hokuyo_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"> | The Mobile Robot Programming Toolkit (MRPT) C++ library |</span> <a name="l00003"></a>00003 <span class="comment"> | |</span> <a name="l00004"></a>00004 <span class="comment"> | http://www.mrpt.org/ |</span> <a name="l00005"></a>00005 <span class="comment"> | |</span> <a name="l00006"></a>00006 <span class="comment"> | Copyright (C) 2005-2011 University of Malaga |</span> <a name="l00007"></a>00007 <span class="comment"> | |</span> <a name="l00008"></a>00008 <span class="comment"> | This software was written by the Machine Perception and Intelligent |</span> <a name="l00009"></a>00009 <span class="comment"> | Robotics Lab, University of Malaga (Spain). |</span> <a name="l00010"></a>00010 <span class="comment"> | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |</span> <a name="l00011"></a>00011 <span class="comment"> | |</span> <a name="l00012"></a>00012 <span class="comment"> | This file is part of the MRPT project. |</span> <a name="l00013"></a>00013 <span class="comment"> | |</span> <a name="l00014"></a>00014 <span class="comment"> | MRPT is free software: you can redistribute it and/or modify |</span> <a name="l00015"></a>00015 <span class="comment"> | it under the terms of the GNU General Public License as published by |</span> <a name="l00016"></a>00016 <span class="comment"> | the Free Software Foundation, either version 3 of the License, or |</span> <a name="l00017"></a>00017 <span class="comment"> | (at your option) any later version. |</span> <a name="l00018"></a>00018 <span class="comment"> | |</span> <a name="l00019"></a>00019 <span class="comment"> | MRPT is distributed in the hope that it will be useful, |</span> <a name="l00020"></a>00020 <span class="comment"> | but WITHOUT ANY WARRANTY; without even the implied warranty of |</span> <a name="l00021"></a>00021 <span class="comment"> | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |</span> <a name="l00022"></a>00022 <span class="comment"> | GNU General Public License for more details. |</span> <a name="l00023"></a>00023 <span class="comment"> | |</span> <a name="l00024"></a>00024 <span class="comment"> | You should have received a copy of the GNU General Public License |</span> <a name="l00025"></a>00025 <span class="comment"> | along with MRPT. If not, see <http://www.gnu.org/licenses/>. |</span> <a name="l00026"></a>00026 <span class="comment"> | |</span> <a name="l00027"></a>00027 <span class="comment"> +---------------------------------------------------------------------------+ */</span> <a name="l00028"></a>00028 <a name="l00029"></a>00029 <span class="preprocessor">#ifndef CPtuHokuyo_H</span> <a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define CPtuHokuyo_H</span> <a name="l00031"></a>00031 <span class="preprocessor"></span> <a name="l00032"></a>00032 <span class="preprocessor">#include <<a class="code" href="_c_hokuyo_u_r_g_8h.html">mrpt/hwdrivers/CHokuyoURG.h</a>></span> <a name="l00033"></a>00033 <span class="preprocessor">#include <<a class="code" href="_c_file_output_stream_8h.html">mrpt/utils/CFileOutputStream.h</a>></span> <a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="_c_ptu_d_perception_8h.html">CPtuDPerception.h</a>"</span> <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="keyword">namespace </span>mrpt <a name="l00037"></a>00037 { <a name="l00038"></a>00038 <span class="keyword">namespace </span>hwdrivers <a name="l00039"></a>00039 {<span class="comment"></span> <a name="l00040"></a>00040 <span class="comment"> /** The objetive of this class is to coordinate PTU movements and</span> <a name="l00041"></a>00041 <span class="comment"> * Hokuyo scans, adding the posibility of save the points earned</span> <a name="l00042"></a>00042 <span class="comment"> * in several different formats, limit valids points and view</span> <a name="l00043"></a>00043 <span class="comment"> * them on a grahic.</span> <a name="l00044"></a>00044 <span class="comment"> * \ingroup mrpt_hwdrivers_grp</span> <a name="l00045"></a>00045 <span class="comment"> */</span> <a name="l00046"></a>00046 <a name="l00047"></a><a class="code" href="group__mrpt__hwdrivers__grp.html#ga01469b6274ea1d1a94de9aa77ba87060">00047</a> <span class="keyword">class </span><a class="code" href="hwdrivers__impexp_8h.html#a5bcf681973c7e4e76310bd0791f1b612">HWDRIVERS_IMPEXP</a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html">CPtuHokuyo</a>; <a name="l00048"></a>00048 <a name="l00049"></a>00049 <span class="keyword">struct </span><a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html">ThreadParams</a> <a name="l00050"></a>00050 { <a name="l00051"></a><a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html#a80d4fac1b096a58bf9753a05a491ce60">00051</a> <span class="keywordtype">char</span> <a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html#a80d4fac1b096a58bf9753a05a491ce60">axis</a>; <a name="l00052"></a><a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html#af92314aff6320df171119affca76d679">00052</a> <span class="keywordtype">bool</span> <a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html#af92314aff6320df171119affca76d679">start_capture</a>; <a name="l00053"></a><a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html#a8147b64f8674bbf73c958b514340952c">00053</a> <span class="keywordtype">double</span> <a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html#a8147b64f8674bbf73c958b514340952c">scan_vel</a>; <span class="comment">// Velocity of continuous scan</span> <a name="l00054"></a><a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html#a1cb442489b96256026e94da01fc94e90">00054</a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html">CPtuHokuyo</a>* <a class="code" href="structmrpt_1_1hwdrivers_1_1_thread_params.html#a1cb442489b96256026e94da01fc94e90">ptu_hokuyo</a>; <a name="l00055"></a>00055 }; <a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="keyword">class </span><a class="code" href="hwdrivers__impexp_8h.html#a5bcf681973c7e4e76310bd0791f1b612">HWDRIVERS_IMPEXP</a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html">CPtuHokuyo</a> : <span class="keyword">public</span> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_generic_sensor.html" title="A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...">CGenericSensor</a> <a name="l00058"></a>00058 { <a name="l00059"></a>00059 <a name="l00060"></a>00060 <a class="code" href="_c_generic_sensor_8h.html#ab8b72c811c520eb036fa4080d9cd9d1d" title="This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...">DEFINE_GENERIC_SENSOR</a>(<a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html">CPtuHokuyo</a>) <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keyword">protected</span>: <a name="l00063"></a>00063 <a name="l00064"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a5edbfdfe3b92d15ed045f644ccafebce">00064</a> std<a class="code" href="classstd_1_1string.html" title="STL class.">::string</a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a5edbfdfe3b92d15ed045f644ccafebce">m_ptu_port</a>; <a name="l00065"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#abc7d1c5862149513f248b7b69d95337b">00065</a> <span class="keywordtype">char</span> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#abc7d1c5862149513f248b7b69d95337b">m_axis</a>; <a name="l00066"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a2e86bf5dc33502e13a04c44b7cb81a6e">00066</a> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a2e86bf5dc33502e13a04c44b7cb81a6e">m_velocity</a>, m_initial, m_final, m_hokuyo_frec; <a name="l00067"></a>00067 <span class="comment"></span> <a name="l00068"></a>00068 <span class="comment"> /** Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes)</span> <a name="l00069"></a>00069 <span class="comment"> * \exception This method must throw an exception with a descriptive message if some critical parameter is missing or has an invalid value.</span> <a name="l00070"></a>00070 <span class="comment"> */</span> <a name="l00071"></a>00071 <span class="keywordtype">void</span> loadConfig_sensorSpecific( <a name="l00072"></a>00072 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_c_config_file_base.html" title="This class allows loading and storing values and vectors of different types from a configuration text...">mrpt::utils::CConfigFileBase</a> &configSource, <a name="l00073"></a>00073 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &section ); <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="keyword">public</span>: <a name="l00076"></a>00076 <a name="l00077"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#ac319b684786f6747c7d5fc435c7fba8b">00077</a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_hokuyo_u_r_g.html" title="This software driver implements the protocol SCIP-2.0 for interfacing HOKUYO URG, UTM and UXM laser s...">CHokuyoURG</a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#ac319b684786f6747c7d5fc435c7fba8b">laser</a>; <a name="l00078"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a64665a3521a522f47028ca405674711a">00078</a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_base.html" title="This class implements initialization and comunication methods to control a generic Pan and Tilt Unit...">CPtuBase</a> *<a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a64665a3521a522f47028ca405674711a">ptu</a>; <a name="l00079"></a>00079 <span class="comment"></span> <a name="l00080"></a>00080 <span class="comment"> /** Specify type of ptu. Current options are:</span> <a name="l00081"></a>00081 <span class="comment"> * m_ptu_type = 0 => CPtuDPerception</span> <a name="l00082"></a>00082 <span class="comment"> * m_ptu_type = 1 => CPtuMicos </span> <a name="l00083"></a>00083 <span class="comment"> */</span> <a name="l00084"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#ad05c22c9b5b084ac865dd3296ceac3c0">00084</a> <span class="keywordtype">int</span> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#ad05c22c9b5b084ac865dd3296ceac3c0" title="Specify type of ptu.">m_ptu_type</a>; <a name="l00085"></a>00085 <a name="l00086"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#aa2d7183d421d969cd3b0f54d9b1275dc">00086</a> std<a class="code" href="classstd_1_1vector.html">::vector<mrpt::slam::CObservation2DRangeScan></a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#aa2d7183d421d969cd3b0f54d9b1275dc">vObs</a>; <a name="l00087"></a>00087 <a name="l00088"></a>00088 <span class="comment">// High between ptu tilt axis and hokuyo laser scan</span> <a name="l00089"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#ae4c83a6e3a51271abcc18dee13d26932">00089</a> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#ae4c83a6e3a51271abcc18dee13d26932">high</a>; <a name="l00090"></a>00090 <a name="l00091"></a>00091 <span class="keyword">struct </span><a class="code" href="structmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo_1_1my__pos.html">my_pos</a> <a name="l00092"></a>00092 { <a name="l00093"></a><a class="code" href="structmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo_1_1my__pos.html#adf1984b83c47148266ad5dc1678c73b0">00093</a> mrpt<a class="code" href="group__time__date.html#ga42674286d8d56afea013b6329bb7327a" title="A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...">::system::TTimeStamp</a> <a class="code" href="structmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo_1_1my__pos.html#adf1984b83c47148266ad5dc1678c73b0">timeStamp</a>; <a name="l00094"></a><a class="code" href="structmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo_1_1my__pos.html#a509e0ec4027f33dd676b0c8025616a32">00094</a> <span class="keywordtype">double</span> <a class="code" href="structmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo_1_1my__pos.html#a509e0ec4027f33dd676b0c8025616a32">pos</a>; <a name="l00095"></a>00095 }; <a name="l00096"></a>00096 <a name="l00097"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a07ea31267673d43dee97b9d7468057cf">00097</a> std<a class="code" href="classstd_1_1vector.html">::vector<mrpt::hwdrivers::CPtuHokuyo::my_pos></a> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a07ea31267673d43dee97b9d7468057cf">v_my_pos</a>; <a name="l00098"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a6064fab490f1af257831a43f9b7971e3">00098</a> std<a class="code" href="classstd_1_1vector.html">::vector<double></a> v_ptu_pos, <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a6064fab490f1af257831a43f9b7971e3">v_ptu_time</a>; <a name="l00099"></a>00099 <a name="l00100"></a>00100 <span class="comment"></span> <a name="l00101"></a>00101 <span class="comment"> /** Default constructor */</span> <a name="l00102"></a>00102 <a name="l00103"></a>00103 <a class="code" href="group__mrpt__hwdrivers__grp.html#ga01469b6274ea1d1a94de9aa77ba87060" title="The objetive of this class is to coordinate PTU movements and Hokuyo scans, adding the posibility of ...">CPtuHokuyo</a>(); <a name="l00104"></a>00104 <span class="comment"></span> <a name="l00105"></a>00105 <span class="comment"> /** Destructor, delete observations of the vector */</span> <a name="l00106"></a>00106 <a name="l00107"></a>00107 ~<a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html">CPtuHokuyo</a>(); <a name="l00108"></a>00108 <span class="comment"></span> <a name="l00109"></a>00109 <span class="comment"> /** Initialization of laser and ptu */</span> <a name="l00110"></a>00110 <a name="l00111"></a>00111 <span class="keywordtype">bool</span> init(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &portPtu, <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &portHokuyo); <a name="l00112"></a>00112 <span class="comment"></span> <a name="l00113"></a>00113 <span class="comment"> /** Performs a complete scan</span> <a name="l00114"></a>00114 <span class="comment"> * \param <axis> Pan or Till</span> <a name="l00115"></a>00115 <span class="comment"> * \param <tWait> Wait time betwen commands</span> <a name="l00116"></a>00116 <span class="comment"> * \param <initial> initial position</span> <a name="l00117"></a>00117 <span class="comment"> * \param <final> final position</span> <a name="l00118"></a>00118 <span class="comment"> * \param <radPre> radians precision for the scan</span> <a name="l00119"></a>00119 <span class="comment"> * \param <interlaced> if interlaced==true performs a double sweep</span> <a name="l00120"></a>00120 <span class="comment"> */</span> <a name="l00121"></a>00121 <a name="l00122"></a>00122 <span class="keywordtype">bool</span> scan(<span class="keywordtype">char</span> &axis, <span class="keyword">const</span> <span class="keywordtype">int</span> &tWait, <span class="keywordtype">double</span> &initial, <span class="keywordtype">double</span> &<span class="keyword">final</span>, <span class="keyword">const</span> <span class="keywordtype">double</span> &radPre, <span class="keyword">const</span> <span class="keywordtype">int</span> &<a class="code" href="eigen__plugins_8h.html#a378ef7ee1218e4aa29b595c6e0f8ee4a" title="Computes the mean of the entire matrix.">mean</a>, <span class="keyword">const</span> <span class="keywordtype">bool</span> &interlaced=<span class="keyword">false</span>); <a name="l00123"></a>00123 <span class="comment"></span> <a name="l00124"></a>00124 <span class="comment"> /** Performs a continuous scan */</span> <a name="l00125"></a>00125 <a name="l00126"></a>00126 <span class="keywordtype">bool</span> continuousScan(<span class="keywordtype">char</span> &axis, <span class="keyword">const</span> <span class="keywordtype">double</span> &velocity, <span class="keywordtype">double</span> &initial, <span class="keywordtype">double</span> &<span class="keyword">final</span>); <a name="l00127"></a>00127 <span class="comment"></span> <a name="l00128"></a>00128 <span class="comment"> /** Show a graphic with the points obtained from the scan or a map*/</span> <a name="l00129"></a>00129 <span class="comment">//bool showGraphic(mrpt::slam::CSimplePointsMap *theMap=0);</span> <a name="l00130"></a>00130 <span class="comment"></span> <a name="l00131"></a>00131 <span class="comment"> /** Save a simple points map into a simple file (if colours==true save points with a color) */</span> <a name="l00132"></a>00132 <span class="comment">//bool saveMap2File(mrpt::slam::CSimplePointsMap &theMap, char* fname="Data.pts", const bool &colours=false);</span> <a name="l00133"></a>00133 <span class="comment"></span> <a name="l00134"></a>00134 <span class="comment"> /** Save vector of observations in a CFileOutputStream file */</span> <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="keywordtype">bool</span> saveVObs2File(<span class="keywordtype">char</span> *fname=<span class="stringliteral">"Data.rawlog"</span>); <a name="l00137"></a>00137 <span class="comment"></span> <a name="l00138"></a>00138 <span class="comment"> /** Save vector points of observations into a simple file */</span> <a name="l00139"></a>00139 <a name="l00140"></a>00140 <span class="keywordtype">bool</span> saveVObsPoints2File(<span class="keywordtype">char</span> *fname=<span class="stringliteral">"Data.pts"</span>,<span class="keyword">const</span> <span class="keywordtype">bool</span> &colours=<span class="keyword">false</span>); <a name="l00141"></a>00141 <span class="comment"></span> <a name="l00142"></a>00142 <span class="comment"> /** Save pitchs and raw distances of all scans */</span> <a name="l00143"></a>00143 <a name="l00144"></a>00144 <span class="keywordtype">bool</span> savePitchAndDistances2File(); <a name="l00145"></a>00145 <span class="comment"></span> <a name="l00146"></a>00146 <span class="comment"> /** Method for limit map points obtained from a scan */</span> <a name="l00147"></a>00147 <span class="comment">//void limit(mrpt::slam::CSimplePointsMap &theMap);</span> <a name="l00148"></a>00148 <span class="comment"></span> <a name="l00149"></a>00149 <span class="comment"> /** Set high between ptu tilt axis and hokuyo laser scan */</span> <a name="l00150"></a>00150 <a name="l00151"></a><a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a2de3940e0296e55a6a7e5f281d9a5697">00151</a> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1hwdrivers_1_1_c_ptu_hokuyo.html#a2de3940e0296e55a6a7e5f281d9a5697" title="Method for limit map points obtained from a scan.">setHigh</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> &newHigh) { high = newHigh; } <a name="l00152"></a>00152 <span class="comment"></span> <a name="l00153"></a>00153 <span class="comment"> /** Obtain a observation from the laser */</span> <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="keywordtype">bool</span> obtainObs( <a class="code" href="classmrpt_1_1slam_1_1_c_observation2_d_range_scan.html" title="A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...">mrpt::slam::CObservation2DRangeScan</a> & obs ); <a name="l00156"></a>00156 <span class="comment"></span> <a name="l00157"></a>00157 <span class="comment"> /** This method can or cannot be implemented in the derived class, depending on the need for it.</span> <a name="l00158"></a>00158 <span class="comment"> * \exception This method must throw an exception with a descriptive message if some critical error is found.</span> <a name="l00159"></a>00159 <span class="comment"> */</span> <a name="l00160"></a>00160 <span class="keywordtype">void</span> initialize(); <a name="l00161"></a>00161 <span class="comment"></span> <a name="l00162"></a>00162 <span class="comment"> /** This method will be invoked at a minimum rate of "process_rate" (Hz)</span> <a name="l00163"></a>00163 <span class="comment"> * \exception This method must throw an exception with a descriptive message if some critical error is found.</span> <a name="l00164"></a>00164 <span class="comment"> */</span> <a name="l00165"></a>00165 <span class="keywordtype">void</span> doProcess(); <a name="l00166"></a>00166 <a name="l00167"></a>00167 <a name="l00168"></a>00168 <span class="keyword">private</span>: <a name="l00169"></a>00169 <span class="comment"></span> <a name="l00170"></a>00170 <span class="comment"> /** Save a observation from the laser into a vector of</span> <a name="l00171"></a>00171 <span class="comment"> * observations, calculating sensor position</span> <a name="l00172"></a>00172 <span class="comment"> */</span> <a name="l00173"></a>00173 <a name="l00174"></a>00174 <span class="keywordtype">double</span> saveObservation(<span class="keyword">const</span> <span class="keywordtype">char</span> &axis, <span class="keyword">const</span> <span class="keywordtype">int</span> &<a class="code" href="eigen__plugins_8h.html#a378ef7ee1218e4aa29b595c6e0f8ee4a" title="Computes the mean of the entire matrix.">mean</a>); <a name="l00175"></a>00175 <span class="comment"></span> <a name="l00176"></a>00176 <span class="comment"> /** Performs a simple scan</span> <a name="l00177"></a>00177 <span class="comment"> * \param <axis> Pan or Till</span> <a name="l00178"></a>00178 <span class="comment"> * \param <tWait> Wait time betwen commands</span> <a name="l00179"></a>00179 <span class="comment"> * \param <movements> number total of movements</span> <a name="l00180"></a>00180 <span class="comment"> * \param <radPre> radians precision for the scan</span> <a name="l00181"></a>00181 <span class="comment"> * \param <vObs> reference to obsevations vector for save the observation</span> <a name="l00182"></a>00182 <span class="comment"> */</span> <a name="l00183"></a>00183 <a name="l00184"></a>00184 <span class="keywordtype">bool</span> singleScan(<span class="keyword">const</span> <span class="keywordtype">char</span> &axis, <span class="keyword">const</span> <span class="keywordtype">int</span> &tWait, <span class="keyword">const</span> <span class="keywordtype">int</span> &movements, <span class="keyword">const</span> <span class="keywordtype">double</span> &radPre, <span class="keyword">const</span> <span class="keywordtype">int</span> &<a class="code" href="eigen__plugins_8h.html#a378ef7ee1218e4aa29b595c6e0f8ee4a" title="Computes the mean of the entire matrix.">mean</a>); <a name="l00185"></a>00185 <span class="comment"></span> <a name="l00186"></a>00186 <span class="comment"> /** Calculate minimum lenght of scan vectors */</span> <a name="l00187"></a>00187 <a name="l00188"></a>00188 <span class="keywordtype">int</span> minLengthVectors(<a class="code" href="classmrpt_1_1slam_1_1_c_observation2_d_range_scan.html" title="A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...">mrpt::slam::CObservation2DRangeScan</a> &obs, <a class="code" href="classstd_1_1vector.html">std::vector<mrpt::slam::CObservation2DRangeScan></a> &vObsAux); <a name="l00189"></a>00189 <span class="comment"></span> <a name="l00190"></a>00190 <span class="comment"> /** Calculate minimum lenght of 2 scan vectors */</span> <a name="l00191"></a>00191 <a name="l00192"></a>00192 <span class="keywordtype">int</span> minLengthVectors(<a class="code" href="classmrpt_1_1slam_1_1_c_observation2_d_range_scan.html" title="A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...">mrpt::slam::CObservation2DRangeScan</a> &obs1, <a class="code" href="classmrpt_1_1slam_1_1_c_observation2_d_range_scan.html" title="A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...">mrpt::slam::CObservation2DRangeScan</a> &obs2, <span class="keyword">const</span> <span class="keywordtype">int</span> &mode); <a name="l00193"></a>00193 <span class="comment"></span> <a name="l00194"></a>00194 <span class="comment"> /** Load observations in a points map */</span> <a name="l00195"></a>00195 <span class="comment">//void loadObs2PointsMap(mrpt::slam::CSimplePointsMap &theMap);</span> <a name="l00196"></a>00196 <span class="comment"></span> <a name="l00197"></a>00197 <span class="comment"> /** Limit the valid position of scan points */</span> <a name="l00198"></a>00198 <span class="comment">//bool limitScan(const char &axis, double &low, double &high, mrpt::slam::CSimplePointsMap &theMap);</span> <a name="l00199"></a>00199 <span class="comment"></span> <a name="l00200"></a>00200 <span class="comment"> /** Refine the observations obtains from a continuous scan */</span> <a name="l00201"></a>00201 <span class="keywordtype">void</span> refineVObs(<span class="keyword">const</span> <span class="keywordtype">char</span> &axis); <a name="l00202"></a>00202 <span class="comment"></span> <a name="l00203"></a>00203 <span class="comment"> /** Calculate the sensor pose depending teh axis of movements and the ptu position */</span> <a name="l00204"></a>00204 <a name="l00205"></a>00205 <span class="keywordtype">void</span> calculateSensorPose(<span class="keyword">const</span> <span class="keywordtype">char</span> &axis, <span class="keyword">const</span> <span class="keywordtype">double</span> &pos, <a class="code" href="classmrpt_1_1slam_1_1_c_observation2_d_range_scan.html" title="A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...">mrpt::slam::CObservation2DRangeScan</a> &obs); <a name="l00206"></a>00206 <span class="comment"></span> <a name="l00207"></a>00207 <span class="comment"> /** Obtain position of observations between first and second position in m_my_pos map */</span> <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="keywordtype">int</span> obsPosition(); <a name="l00210"></a>00210 <a name="l00211"></a>00211 <a name="l00212"></a>00212 }; <span class="comment">// End of class</span> <a name="l00213"></a>00213 <a name="l00214"></a>00214 } <span class="comment">// End of namespace</span> <a name="l00215"></a>00215 <a name="l00216"></a>00216 } <span class="comment">// End of namespace</span> <a name="l00217"></a>00217 <a name="l00218"></a>00218 <span class="preprocessor">#endif</span> </pre></div></div> </div> <br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150"> </td></tr> </table> </body></html>