Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 4bc66056a634db26a1f4d0845dc41ca6 > files > 1333

mrpt-doc-0.9.5-0.1.20110925svn2670.fc16.i686.rpm

<!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>COccupancyGridMap2D.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> &gt; <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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;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&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">COccupancyGridMap2D.h</div>  </div>
</div>
<div class="contents">
<a href="_c_occupancy_grid_map2_d_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  &lt;jlblanco@ctima.uma.es&gt;                     |</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 &lt;http://www.gnu.org/licenses/&gt;.         |</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 COccupancyGridMap2D_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define COccupancyGridMap2D_H</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="_c_serializable_8h.html">mrpt/utils/CSerializable.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="_c_loadable_options_8h.html">mrpt/utils/CLoadableOptions.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="_c_image_8h.html">mrpt/utils/CImage.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="_c_dynamic_grid_8h.html">mrpt/utils/CDynamicGrid.h</a>&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="_c_metric_map_8h.html">mrpt/slam/CMetricMap.h</a>&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="_t_matching_pair_8h.html">mrpt/utils/TMatchingPair.h</a>&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;<a class="code" href="_c_log_odds_grid_map2_d_8h.html">mrpt/slam/CLogOddsGridMap2D.h</a>&gt;</span>
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;<a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html">mrpt/maps/link_pragmas.h</a>&gt;</span>
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;<a class="code" href="safe__pointers_8h.html">mrpt/utils/safe_pointers.h</a>&gt;</span>
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="preprocessor">#include &lt;mrpt/config.h&gt;</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="preprocessor">#if !defined(OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS) &amp;&amp; !defined(OCCUPANCY_GRIDMAP_CELL_SIZE_16BITS)</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">                #error One of OCCUPANCY_GRIDMAP_CELL_SIZE_16BITS or OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS must be defined.</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span>
<a name="l00050"></a>00050 <span class="preprocessor">#if defined(OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS) &amp;&amp; defined(OCCUPANCY_GRIDMAP_CELL_SIZE_16BITS)</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">                #error Only one of OCCUPANCY_GRIDMAP_CELL_SIZE_16BITS or OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS must be defined at a time.</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span>
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="keyword">namespace </span>mrpt
<a name="l00056"></a>00056 {
<a name="l00057"></a>00057         <span class="keyword">namespace </span>poses { <span class="keyword">class </span>CPose2D; }
<a name="l00058"></a>00058 <span class="keyword">namespace </span>slam
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060         <span class="keyword">using namespace </span>mrpt::poses;
<a name="l00061"></a>00061         <span class="keyword">using namespace </span>mrpt::utils;
<a name="l00062"></a>00062 
<a name="l00063"></a>00063         <span class="keyword">class </span>CObservation2DRangeScan;
<a name="l00064"></a>00064         <span class="keyword">class </span>CObservationRange;
<a name="l00065"></a>00065         <span class="keyword">class </span>CObservation;
<a name="l00066"></a>00066         <span class="keyword">class </span>CPointsMap;
<a name="l00067"></a>00067 
<a name="l00068"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_ptr.html#af1087bcf1891531f04e2091021151021">00068</a>         <a class="code" href="_c_serializable_8h.html#a9ef523d787f6cb837a0585b790882588" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE</a>( <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a>, <a class="code" href="classmrpt_1_1slam_1_1_c_metric_map.html" title="Declares a virtual base class for all metric maps storage classes.">CMetricMap</a>, <a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> )
<a name="l00069"></a>00069 
<a name="l00070"></a>00070         <span class="comment">/** A class for storing an occupancy grid map.</span>
<a name="l00071"></a>00071 <span class="comment">         *  COccupancyGridMap2D is a class for storing a metric map</span>
<a name="l00072"></a>00072 <span class="comment">         *   representation in the form of a probabilistic occupancy</span>
<a name="l00073"></a>00073 <span class="comment">         *   grid map: value of 0 means certainly occupied, 1 means</span>
<a name="l00074"></a>00074 <span class="comment">         *   a certainly empty cell. Initially 0.5 means uncertainty.</span>
<a name="l00075"></a>00075 <span class="comment">         *</span>
<a name="l00076"></a>00076 <span class="comment">         * The cells keep the log-odd representation of probabilities instead of the probabilities themselves.</span>
<a name="l00077"></a>00077 <span class="comment">         *  More details can be found at http://www.mrpt.org/Occupancy_Grids</span>
<a name="l00078"></a>00078 <span class="comment">         *</span>
<a name="l00079"></a>00079 <span class="comment">         * The algorithm for updating the grid from a laser scanner can optionally take into account the progressive widening of the beams, as</span>
<a name="l00080"></a>00080 <span class="comment">         *   described in the &lt;a href=&quot;http://www.mrpt.org/Occupancy_Grids&quot; &gt; wiki &lt;/a&gt; (this feature was introduced in MRPT 0.6.4).</span>
<a name="l00081"></a>00081 <span class="comment">         *</span>
<a name="l00082"></a>00082 <span class="comment">         *   Some implemented methods are:</span>
<a name="l00083"></a>00083 <span class="comment">         *              - Update of individual cells</span>
<a name="l00084"></a>00084 <span class="comment">         *              - Insertion of observations</span>
<a name="l00085"></a>00085 <span class="comment">         *              - Voronoi diagram and critical points (\a buildVoronoiDiagram)</span>
<a name="l00086"></a>00086 <span class="comment">         *              - Saving and loading from/to a bitmap</span>
<a name="l00087"></a>00087 <span class="comment">         *              - Laser scans simulation for the map contents</span>
<a name="l00088"></a>00088 <span class="comment">         *              - Entropy and information methods (See computeEntropy)</span>
<a name="l00089"></a>00089 <span class="comment">         *</span>
<a name="l00090"></a>00090 <span class="comment">          * \ingroup mrpt_maps_grp</span>
<a name="l00091"></a>00091 <span class="comment">         **/</span>
<a name="l00092"></a>00092         class <a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a> :
<a name="l00093"></a>00093                 public <a class="code" href="classmrpt_1_1slam_1_1_c_metric_map.html" title="Declares a virtual base class for all metric maps storage classes.">CMetricMap</a>,
<a name="l00094"></a>00094                 <span class="comment">// Inherit from the corresponding specialization of CLogOddsGridMap2D&lt;&gt;:</span>
<a name="l00095"></a>00095 <span class="preprocessor">#ifdef  OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS</span>
<a name="l00096"></a>00096 <span class="preprocessor"></span>                <span class="keyword">public</span> <a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map2_d.html">CLogOddsGridMap2D&lt;int8_t&gt;</a>
<a name="l00097"></a>00097 <span class="preprocessor">#else</span>
<a name="l00098"></a>00098 <span class="preprocessor"></span>                <span class="keyword">public</span> <a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map2_d.html">CLogOddsGridMap2D&lt;int16_t&gt;</a>
<a name="l00099"></a>00099 <span class="preprocessor">#endif</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span>        {
<a name="l00101"></a>00101                 <span class="comment">// This must be added to any CSerializable derived class:</span>
<a name="l00102"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a2d4a30ba6a4cfba1c9540ebfc2ca190e">00102</a>                 <a class="code" href="_c_serializable_8h.html#a72ab55bf7ae009c89b75715cfa21e84d" title="This declaration must be inserted in all CSerializable classes definition, within the class declarati...">DEFINE_SERIALIZABLE</a>( <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a> )
<a name="l00103"></a>00103 
<a name="l00104"></a>00104         public:<span class="comment"></span>
<a name="l00105"></a>00105 <span class="comment">        /** The type of the map cells: */</span>
<a name="l00106"></a>00106 <span class="preprocessor">#ifdef  OCCUPANCY_GRIDMAP_CELL_SIZE_8BITS</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span>                <span class="keyword">typedef</span> int8_t  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad8b8a3357bc682ae5949d9e4768709aa" title="The type of the map cells:">cellType</a>;
<a name="l00108"></a>00108                 <span class="keyword">typedef</span> uint8_t <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ac8708b0ca86e8cd4ec6193111cf4909c">cellTypeUnsigned</a>;
<a name="l00109"></a>00109 <span class="preprocessor">#else</span>
<a name="l00110"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad8b8a3357bc682ae5949d9e4768709aa">00110</a> <span class="preprocessor"></span>                <span class="keyword">typedef</span> int16_t  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad8b8a3357bc682ae5949d9e4768709aa" title="The type of the map cells:">cellType</a>;
<a name="l00111"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ac8708b0ca86e8cd4ec6193111cf4909c">00111</a>                 <span class="keyword">typedef</span> uint16_t <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ac8708b0ca86e8cd4ec6193111cf4909c">cellTypeUnsigned</a>;
<a name="l00112"></a>00112 <span class="preprocessor">#endif</span>
<a name="l00113"></a>00113 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00114"></a>00114 <span class="comment">        /** Discrete to float conversion factors: The min/max values of the integer cell type, eg.[0,255] or [0,65535] */</span>
<a name="l00115"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a833dc6bc133c8c117858181c55f53787">00115</a>         <span class="keyword">static</span> <span class="keyword">const</span> cellType OCCGRID_CELLTYPE_MIN  = <a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map2_d.html" title="A generic provider of log-odds grid-map maintainance functions.">CLogOddsGridMap2D&lt;cellType&gt;::CELLTYPE_MIN</a>;
<a name="l00116"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a772c1d95974f88db924ff5067364290d">00116</a>         <span class="keyword">static</span> <span class="keyword">const</span> cellType OCCGRID_CELLTYPE_MAX  = <a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map2_d.html" title="A generic provider of log-odds grid-map maintainance functions.">CLogOddsGridMap2D&lt;cellType&gt;::CELLTYPE_MAX</a>;
<a name="l00117"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ab044797ba667c4ece543b210cb32110a">00117</a>         <span class="keyword">static</span> <span class="keyword">const</span> cellType OCCGRID_P2LTABLE_SIZE = <a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map2_d.html" title="A generic provider of log-odds grid-map maintainance functions.">CLogOddsGridMap2D&lt;cellType&gt;::P2LTABLE_SIZE</a>;
<a name="l00118"></a>00118 
<a name="l00119"></a>00119         <span class="keyword">protected</span>:
<a name="l00120"></a>00120 
<a name="l00121"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a1bae34eddd4e2faa9c5f33c50f07f4fe">00121</a>                 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmrpt_1_1slam_1_1_c_multi_metric_map.html" title="This class stores any customizable set of metric maps.">CMultiMetricMap</a>;
<a name="l00122"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ab04439e1f92cce9e3682f6c32d87e172">00122</a>                 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmrpt_1_1slam_1_1_c_multi_metric_map_p_d_f.html" title="Declares a class that represents a Rao-Blackwellized set of particles for solving the SLAM problem (T...">CMultiMetricMapPDF</a>;
<a name="l00123"></a>00123 
<a name="l00124"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#afd2e8f0e766de3b330f6ce03be5ee522">00124</a>                 <span class="keyword">static</span> <a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map_l_u_t.html">CLogOddsGridMapLUT&lt;cellType&gt;</a>  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#afd2e8f0e766de3b330f6ce03be5ee522" title="Lookup tables for log-odds.">m_logodd_lut</a>; <span class="comment">//!&lt; Lookup tables for log-odds</span>
<a name="l00125"></a>00125 <span class="comment"></span><span class="comment"></span>
<a name="l00126"></a>00126 <span class="comment">                /** This is the buffer for storing the cells.In this dynamic</span>
<a name="l00127"></a>00127 <span class="comment">                 *   size buffer are stored the cell values as</span>
<a name="l00128"></a>00128 <span class="comment">                 *   &quot;bytes&quot;, stored row by row, from left to right cells.</span>
<a name="l00129"></a>00129 <span class="comment">                 */</span>
<a name="l00130"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a3d044620d441c1cb421eaadc10f9e963">00130</a>                 std<a class="code" href="classstd_1_1vector.html">::vector&lt;cellType&gt;</a>    <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a3d044620d441c1cb421eaadc10f9e963" title="This is the buffer for storing the cells.In this dynamic size buffer are stored the cell values as &quot;b...">map</a>;
<a name="l00131"></a>00131 <span class="comment"></span>
<a name="l00132"></a>00132 <span class="comment">                /** The size of the grid in cells.</span>
<a name="l00133"></a>00133 <span class="comment">                 */</span>
<a name="l00134"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a20174e16db008338bb2fac9ca64e6541">00134</a>                 uint32_t                size_x,<a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a20174e16db008338bb2fac9ca64e6541">size_y</a>;
<a name="l00135"></a>00135 <span class="comment"></span>
<a name="l00136"></a>00136 <span class="comment">                /** The limits of the grid in &quot;units&quot; (meters).</span>
<a name="l00137"></a>00137 <span class="comment">                 */</span>
<a name="l00138"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a2997ff6789278a6b1fcc99534aaa128e">00138</a>                 <span class="keywordtype">float</span>           x_min,x_max,<a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a2997ff6789278a6b1fcc99534aaa128e">y_min</a>,y_max;
<a name="l00139"></a>00139 <span class="comment"></span>
<a name="l00140"></a>00140 <span class="comment">                /** Cell size, i.e. resolution of the grid map.</span>
<a name="l00141"></a>00141 <span class="comment">                 */</span>
<a name="l00142"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a16e113fd57e5dfaa69d293862eb22a89">00142</a>                 <span class="keywordtype">float</span>           <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a16e113fd57e5dfaa69d293862eb22a89" title="Cell size, i.e.">resolution</a>;
<a name="l00143"></a>00143 <span class="comment"></span>
<a name="l00144"></a>00144 <span class="comment">                /** These are auxiliary variables to speed up the computation of observation likelihood values for LF method among others, at a high cost in memory (see TLikelihoodOptions::enableLikelihoodCache).</span>
<a name="l00145"></a>00145 <span class="comment">                  */</span>
<a name="l00146"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ab18878533cdf1a7cf156da3d2ac3b994">00146</a>                 std<a class="code" href="classstd_1_1vector.html">::vector&lt;double&gt;</a>             <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ab18878533cdf1a7cf156da3d2ac3b994" title="These are auxiliary variables to speed up the computation of observation likelihood values for LF met...">precomputedLikelihood</a>;
<a name="l00147"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a86fc3a35a5a4fab534ac4ce89754bd09">00147</a>                 <span class="keywordtype">bool</span>                                    <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a86fc3a35a5a4fab534ac4ce89754bd09">precomputedLikelihoodToBeRecomputed</a>;
<a name="l00148"></a>00148 <span class="comment"></span>
<a name="l00149"></a>00149 <span class="comment">                /** Used for Voronoi calculation.Same struct as &quot;map&quot;, but contains a &quot;0&quot; if not a basis point. */</span>
<a name="l00150"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a7d6cc3b3aa8a48abfdb0fbf1af81121e">00150</a>                 <a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html">CDynamicGrid&lt;uint8_t&gt;</a>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a7d6cc3b3aa8a48abfdb0fbf1af81121e" title="Used for Voronoi calculation.Same struct as &quot;map&quot;, but contains a &quot;0&quot; if not a basis point...">m_basis_map</a>;
<a name="l00151"></a>00151 <span class="comment"></span>
<a name="l00152"></a>00152 <span class="comment">                /** Used to store the Voronoi diagram.</span>
<a name="l00153"></a>00153 <span class="comment">                 *    Contains the distance of each cell to its closer obstacles</span>
<a name="l00154"></a>00154 <span class="comment">                 *    in 1/100th distance units (i.e. in centimeters), or 0 if not into the Voronoi diagram.</span>
<a name="l00155"></a>00155 <span class="comment">                 */</span>
<a name="l00156"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a4e93126b14249d477e9c7c8bf7af835f">00156</a>                 <a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html">CDynamicGrid&lt;uint16_t&gt;</a>  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a4e93126b14249d477e9c7c8bf7af835f" title="Used to store the Voronoi diagram.">m_voronoi_diagram</a>;
<a name="l00157"></a>00157 
<a name="l00158"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#adcf066b52e180300b0988b9d27247d91">00158</a>                 <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#adcf066b52e180300b0988b9d27247d91" title="True upon construction; used by isEmpty()">m_is_empty</a>; <span class="comment">//!&lt; True upon construction; used by isEmpty()</span>
<a name="l00159"></a>00159 <span class="comment"></span>
<a name="l00160"></a>00160                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> OnPostSuccesfulInsertObs(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a> *); <span class="comment">//!&lt; See base class</span>
<a name="l00161"></a>00161 <span class="comment"></span><span class="comment"></span>
<a name="l00162"></a>00162 <span class="comment">                /** The free-cells threshold used to compute the Voronoi diagram.</span>
<a name="l00163"></a>00163 <span class="comment">                 */</span>
<a name="l00164"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#af3bc90ff048f4a010d6e5214eb49fc92">00164</a>                 <span class="keywordtype">float</span>           <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#af3bc90ff048f4a010d6e5214eb49fc92" title="The free-cells threshold used to compute the Voronoi diagram.">voroni_free_threshold</a>;
<a name="l00165"></a>00165 <span class="comment"></span>
<a name="l00166"></a>00166 <span class="comment">                /** Frees the dynamic memory buffers of map.</span>
<a name="l00167"></a>00167 <span class="comment">                 */</span>
<a name="l00168"></a>00168                 <span class="keywordtype">void</span>            freeMap();
<a name="l00169"></a>00169 <span class="comment"></span>
<a name="l00170"></a>00170 <span class="comment">                /** Entropy computation internal function:</span>
<a name="l00171"></a>00171 <span class="comment">                 */</span>
<a name="l00172"></a>00172                 <span class="keyword">static</span> <span class="keywordtype">double</span>  H(<span class="keywordtype">double</span> p);
<a name="l00173"></a>00173 <span class="comment"></span>
<a name="l00174"></a>00174 <span class="comment">                /** Change the contents [0,1] of a cell, given its index.</span>
<a name="l00175"></a>00175 <span class="comment">                 */</span>
<a name="l00176"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a13550e4fa84ccd41e3c4d525f1d09fc6">00176</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span>   setCell_nocheck(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<span class="keywordtype">float</span> value)
<a name="l00177"></a>00177                 {
<a name="l00178"></a>00178                                 map[x+y*size_x]=p2l(value);
<a name="l00179"></a>00179                 }
<a name="l00180"></a>00180 <span class="comment"></span>
<a name="l00181"></a>00181 <span class="comment">                /** Read the real valued [0,1] contents of a cell, given its index.</span>
<a name="l00182"></a>00182 <span class="comment">                 */</span>
<a name="l00183"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#aae99538b4cffdb47735a038979f85188">00183</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>  getCell_nocheck(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>)<span class="keyword"> const</span>
<a name="l00184"></a>00184 <span class="keyword">                </span>{
<a name="l00185"></a>00185                                 <span class="keywordflow">return</span> l2p(map[x+y*size_x]);
<a name="l00186"></a>00186                 }
<a name="l00187"></a>00187 <span class="comment"></span>
<a name="l00188"></a>00188 <span class="comment">                /** Changes a cell by its absolute index (Do not use it normally)</span>
<a name="l00189"></a>00189 <span class="comment">                  */</span>
<a name="l00190"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a099c4d1b2bb1d2d51d5e19abec266fcc">00190</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span>  setRawCell(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> cellIndex, cellType b)
<a name="l00191"></a>00191                 {
<a name="l00192"></a>00192                         <span class="keywordflow">if</span> (cellIndex&lt;size_x*size_y)
<a name="l00193"></a>00193                         {
<a name="l00194"></a>00194                                 map[cellIndex] = b;
<a name="l00195"></a>00195                         }
<a name="l00196"></a>00196                 }
<a name="l00197"></a>00197 <span class="comment"></span>
<a name="l00198"></a>00198 <span class="comment">                /** Internally used to speed-up entropy calculation</span>
<a name="l00199"></a>00199 <span class="comment">                  */</span>
<a name="l00200"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a641338c6a59d4cb93a7d7e27822bed38">00200</a>                 <span class="keyword">static</span> std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a>               <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a641338c6a59d4cb93a7d7e27822bed38" title="Internally used to speed-up entropy calculation.">entropyTable</a>;
<a name="l00201"></a>00201 
<a name="l00202"></a>00202 <span class="comment"></span>
<a name="l00203"></a>00203 <span class="comment">                /** One of the methods that can be selected for implementing &quot;computeObservationLikelihood&quot; (This method is the Range-Scan Likelihood Consensus for gridmaps, see the ICRA2007 paper by Blanco et al.)</span>
<a name="l00204"></a>00204 <span class="comment">                  */</span>
<a name="l00205"></a>00205                 <span class="keywordtype">double</span>   computeObservationLikelihood_Consensus(
<a name="l00206"></a>00206                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a>              *obs,
<a name="l00207"></a>00207                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                           &amp;takenFrom );
<a name="l00208"></a>00208 <span class="comment"></span>
<a name="l00209"></a>00209 <span class="comment">                /** One of the methods that can be selected for implementing &quot;computeObservationLikelihood&quot;</span>
<a name="l00210"></a>00210 <span class="comment">                  *  TODO: This method is described in....</span>
<a name="l00211"></a>00211 <span class="comment">                  */</span>
<a name="l00212"></a>00212                 <span class="keywordtype">double</span>   computeObservationLikelihood_ConsensusOWA(
<a name="l00213"></a>00213                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a>              *obs,
<a name="l00214"></a>00214                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                           &amp;takenFrom );
<a name="l00215"></a>00215 <span class="comment"></span>
<a name="l00216"></a>00216 <span class="comment">                /** One of the methods that can be selected for implementing &quot;computeObservationLikelihood&quot;.</span>
<a name="l00217"></a>00217 <span class="comment">                  */</span>
<a name="l00218"></a>00218                 <span class="keywordtype">double</span>   computeObservationLikelihood_CellsDifference(
<a name="l00219"></a>00219                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a>              *obs,
<a name="l00220"></a>00220                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                           &amp;takenFrom );
<a name="l00221"></a>00221 <span class="comment"></span>
<a name="l00222"></a>00222 <span class="comment">                /** One of the methods that can be selected for implementing &quot;computeObservationLikelihood&quot;.</span>
<a name="l00223"></a>00223 <span class="comment">                  */</span>
<a name="l00224"></a>00224                 <span class="keywordtype">double</span>   computeObservationLikelihood_MI(
<a name="l00225"></a>00225                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a>              *obs,
<a name="l00226"></a>00226                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                           &amp;takenFrom );
<a name="l00227"></a>00227 <span class="comment"></span>
<a name="l00228"></a>00228 <span class="comment">                /** One of the methods that can be selected for implementing &quot;computeObservationLikelihood&quot;.</span>
<a name="l00229"></a>00229 <span class="comment">                  */</span>
<a name="l00230"></a>00230                 <span class="keywordtype">double</span>   computeObservationLikelihood_rayTracing(
<a name="l00231"></a>00231                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a>              *obs,
<a name="l00232"></a>00232                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                           &amp;takenFrom );
<a name="l00233"></a>00233 <span class="comment"></span>
<a name="l00234"></a>00234 <span class="comment">                /** One of the methods that can be selected for implementing &quot;computeObservationLikelihood&quot;.</span>
<a name="l00235"></a>00235 <span class="comment">                  */</span>
<a name="l00236"></a>00236                 <span class="keywordtype">double</span>   computeObservationLikelihood_likelihoodField_Thrun(
<a name="l00237"></a>00237                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a>              *obs,
<a name="l00238"></a>00238                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                           &amp;takenFrom );
<a name="l00239"></a>00239 <span class="comment"></span>
<a name="l00240"></a>00240 <span class="comment">                /** One of the methods that can be selected for implementing &quot;computeObservationLikelihood&quot;.</span>
<a name="l00241"></a>00241 <span class="comment">                  */</span>
<a name="l00242"></a>00242                 <span class="keywordtype">double</span>   computeObservationLikelihood_likelihoodField_II(
<a name="l00243"></a>00243                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a>              *obs,
<a name="l00244"></a>00244                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                           &amp;takenFrom );
<a name="l00245"></a>00245 <span class="comment"></span>
<a name="l00246"></a>00246 <span class="comment">                /** Clear the map: It set all cells to their default occupancy value (0.5), without changing the resolution (the grid extension is reset to the default values).</span>
<a name="l00247"></a>00247 <span class="comment">                  */</span>
<a name="l00248"></a>00248                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  internal_clear( );
<a name="l00249"></a>00249 <span class="comment"></span>
<a name="l00250"></a>00250 <span class="comment">                 /** Insert the observation information into this map.</span>
<a name="l00251"></a>00251 <span class="comment">                  *</span>
<a name="l00252"></a>00252 <span class="comment">                  * \param obs The observation</span>
<a name="l00253"></a>00253 <span class="comment">                  * \param robotPose The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use CPose2D(0,0,deg)</span>
<a name="l00254"></a>00254 <span class="comment">                  *</span>
<a name="l00255"></a>00255 <span class="comment">                  *  After successfull execution, &quot;lastObservationInsertionInfo&quot; is updated.</span>
<a name="l00256"></a>00256 <span class="comment">                  *</span>
<a name="l00257"></a>00257 <span class="comment">                  * \sa insertionOptions, CObservation::insertObservationInto</span>
<a name="l00258"></a>00258 <span class="comment">                  */</span>
<a name="l00259"></a>00259                  <span class="keyword">virtual</span> <span class="keywordtype">bool</span>  internal_insertObservation( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a> *obs, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d.html" title="A class used to store a 3D pose (a 3D translation + a rotation in 3D).">CPose3D</a> *robotPose = NULL );
<a name="l00260"></a>00260 
<a name="l00261"></a>00261         <span class="keyword">public</span>:
<a name="l00262"></a>00262 <span class="comment"></span>
<a name="l00263"></a>00263 <span class="comment">                /** Performs the Bayesian fusion of a new observation of a cell.</span>
<a name="l00264"></a>00264 <span class="comment">                  * \sa updateInfoChangeOnly, updateCell_fast_occupied, updateCell_fast_free</span>
<a name="l00265"></a>00265 <span class="comment">                 */</span>
<a name="l00266"></a>00266                 <span class="keywordtype">void</span>  updateCell(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">float</span> v);
<a name="l00267"></a>00267 <span class="comment"></span>
<a name="l00268"></a>00268 <span class="comment">                /** An internal structure for storing data related to counting the new information apported by some observation.</span>
<a name="l00269"></a>00269 <span class="comment">                  */</span>
<a name="l00270"></a>00270                 <span class="keyword">struct </span><a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html" title="An internal structure for storing data related to counting the new information apported by some obser...">TUpdateCellsInfoChangeOnly</a>
<a name="l00271"></a>00271                 {
<a name="l00272"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#a0c578de31a374aa14c29f73cb1321e38">00272</a>                         <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html" title="An internal structure for storing data related to counting the new information apported by some obser...">TUpdateCellsInfoChangeOnly</a>( <span class="keywordtype">bool</span>        enabled = <span class="keyword">false</span>,
<a name="l00273"></a>00273                                                                                 <span class="keywordtype">double</span>  I_change = 0,
<a name="l00274"></a>00274                                                                                 <span class="keywordtype">int</span>             cellsUpdated=0) :       enabled(enabled),
<a name="l00275"></a>00275                                                                                                                                         I_change(I_change),
<a name="l00276"></a>00276                                                                                                                                         cellsUpdated(cellsUpdated),
<a name="l00277"></a>00277                                                                                                                                         laserRaysSkip(1)
<a name="l00278"></a>00278                         {
<a name="l00279"></a>00279                         }
<a name="l00280"></a>00280 <span class="comment"></span>
<a name="l00281"></a>00281 <span class="comment">                        /** If set to false (default), this struct is not used. Set to true only when measuring the info of an observation.</span>
<a name="l00282"></a>00282 <span class="comment">                          */</span>
<a name="l00283"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#a3c5741747b4f4161d83e2b47c850fb85">00283</a>                         <span class="keywordtype">bool</span>            <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#a3c5741747b4f4161d83e2b47c850fb85" title="If set to false (default), this struct is not used.">enabled</a>;
<a name="l00284"></a>00284 <span class="comment"></span>
<a name="l00285"></a>00285 <span class="comment">                        /** The cummulative change in Information: This is updated only from the &quot;updateCell&quot; method.</span>
<a name="l00286"></a>00286 <span class="comment">                          */</span>
<a name="l00287"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#ad1c275d1fef0ba49a8ca1f9691b3ccd0">00287</a>                         <span class="keywordtype">double</span>          <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#ad1c275d1fef0ba49a8ca1f9691b3ccd0" title="The cummulative change in Information: This is updated only from the &quot;updateCell&quot; method...">I_change</a>;
<a name="l00288"></a>00288 <span class="comment"></span>
<a name="l00289"></a>00289 <span class="comment">                        /** The cummulative updated cells count: This is updated only from the &quot;updateCell&quot; method.</span>
<a name="l00290"></a>00290 <span class="comment">                          */</span>
<a name="l00291"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#aabec145eee4ad62c31fabcc3f3cd4807">00291</a>                         <span class="keywordtype">int</span>                     <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#aabec145eee4ad62c31fabcc3f3cd4807" title="The cummulative updated cells count: This is updated only from the &quot;updateCell&quot; method.">cellsUpdated</a>;
<a name="l00292"></a>00292 <span class="comment"></span>
<a name="l00293"></a>00293 <span class="comment">                        /** In this mode, some laser rays can be skips to speep-up</span>
<a name="l00294"></a>00294 <span class="comment">                          */</span>
<a name="l00295"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#acb7b7c1bc6303251beaf5eec55b17d2f">00295</a>                         <span class="keywordtype">int</span>                     <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_update_cells_info_change_only.html#acb7b7c1bc6303251beaf5eec55b17d2f" title="In this mode, some laser rays can be skips to speep-up.">laserRaysSkip</a>;
<a name="l00296"></a>00296                 } updateInfoChangeOnly;
<a name="l00297"></a>00297 <span class="comment"></span>
<a name="l00298"></a>00298 <span class="comment">                /** Constructor.</span>
<a name="l00299"></a>00299 <span class="comment">                 */</span>
<a name="l00300"></a>00300                 <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a>( <span class="keywordtype">float</span> min_x = -20.0f,
<a name="l00301"></a>00301                                                          <span class="keywordtype">float</span> max_x = 20.0f,
<a name="l00302"></a>00302                                                          <span class="keywordtype">float</span> min_y = -20.0f,
<a name="l00303"></a>00303                                                          <span class="keywordtype">float</span> max_y = 20.0f,
<a name="l00304"></a>00304                                                          <span class="keywordtype">float</span> resolution = 0.05f
<a name="l00305"></a>00305                                                          );
<a name="l00306"></a>00306 <span class="comment"></span>
<a name="l00307"></a>00307 <span class="comment">                /** Fills all the cells with a default value.</span>
<a name="l00308"></a>00308 <span class="comment">                  */</span>
<a name="l00309"></a>00309                 <span class="keywordtype">void</span>  <a class="code" href="eigen__plugins_8h.html#a57fce471b07c3c84924883b5e17e2388">fill</a>(<span class="keywordtype">float</span> default_value = 0.5f );
<a name="l00310"></a>00310 <span class="comment"></span>
<a name="l00311"></a>00311 <span class="comment">                /** Destructor.</span>
<a name="l00312"></a>00312 <span class="comment">                 */</span>
<a name="l00313"></a>00313                 <span class="keyword">virtual</span> ~<a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a>();
<a name="l00314"></a>00314 <span class="comment"></span>
<a name="l00315"></a>00315 <span class="comment">                /** Change the size of gridmap, erasing all its previous contents.</span>
<a name="l00316"></a>00316 <span class="comment">                 * \param x_min The &quot;x&quot; coordinates of left most side of grid.</span>
<a name="l00317"></a>00317 <span class="comment">                 * \param x_max The &quot;x&quot; coordinates of right most side of grid.</span>
<a name="l00318"></a>00318 <span class="comment">                 * \param y_min The &quot;y&quot; coordinates of top most side of grid.</span>
<a name="l00319"></a>00319 <span class="comment">                 * \param y_max The &quot;y&quot; coordinates of bottom most side of grid.</span>
<a name="l00320"></a>00320 <span class="comment">                 * \param resolution The new size of cells.</span>
<a name="l00321"></a>00321 <span class="comment">                 * \param default_value The value of cells, tipically 0.5.</span>
<a name="l00322"></a>00322 <span class="comment">                 * \sa ResizeGrid</span>
<a name="l00323"></a>00323 <span class="comment">                 */</span>
<a name="l00324"></a>00324                 <span class="keywordtype">void</span>  <a class="code" href="eigen__plugins_8h.html#a8133077108cd44f617e7784243eb5db9" title="Changes the size of matrix, maintaining its previous content as possible and padding with zeros where...">setSize</a>(<span class="keywordtype">float</span> x_min,<span class="keywordtype">float</span> x_max,<span class="keywordtype">float</span> y_min,<span class="keywordtype">float</span> y_max,<span class="keywordtype">float</span> resolution,<span class="keywordtype">float</span> default_value = 0.5f);
<a name="l00325"></a>00325 <span class="comment"></span>
<a name="l00326"></a>00326 <span class="comment">                /** Change the size of gridmap, maintaining previous contents.</span>
<a name="l00327"></a>00327 <span class="comment">                 * \param new_x_min The &quot;x&quot; coordinates of new left most side of grid.</span>
<a name="l00328"></a>00328 <span class="comment">                 * \param new_x_max The &quot;x&quot; coordinates of new right most side of grid.</span>
<a name="l00329"></a>00329 <span class="comment">                 * \param new_y_min The &quot;y&quot; coordinates of new top most side of grid.</span>
<a name="l00330"></a>00330 <span class="comment">                 * \param new_y_max The &quot;y&quot; coordinates of new bottom most side of grid.</span>
<a name="l00331"></a>00331 <span class="comment">                 * \param new_cells_default_value The value of the new cells, tipically 0.5.</span>
<a name="l00332"></a>00332 <span class="comment">                 * \param additionalMargin If set to true (default), an additional margin of a few meters will be added to the grid, ONLY if the new coordinates are larger than current ones.</span>
<a name="l00333"></a>00333 <span class="comment">                 * \sa setSize</span>
<a name="l00334"></a>00334 <span class="comment">                 */</span>
<a name="l00335"></a>00335                 <span class="keywordtype">void</span>  resizeGrid(<span class="keywordtype">float</span> new_x_min,<span class="keywordtype">float</span> new_x_max,<span class="keywordtype">float</span> new_y_min,<span class="keywordtype">float</span> new_y_max,<span class="keywordtype">float</span> new_cells_default_value = 0.5f, <span class="keywordtype">bool</span> additionalMargin = <span class="keyword">true</span>) <a class="code" href="mrpt__macros_8h.html#afed971bfd24ff010f488cce2aa424de4" title="Used after member declarations.">MRPT_NO_THROWS</a>;
<a name="l00336"></a>00336 <span class="comment"></span>
<a name="l00337"></a>00337 <span class="comment">                /** Returns the area of the gridmap, in square meters */</span>
<a name="l00338"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#aacf8986a3f7dd1b00b93ef39bf2b85d4">00338</a>                 inline <span class="keywordtype">double</span> getArea()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> size_x*size_y*<a class="code" href="namespacemrpt_1_1utils.html#a67cb05bb8ad4e725875a7ee54b7042ae" title="Inline function for the square of a number.">square</a>(resolution); }
<a name="l00339"></a>00339 <span class="comment"></span>
<a name="l00340"></a>00340 <span class="comment">                /** Returns the horizontal size of grid map in cells count.</span>
<a name="l00341"></a>00341 <span class="comment">                 */</span>
<a name="l00342"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a5f96a77f7402a402f41964bc38b86393">00342</a>                 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a5f96a77f7402a402f41964bc38b86393" title="Returns the horizontal size of grid map in cells count.">getSizeX</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> size_x; }
<a name="l00343"></a>00343 <span class="comment"></span>
<a name="l00344"></a>00344 <span class="comment">                /** Returns the vertical size of grid map in cells count.</span>
<a name="l00345"></a>00345 <span class="comment">                 */</span>
<a name="l00346"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#af681da104343ef9dd996cd54da8c4e05">00346</a>                 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#af681da104343ef9dd996cd54da8c4e05" title="Returns the vertical size of grid map in cells count.">getSizeY</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> size_y; }
<a name="l00347"></a>00347 <span class="comment"></span>
<a name="l00348"></a>00348 <span class="comment">                /** Returns the &quot;x&quot; coordinate of left side of grid map.</span>
<a name="l00349"></a>00349 <span class="comment">                 */</span>
<a name="l00350"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a080c72c132572f5f8ad92434dbf4440b">00350</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a080c72c132572f5f8ad92434dbf4440b" title="Returns the &quot;x&quot; coordinate of left side of grid map.">getXMin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x_min; }
<a name="l00351"></a>00351 <span class="comment"></span>
<a name="l00352"></a>00352 <span class="comment">                /** Returns the &quot;x&quot; coordinate of right side of grid map.</span>
<a name="l00353"></a>00353 <span class="comment">                 */</span>
<a name="l00354"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a365bd65fa36738c134d3d5c1f8e5c5dc">00354</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a365bd65fa36738c134d3d5c1f8e5c5dc" title="Returns the &quot;x&quot; coordinate of right side of grid map.">getXMax</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x_max; }
<a name="l00355"></a>00355 <span class="comment"></span>
<a name="l00356"></a>00356 <span class="comment">                /** Returns the &quot;y&quot; coordinate of top side of grid map.</span>
<a name="l00357"></a>00357 <span class="comment">                 */</span>
<a name="l00358"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9779b623cfb4b9576e5352f7087b90e8">00358</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9779b623cfb4b9576e5352f7087b90e8" title="Returns the &quot;y&quot; coordinate of top side of grid map.">getYMin</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> y_min; }
<a name="l00359"></a>00359 <span class="comment"></span>
<a name="l00360"></a>00360 <span class="comment">                /** Returns the &quot;y&quot; coordinate of bottom side of grid map.</span>
<a name="l00361"></a>00361 <span class="comment">                 */</span>
<a name="l00362"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a4027f3da4015ca35c0a11266454c6977">00362</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a4027f3da4015ca35c0a11266454c6977" title="Returns the &quot;y&quot; coordinate of bottom side of grid map.">getYMax</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> y_max; }
<a name="l00363"></a>00363 <span class="comment"></span>
<a name="l00364"></a>00364 <span class="comment">                /** Returns the resolution of the grid map.</span>
<a name="l00365"></a>00365 <span class="comment">                 */</span>
<a name="l00366"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a91898b9f7dcd3a8e7f0003c623147276">00366</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a91898b9f7dcd3a8e7f0003c623147276" title="Returns the resolution of the grid map.">getResolution</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> resolution; }
<a name="l00367"></a>00367 <span class="comment"></span>
<a name="l00368"></a>00368 <span class="comment">                /** Transform a coordinate value into a cell index.</span>
<a name="l00369"></a>00369 <span class="comment">                 */</span>
<a name="l00370"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a10cbc01d4256cf358e7b94c00bcc0653">00370</a>                 <span class="keyword">inline</span> <span class="keywordtype">int</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a10cbc01d4256cf358e7b94c00bcc0653" title="Transform a coordinate value into a cell index.">x2idx</a>(<span class="keywordtype">float</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>((x-x_min)/resolution ); }
<a name="l00371"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a1402c1e6981535dea1557776437dd1f1">00371</a>                 <span class="keyword">inline</span> <span class="keywordtype">int</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a1402c1e6981535dea1557776437dd1f1">y2idx</a>(<span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>((y-y_min)/resolution ); }
<a name="l00372"></a>00372 
<a name="l00373"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a7ab194b19c356d12acfdd2e34a80c316">00373</a>                 <span class="keyword">inline</span> <span class="keywordtype">int</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a7ab194b19c356d12acfdd2e34a80c316">x2idx</a>(<span class="keywordtype">double</span> x)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>((x-x_min)/resolution ); }
<a name="l00374"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a067dd01770dc79dba5bdb985fec1d70e">00374</a>                 <span class="keyword">inline</span> <span class="keywordtype">int</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a067dd01770dc79dba5bdb985fec1d70e">y2idx</a>(<span class="keywordtype">double</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>((y-y_min)/resolution ); }
<a name="l00375"></a>00375 <span class="comment"></span>
<a name="l00376"></a>00376 <span class="comment">                /** Transform a cell index into a coordinate value.</span>
<a name="l00377"></a>00377 <span class="comment">                 */</span>
<a name="l00378"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a244c52d508f9f8485b9b501ca2041744">00378</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a244c52d508f9f8485b9b501ca2041744" title="Transform a cell index into a coordinate value.">idx2x</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> cx)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x_min+(cx+0.5f)*resolution; }
<a name="l00379"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a44bde0674e018f6919fbce4846e117dd">00379</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a44bde0674e018f6919fbce4846e117dd">idx2y</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> cy)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> y_min+(cy+0.5f)*resolution; }
<a name="l00380"></a>00380 <span class="comment"></span>
<a name="l00381"></a>00381 <span class="comment">                /** Transform a coordinate value into a cell index, using a diferent &quot;x_min&quot; value</span>
<a name="l00382"></a>00382 <span class="comment">                 */</span>
<a name="l00383"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#abf40dfd4a6a20181eaa7fc39637aff68">00383</a>                 <span class="keyword">inline</span> <span class="keywordtype">int</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#abf40dfd4a6a20181eaa7fc39637aff68" title="Transform a coordinate value into a cell index, using a diferent &quot;x_min&quot; value.">x2idx</a>(<span class="keywordtype">float</span> x,<span class="keywordtype">float</span> x_min)<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>((x-x_min)/resolution ); }
<a name="l00384"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a0b4d7c16ea7fc8062c7d4529864a86e6">00384</a>                 <span class="keyword">inline</span> <span class="keywordtype">int</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a0b4d7c16ea7fc8062c7d4529864a86e6">y2idx</a>(<span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">float</span> y_min)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>((y-y_min)/resolution ); }
<a name="l00385"></a>00385 <span class="comment"></span>
<a name="l00386"></a>00386 <span class="comment">                /** Scales an integer representation of the log-odd into a real valued probability in [0,1], using p=exp(l)/(1+exp(l))</span>
<a name="l00387"></a>00387 <span class="comment">                  */</span>
<a name="l00388"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a2db2fbd3c4e985ffccc58c440c1b2ac2">00388</a>                 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> l2p(<span class="keyword">const</span> cellType  l)
<a name="l00389"></a>00389                 {
<a name="l00390"></a>00390                         <span class="keywordflow">return</span> m_logodd_lut.<a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map_l_u_t.html#a26003c76f089968f664b8c7e3c7dd3d4" title="Scales an integer representation of the log-odd into a real valued probability in [0...">l2p</a>(l);
<a name="l00391"></a>00391                 }
<a name="l00392"></a>00392 <span class="comment"></span>
<a name="l00393"></a>00393 <span class="comment">                /** Scales an integer representation of the log-odd into a linear scale [0,255], using p=exp(l)/(1+exp(l))</span>
<a name="l00394"></a>00394 <span class="comment">                  */</span>
<a name="l00395"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a0ee658a6a2c99fd318e891471abba304">00395</a>                 <span class="keyword">static</span> <span class="keyword">inline</span> uint8_t l2p_255(<span class="keyword">const</span> cellType l)
<a name="l00396"></a>00396                 {
<a name="l00397"></a>00397                         <span class="keywordflow">return</span> m_logodd_lut.<a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map_l_u_t.html#a5e16de15a3e35a430f3a5609e711d8ae" title="Scales an integer representation of the log-odd into a linear scale [0,255], using p=exp(l)/(1+exp(l)...">l2p_255</a>(l);
<a name="l00398"></a>00398                 }
<a name="l00399"></a>00399 <span class="comment"></span>
<a name="l00400"></a>00400 <span class="comment">                /** Scales a real valued probability in [0,1] to an integer representation of: log(p)-log(1-p)  in the valid range of cellType.</span>
<a name="l00401"></a>00401 <span class="comment">                  */</span>
<a name="l00402"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ab5145eccde0c7bb6d216b14f46be03bd">00402</a>                 <span class="keyword">static</span> <span class="keyword">inline</span> cellType p2l(<span class="keyword">const</span> <span class="keywordtype">float</span> p)
<a name="l00403"></a>00403                 {
<a name="l00404"></a>00404                         <span class="keywordflow">return</span> m_logodd_lut.<a class="code" href="structmrpt_1_1slam_1_1_c_log_odds_grid_map_l_u_t.html#af325712d6dc838a8721e35545f550103" title="Scales a real valued probability in [0,1] to an integer representation of: log(p)-log(1-p) in the val...">p2l</a>(p);
<a name="l00405"></a>00405                 }
<a name="l00406"></a>00406 <span class="comment"></span>
<a name="l00407"></a>00407 <span class="comment">                /** Change the contents [0,1] of a cell, given its index.</span>
<a name="l00408"></a>00408 <span class="comment">                 */</span>
<a name="l00409"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a5ca93b2d3b8fac353a17ea79cf953efd">00409</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span>   setCell(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<span class="keywordtype">float</span> value)
<a name="l00410"></a>00410                 {
<a name="l00411"></a>00411                         <span class="comment">// The x&gt; comparison implicitly holds if x&lt;0</span>
<a name="l00412"></a>00412                         <span class="keywordflow">if</span> (static_cast&lt;unsigned int&gt;(x)&gt;=size_x ||     static_cast&lt;unsigned int&gt;(y)&gt;=size_y)
<a name="l00413"></a>00413                                         <span class="keywordflow">return</span>;
<a name="l00414"></a>00414                         <span class="keywordflow">else</span>    map[x+y*size_x]=p2l(value);
<a name="l00415"></a>00415                 }
<a name="l00416"></a>00416 <span class="comment"></span>
<a name="l00417"></a>00417 <span class="comment">                /** Read the real valued [0,1] contents of a cell, given its index.</span>
<a name="l00418"></a>00418 <span class="comment">                 */</span>
<a name="l00419"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a5de84f1363c3dabe43bfa13d9b4ad823">00419</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>  getCell(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>)<span class="keyword"> const</span>
<a name="l00420"></a>00420 <span class="keyword">                </span>{
<a name="l00421"></a>00421                         <span class="comment">// The x&gt; comparison implicitly holds if x&lt;0</span>
<a name="l00422"></a>00422                         <span class="keywordflow">if</span> (static_cast&lt;unsigned int&gt;(x)&gt;=size_x ||     static_cast&lt;unsigned int&gt;(y)&gt;=size_y)
<a name="l00423"></a>00423                                         <span class="keywordflow">return</span> 0.5f;
<a name="l00424"></a>00424                         <span class="keywordflow">else</span>    <span class="keywordflow">return</span> l2p(map[x+y*size_x]);
<a name="l00425"></a>00425                 }
<a name="l00426"></a>00426 <span class="comment"></span>
<a name="l00427"></a>00427 <span class="comment">                /** Access to a &quot;row&quot;: mainly used for drawing grid as a bitmap efficiently, do not use it normally.</span>
<a name="l00428"></a>00428 <span class="comment">                  */</span>
<a name="l00429"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad75129f6fcaba8d1a7699bc4056bd914">00429</a>                 <span class="keyword">inline</span>  cellType *<a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad75129f6fcaba8d1a7699bc4056bd914" title="Access to a &quot;row&quot;: mainly used for drawing grid as a bitmap efficiently, do not use it normally...">getRow</a>( <span class="keywordtype">int</span> cy ) { <span class="keywordflow">if</span> (cy&lt;0 || static_cast&lt;unsigned int&gt;(cy)&gt;=size_y) <span class="keywordflow">return</span> NULL; <span class="keywordflow">else</span> <span class="keywordflow">return</span> &amp;map[0+cy*size_x]; }
<a name="l00430"></a>00430 <span class="comment"></span>
<a name="l00431"></a>00431 <span class="comment">                /** Access to a &quot;row&quot;: mainly used for drawing grid as a bitmap efficiently, do not use it normally.</span>
<a name="l00432"></a>00432 <span class="comment">                  */</span>
<a name="l00433"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#adbe973dc21d3f4eb798d2986c5aa6e92">00433</a>                 <span class="keyword">inline</span>  <span class="keyword">const</span> cellType *<a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#adbe973dc21d3f4eb798d2986c5aa6e92" title="Access to a &quot;row&quot;: mainly used for drawing grid as a bitmap efficiently, do not use it normally...">getRow</a>( <span class="keywordtype">int</span> cy )<span class="keyword"> const </span>{ <span class="keywordflow">if</span> (cy&lt;0 || static_cast&lt;unsigned int&gt;(cy)&gt;=size_y) <span class="keywordflow">return</span> NULL; <span class="keywordflow">else</span> <span class="keywordflow">return</span> &amp;map[0+cy*size_x]; }
<a name="l00434"></a>00434 <span class="comment"></span>
<a name="l00435"></a>00435 <span class="comment">                /** Change the contents [0,1] of a cell, given its coordinates.</span>
<a name="l00436"></a>00436 <span class="comment">                 */</span>
<a name="l00437"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9ef4135b6116018d807cbfd26cb613f5">00437</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9ef4135b6116018d807cbfd26cb613f5" title="Change the contents [0,1] of a cell, given its coordinates.">setPos</a>(<span class="keywordtype">float</span> x,<span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<span class="keywordtype">float</span> value) { setCell(x2idx(x),y2idx(y),value); }
<a name="l00438"></a>00438 <span class="comment"></span>
<a name="l00439"></a>00439 <span class="comment">                /** Read the real valued [0,1] contents of a cell, given its coordinates.</span>
<a name="l00440"></a>00440 <span class="comment">                 */</span>
<a name="l00441"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a774ac3243e0de2e8444808c15b6d0e11">00441</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a774ac3243e0de2e8444808c15b6d0e11" title="Read the real valued [0,1] contents of a cell, given its coordinates.">getPos</a>(<span class="keywordtype">float</span> x,<span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> getCell(x2idx(x),y2idx(y)); }
<a name="l00442"></a>00442 <span class="comment"></span>
<a name="l00443"></a>00443 <span class="comment">                /** Returns &quot;true&quot; if cell is &quot;static&quot;, i.e.if its occupancy is below a given threshold.</span>
<a name="l00444"></a>00444 <span class="comment">                 */</span>
<a name="l00445"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad542af3288933578bb5f82935dff6bdb">00445</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad542af3288933578bb5f82935dff6bdb" title="Returns &quot;true&quot; if cell is &quot;static&quot;, i.e.if its occupancy is below a given threshold.">isStaticPos</a>(<span class="keywordtype">float</span> x,<span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<span class="keywordtype">float</span> threshold = 0.7f)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> isStaticCell(x2idx(x),y2idx(y),threshold); }
<a name="l00446"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a8816c642fb95f3251e7f808a8266c3b2">00446</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a8816c642fb95f3251e7f808a8266c3b2">isStaticCell</a>(<span class="keywordtype">int</span> cx,<span class="keywordtype">int</span> cy,<span class="keywordtype">float</span> threshold = 0.7f)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (getCell(cx,cy)&lt;=threshold); }
<a name="l00447"></a>00447 <span class="comment"></span>
<a name="l00448"></a>00448 <span class="comment">                /** Change a cell in the &quot;basis&quot; maps.Used for Voronoi calculation.</span>
<a name="l00449"></a>00449 <span class="comment">                 */</span>
<a name="l00450"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#af85c888dad3661272c75720acac785e4">00450</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span>   setBasisCell(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,uint8_t value)
<a name="l00451"></a>00451                 {
<a name="l00452"></a>00452                         uint8_t *cell=m_basis_map.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#a4781cecfa674b11cd29470a0555a0622" title="Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the ma...">cellByIndex</a>(x,y);
<a name="l00453"></a>00453 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l00454"></a>00454 <span class="preprocessor"></span>                        <a class="code" href="mrpt__macros_8h.html#ad8765ef1dc961d49450d95338d283386">ASSERT_ABOVEEQ_</a>(x,0)
<a name="l00455"></a>00455                         <a class="code" href="mrpt__macros_8h.html#ad8765ef1dc961d49450d95338d283386">ASSERT_ABOVEEQ_</a>(y,0)
<a name="l00456"></a>00456                         <a class="code" href="mrpt__macros_8h.html#a9cadce51acb48cccb17428421c952dbf">ASSERT_BELOWEQ_</a>(x,<span class="keywordtype">int</span>(m_basis_map.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#aeb24078d14768d08d00c1eb79c547ff3" title="Returns the horizontal size of grid map in cells count.">getSizeX</a>()))
<a name="l00457"></a>00457                         <a class="code" href="mrpt__macros_8h.html#a9cadce51acb48cccb17428421c952dbf">ASSERT_BELOWEQ_</a>(y,<span class="keywordtype">int</span>(m_basis_map.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#a4d300627ac8a06e1e277292c1b0a711b" title="Returns the vertical size of grid map in cells count.">getSizeY</a>()))
<a name="l00458"></a>00458 <span class="preprocessor">#endif</span>
<a name="l00459"></a>00459 <span class="preprocessor"></span>                        *cell = value;
<a name="l00460"></a>00460                 }
<a name="l00461"></a>00461 <span class="comment"></span>
<a name="l00462"></a>00462 <span class="comment">                /** Reads a cell in the &quot;basis&quot; maps.Used for Voronoi calculation.</span>
<a name="l00463"></a>00463 <span class="comment">                 */</span>
<a name="l00464"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a1b5d506c42ba97e8d65ecdeebb36c99a">00464</a>                 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>  getBasisCell(<span class="keywordtype">int</span> x,<span class="keywordtype">int</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>)<span class="keyword"> const</span>
<a name="l00465"></a>00465 <span class="keyword">                </span>{
<a name="l00466"></a>00466                         <span class="keyword">const</span> uint8_t *cell=m_basis_map.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#a4781cecfa674b11cd29470a0555a0622" title="Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the ma...">cellByIndex</a>(x,y);
<a name="l00467"></a>00467 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l00468"></a>00468 <span class="preprocessor"></span>                        <a class="code" href="mrpt__macros_8h.html#ad8765ef1dc961d49450d95338d283386">ASSERT_ABOVEEQ_</a>(x,0)
<a name="l00469"></a>00469                         <a class="code" href="mrpt__macros_8h.html#ad8765ef1dc961d49450d95338d283386">ASSERT_ABOVEEQ_</a>(y,0)
<a name="l00470"></a>00470                         <a class="code" href="mrpt__macros_8h.html#a9cadce51acb48cccb17428421c952dbf">ASSERT_BELOWEQ_</a>(x,<span class="keywordtype">int</span>(m_basis_map.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#aeb24078d14768d08d00c1eb79c547ff3" title="Returns the horizontal size of grid map in cells count.">getSizeX</a>()))
<a name="l00471"></a>00471                         <a class="code" href="mrpt__macros_8h.html#a9cadce51acb48cccb17428421c952dbf">ASSERT_BELOWEQ_</a>(y,<span class="keywordtype">int</span>(m_basis_map.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#a4d300627ac8a06e1e277292c1b0a711b" title="Returns the vertical size of grid map in cells count.">getSizeY</a>()))
<a name="l00472"></a>00472 <span class="preprocessor">#endif</span>
<a name="l00473"></a>00473 <span class="preprocessor"></span>                        <span class="keywordflow">return</span> *cell;
<a name="l00474"></a>00474                 }
<a name="l00475"></a>00475 <span class="comment"></span>
<a name="l00476"></a>00476 <span class="comment">                /** Used for returning entropy related information</span>
<a name="l00477"></a>00477 <span class="comment">                 * \sa computeEntropy</span>
<a name="l00478"></a>00478 <span class="comment">                 */</span>
<a name="l00479"></a>00479                 <span class="keyword">struct </span><a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> TEntropyInfo
<a name="l00480"></a>00480                 {
<a name="l00481"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#abab1aaa559b65809ed200a25ce2a886a">00481</a>                         <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html" title="Used for returning entropy related information.">TEntropyInfo</a>() : H(0),I(0),mean_H(0),mean_I(0),effectiveMappedArea(0),effectiveMappedCells(0)
<a name="l00482"></a>00482                         {
<a name="l00483"></a>00483                         }
<a name="l00484"></a>00484 <span class="comment"></span>
<a name="l00485"></a>00485 <span class="comment">                        /** The target variable for absolute entropy, computed as:&lt;br&gt;&lt;center&gt;H(map)=Sum&lt;sub&gt;x,y&lt;/sub&gt;{ -p(x,y)·ln(p(x,y)) -(1-p(x,y))·ln(1-p(x,y)) }&lt;/center&gt;&lt;br&gt;&lt;br&gt;</span>
<a name="l00486"></a>00486 <span class="comment">                          */</span>
<a name="l00487"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#aa32374328be368f3d0884cc31a93a7dd">00487</a>                         <span class="keywordtype">double</span>          <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#aa32374328be368f3d0884cc31a93a7dd" title="The target variable for absolute entropy, computed as: H(map)=Sumx,y{ -p(x,y)·ln(p(x,y)) -(1-p(x,y))·ln(1-p(x,y)) }  ">H</a>;
<a name="l00488"></a>00488 <span class="comment"></span>
<a name="l00489"></a>00489 <span class="comment">                        /** The target variable for absolute &quot;information&quot;, defining I(x) = 1 - H(x)</span>
<a name="l00490"></a>00490 <span class="comment">                          */</span>
<a name="l00491"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#acb919482458a34dee01c1ba4ea8b956a">00491</a>                         <span class="keywordtype">double</span>          <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#acb919482458a34dee01c1ba4ea8b956a" title="The target variable for absolute &quot;information&quot;, defining I(x) = 1 - H(x)">I</a>;
<a name="l00492"></a>00492 <span class="comment"></span>
<a name="l00493"></a>00493 <span class="comment">                        /** The target variable for mean entropy, defined as entropy per cell: mean_H(map) = H(map) / (cells)</span>
<a name="l00494"></a>00494 <span class="comment">                          */</span>
<a name="l00495"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#aabb2adec9e46784547c6e3a6ccabbae2">00495</a>                         <span class="keywordtype">double</span>          <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#aabb2adec9e46784547c6e3a6ccabbae2" title="The target variable for mean entropy, defined as entropy per cell: mean_H(map) = H(map) / (cells)...">mean_H</a>;
<a name="l00496"></a>00496 <span class="comment"></span>
<a name="l00497"></a>00497 <span class="comment">                        /** The target variable for mean information, defined as information per cell: mean_I(map) = I(map) / (cells)</span>
<a name="l00498"></a>00498 <span class="comment">                          */</span>
<a name="l00499"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#a62bf96c42d4e4d7b069a9361e48f05a5">00499</a>                         <span class="keywordtype">double</span>          <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#a62bf96c42d4e4d7b069a9361e48f05a5" title="The target variable for mean information, defined as information per cell: mean_I(map) = I(map) / (ce...">mean_I</a>;
<a name="l00500"></a>00500 <span class="comment"></span>
<a name="l00501"></a>00501 <span class="comment">                        /** The target variable for the area of cells with information, i.e. p(x)!=0.5</span>
<a name="l00502"></a>00502 <span class="comment">                          */</span>
<a name="l00503"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#ad7dd7d0e69edb32ada0339b3d0512f33">00503</a>                         <span class="keywordtype">double</span>          <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#ad7dd7d0e69edb32ada0339b3d0512f33" title="The target variable for the area of cells with information, i.e.">effectiveMappedArea</a>;
<a name="l00504"></a>00504 <span class="comment"></span>
<a name="l00505"></a>00505 <span class="comment">                        /** The mapped area in cells.</span>
<a name="l00506"></a>00506 <span class="comment">                          */</span>
<a name="l00507"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#a4c55e51c2a26c644952c1e56db78d619">00507</a>                         <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html#a4c55e51c2a26c644952c1e56db78d619" title="The mapped area in cells.">effectiveMappedCells</a>;
<a name="l00508"></a>00508                 };
<a name="l00509"></a>00509 <span class="comment"></span>
<a name="l00510"></a>00510 <span class="comment">                /** With this struct options are provided to the observation insertion process.</span>
<a name="l00511"></a>00511 <span class="comment">                * \sa CObservation::insertIntoGridMap</span>
<a name="l00512"></a>00512 <span class="comment">                */</span>
<a name="l00513"></a>00513                 <span class="keyword">class </span><a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html" title="With this struct options are provided to the observation insertion process.">TInsertionOptions</a> : <span class="keyword">public</span> mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_c_loadable_options.html" title="This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...">CLoadableOptions</a>
<a name="l00514"></a>00514                 {
<a name="l00515"></a>00515                 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00516"></a>00516 <span class="comment">                        /** Initilization of default parameters</span>
<a name="l00517"></a>00517 <span class="comment">                        */</span>
<a name="l00518"></a>00518                         <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html" title="With this struct options are provided to the observation insertion process.">TInsertionOptions</a>( );
<a name="l00519"></a>00519 <span class="comment"></span>
<a name="l00520"></a>00520 <span class="comment">                        /** This method load the options from a &quot;.ini&quot; file.</span>
<a name="l00521"></a>00521 <span class="comment">                         *   Only those parameters found in the given &quot;section&quot; and having</span>
<a name="l00522"></a>00522 <span class="comment">                         *   the same name that the variable are loaded. Those not found in</span>
<a name="l00523"></a>00523 <span class="comment">                         *   the file will stay with their previous values (usually the default</span>
<a name="l00524"></a>00524 <span class="comment">                         *   values loaded at initialization). An example of an &quot;.ini&quot; file:</span>
<a name="l00525"></a>00525 <span class="comment">                         *  \code</span>
<a name="l00526"></a>00526 <span class="comment">                         *  [section]</span>
<a name="l00527"></a>00527 <span class="comment">                         *      resolution=0.10         ; blah blah...</span>
<a name="l00528"></a>00528 <span class="comment">                         *      modeSelection=1         ; 0=blah, 1=blah,...</span>
<a name="l00529"></a>00529 <span class="comment">                         *  \endcode</span>
<a name="l00530"></a>00530 <span class="comment">                         */</span>
<a name="l00531"></a>00531                         <span class="keywordtype">void</span>  loadFromConfigFile(
<a name="l00532"></a>00532                                 <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>  &amp;source,
<a name="l00533"></a>00533                                 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section);
<a name="l00534"></a>00534 <span class="comment"></span>
<a name="l00535"></a>00535 <span class="comment">                        /** This method must display clearly all the contents of the structure in textual form, sending it to a CStream.</span>
<a name="l00536"></a>00536 <span class="comment">                          */</span>
<a name="l00537"></a>00537                         <span class="keywordtype">void</span>  dumpToTextStream(<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">CStream</a>  &amp;out) <span class="keyword">const</span>;
<a name="l00538"></a>00538 
<a name="l00539"></a>00539 <span class="comment"></span>
<a name="l00540"></a>00540 <span class="comment">                        /** The altitude (z-axis) of 2D scans (within a 0.01m tolerance) for they to be inserted in this map!</span>
<a name="l00541"></a>00541 <span class="comment">                          */</span>
<a name="l00542"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a2b3d4b7e8bb4ebc7dd5c42ba08d7543b">00542</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a2b3d4b7e8bb4ebc7dd5c42ba08d7543b" title="The altitude (z-axis) of 2D scans (within a 0.01m tolerance) for they to be inserted in this map!...">mapAltitude</a>;
<a name="l00543"></a>00543 <span class="comment"></span>
<a name="l00544"></a>00544 <span class="comment">                        /** The parameter &quot;mapAltitude&quot; has effect while inserting observations in the grid only if this is true.</span>
<a name="l00545"></a>00545 <span class="comment">                          */</span>
<a name="l00546"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a4bff78a9a1f8c096e75cd14b68a89145">00546</a>                         <span class="keywordtype">bool</span>    <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a4bff78a9a1f8c096e75cd14b68a89145" title="The parameter &quot;mapAltitude&quot; has effect while inserting observations in the grid only if this is true...">useMapAltitude</a>;
<a name="l00547"></a>00547 <span class="comment"></span>
<a name="l00548"></a>00548 <span class="comment">                        /** The largest distance at which cells will be updated (Default 15 meters)</span>
<a name="l00549"></a>00549 <span class="comment">                        */</span>
<a name="l00550"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#aa1412825241629c1d5acd9a4a1a4cafa">00550</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#aa1412825241629c1d5acd9a4a1a4cafa" title="The largest distance at which cells will be updated (Default 15 meters)">maxDistanceInsertion</a>;
<a name="l00551"></a>00551 <span class="comment"></span>
<a name="l00552"></a>00552 <span class="comment">                        /** A value in the range [0.5,1] used for updating cell with a bayesian approach (default 0.8)</span>
<a name="l00553"></a>00553 <span class="comment">                        */</span>
<a name="l00554"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a6740c382b00b8705a9111572f62dece1">00554</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a6740c382b00b8705a9111572f62dece1" title="A value in the range [0.5,1] used for updating cell with a bayesian approach (default 0...">maxOccupancyUpdateCertainty</a>;
<a name="l00555"></a>00555 <span class="comment"></span>
<a name="l00556"></a>00556 <span class="comment">                        /** If set to true (default), invalid range values (no echo rays) as consider as free space until &quot;maxOccupancyUpdateCertainty&quot;, but ONLY when the previous and next rays are also an invalid ray.</span>
<a name="l00557"></a>00557 <span class="comment">                        */</span>
<a name="l00558"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a41a59d71f0b112edafbcc23d295a7d86">00558</a>                         <span class="keywordtype">bool</span>    <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a41a59d71f0b112edafbcc23d295a7d86" title="If set to true (default), invalid range values (no echo rays) as consider as free space until &quot;maxOcc...">considerInvalidRangesAsFreeSpace</a>;
<a name="l00559"></a>00559 <span class="comment"></span>
<a name="l00560"></a>00560 <span class="comment">                        /** Specify the decimation of the range scan (default=1 : take all the range values!)</span>
<a name="l00561"></a>00561 <span class="comment">                          */</span>
<a name="l00562"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a79bb90fd2d0917c2453b773a385d283f">00562</a>                         uint16_t        <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a79bb90fd2d0917c2453b773a385d283f" title="Specify the decimation of the range scan (default=1 : take all the range values!)">decimation</a>;
<a name="l00563"></a>00563 <span class="comment"></span>
<a name="l00564"></a>00564 <span class="comment">                        /** The tolerance in rads in pitch &amp; roll for a laser scan to be considered horizontal, then processed by calls to this class (default=0). */</span>
<a name="l00565"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a72a3a89324ed7a934db8722efe972be2">00565</a>                         <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a72a3a89324ed7a934db8722efe972be2" title="The tolerance in rads in pitch &amp; roll for a laser scan to be considered horizontal, then processed by calls to this class (default=0).">horizontalTolerance</a>;
<a name="l00566"></a>00566 <span class="comment"></span>
<a name="l00567"></a>00567 <span class="comment">                        /** Gaussian sigma of the filter used in getAsImageFiltered (for features detection) (Default=1) (0:Disabled) */</span>
<a name="l00568"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a18730bc93b2cde3b517e234496c1ec83">00568</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#a18730bc93b2cde3b517e234496c1ec83" title="Gaussian sigma of the filter used in getAsImageFiltered (for features detection) (Default=1) (0:Disab...">CFD_features_gaussian_size</a>;
<a name="l00569"></a>00569 <span class="comment"></span>
<a name="l00570"></a>00570 <span class="comment">                        /** Size of the Median filter used in getAsImageFiltered (for features detection) (Default=3) (0:Disabled) */</span>
<a name="l00571"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#ace2fc6dd1d6622f1d34a9ec7786a7ea6">00571</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#ace2fc6dd1d6622f1d34a9ec7786a7ea6" title="Size of the Median filter used in getAsImageFiltered (for features detection) (Default=3) (0:Disabled...">CFD_features_median_size</a>;
<a name="l00572"></a>00572 
<a name="l00573"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#ad97e9b0b25f2018370dddfce57c1a6ab">00573</a>                         <span class="keywordtype">bool</span>    <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html#ad97e9b0b25f2018370dddfce57c1a6ab" title="Enabled: Rays widen with distance to approximate the real behavior of lasers, disabled: insert rays a...">wideningBeamsWithDistance</a>;      <span class="comment">//!&lt; Enabled: Rays widen with distance to approximate the real behavior of lasers, disabled: insert rays as simple lines (Default=true)</span>
<a name="l00574"></a>00574 <span class="comment"></span>
<a name="l00575"></a>00575                 };
<a name="l00576"></a>00576 <span class="comment"></span>
<a name="l00577"></a>00577 <span class="comment">                /** With this struct options are provided to the observation insertion process.</span>
<a name="l00578"></a>00578 <span class="comment">                * \sa CObservation::insertIntoGridMap</span>
<a name="l00579"></a>00579 <span class="comment">                */</span>
<a name="l00580"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a1cbb040250b2c31874f99bce0bd978b4">00580</a>                 <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_insertion_options.html" title="With this struct options are provided to the observation insertion process.">TInsertionOptions</a>       <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a1cbb040250b2c31874f99bce0bd978b4" title="With this struct options are provided to the observation insertion process.">insertionOptions</a>;
<a name="l00581"></a>00581 <span class="comment"></span>
<a name="l00582"></a>00582 <span class="comment">                /** The type for selecting a likelihood computation method</span>
<a name="l00583"></a>00583 <span class="comment">                */</span>
<a name="l00584"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1">00584</a>                 <span class="keyword">enum</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1" title="The type for selecting a likelihood computation method.">TLikelihoodMethod</a>
<a name="l00585"></a>00585                 {
<a name="l00586"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a95a02c9e818f23225a61b58a828bed1b">00586</a>                         lmMeanInformation = 0,
<a name="l00587"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a3ca355799d98bd1bcc00815cb41bcbc4">00587</a>                         <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a3ca355799d98bd1bcc00815cb41bcbc4">lmRayTracing</a>,
<a name="l00588"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a11621815c435ed51db10a23576cdac2c">00588</a>                         <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a11621815c435ed51db10a23576cdac2c">lmConsensus</a>,
<a name="l00589"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a3fccf7695fc59ae53e10e079b6ccdab0">00589</a>                         <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a3fccf7695fc59ae53e10e079b6ccdab0">lmCellsDifference</a>,
<a name="l00590"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a8b2d704901595037d273c3e9b6236559">00590</a>                         <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1a8b2d704901595037d273c3e9b6236559">lmLikelihoodField_Thrun</a>,
<a name="l00591"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1afc7020b15d07152a49b05eff808c5ddc">00591</a>                         <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1afc7020b15d07152a49b05eff808c5ddc">lmLikelihoodField_II</a>,
<a name="l00592"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1ab4f0badb2fb763975a43ee84d70b9bc3">00592</a>                         lmConsensusOWA
<a name="l00593"></a>00593                 };
<a name="l00594"></a>00594 <span class="comment"></span>
<a name="l00595"></a>00595 <span class="comment">                /** With this struct options are provided to the observation likelihood computation process.</span>
<a name="l00596"></a>00596 <span class="comment">                */</span>
<a name="l00597"></a>00597                 <span class="keyword">class </span><a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> TLikelihoodOptions  : <span class="keyword">public</span> mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_c_loadable_options.html" title="This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...">CLoadableOptions</a>
<a name="l00598"></a>00598                 {
<a name="l00599"></a>00599                 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00600"></a>00600 <span class="comment">                        /** Initilization of default parameters</span>
<a name="l00601"></a>00601 <span class="comment">                        */</span>
<a name="l00602"></a>00602                         TLikelihoodOptions();
<a name="l00603"></a>00603 <span class="comment"></span>
<a name="l00604"></a>00604 <span class="comment">                        /** This method load the options from a &quot;.ini&quot; file.</span>
<a name="l00605"></a>00605 <span class="comment">                         *   Only those parameters found in the given &quot;section&quot; and having</span>
<a name="l00606"></a>00606 <span class="comment">                         *   the same name that the variable are loaded. Those not found in</span>
<a name="l00607"></a>00607 <span class="comment">                         *   the file will stay with their previous values (usually the default</span>
<a name="l00608"></a>00608 <span class="comment">                         *   values loaded at initialization). An example of an &quot;.ini&quot; file:</span>
<a name="l00609"></a>00609 <span class="comment">                         *  \code</span>
<a name="l00610"></a>00610 <span class="comment">                         *  [section]</span>
<a name="l00611"></a>00611 <span class="comment">                         *      resolution=0.10         ; blah blah...</span>
<a name="l00612"></a>00612 <span class="comment">                         *      modeSelection=1         ; 0=blah, 1=blah,...</span>
<a name="l00613"></a>00613 <span class="comment">                         *  \endcode</span>
<a name="l00614"></a>00614 <span class="comment">                         */</span>
<a name="l00615"></a>00615                         <span class="keywordtype">void</span>  loadFromConfigFile(
<a name="l00616"></a>00616                                 <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>  &amp;source,
<a name="l00617"></a>00617                                 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section);
<a name="l00618"></a>00618 <span class="comment"></span>
<a name="l00619"></a>00619 <span class="comment">                        /** This method must display clearly all the contents of the structure in textual form, sending it to a CStream.</span>
<a name="l00620"></a>00620 <span class="comment">                          */</span>
<a name="l00621"></a>00621                         <span class="keywordtype">void</span>  dumpToTextStream(<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">CStream</a>  &amp;out) <span class="keyword">const</span>;
<a name="l00622"></a>00622 <span class="comment"></span>
<a name="l00623"></a>00623 <span class="comment">                        /** The selected method to compute an observation likelihood.</span>
<a name="l00624"></a>00624 <span class="comment">                        */</span>
<a name="l00625"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a39d6d551160319f457e5b6d066a404fe">00625</a>                         <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a9c20551c74e17a4082c29572e56db5e1" title="The type for selecting a likelihood computation method.">TLikelihoodMethod</a>       <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a39d6d551160319f457e5b6d066a404fe" title="The selected method to compute an observation likelihood.">likelihoodMethod</a>;
<a name="l00626"></a>00626 <span class="comment"></span>
<a name="l00627"></a>00627 <span class="comment">                        /** [LikelihoodField] The laser range &quot;sigma&quot; used in computations; Default value = 0.35</span>
<a name="l00628"></a>00628 <span class="comment">                        */</span>
<a name="l00629"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a902f17ece39c08b9f65287a4c37a535d">00629</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a902f17ece39c08b9f65287a4c37a535d" title="[LikelihoodField] The laser range &quot;sigma&quot; used in computations; Default value = 0.35">LF_stdHit</a>;
<a name="l00630"></a>00630 <span class="comment"></span>
<a name="l00631"></a>00631 <span class="comment">                        /** [LikelihoodField] Ratios of the hit/random components of the likelihood; Default values=0.95/0.5</span>
<a name="l00632"></a>00632 <span class="comment">                        */</span>
<a name="l00633"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a505e23d909ec0b7e58390ec0c58bd2b4">00633</a>                         <span class="keywordtype">float</span>   LF_zHit, <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a505e23d909ec0b7e58390ec0c58bd2b4">LF_zRandom</a>;
<a name="l00634"></a>00634 <span class="comment"></span>
<a name="l00635"></a>00635 <span class="comment">                        /** [LikelihoodField] The max. range of the sensor (def=81meters)</span>
<a name="l00636"></a>00636 <span class="comment">                        */</span>
<a name="l00637"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#ae288d31573d6f3a0b971588a0c25d096">00637</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#ae288d31573d6f3a0b971588a0c25d096" title="[LikelihoodField] The max.">LF_maxRange</a>;
<a name="l00638"></a>00638 <span class="comment"></span>
<a name="l00639"></a>00639 <span class="comment">                        /** [LikelihoodField] The decimation of the points in a scan, default=1 == no decimation.</span>
<a name="l00640"></a>00640 <span class="comment">                        */</span>
<a name="l00641"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a06ad81a426281bb6a284f59ea5e040f0">00641</a>                         uint32_t <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a06ad81a426281bb6a284f59ea5e040f0" title="[LikelihoodField] The decimation of the points in a scan, default=1 == no decimation.">LF_decimation</a>;
<a name="l00642"></a>00642 <span class="comment"></span>
<a name="l00643"></a>00643 <span class="comment">                        /** [LikelihoodField] The max. distance for searching correspondences around each sensed point</span>
<a name="l00644"></a>00644 <span class="comment">                        */</span>
<a name="l00645"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a0c133e796b24da41290676cfc1533e79">00645</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a0c133e796b24da41290676cfc1533e79" title="[LikelihoodField] The max.">LF_maxCorrsDistance</a>;
<a name="l00646"></a>00646 <span class="comment"></span>
<a name="l00647"></a>00647 <span class="comment">                        /** [LikelihoodField] Set this to &quot;true&quot; ot use an alternative method, where the likelihood of the whole range scan is computed by &quot;averaging&quot; of individual ranges, instead of by the &quot;product&quot;.</span>
<a name="l00648"></a>00648 <span class="comment">                          */</span>
<a name="l00649"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a10b214930407193a449f9379ae9d2d18">00649</a>                         <span class="keywordtype">bool</span>    <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a10b214930407193a449f9379ae9d2d18" title="[LikelihoodField] Set this to &quot;true&quot; ot use an alternative method, where the likelihood of the whole ...">LF_alternateAverageMethod</a>;
<a name="l00650"></a>00650 <span class="comment"></span>
<a name="l00651"></a>00651 <span class="comment">                        /** [MI] The exponent in the MI likelihood computation. Default value = 5</span>
<a name="l00652"></a>00652 <span class="comment">                        */</span>
<a name="l00653"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#aaca8362859d3bea9f9723b3d2713f99b">00653</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#aaca8362859d3bea9f9723b3d2713f99b" title="[MI] The exponent in the MI likelihood computation.">MI_exponent</a>;
<a name="l00654"></a>00654 <span class="comment"></span>
<a name="l00655"></a>00655 <span class="comment">                        /** [MI] The scan rays decimation: at every N rays, one will be used to compute the MI:</span>
<a name="l00656"></a>00656 <span class="comment">                         */</span>
<a name="l00657"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a6db09b33130cef9e623247b1350a77aa">00657</a>                         uint32_t <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a6db09b33130cef9e623247b1350a77aa" title="[MI] The scan rays decimation: at every N rays, one will be used to compute the MI:">MI_skip_rays</a>;
<a name="l00658"></a>00658 <span class="comment"></span>
<a name="l00659"></a>00659 <span class="comment">                        /** [MI] The ratio for the max. distance used in the MI computation and in the insertion of scans, e.g. if set to 2.0 the MI will use twice the distance that the update distance.</span>
<a name="l00660"></a>00660 <span class="comment">                          */</span>
<a name="l00661"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a56b707f150f90c05b6706452e0ccd503">00661</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a56b707f150f90c05b6706452e0ccd503" title="[MI] The ratio for the max.">MI_ratio_max_distance</a>;
<a name="l00662"></a>00662 <span class="comment"></span>
<a name="l00663"></a>00663 <span class="comment">                        /** [rayTracing] If true (default), the rayTracing method will ignore measured ranges shorter than the simulated ones.</span>
<a name="l00664"></a>00664 <span class="comment">                          */</span>
<a name="l00665"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#ac9665d7b553902e61758183ce24cb929">00665</a>                         <span class="keywordtype">bool</span>    <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#ac9665d7b553902e61758183ce24cb929" title="[rayTracing] If true (default), the rayTracing method will ignore measured ranges shorter than the si...">rayTracing_useDistanceFilter</a>;
<a name="l00666"></a>00666 <span class="comment"></span>
<a name="l00667"></a>00667 <span class="comment">                        /** [rayTracing] One out of &quot;rayTracing_decimation&quot; rays will be simulated and compared only: set to 1 to use all the sensed ranges.</span>
<a name="l00668"></a>00668 <span class="comment">                          */</span>
<a name="l00669"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a140ece3d48c5b6dfece5e4b6ba500fde">00669</a>                         int32_t  <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a140ece3d48c5b6dfece5e4b6ba500fde" title="[rayTracing] One out of &quot;rayTracing_decimation&quot; rays will be simulated and compared only: set to 1 to...">rayTracing_decimation</a>;
<a name="l00670"></a>00670 <span class="comment"></span>
<a name="l00671"></a>00671 <span class="comment">                        /** [rayTracing] The laser range sigma.</span>
<a name="l00672"></a>00672 <span class="comment">                          */</span>
<a name="l00673"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a12f4a31c5bb63bedd6e4e549cc7fb46d">00673</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a12f4a31c5bb63bedd6e4e549cc7fb46d" title="[rayTracing] The laser range sigma.">rayTracing_stdHit</a>;
<a name="l00674"></a>00674 <span class="comment"></span>
<a name="l00675"></a>00675 <span class="comment">                        /** [Consensus] The down-sample ratio of ranges (default=1, consider all the ranges)</span>
<a name="l00676"></a>00676 <span class="comment">                          */</span>
<a name="l00677"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a17a40876f6ca8994776cb153d074fe11">00677</a>                         int32_t <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#a17a40876f6ca8994776cb153d074fe11" title="[Consensus] The down-sample ratio of ranges (default=1, consider all the ranges)">consensus_takeEachRange</a>;
<a name="l00678"></a>00678 <span class="comment"></span>
<a name="l00679"></a>00679 <span class="comment">                        /** [Consensus] The power factor for the likelihood (default=5)</span>
<a name="l00680"></a>00680 <span class="comment">                          */</span>
<a name="l00681"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#ab1e509ec9d1e96ccb32d366078863f72">00681</a>                         <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#ab1e509ec9d1e96ccb32d366078863f72" title="[Consensus] The power factor for the likelihood (default=5)">consensus_pow</a>;
<a name="l00682"></a>00682 <span class="comment"></span>
<a name="l00683"></a>00683 <span class="comment">                        /** [OWA] The sequence of weights to be multiplied to of the ordered list of likelihood values (first one is the largest); the size of this vector determines the number of highest likelihood values to fuse.</span>
<a name="l00684"></a>00684 <span class="comment">                          */</span>
<a name="l00685"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#ab8f84c8066e19e73aec4d91556c48cd0">00685</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a>      <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#ab8f84c8066e19e73aec4d91556c48cd0" title="[OWA] The sequence of weights to be multiplied to of the ordered list of likelihood values (first one...">OWA_weights</a>;
<a name="l00686"></a>00686 <span class="comment"></span>
<a name="l00687"></a>00687 <span class="comment">                        /** Enables the usage of a cache of likelihood values (for LF methods), if set to true (default=false).</span>
<a name="l00688"></a>00688 <span class="comment">                          */</span>
<a name="l00689"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#aff1e9eba8f8fa136f9d4f41c6718f521">00689</a>                         <span class="keywordtype">bool</span>    <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_options.html#aff1e9eba8f8fa136f9d4f41c6718f521" title="Enables the usage of a cache of likelihood values (for LF methods), if set to true (default=false)...">enableLikelihoodCache</a>;
<a name="l00690"></a>00690 
<a name="l00691"></a>00691                 } likelihoodOptions;
<a name="l00692"></a>00692 <span class="comment"></span>
<a name="l00693"></a>00693 <span class="comment">                /** Auxiliary private class.</span>
<a name="l00694"></a>00694 <span class="comment">                  */</span>
<a name="l00695"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a5d65008293a7029cf0f615ca9d187787">00695</a>                 <span class="keyword">typedef</span> std::pair&lt;double,CPoint2D&gt; <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a5d65008293a7029cf0f615ca9d187787" title="Auxiliary private class.">TPairLikelihoodIndex</a>;
<a name="l00696"></a>00696 <span class="comment"></span>
<a name="l00697"></a>00697 <span class="comment">                /** Some members of this struct will contain intermediate or output data after calling &quot;computeObservationLikelihood&quot; for some likelihood functions.</span>
<a name="l00698"></a>00698 <span class="comment">                  */</span>
<a name="l00699"></a>00699                 <span class="keyword">class </span><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_output.html" title="Some members of this struct will contain intermediate or output data after calling &quot;computeObservatio...">TLikelihoodOutput</a>
<a name="l00700"></a>00700                 {
<a name="l00701"></a>00701                 <span class="keyword">public</span>:
<a name="l00702"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_output.html#a485805171e33cd810a4dd4df3000f8ea">00702</a>                         <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_output.html" title="Some members of this struct will contain intermediate or output data after calling &quot;computeObservatio...">TLikelihoodOutput</a>() : OWA_pairList(), OWA_individualLikValues()
<a name="l00703"></a>00703                         {}
<a name="l00704"></a>00704 <span class="comment"></span>
<a name="l00705"></a>00705 <span class="comment">                        /** [OWA method] This will contain the ascending-ordered list of pairs:(likelihood values, 2D point in map coordinates).</span>
<a name="l00706"></a>00706 <span class="comment">                          */</span>
<a name="l00707"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_output.html#a0b516239fe7cb6eb51fc4c14830a1c15">00707</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;TPairLikelihoodIndex&gt;</a>       <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_output.html#a0b516239fe7cb6eb51fc4c14830a1c15" title="[OWA method] This will contain the ascending-ordered list of pairs:(likelihood values, 2D point in map coordinates).">OWA_pairList</a>;
<a name="l00708"></a>00708 <span class="comment"></span>
<a name="l00709"></a>00709 <span class="comment">                        /** [OWA method] This will contain the ascending-ordered list of likelihood values for individual range measurements in the scan.</span>
<a name="l00710"></a>00710 <span class="comment">                          */</span>
<a name="l00711"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_output.html#ad3a9f8b358ff3dd7adec8e773fce78fd">00711</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;double&gt;</a>     <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_likelihood_output.html#ad3a9f8b358ff3dd7adec8e773fce78fd" title="[OWA method] This will contain the ascending-ordered list of likelihood values for individual range m...">OWA_individualLikValues</a>;
<a name="l00712"></a>00712 
<a name="l00713"></a>00713                 } likelihoodOutputs;
<a name="l00714"></a>00714 <span class="comment"></span>
<a name="l00715"></a>00715 <span class="comment">                 /** Performs a downsampling of the gridmap, by a given factor: resolution/=ratio</span>
<a name="l00716"></a>00716 <span class="comment">                  */</span>
<a name="l00717"></a>00717                  <span class="keywordtype">void</span>  subSample( <span class="keywordtype">int</span> downRatio );
<a name="l00718"></a>00718 <span class="comment"></span>
<a name="l00719"></a>00719 <span class="comment">                /** Computes the entropy and related values of this grid map.</span>
<a name="l00720"></a>00720 <span class="comment">                 *  The entropy is computed as the summed entropy of each cell, taking them as discrete random variables following a Bernoulli distribution:</span>
<a name="l00721"></a>00721 <span class="comment">                 * \param info The output information is returned here.</span>
<a name="l00722"></a>00722 <span class="comment">                 */</span>
<a name="l00723"></a>00723                 <span class="keywordtype">void</span>  computeEntropy( <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_entropy_info.html" title="Used for returning entropy related information.">TEntropyInfo</a> &amp;info ) <span class="keyword">const</span>;
<a name="l00724"></a>00724 <span class="comment"></span>
<a name="l00725"></a>00725 <span class="comment">                /** @name Voronoi methods</span>
<a name="l00726"></a>00726 <span class="comment">                    @{ */</span>
<a name="l00727"></a>00727 <span class="comment"></span>
<a name="l00728"></a>00728 <span class="comment">                /** Build the Voronoi diagram of the grid map.</span>
<a name="l00729"></a>00729 <span class="comment">                 * \param threshold The threshold for binarizing the map.</span>
<a name="l00730"></a>00730 <span class="comment">                 * \param robot_size Size in &quot;units&quot; (meters) of robot, approx.</span>
<a name="l00731"></a>00731 <span class="comment">                 * \param x1 Left coordinate of area to be computed. Default, entire map.</span>
<a name="l00732"></a>00732 <span class="comment">                 * \param x2 Right coordinate of area to be computed. Default, entire map.</span>
<a name="l00733"></a>00733 <span class="comment">                 * \param y1 Top coordinate of area to be computed. Default, entire map.</span>
<a name="l00734"></a>00734 <span class="comment">                 * \param y2 Bottom coordinate of area to be computed. Default, entire map.</span>
<a name="l00735"></a>00735 <span class="comment">                 * \sa findCriticalPoints</span>
<a name="l00736"></a>00736 <span class="comment">                 */</span>
<a name="l00737"></a>00737                 <span class="keywordtype">void</span>  buildVoronoiDiagram(<span class="keywordtype">float</span> threshold, <span class="keywordtype">float</span> robot_size,<span class="keywordtype">int</span> x1=0,<span class="keywordtype">int</span> x2=0, <span class="keywordtype">int</span> y1=0,<span class="keywordtype">int</span> y2=0);
<a name="l00738"></a>00738 <span class="comment"></span>
<a name="l00739"></a>00739 <span class="comment">                /** Reads a the clearance of a cell (in centimeters), after building the Voronoi diagram with \a buildVoronoiDiagram */</span>
<a name="l00740"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad5729a26efcc0f9633f82acaf4384b00">00740</a>                 <span class="keyword">inline</span> uint16_t getVoroniClearance(<span class="keywordtype">int</span> cx,<span class="keywordtype">int</span> cy)<span class="keyword"> const</span>
<a name="l00741"></a>00741 <span class="keyword">                </span>{
<a name="l00742"></a>00742 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l00743"></a>00743 <span class="preprocessor"></span>                        <a class="code" href="mrpt__macros_8h.html#ad8765ef1dc961d49450d95338d283386">ASSERT_ABOVEEQ_</a>(cx,0)
<a name="l00744"></a>00744                         <a class="code" href="mrpt__macros_8h.html#ad8765ef1dc961d49450d95338d283386">ASSERT_ABOVEEQ_</a>(cy,0)
<a name="l00745"></a>00745                         <a class="code" href="mrpt__macros_8h.html#a9cadce51acb48cccb17428421c952dbf">ASSERT_BELOWEQ_</a>(cx,<span class="keywordtype">int</span>(m_voronoi_diagram.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#aeb24078d14768d08d00c1eb79c547ff3" title="Returns the horizontal size of grid map in cells count.">getSizeX</a>()))
<a name="l00746"></a>00746                         <a class="code" href="mrpt__macros_8h.html#a9cadce51acb48cccb17428421c952dbf">ASSERT_BELOWEQ_</a>(cy,<span class="keywordtype">int</span>(m_voronoi_diagram.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#a4d300627ac8a06e1e277292c1b0a711b" title="Returns the vertical size of grid map in cells count.">getSizeY</a>()))
<a name="l00747"></a>00747 <span class="preprocessor">#endif</span>
<a name="l00748"></a>00748 <span class="preprocessor"></span>                        <span class="keyword">const</span> uint16_t *cell=m_voronoi_diagram.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#a4781cecfa674b11cd29470a0555a0622" title="Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the ma...">cellByIndex</a>(cx,cy);
<a name="l00749"></a>00749                         <span class="keywordflow">return</span> *cell;
<a name="l00750"></a>00750                 }
<a name="l00751"></a>00751 
<a name="l00752"></a>00752         <span class="keyword">protected</span>:<span class="comment"></span>
<a name="l00753"></a>00753 <span class="comment">                /** Used to set the clearance of a cell, while building the Voronoi diagram. */</span>
<a name="l00754"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a6438c48bc30c091920f2ed47a11e5f65">00754</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> setVoroniClearance(<span class="keywordtype">int</span> cx,<span class="keywordtype">int</span> cy,uint16_t dist)
<a name="l00755"></a>00755                 {
<a name="l00756"></a>00756                         uint16_t *cell=m_voronoi_diagram.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#a4781cecfa674b11cd29470a0555a0622" title="Returns a pointer to the contents of a cell given by its cell indexes, or NULL if it is out of the ma...">cellByIndex</a>(cx,cy);
<a name="l00757"></a>00757 <span class="preprocessor">#ifdef _DEBUG</span>
<a name="l00758"></a>00758 <span class="preprocessor"></span>                        <a class="code" href="mrpt__macros_8h.html#ad8765ef1dc961d49450d95338d283386">ASSERT_ABOVEEQ_</a>(cx,0)
<a name="l00759"></a>00759                         <a class="code" href="mrpt__macros_8h.html#ad8765ef1dc961d49450d95338d283386">ASSERT_ABOVEEQ_</a>(cy,0)
<a name="l00760"></a>00760                         <a class="code" href="mrpt__macros_8h.html#a9cadce51acb48cccb17428421c952dbf">ASSERT_BELOWEQ_</a>(cx,<span class="keywordtype">int</span>(m_voronoi_diagram.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#aeb24078d14768d08d00c1eb79c547ff3" title="Returns the horizontal size of grid map in cells count.">getSizeX</a>()))
<a name="l00761"></a>00761                         <a class="code" href="mrpt__macros_8h.html#a9cadce51acb48cccb17428421c952dbf">ASSERT_BELOWEQ_</a>(cy,<span class="keywordtype">int</span>(m_voronoi_diagram.<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html#a4d300627ac8a06e1e277292c1b0a711b" title="Returns the vertical size of grid map in cells count.">getSizeY</a>()))
<a name="l00762"></a>00762 <span class="preprocessor">#endif</span>
<a name="l00763"></a>00763 <span class="preprocessor"></span>                        *cell = dist;
<a name="l00764"></a>00764                 }
<a name="l00765"></a>00765 
<a name="l00766"></a>00766         <span class="keyword">public</span>:
<a name="l00767"></a>00767 <span class="comment"></span>
<a name="l00768"></a>00768 <span class="comment">                /** Return the auxiliary &quot;basis&quot; map built while building the Voronoi diagram \sa buildVoronoiDiagram */</span>
<a name="l00769"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad1ad5b935dfd9a9c9d1ce8ad6f9c5307">00769</a>                 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html">CDynamicGrid&lt;uint8_t&gt;</a>      &amp; <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad1ad5b935dfd9a9c9d1ce8ad6f9c5307" title="Return the auxiliary &quot;basis&quot; map built while building the Voronoi diagram.">getBasisMap</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_basis_map; }
<a name="l00770"></a>00770 <span class="comment"></span>
<a name="l00771"></a>00771 <span class="comment">                /** Return the Voronoi diagram; each cell contains the distance to its closer obstacle, or 0 if not part of the Voronoi diagram \sa buildVoronoiDiagram */</span>
<a name="l00772"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a674df8431ce288f27ab1d559ff2c42c0">00772</a>                 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html">CDynamicGrid&lt;uint16_t&gt;</a>     &amp; <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a674df8431ce288f27ab1d559ff2c42c0" title="Return the Voronoi diagram; each cell contains the distance to its closer obstacle, or 0 if not part of the Voronoi diagram.">getVoronoiDiagram</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_voronoi_diagram; }
<a name="l00773"></a>00773 <span class="comment"></span>
<a name="l00774"></a>00774 <span class="comment">                /** Builds a list with the critical points from Voronoi diagram, which must</span>
<a name="l00775"></a>00775 <span class="comment">                 *    must be built before calling this method.</span>
<a name="l00776"></a>00776 <span class="comment">                 * \param filter_distance The minimum distance between two critical points.</span>
<a name="l00777"></a>00777 <span class="comment">                 * \sa buildVoronoiDiagram</span>
<a name="l00778"></a>00778 <span class="comment">                 */</span>
<a name="l00779"></a>00779                 <span class="keywordtype">void</span>  findCriticalPoints( <span class="keywordtype">float</span> filter_distance );
<a name="l00780"></a>00780 <span class="comment"></span>
<a name="l00781"></a>00781 <span class="comment">                /** @} */</span> <span class="comment">// End of Voronoi methods</span>
<a name="l00782"></a>00782 
<a name="l00783"></a>00783 <span class="comment"></span>
<a name="l00784"></a>00784 <span class="comment">                /** Compute the clearance of a given cell, and returns its two first</span>
<a name="l00785"></a>00785 <span class="comment">                 *   basis (closest obstacle) points.Used to build Voronoi and critical points.</span>
<a name="l00786"></a>00786 <span class="comment">                 * \return The clearance of the cell, in 1/100 of &quot;cell&quot;.</span>
<a name="l00787"></a>00787 <span class="comment">                 * \param cx The cell index</span>
<a name="l00788"></a>00788 <span class="comment">                 * \param cy The cell index</span>
<a name="l00789"></a>00789 <span class="comment">                 * \param basis_x Target buffer for coordinates of basis, having a size of two &quot;ints&quot;.</span>
<a name="l00790"></a>00790 <span class="comment">                 * \param basis_y Target buffer for coordinates of basis, having a size of two &quot;ints&quot;.</span>
<a name="l00791"></a>00791 <span class="comment">                 * \param nBasis The number of found basis: Can be 0,1 or 2.</span>
<a name="l00792"></a>00792 <span class="comment">                 * \param GetContourPoint If &quot;true&quot; the basis are not returned, but the closest free cells.Default at false.</span>
<a name="l00793"></a>00793 <span class="comment">                 * \sa Build_VoronoiDiagram</span>
<a name="l00794"></a>00794 <span class="comment">                 */</span>
<a name="l00795"></a>00795                 <span class="keywordtype">int</span>  computeClearance( <span class="keywordtype">int</span> cx, <span class="keywordtype">int</span> cy, <span class="keywordtype">int</span> *basis_x, <span class="keywordtype">int</span> *basis_y, <span class="keywordtype">int</span> *nBasis, <span class="keywordtype">bool</span> GetContourPoint = <span class="keyword">false</span> ) <span class="keyword">const</span>;
<a name="l00796"></a>00796 <span class="comment"></span>
<a name="l00797"></a>00797 <span class="comment">                /** An alternative method for computing the clearance of a given location (in meters).</span>
<a name="l00798"></a>00798 <span class="comment">                  *  \return The clearance (distance to closest OCCUPIED cell), in meters.</span>
<a name="l00799"></a>00799 <span class="comment">                  */</span>
<a name="l00800"></a>00800                 <span class="keywordtype">float</span>  computeClearance( <span class="keywordtype">float</span> x, <span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">float</span> maxSearchDistance ) <span class="keyword">const</span>;
<a name="l00801"></a>00801 <span class="comment"></span>
<a name="l00802"></a>00802 <span class="comment">                /** Compute the &#39;cost&#39; of traversing a segment of the map according to the occupancy of traversed cells.</span>
<a name="l00803"></a>00803 <span class="comment">                  *  \return This returns &#39;1-mean(traversed cells occupancy)&#39;, i.e. 0.5 for unknown cells, 1 for a free path.</span>
<a name="l00804"></a>00804 <span class="comment">                  */</span>
<a name="l00805"></a>00805                 <span class="keywordtype">float</span>  computePathCost( <span class="keywordtype">float</span> x1, <span class="keywordtype">float</span> y1, <span class="keywordtype">float</span> x2, <span class="keywordtype">float</span> y2 ) <span class="keyword">const</span>;
<a name="l00806"></a>00806 
<a name="l00807"></a>00807 <span class="comment"></span>
<a name="l00808"></a>00808 <span class="comment">                /** \name Sensor simulators</span>
<a name="l00809"></a>00809 <span class="comment">                    @{</span>
<a name="l00810"></a>00810 <span class="comment">                   */</span>
<a name="l00811"></a>00811 <span class="comment"></span>
<a name="l00812"></a>00812 <span class="comment">                /** Simulates a laser range scan into the current grid map.</span>
<a name="l00813"></a>00813 <span class="comment">                 *   The simulated scan is stored in a CObservation2DRangeScan object, which is also used</span>
<a name="l00814"></a>00814 <span class="comment">                 *    to pass some parameters: all previously stored characteristics (as aperture,...) are</span>
<a name="l00815"></a>00815 <span class="comment">                 *        taken into account for simulation. Only a few more parameters are needed. Additive gaussian noise can be optionally added to the simulated scan.</span>
<a name="l00816"></a>00816 <span class="comment">                 * \param inout_Scan [IN/OUT] This must be filled with desired parameters before calling, and will contain the scan samples on return.</span>
<a name="l00817"></a>00817 <span class="comment">                 * \param robotPose [IN] The robot pose in this map coordinates. Recall that sensor pose relative to this robot pose must be specified in the observation object.</span>
<a name="l00818"></a>00818 <span class="comment">                 * \param threshold [IN] The minimum occupancy threshold to consider a cell to be occupied, for example 0.5.</span>
<a name="l00819"></a>00819 <span class="comment">                 * \param N [IN] The count of range scan &quot;rays&quot;, by default to 361.</span>
<a name="l00820"></a>00820 <span class="comment">                 * \param noiseStd [IN] The standard deviation of measurement noise. If not desired, set to 0.</span>
<a name="l00821"></a>00821 <span class="comment">                 * \param decimation [IN] The rays that will be simulated are at indexes: 0, D, 2D, 3D, ... Default is D=1</span>
<a name="l00822"></a>00822 <span class="comment">                 * \param angleNoiseStd [IN] The sigma of an optional Gaussian noise added to the angles at which ranges are measured (in radians).</span>
<a name="l00823"></a>00823 <span class="comment">                 *</span>
<a name="l00824"></a>00824 <span class="comment">                 * \sa sonarSimulator</span>
<a name="l00825"></a>00825 <span class="comment">                 */</span>
<a name="l00826"></a>00826                 <span class="keywordtype">void</span>  laserScanSimulator(
<a name="l00827"></a>00827                                 <a class="code" href="classmrpt_1_1slam_1_1_c_observation2_d_range_scan.html" title="A &quot;CObservation&quot;-derived class that represents a 2D range scan measurement (typically from a laser sc...">CObservation2DRangeScan</a>         &amp;inout_Scan,
<a name="l00828"></a>00828                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                                   &amp;robotPose,
<a name="l00829"></a>00829                                 <span class="keywordtype">float</span>                                               threshold = 0.5f,
<a name="l00830"></a>00830                                 <span class="keywordtype">size_t</span>                                              N = 361,
<a name="l00831"></a>00831                                 <span class="keywordtype">float</span>                                               noiseStd = 0,
<a name="l00832"></a>00832                                 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>                                decimation = 1,
<a name="l00833"></a>00833                                 <span class="keywordtype">float</span>                                                   angleNoiseStd = <a class="code" href="namespacemrpt_1_1utils.html#a186dc19748953878f7be5e9b0c345dfd" title="Degrees to radians.">DEG2RAD</a>(0) ) <span class="keyword">const</span>;
<a name="l00834"></a>00834 <span class="comment"></span>
<a name="l00835"></a>00835 <span class="comment">                /** Simulates the observations of a sonar rig into the current grid map.</span>
<a name="l00836"></a>00836 <span class="comment">                 *   The simulated ranges are stored in a CObservationRange object, which is also used</span>
<a name="l00837"></a>00837 <span class="comment">                 *    to pass in some needed parameters, as the poses of the sonar sensors onto the mobile robot.</span>
<a name="l00838"></a>00838 <span class="comment">                 * \param inout_observation [IN/OUT] This must be filled with desired parameters before calling, and will contain the simulated ranges on return.</span>
<a name="l00839"></a>00839 <span class="comment">                 * \param robotPose [IN] The robot pose in this map coordinates. Recall that sensor pose relative to this robot pose must be specified in the observation object.</span>
<a name="l00840"></a>00840 <span class="comment">                 * \param threshold [IN] The minimum occupancy threshold to consider a cell to be occupied, for example 0.5.</span>
<a name="l00841"></a>00841 <span class="comment">                 * \param rangeNoiseStd [IN] The standard deviation of measurement noise. If not desired, set to 0.</span>
<a name="l00842"></a>00842 <span class="comment">                 * \param angleNoiseStd [IN] The sigma of an optional Gaussian noise added to the angles at which ranges are measured (in radians).</span>
<a name="l00843"></a>00843 <span class="comment">                 *</span>
<a name="l00844"></a>00844 <span class="comment">                 * \sa laserScanSimulator</span>
<a name="l00845"></a>00845 <span class="comment">                 */</span>
<a name="l00846"></a>00846                 <span class="keywordtype">void</span>  sonarSimulator(
<a name="l00847"></a>00847                                 <a class="code" href="classmrpt_1_1slam_1_1_c_observation_range.html" title="Declares a class derived from &quot;CObservation&quot; that encapsules a single range measurement, and associated parameters.">CObservationRange</a>               &amp;inout_observation,
<a name="l00848"></a>00848                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>                           &amp;robotPose,
<a name="l00849"></a>00849                                 <span class="keywordtype">float</span>                                           threshold = 0.5f,
<a name="l00850"></a>00850                                 <span class="keywordtype">float</span>                                           rangeNoiseStd = 0,
<a name="l00851"></a>00851                                 <span class="keywordtype">float</span>                                           angleNoiseStd = <a class="code" href="namespacemrpt_1_1utils.html#a186dc19748953878f7be5e9b0c345dfd" title="Degrees to radians.">DEG2RAD</a>(0) ) <span class="keyword">const</span>;
<a name="l00852"></a>00852 <span class="comment"></span>
<a name="l00853"></a>00853 <span class="comment">                /** Simulate just one &quot;ray&quot; in the grid map. This method is used internally to sonarSimulator and laserScanSimulator.</span>
<a name="l00854"></a>00854 <span class="comment">                  */</span>
<a name="l00855"></a>00855                 <span class="keyword">inline</span> <span class="keywordtype">void</span> simulateScanRay(
<a name="l00856"></a>00856                         <span class="keyword">const</span> <span class="keywordtype">double</span> x,<span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<span class="keyword">const</span> <span class="keywordtype">double</span> angle_direction,
<a name="l00857"></a>00857                         <span class="keywordtype">float</span> &amp;out_range,<span class="keywordtype">bool</span> &amp;out_valid,
<a name="l00858"></a>00858                         <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> max_ray_len,
<a name="l00859"></a>00859                         <span class="keyword">const</span> <span class="keywordtype">float</span> threshold_free=0.5f,
<a name="l00860"></a>00860                         <span class="keyword">const</span> <span class="keywordtype">double</span> noiseStd=0, <span class="keyword">const</span> <span class="keywordtype">double</span> angleNoiseStd=0 ) <span class="keyword">const</span>;
<a name="l00861"></a>00861 
<a name="l00862"></a>00862 <span class="comment"></span>
<a name="l00863"></a>00863 <span class="comment">                /** @} */</span>
<a name="l00864"></a>00864 <span class="comment"></span>
<a name="l00865"></a>00865 <span class="comment">                /** Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.</span>
<a name="l00866"></a>00866 <span class="comment">                 *  See &quot;likelihoodOptions&quot; for configuration parameters.</span>
<a name="l00867"></a>00867 <span class="comment">                 *</span>
<a name="l00868"></a>00868 <span class="comment">                 * \param takenFrom The robot&#39;s pose the observation is supposed to be taken from.</span>
<a name="l00869"></a>00869 <span class="comment">                 * \param obs The observation.</span>
<a name="l00870"></a>00870 <span class="comment">                 * \return This method returns a likelihood in the range [0,1].</span>
<a name="l00871"></a>00871 <span class="comment">                 *</span>
<a name="l00872"></a>00872 <span class="comment">                 * Used in particle filter algorithms, see: CMultiMetricMapPDF::prediction_and_update</span>
<a name="l00873"></a>00873 <span class="comment">                 *</span>
<a name="l00874"></a>00874 <span class="comment">                 * \sa likelihoodOptions, likelihoodOutputs</span>
<a name="l00875"></a>00875 <span class="comment">                 */</span>
<a name="l00876"></a>00876                 <span class="keywordtype">double</span>   computeObservationLikelihood( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a> *obs, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d.html" title="A class used to store a 3D pose (a 3D translation + a rotation in 3D).">CPose3D</a> &amp;takenFrom );
<a name="l00877"></a>00877 <span class="comment"></span>
<a name="l00878"></a>00878 <span class="comment">                /** Returns true if this map is able to compute a sensible likelihood function for this observation (i.e. an occupancy grid map cannot with an image).</span>
<a name="l00879"></a>00879 <span class="comment">                 * \param obs The observation.</span>
<a name="l00880"></a>00880 <span class="comment">                 * \sa computeObservationLikelihood</span>
<a name="l00881"></a>00881 <span class="comment">                 */</span>
<a name="l00882"></a>00882                 <span class="keywordtype">bool</span> canComputeObservationLikelihood( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a> *obs );
<a name="l00883"></a>00883 <span class="comment"></span>
<a name="l00884"></a>00884 <span class="comment">                /** Computes the likelihood [0,1] of a set of points, given the current grid map as reference.</span>
<a name="l00885"></a>00885 <span class="comment">                  * \param pm The points map</span>
<a name="l00886"></a>00886 <span class="comment">                  * \param relativePose The relative pose of the points map in this map&#39;s coordinates, or NULL for (0,0,0).</span>
<a name="l00887"></a>00887 <span class="comment">                  *  See &quot;likelihoodOptions&quot; for configuration parameters.</span>
<a name="l00888"></a>00888 <span class="comment">                  */</span>
<a name="l00889"></a>00889                 <span class="keywordtype">double</span>   computeLikelihoodField_Thrun( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html" title="A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...">CPointsMap</a> *pm, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a> *relativePose = NULL);
<a name="l00890"></a>00890 <span class="comment"></span>
<a name="l00891"></a>00891 <span class="comment">                /** Computes the likelihood [0,1] of a set of points, given the current grid map as reference.</span>
<a name="l00892"></a>00892 <span class="comment">                  * \param pm The points map</span>
<a name="l00893"></a>00893 <span class="comment">                  * \param relativePose The relative pose of the points map in this map&#39;s coordinates, or NULL for (0,0,0).</span>
<a name="l00894"></a>00894 <span class="comment">                  *  See &quot;likelihoodOptions&quot; for configuration parameters.</span>
<a name="l00895"></a>00895 <span class="comment">                  */</span>
<a name="l00896"></a>00896                 <span class="keywordtype">double</span>   computeLikelihoodField_II( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html" title="A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors...">CPointsMap</a>    *pm, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a> *relativePose = NULL);
<a name="l00897"></a>00897 <span class="comment"></span>
<a name="l00898"></a>00898 <span class="comment">                /** Saves the gridmap as a graphical file (BMP,PNG,...).</span>
<a name="l00899"></a>00899 <span class="comment">                 * The format will be derived from the file extension (see  CImage::saveToFile )</span>
<a name="l00900"></a>00900 <span class="comment">                 * \return False on any error.</span>
<a name="l00901"></a>00901 <span class="comment">                 */</span>
<a name="l00902"></a>00902                 <span class="keywordtype">bool</span>  saveAsBitmapFile(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;file) <span class="keyword">const</span>;
<a name="l00903"></a>00903 <span class="comment"></span>
<a name="l00904"></a>00904 <span class="comment">                /** Saves a composite image with two gridmaps and lines representing a set of correspondences between them.</span>
<a name="l00905"></a>00905 <span class="comment">                 * \sa saveAsEMFTwoMapsWithCorrespondences</span>
<a name="l00906"></a>00906 <span class="comment">                 * \return False on any error.</span>
<a name="l00907"></a>00907 <span class="comment">                 */</span>
<a name="l00908"></a>00908                 <span class="keyword">static</span> <span class="keywordtype">bool</span>  saveAsBitmapTwoMapsWithCorrespondences(
<a name="l00909"></a>00909                         <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>                                               &amp;fileName,
<a name="l00910"></a>00910                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a>                               *m1,
<a name="l00911"></a>00911                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a>                               *m2,
<a name="l00912"></a>00912                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_t_matching_pair_list.html" title="A list of TMatchingPair.">TMatchingPairList</a>         &amp;corrs);
<a name="l00913"></a>00913 <span class="comment"></span>
<a name="l00914"></a>00914 <span class="comment">                /** Saves a composite image with two gridmaps and numbers for the correspondences between them.</span>
<a name="l00915"></a>00915 <span class="comment">                 * \sa saveAsBitmapTwoMapsWithCorrespondences</span>
<a name="l00916"></a>00916 <span class="comment">                 * \return False on any error.</span>
<a name="l00917"></a>00917 <span class="comment">                 */</span>
<a name="l00918"></a>00918                 <span class="keyword">static</span> <span class="keywordtype">bool</span>  saveAsEMFTwoMapsWithCorrespondences(
<a name="l00919"></a>00919                         <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>                                               &amp;fileName,
<a name="l00920"></a>00920                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a>                               *m1,
<a name="l00921"></a>00921                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html" title="A class for storing an occupancy grid map.">COccupancyGridMap2D</a>                               *m2,
<a name="l00922"></a>00922                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_t_matching_pair_list.html" title="A list of TMatchingPair.">TMatchingPairList</a>         &amp;corrs);
<a name="l00923"></a>00923 <span class="comment"></span>
<a name="l00924"></a>00924 <span class="comment">                /** Saves the gridmap as a graphical bitmap file, 8 bit gray scale, 1 pixel is 1 cell, and with an overlay of landmarks.</span>
<a name="l00925"></a>00925 <span class="comment">                 * \note The template parameter CLANDMARKSMAP is assumed to be mrpt::slam::CLandmarksMap normally.</span>
<a name="l00926"></a>00926 <span class="comment">                 * \return False on any error.</span>
<a name="l00927"></a>00927 <span class="comment">                 */</span>
<a name="l00928"></a>00928                 <span class="keyword">template</span> &lt;<span class="keyword">class</span> CLANDMARKSMAP&gt;
<a name="l00929"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#ad77412cb0cf67e6dbea85c132892bac5">00929</a>                 <span class="keywordtype">bool</span>  saveAsBitmapFileWithLandmarks(
<a name="l00930"></a>00930                         <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>       &amp;file,
<a name="l00931"></a>00931                         <span class="keyword">const</span> CLANDMARKSMAP *landmarks,
<a name="l00932"></a>00932                         <span class="keywordtype">bool</span>  addTextLabels = <span class="keyword">false</span>,
<a name="l00933"></a>00933                         <span class="keyword">const</span> <a class="code" href="structmrpt_1_1utils_1_1_t_color.html" title="A RGB color - 8bit.">mrpt::utils::TColor</a> &amp;marks_color = <a class="code" href="structmrpt_1_1utils_1_1_t_color.html" title="A RGB color - 8bit.">mrpt::utils::TColor</a>(0,0,255) )<span class="keyword"> const</span>
<a name="l00934"></a>00934 <span class="keyword">                </span>{
<a name="l00935"></a>00935                         <a class="code" href="mrpt__macros_8h.html#a45b840af519f33816311acdbb28d7c10">MRPT_START</a>
<a name="l00936"></a>00936                         <a class="code" href="classmrpt_1_1utils_1_1_c_image.html" title="A class for storing images as grayscale or RGB bitmaps.">CImage</a>          img(1,1,3);
<a name="l00937"></a>00937                         getAsImageFiltered( img, <span class="keyword">false</span>,  <span class="keyword">true</span> ); <span class="comment">// in RGB</span>
<a name="l00938"></a>00938                         <span class="keyword">const</span> <span class="keywordtype">bool</span> topleft = img.isOriginTopLeft();
<a name="l00939"></a>00939                         <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0;i&lt;landmarks-&gt;landmarks.size();i++)
<a name="l00940"></a>00940                         {
<a name="l00941"></a>00941                                 <span class="keyword">const</span> <span class="keyword">typename</span> CLANDMARKSMAP::landmark_type *lm = landmarks-&gt;landmarks.get( i );
<a name="l00942"></a>00942                                 <span class="keywordtype">int</span>             px = x2idx( lm-&gt;pose_mean.x );
<a name="l00943"></a>00943                                 <span class="keywordtype">int</span>             py = topleft ?  size_y-1- y2idx( lm-&gt;pose_mean.y ) : y2idx( lm-&gt;pose_mean.y );
<a name="l00944"></a>00944                                 img.rectangle(  px - 7, (py + 7), px +7, (py -7), marks_color );
<a name="l00945"></a>00945                                 img.rectangle(  px - 6, (py + 6), px +6, (py -6), marks_color );
<a name="l00946"></a>00946                                 <span class="keywordflow">if</span> (addTextLabels)
<a name="l00947"></a>00947                                         img.textOut(px,py-8,<a class="code" href="namespacemrpt.html#a3a27af794b658df5491e2b7678f8ccb8" title="A std::string version of C sprintf.">format</a>(<span class="stringliteral">&quot;%u&quot;</span>,i), <a class="code" href="structmrpt_1_1utils_1_1_t_color.html#ae112ea044360e8bbee5b2553a79240e8" title="Predefined colors.">TColor::black</a>);
<a name="l00948"></a>00948                         }
<a name="l00949"></a>00949                         <span class="keywordflow">return</span> img.saveToFile(file.c_str() );
<a name="l00950"></a>00950                         <a class="code" href="mrpt__macros_8h.html#a88a917260793b56abd83ad2a0d849eb1">MRPT_END</a>
<a name="l00951"></a>00951                 }
<a name="l00952"></a>00952 
<a name="l00953"></a>00953 <span class="comment"></span>
<a name="l00954"></a>00954 <span class="comment">                /** Returns the grid as a 8-bit graylevel image, where each pixel is a cell (output image is RGB only if forceRGB is true)</span>
<a name="l00955"></a>00955 <span class="comment">                  *  If &quot;tricolor&quot; is true, only three gray levels will appear in the image: gray for unobserved cells, and black/white for occupied/empty cells respectively.</span>
<a name="l00956"></a>00956 <span class="comment">                  * \sa getAsImageFiltered</span>
<a name="l00957"></a>00957 <span class="comment">                  */</span>
<a name="l00958"></a>00958                 <span class="keywordtype">void</span>  getAsImage( <a class="code" href="classmrpt_1_1utils_1_1_c_image.html" title="A class for storing images as grayscale or RGB bitmaps.">utils::CImage</a> &amp;img, <span class="keywordtype">bool</span> verticalFlip = <span class="keyword">false</span>, <span class="keywordtype">bool</span> forceRGB=<span class="keyword">false</span>, <span class="keywordtype">bool</span> tricolor = <span class="keyword">false</span>) <span class="keyword">const</span>;
<a name="l00959"></a>00959 <span class="comment"></span>
<a name="l00960"></a>00960 <span class="comment">                /** Returns the grid as a 8-bit graylevel image, where each pixel is a cell (output image is RGB only if forceRGB is true) - This method filters the image for easy feature detection</span>
<a name="l00961"></a>00961 <span class="comment">                  *  If &quot;tricolor&quot; is true, only three gray levels will appear in the image: gray for unobserved cells, and black/white for occupied/empty cells respectively.</span>
<a name="l00962"></a>00962 <span class="comment">                  * \sa getAsImage</span>
<a name="l00963"></a>00963 <span class="comment">                  */</span>
<a name="l00964"></a>00964                 <span class="keywordtype">void</span>  getAsImageFiltered( <a class="code" href="classmrpt_1_1utils_1_1_c_image.html" title="A class for storing images as grayscale or RGB bitmaps.">utils::CImage</a> &amp;img, <span class="keywordtype">bool</span> verticalFlip = <span class="keyword">false</span>, <span class="keywordtype">bool</span> forceRGB=<span class="keyword">false</span>) <span class="keyword">const</span>;
<a name="l00965"></a>00965 <span class="comment"></span>
<a name="l00966"></a>00966 <span class="comment">                /** Returns a 3D plane with its texture being the occupancy grid and transparency proportional to &quot;uncertainty&quot; (i.e. a value of 0.5 is fully transparent)</span>
<a name="l00967"></a>00967 <span class="comment">                  */</span>
<a name="l00968"></a>00968                 <span class="keywordtype">void</span>  getAs3DObject ( <a class="code" href="structmrpt_1_1opengl_1_1_c_set_of_objects_ptr.html">mrpt::opengl::CSetOfObjectsPtr</a>    &amp;outObj ) <span class="keyword">const</span>;
<a name="l00969"></a>00969 <span class="comment"></span>
<a name="l00970"></a>00970 <span class="comment">                /** Returns true upon map construction or after calling clear(), the return</span>
<a name="l00971"></a>00971 <span class="comment">                  *  changes to false upon successful insertObservation() or any other method to load data in the map.</span>
<a name="l00972"></a>00972 <span class="comment">                  */</span>
<a name="l00973"></a>00973                 <span class="keywordtype">bool</span>  isEmpty() <span class="keyword">const</span>;
<a name="l00974"></a>00974 <span class="comment"></span>
<a name="l00975"></a>00975 <span class="comment">                /** Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile).</span>
<a name="l00976"></a>00976 <span class="comment">                 * \param file The file to be loaded.</span>
<a name="l00977"></a>00977 <span class="comment">                 * \param resolution The size of a pixel (cell), in meters. Recall cells are always squared, so just a dimension is needed.</span>
<a name="l00978"></a>00978 <span class="comment">                 * \param xCentralPixel The &quot;x&quot; coordinate (0=first) for the pixel which will be taken at coordinates origin (0,0). If not supplied, it will be used the middle of the map.</span>
<a name="l00979"></a>00979 <span class="comment">                 * \param yCentralPixel The &quot;y&quot; coordinate (0=first) for the pixel which will be taken at coordinates origin (0,0). If not supplied, it will be used the middle of the map.</span>
<a name="l00980"></a>00980 <span class="comment">                 * \return False on any error.</span>
<a name="l00981"></a>00981 <span class="comment">                 * \sa loadFromBitmap</span>
<a name="l00982"></a>00982 <span class="comment">                 */</span>
<a name="l00983"></a>00983                 <span class="keywordtype">bool</span>  loadFromBitmapFile(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>      &amp;file, <span class="keywordtype">float</span> resolution, <span class="keywordtype">float</span> xCentralPixel = -1, <span class="keywordtype">float</span> yCentralPixel =-1 );
<a name="l00984"></a>00984 <span class="comment"></span>
<a name="l00985"></a>00985 <span class="comment">                /** Load the gridmap from a image in a file (the format can be any supported by CImage::loadFromFile).</span>
<a name="l00986"></a>00986 <span class="comment">                 * \param img The image. Only a grayscale image will be used, so RGB components will be mixed if a color image is passed.</span>
<a name="l00987"></a>00987 <span class="comment">                 * \param resolution The size of a pixel (cell), in meters. Recall cells are always squared, so just a dimension is needed.</span>
<a name="l00988"></a>00988 <span class="comment">                 * \param xCentralPixel The &quot;x&quot; coordinate (0=first) for the pixel which will be taken at coordinates origin (0,0). If not supplied, it will be used the middle of the map.</span>
<a name="l00989"></a>00989 <span class="comment">                 * \param yCentralPixel The &quot;y&quot; coordinate (0=first) for the pixel which will be taken at coordinates origin (0,0). If not supplied, it will be used the middle of the map.</span>
<a name="l00990"></a>00990 <span class="comment">                 * \return False on any error.</span>
<a name="l00991"></a>00991 <span class="comment">                 * \sa loadFromBitmapFile</span>
<a name="l00992"></a>00992 <span class="comment">                 */</span>
<a name="l00993"></a>00993                 <span class="keywordtype">bool</span>  loadFromBitmap(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_c_image.html" title="A class for storing images as grayscale or RGB bitmaps.">mrpt::utils::CImage</a> &amp;img, <span class="keywordtype">float</span> resolution, <span class="keywordtype">float</span> xCentralPixel = -1, <span class="keywordtype">float</span> yCentralPixel =-1 );
<a name="l00994"></a>00994 <span class="comment"></span>
<a name="l00995"></a>00995 <span class="comment">                /** See the base class for more details: In this class it is implemented as correspondences of the passed points map to occupied cells.</span>
<a name="l00996"></a>00996 <span class="comment">                 * NOTICE: That the &quot;z&quot; dimension is ignored in the points. Clip the points as appropiated if needed before calling this method.</span>
<a name="l00997"></a>00997 <span class="comment">                 *</span>
<a name="l00998"></a>00998 <span class="comment">                 * \sa computeMatching3DWith</span>
<a name="l00999"></a>00999 <span class="comment">                 */</span>
<a name="l01000"></a>01000                 <span class="keywordtype">void</span>  computeMatchingWith2D(
<a name="l01001"></a>01001                                 <span class="keyword">const</span> CMetricMap     *otherMap,
<a name="l01002"></a>01002                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>        &amp;otherMapPose,
<a name="l01003"></a>01003                                 <span class="keywordtype">float</span>                maxDistForCorrespondence,
<a name="l01004"></a>01004                                 <span class="keywordtype">float</span>                maxAngularDistForCorrespondence,
<a name="l01005"></a>01005                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>        &amp;angularDistPivotPoint,
<a name="l01006"></a>01006                                 <a class="code" href="classmrpt_1_1utils_1_1_t_matching_pair_list.html" title="A list of TMatchingPair.">TMatchingPairList</a>    &amp;correspondences,
<a name="l01007"></a>01007                                 <span class="keywordtype">float</span>                &amp;correspondencesRatio,
<a name="l01008"></a>01008                                 <span class="keywordtype">float</span>                *sumSqrDist        = NULL,
<a name="l01009"></a>01009                                 <span class="keywordtype">bool</span>                  onlyKeepTheClosest = <span class="keyword">false</span>,
<a name="l01010"></a>01010                                 <span class="keywordtype">bool</span>                  onlyUniqueRobust = <span class="keyword">false</span>,
<a name="l01011"></a>01011                                 <span class="keyword">const</span> <span class="keywordtype">size_t</span>          decimation_other_map_points = 1,
<a name="l01012"></a>01012                                 <span class="keyword">const</span> <span class="keywordtype">size_t</span>          offset_other_map_points = 0 ) <span class="keyword">const</span>;
<a name="l01013"></a>01013 
<a name="l01014"></a>01014 <span class="comment"></span>
<a name="l01015"></a>01015 <span class="comment">                /** Computes the ratio in [0,1] of correspondences between &quot;this&quot; and the &quot;otherMap&quot; map, whose 6D pose relative to &quot;this&quot; is &quot;otherMapPose&quot;</span>
<a name="l01016"></a>01016 <span class="comment">                 *   In the case of a multi-metric map, this returns the average between the maps. This method always return 0 for grid maps.</span>
<a name="l01017"></a>01017 <span class="comment">                 * \param  otherMap                                       [IN] The other map to compute the matching with.</span>
<a name="l01018"></a>01018 <span class="comment">                 * \param  otherMapPose                           [IN] The 6D pose of the other map as seen from &quot;this&quot;.</span>
<a name="l01019"></a>01019 <span class="comment">                 * \param  minDistForCorr                         [IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence.</span>
<a name="l01020"></a>01020 <span class="comment">                 * \param  minMahaDistForCorr             [IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence.</span>
<a name="l01021"></a>01021 <span class="comment">                 *</span>
<a name="l01022"></a>01022 <span class="comment">                 * \return The matching ratio [0,1]</span>
<a name="l01023"></a>01023 <span class="comment">                 * \sa computeMatchingWith2D</span>
<a name="l01024"></a>01024 <span class="comment">                 */</span>
<a name="l01025"></a>01025                 <span class="keywordtype">float</span>  compute3DMatchingRatio(
<a name="l01026"></a>01026                                 <span class="keyword">const</span> CMetricMap                                                *otherMap,
<a name="l01027"></a>01027                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d.html" title="A class used to store a 3D pose (a 3D translation + a rotation in 3D).">CPose3D</a>                                                   &amp;otherMapPose,
<a name="l01028"></a>01028                                 <span class="keywordtype">float</span>                                                                   minDistForCorr = 0.10f,
<a name="l01029"></a>01029                                 <span class="keywordtype">float</span>                                                                   minMahaDistForCorr = 2.0f
<a name="l01030"></a>01030                                 ) <span class="keyword">const</span>;
<a name="l01031"></a>01031 <span class="comment"></span>
<a name="l01032"></a>01032 <span class="comment">                /** This virtual method saves the map to a file &quot;filNamePrefix&quot;+&lt; some_file_extension &gt;, as an image or in any other applicable way (Notice that other methods to save the map may be implemented in classes implementing this virtual interface).</span>
<a name="l01033"></a>01033 <span class="comment">                  */</span>
<a name="l01034"></a>01034                 <span class="keywordtype">void</span>  saveMetricMapRepresentationToFile(
<a name="l01035"></a>01035                         <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>       &amp;filNamePrefix
<a name="l01036"></a>01036                         ) <span class="keyword">const</span>;
<a name="l01037"></a>01037 <span class="comment"></span>
<a name="l01038"></a>01038 <span class="comment">                /** The structure used to store the set of Voronoi diagram</span>
<a name="l01039"></a>01039 <span class="comment">                 *    critical points.</span>
<a name="l01040"></a>01040 <span class="comment">                 * \sa findCriticalPoints</span>
<a name="l01041"></a>01041 <span class="comment">                 */</span>
<a name="l01042"></a>01042                 <span class="keyword">struct </span><a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> TCriticalPointsList
<a name="l01043"></a>01043                 {
<a name="l01044"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_critical_points_list.html#af4e1aa32cf5f271f44a19849e957d45e">01044</a>                         <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_critical_points_list.html" title="The structure used to store the set of Voronoi diagram critical points.">TCriticalPointsList</a>() : x(),<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>(),clearance(),x_basis1(),y_basis1(),x_basis2(),y_basis2()
<a name="l01045"></a>01045                         {}
<a name="l01046"></a>01046 <span class="comment"></span>
<a name="l01047"></a>01047 <span class="comment">                        /** The coordinates of critical point.</span>
<a name="l01048"></a>01048 <span class="comment">                         */</span>
<a name="l01049"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_critical_points_list.html#aa4396a587461a319754bdbd0668af4b5">01049</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;int&gt;</a>       x,<a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_critical_points_list.html#aa4396a587461a319754bdbd0668af4b5">y</a>;<span class="comment"></span>
<a name="l01050"></a>01050 <span class="comment">                        /** The clearance of critical points, in 1/100 of cells.</span>
<a name="l01051"></a>01051 <span class="comment">                         */</span>
<a name="l01052"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_critical_points_list.html#a28211f3077ca927d532c2bacd5762bab">01052</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;int&gt;</a>       <a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_critical_points_list.html#a28211f3077ca927d532c2bacd5762bab" title="The clearance of critical points, in 1/100 of cells.">clearance</a>;<span class="comment"></span>
<a name="l01053"></a>01053 <span class="comment">                        /** Their two first basis points coordinates.</span>
<a name="l01054"></a>01054 <span class="comment">                         */</span>
<a name="l01055"></a><a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_critical_points_list.html#a4aca30def3244e1084ef3598f5366572">01055</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;int&gt;</a>       x_basis1,y_basis1, x_basis2,<a class="code" href="structmrpt_1_1slam_1_1_c_occupancy_grid_map2_d_1_1_t_critical_points_list.html#a4aca30def3244e1084ef3598f5366572">y_basis2</a>;
<a name="l01056"></a>01056                 } CriticalPointsList;
<a name="l01057"></a>01057 
<a name="l01058"></a>01058 
<a name="l01059"></a>01059         <span class="keyword">private</span>:<span class="comment"></span>
<a name="l01060"></a>01060 <span class="comment">                /** Returns a byte with the occupancy of the 8 sorrounding cells.</span>
<a name="l01061"></a>01061 <span class="comment">                 * \param cx The cell index</span>
<a name="l01062"></a>01062 <span class="comment">                 * \param cy The cell index</span>
<a name="l01063"></a>01063 <span class="comment">                 * \sa direction2idx</span>
<a name="l01064"></a>01064 <span class="comment">                 */</span>
<a name="l01065"></a>01065                 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>  GetNeighborhood( <span class="keywordtype">int</span> cx, <span class="keywordtype">int</span> cy ) <span class="keyword">const</span>;
<a name="l01066"></a>01066 <span class="comment"></span>
<a name="l01067"></a>01067 <span class="comment">                /** Used to store the 8 possible movements from a cell to the</span>
<a name="l01068"></a>01068 <span class="comment">                 *   sorrounding ones.Filled in the constructor.</span>
<a name="l01069"></a>01069 <span class="comment">                 * \sa direction2idx</span>
<a name="l01070"></a>01070 <span class="comment">                 */</span>
<a name="l01071"></a><a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a677d53e00fc6f4c862c2a8452b80f7c8">01071</a>                 <span class="keywordtype">int</span>     direccion_vecino_x[8],direccion_vecino_y[8];
<a name="l01072"></a>01072 <span class="comment"></span>
<a name="l01073"></a>01073 <span class="comment">                /** Returns the index [0,7] of the given movement, or</span>
<a name="l01074"></a>01074 <span class="comment">                 *  -1 if invalid one.</span>
<a name="l01075"></a>01075 <span class="comment">                 * \sa direccion_vecino_x,direccion_vecino_y,GetNeighborhood</span>
<a name="l01076"></a>01076 <span class="comment">                 */</span>
<a name="l01077"></a>01077                 <span class="keywordtype">int</span>  direction2idx(<span class="keywordtype">int</span> dx, <span class="keywordtype">int</span> dy);
<a name="l01078"></a>01078         };
<a name="l01079"></a>01079 
<a name="l01080"></a>01080 
<a name="l01081"></a>01081         <span class="keywordtype">bool</span> <a class="code" href="namespacemrpt_1_1slam.html#a74b2946c38c77689d5ad4c41ebda2715">operator &lt;</a>(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a5d65008293a7029cf0f615ca9d187787" title="Auxiliary private class.">COccupancyGridMap2D::TPairLikelihoodIndex</a> &amp;e1, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_occupancy_grid_map2_d.html#a5d65008293a7029cf0f615ca9d187787" title="Auxiliary private class.">COccupancyGridMap2D::TPairLikelihoodIndex</a> &amp;e2);
<a name="l01082"></a>01082 
<a name="l01083"></a>01083         } <span class="comment">// End of namespace</span>
<a name="l01084"></a>01084 } <span class="comment">// End of namespace</span>
<a name="l01085"></a>01085 
<a name="l01086"></a>01086 <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>