Sophie

Sophie

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

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>CPointsMap.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">CPointsMap.h</div>  </div>
</div>
<div class="contents">
<a href="_c_points_map_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 <span class="preprocessor">#ifndef CPOINTSMAP_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define CPOINTSMAP_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;<a class="code" href="_c_metric_map_8h.html">mrpt/slam/CMetricMap.h</a>&gt;</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_matrix_8h.html">mrpt/math/CMatrix.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="_c_loadable_options_8h.html">mrpt/utils/CLoadableOptions.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="safe__pointers_8h.html">mrpt/utils/safe_pointers.h</a>&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="_k_d_tree_capable_8h.html">mrpt/math/KDTreeCapable.h</a>&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="_c_sin_cos_look_up_table_for2_d_scans_8h.html">mrpt/slam/CSinCosLookUpTableFor2DScans.h</a>&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;<a class="code" href="_c_point2_d_8h.html">mrpt/poses/CPoint2D.h</a>&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;<a class="code" href="lightweight__geom__data_8h.html">mrpt/math/lightweight_geom_data.h</a>&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;<a class="code" href="_p_l_y__import__export_8h.html">mrpt/utils/PLY_import_export.h</a>&gt;</span>
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <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="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="keyword">namespace </span>mrpt
<a name="l00045"></a>00045 {<span class="comment"></span>
<a name="l00046"></a>00046 <span class="comment">/** \ingroup mrpt_maps_grp */</span>
<a name="l00047"></a>00047 <span class="keyword">namespace </span>slam
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049         <span class="comment">// Fordward declarations:</span>
<a name="l00050"></a>00050         <span class="keyword">class </span>CSimplePointsMap;
<a name="l00051"></a>00051         <span class="keyword">class </span>CObservation2DRangeScan;
<a name="l00052"></a>00052         <span class="keyword">class </span>CObservation3DRangeScan;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054         <span class="keyword">using namespace </span>mrpt::poses;
<a name="l00055"></a>00055         <span class="keyword">using namespace </span>mrpt::math;
<a name="l00056"></a>00056 
<a name="l00057"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_ptr.html#a697fb3b0660dec8f24ba21df43b3f186">00057</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_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> , <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="l00058"></a>00058 
<a name="l00059"></a>00059         <span class="comment">// Forward decls. needed to make its static methods friends of CPointsMap</span>
<a name="l00060"></a>00060         namespace detail {
<a name="l00061"></a>00061                 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Derived&gt; <span class="keyword">struct </span>loadFromRangeImpl;
<a name="l00062"></a>00062                 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Derived&gt; <span class="keyword">struct </span>pointmap_traits;
<a name="l00063"></a>00063         }
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">        /** A cloud of points in 2D or 3D, which can be built from a sequence of laser scans or other sensors.</span>
<a name="l00067"></a>00067 <span class="comment">         *  This is a virtual class, thus only a derived class can be instantiated by the user. The user most usually wants to use CSimplePointsMap.</span>
<a name="l00068"></a>00068 <span class="comment">         *</span>
<a name="l00069"></a>00069 <span class="comment">         *  This class implements generic version of mrpt::slam::CMetric::insertObservation() accepting these types of sensory data:</span>
<a name="l00070"></a>00070 <span class="comment">         *              - mrpt::slam::CObservation2DRangeScan: 2D range scans</span>
<a name="l00071"></a>00071 <span class="comment">         *              - mrpt::slam::CObservation3DRangeScan: 3D range scans (Kinect, etc...)</span>
<a name="l00072"></a>00072 <span class="comment">         *              - mrpt::slam::CObservationRange: IRs, Sonars, etc.</span>
<a name="l00073"></a>00073 <span class="comment">         *</span>
<a name="l00074"></a>00074 <span class="comment">         * \sa CMetricMap, CPoint, mrpt::utils::CSerializable</span>
<a name="l00075"></a>00075 <span class="comment">          * \ingroup mrpt_maps_grp</span>
<a name="l00076"></a>00076 <span class="comment">         */</span>
<a name="l00077"></a>00077         <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_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> :
<a name="l00078"></a>00078                 <span class="keyword">public</span> <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="l00079"></a>00079                 <span class="keyword">public</span> mrpt::utils::<a class="code" href="classmrpt_1_1math_1_1_k_d_tree_capable.html" title="A generic adaptor class for providing Approximate Nearest Neighbors (ANN) (via the nanoflann library)...">KDTreeCapable</a>&lt;CPointsMap&gt;,
<a name="l00080"></a>00080                 <span class="keyword">public</span> mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_p_l_y___importer.html" title="A virtual base class that implements the capability of importing 3D point clouds and faces from a fil...">PLY_Importer</a>,
<a name="l00081"></a>00081                 <span class="keyword">public</span> mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_p_l_y___exporter.html" title="A virtual base class that implements the capability of exporting 3D point clouds and faces to a file ...">PLY_Exporter</a>
<a name="l00082"></a>00082         {
<a name="l00083"></a>00083                 <span class="comment">// This must be added to any CSerializable derived class:</span>
<a name="l00084"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a6fec28a53e20dfc1c4d046c26f9f7b48">00084</a>                 <a class="code" href="_c_serializable_8h.html#a5876f72cf51bfb66a82bf81cc493febc" title="This declaration must be inserted in virtual CSerializable classes definition:">DEFINE_VIRTUAL_SERIALIZABLE</a>( <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> )
<a name="l00085"></a>00085 
<a name="l00086"></a>00086         protected:<span class="comment"></span>
<a name="l00087"></a>00087 <span class="comment">                /** Helper struct used for \a internal_loadFromRangeScan2D_prepareOneRange() */</span>
<a name="l00088"></a>00088                 struct <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_points_map_1_1_t_laser_range2_d_insert_context.html" title="Helper struct used for internal_loadFromRangeScan2D_prepareOneRange() ">TLaserRange2DInsertContext</a> {
<a name="l00089"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a430857981311bbfb3bdbeecbe2b6b17c">00089</a>                         TLaserRange2DInsertContext(<span class="keyword">const</span> <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;_rangeScan) : HM(<a class="code" href="namespacemrpt_1_1math.html#a27e8ae8971ff5aa1c39f1f9be334d73aa28acc66160006cb691487ec89f8d266d">UNINITIALIZED_MATRIX</a>), rangeScan(_rangeScan)
<a name="l00090"></a>00090                         { }
<a name="l00091"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a170a2c7dfc0711e20b60bc2c85812208">00091</a>                         <a class="code" href="classmrpt_1_1math_1_1_c_matrix_fixed_numeric.html">CMatrixDouble44</a> <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a170a2c7dfc0711e20b60bc2c85812208" title="Homog matrix of the local sensor pose within the robot.">HM</a>;  <span class="comment">//!&lt; Homog matrix of the local sensor pose within the robot</span>
<a name="l00092"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a7bf130dac5024d8ee6fbe37f259b8223">00092</a> <span class="comment"></span>                        <span class="keyword">const</span> <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;<a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a7bf130dac5024d8ee6fbe37f259b8223">rangeScan</a>;
<a name="l00093"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#aa927071deb4cf2f716047e2e9b8e7e82">00093</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a>         <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#aa927071deb4cf2f716047e2e9b8e7e82" title="Extra variables to be used as desired by the derived class.">fVars</a>;  <span class="comment">//!&lt; Extra variables to be used as desired by the derived class.</span>
<a name="l00094"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a62a347fd1cffb17bd98d9627fd727e73">00094</a> <span class="comment"></span>                        std<a class="code" href="classstd_1_1vector.html">::vector&lt;unsigned int&gt;</a>  <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a62a347fd1cffb17bd98d9627fd727e73">uVars</a>;
<a name="l00095"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a4d1a894c499d8a4045c446e264284f4c">00095</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;uint8_t&gt;</a>       <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range2_d_insert_context.html#a4d1a894c499d8a4045c446e264284f4c">bVars</a>;
<a name="l00096"></a>00096                 };
<a name="l00097"></a>00097 <span class="comment"></span>
<a name="l00098"></a>00098 <span class="comment">                /** Helper struct used for \a internal_loadFromRangeScan3D_prepareOneRange() */</span>
<a name="l00099"></a>00099                 <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_points_map_1_1_t_laser_range3_d_insert_context.html" title="Helper struct used for internal_loadFromRangeScan3D_prepareOneRange() ">TLaserRange3DInsertContext</a> {
<a name="l00100"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a1a01a65866e4fc0ab697bfe792da061c">00100</a>                         <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html" title="Helper struct used for internal_loadFromRangeScan3D_prepareOneRange() ">TLaserRange3DInsertContext</a>(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation3_d_range_scan.html" title="Declares a class derived from &quot;CObservation&quot; that encapsules a 3D range scan measurement (e...">CObservation3DRangeScan</a>  &amp;_rangeScan) : HM(<a class="code" href="namespacemrpt_1_1math.html#a27e8ae8971ff5aa1c39f1f9be334d73aa28acc66160006cb691487ec89f8d266d">UNINITIALIZED_MATRIX</a>), rangeScan(_rangeScan)
<a name="l00101"></a>00101                         { }
<a name="l00102"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a6ae364f7652a3a026f7fe8eaddaabdc2">00102</a>                         <a class="code" href="classmrpt_1_1math_1_1_c_matrix_fixed_numeric.html">CMatrixDouble44</a> <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a6ae364f7652a3a026f7fe8eaddaabdc2" title="Homog matrix of the local sensor pose within the robot.">HM</a>;  <span class="comment">//!&lt; Homog matrix of the local sensor pose within the robot</span>
<a name="l00103"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a744275a63dae4d389dde16f4ef2c8172">00103</a> <span class="comment"></span>                        <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation3_d_range_scan.html" title="Declares a class derived from &quot;CObservation&quot; that encapsules a 3D range scan measurement (e...">CObservation3DRangeScan</a>  &amp;<a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a744275a63dae4d389dde16f4ef2c8172">rangeScan</a>;
<a name="l00104"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a2b2e8bca96be19fe14b020462216e03c">00104</a>                         <span class="keywordtype">float</span> scan_x, scan_y,<a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a2b2e8bca96be19fe14b020462216e03c" title="In internal_loadFromRangeScan3D_prepareOneRange, these are the local coordinates of the scan points b...">scan_z</a>; <span class="comment">//!&lt; In \a internal_loadFromRangeScan3D_prepareOneRange, these are the local coordinates of the scan points being inserted right now.</span>
<a name="l00105"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a0d6fa25bd926188a5ed01ae26ffaa9c5">00105</a> <span class="comment"></span>                        std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a>         <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a0d6fa25bd926188a5ed01ae26ffaa9c5" title="Extra variables to be used as desired by the derived class.">fVars</a>;  <span class="comment">//!&lt; Extra variables to be used as desired by the derived class.</span>
<a name="l00106"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#aba975fa038f32a0a755e575782eba6ec">00106</a> <span class="comment"></span>                        std<a class="code" href="classstd_1_1vector.html">::vector&lt;unsigned int&gt;</a>  <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#aba975fa038f32a0a755e575782eba6ec">uVars</a>;
<a name="l00107"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a021ac1df2c8454b9a9495b253850b1e0">00107</a>                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;uint8_t&gt;</a>       <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_laser_range3_d_insert_context.html#a021ac1df2c8454b9a9495b253850b1e0">bVars</a>;
<a name="l00108"></a>00108                 };
<a name="l00109"></a>00109 
<a name="l00110"></a>00110          <span class="keyword">public</span>:
<a name="l00111"></a>00111                  <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>();            <span class="comment">//!&lt; Ctor</span>
<a name="l00112"></a>00112 <span class="comment"></span>                 <span class="keyword">virtual</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>();   <span class="comment">//!&lt; Virtual destructor.</span>
<a name="l00113"></a>00113 <span class="comment"></span>
<a name="l00114"></a>00114 
<a name="l00115"></a>00115                 <span class="comment">// --------------------------------------------</span><span class="comment"></span>
<a name="l00116"></a>00116 <span class="comment">                /** @name Pure virtual interfaces to be implemented by any class derived from CPointsMap</span>
<a name="l00117"></a>00117 <span class="comment">                    @{ */</span>
<a name="l00118"></a>00118 <span class="comment"></span>
<a name="l00119"></a>00119 <span class="comment">                /** Reserves memory for a given number of points: the size of the map does not change, it only reserves the memory.</span>
<a name="l00120"></a>00120 <span class="comment">                  *  This is useful for situations where it is approximately known the final size of the map. This method is more</span>
<a name="l00121"></a>00121 <span class="comment">                  *  efficient than constantly increasing the size of the buffers. Refer to the STL C++ library&#39;s &quot;reserve&quot; methods.</span>
<a name="l00122"></a>00122 <span class="comment">                  */</span>
<a name="l00123"></a>00123                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> reserve(<span class="keywordtype">size_t</span> newLength) = 0;
<a name="l00124"></a>00124 <span class="comment"></span>
<a name="l00125"></a>00125 <span class="comment">                /** Resizes all point buffers so they can hold the given number of points: newly created points are set to default values,</span>
<a name="l00126"></a>00126 <span class="comment">                  *  and old contents are not changed.</span>
<a name="l00127"></a>00127 <span class="comment">                  * \sa reserve, setPoint, setPointFast, setSize</span>
<a name="l00128"></a>00128 <span class="comment">                  */</span>
<a name="l00129"></a>00129                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> resize(<span class="keywordtype">size_t</span> newLength) = 0;
<a name="l00130"></a>00130 <span class="comment"></span>
<a name="l00131"></a>00131 <span class="comment">                /** Resizes all point buffers so they can hold the given number of points, *erasing* all previous contents</span>
<a name="l00132"></a>00132 <span class="comment">                  *  and leaving all points to default values.</span>
<a name="l00133"></a>00133 <span class="comment">                  * \sa reserve, setPoint, setPointFast, setSize</span>
<a name="l00134"></a>00134 <span class="comment">                  */</span>
<a name="l00135"></a>00135                 <span class="keyword">virtual</span> <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">size_t</span> newLength) = 0;
<a name="l00136"></a>00136 <span class="comment"></span>
<a name="l00137"></a>00137 <span class="comment">                /** Changes the coordinates of the given point (0-based index), *without* checking for out-of-bounds and *without* calling mark_as_modified()  \sa setPoint */</span>
<a name="l00138"></a>00138                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  setPointFast(<span class="keywordtype">size_t</span> index,<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> z)=0;
<a name="l00139"></a>00139 <span class="comment"></span>
<a name="l00140"></a>00140 <span class="comment">                /** The virtual method for \a insertPoint() *without* calling mark_as_modified()   */</span>
<a name="l00141"></a>00141                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  insertPointFast( <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> z = 0 ) = 0;
<a name="l00142"></a>00142 <span class="comment"></span>
<a name="l00143"></a>00143 <span class="comment">                 /** Virtual assignment operator, copies as much common data (XYZ, color,...) as possible from the source map into this one. */</span>
<a name="l00144"></a>00144                  <span class="keyword">virtual</span> <span class="keywordtype">void</span>  copyFrom(<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> &amp;obj) = 0;
<a name="l00145"></a>00145 <span class="comment"></span>
<a name="l00146"></a>00146 <span class="comment">                /** Get all the data fields for one point as a vector: depending on the implementation class this can be [X Y Z] or [X Y Z R G B], etc...</span>
<a name="l00147"></a>00147 <span class="comment">                  *  Unlike getPointAllFields(), this method does not check for index out of bounds</span>
<a name="l00148"></a>00148 <span class="comment">                  * \sa getPointAllFields, setPointAllFields, setPointAllFieldsFast</span>
<a name="l00149"></a>00149 <span class="comment">                  */</span>
<a name="l00150"></a>00150                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  getPointAllFieldsFast( <span class="keyword">const</span> <span class="keywordtype">size_t</span> index, <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp; point_data ) <span class="keyword">const</span> = 0;
<a name="l00151"></a>00151 <span class="comment"></span>
<a name="l00152"></a>00152 <span class="comment">                /** Set all the data fields for one point as a vector: depending on the implementation class this can be [X Y Z] or [X Y Z R G B], etc...</span>
<a name="l00153"></a>00153 <span class="comment">                  *  Unlike setPointAllFields(), this method does not check for index out of bounds</span>
<a name="l00154"></a>00154 <span class="comment">                  * \sa setPointAllFields, getPointAllFields, getPointAllFieldsFast</span>
<a name="l00155"></a>00155 <span class="comment">                  */</span>
<a name="l00156"></a>00156                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  setPointAllFieldsFast( <span class="keyword">const</span> <span class="keywordtype">size_t</span> index, <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp; point_data ) = 0;
<a name="l00157"></a>00157 
<a name="l00158"></a>00158         <span class="keyword">protected</span>:
<a name="l00159"></a>00159 <span class="comment"></span>
<a name="l00160"></a>00160 <span class="comment">                /** Auxiliary method called from within \a addFrom() automatically, to finish the copying of class-specific data  */</span>
<a name="l00161"></a>00161                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  addFrom_classSpecific(<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> &amp;anotherMap, <span class="keyword">const</span> <span class="keywordtype">size_t</span> nPreviousPoints) = 0;
<a name="l00162"></a>00162 
<a name="l00163"></a>00163         <span class="keyword">public</span>:
<a name="l00164"></a>00164 <span class="comment"></span>
<a name="l00165"></a>00165 <span class="comment">                /** @} */</span>
<a name="l00166"></a>00166                 <span class="comment">// --------------------------------------------</span>
<a name="l00167"></a>00167 
<a name="l00168"></a>00168 <span class="comment"></span>
<a name="l00169"></a>00169 <span class="comment">                /** Returns the square distance from the 2D point (x0,y0) to the closest correspondence in the map.</span>
<a name="l00170"></a>00170 <span class="comment">                  */</span>
<a name="l00171"></a>00171                 <span class="keyword">virtual</span> <span class="keywordtype">float</span> squareDistanceToClosestCorrespondence(
<a name="l00172"></a>00172                         <span class="keywordtype">float</span>   x0,
<a name="l00173"></a>00173                         <span class="keywordtype">float</span>   y0 ) <span class="keyword">const</span>;
<a name="l00174"></a>00174 
<a name="l00175"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ac367eb5a8720b1d09b7ae8e8f4bfb8bd">00175</a>                 <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ac367eb5a8720b1d09b7ae8e8f4bfb8bd">squareDistanceToClosestCorrespondenceT</a>(<span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point2_d.html" title="Lightweight 2D point.">TPoint2D</a> &amp;p0)<span class="keyword"> const   </span>{
<a name="l00176"></a>00176                         <span class="keywordflow">return</span> squareDistanceToClosestCorrespondence(static_cast&lt;float&gt;(p0.<a class="code" href="structmrpt_1_1math_1_1_t_point2_d.html#a084825c8b4d02df7b89d66f8b08e26f2" title="X coordinate.">x</a>),static_cast&lt;float&gt;(p0.<a class="code" href="structmrpt_1_1math_1_1_t_point2_d.html#a1b6b3c44215ec8285ae97ff1ad1f6fcf" title="Y coordinate.">y</a>));
<a name="l00177"></a>00177                 }
<a name="l00178"></a>00178 
<a name="l00179"></a>00179 <span class="comment"></span>
<a name="l00180"></a>00180 <span class="comment">                 /** With this struct options are provided to the observation insertion process.</span>
<a name="l00181"></a>00181 <span class="comment">                  * \sa CObservation::insertIntoPointsMap</span>
<a name="l00182"></a>00182 <span class="comment">                  */</span>
<a name="l00183"></a>00183                  <span class="keyword">struct </span><a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> TInsertionOptions : <span class="keyword">public</span> 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="l00184"></a>00184                  {<span class="comment"></span>
<a name="l00185"></a>00185 <span class="comment">                        /** Initilization of default parameters */</span>
<a name="l00186"></a>00186                         TInsertionOptions( );<span class="comment"></span>
<a name="l00187"></a>00187 <span class="comment">                        /** See utils::CLoadableOptions */</span>
<a name="l00188"></a>00188                         <span class="keywordtype">void</span>  loadFromConfigFile(<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,<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section);<span class="comment"></span>
<a name="l00189"></a>00189 <span class="comment">                        /** See utils::CLoadableOptions */</span>
<a name="l00190"></a>00190                         <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="l00191"></a>00191 
<a name="l00192"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#a000a3abe7e6f2913a06152861fa2187d">00192</a>                         <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#a000a3abe7e6f2913a06152861fa2187d" title="The minimum distance between points (in 3D): If two points are too close, one of them is not inserted...">minDistBetweenLaserPoints</a>;   <span class="comment">//!&lt; The minimum distance between points (in 3D): If two points are too close, one of them is not inserted into the map. Default is 0.02 meters.</span>
<a name="l00193"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#add327bb248876dd3e04c68ba3ce9b536">00193</a> <span class="comment"></span>                        <span class="keywordtype">bool</span>    <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#add327bb248876dd3e04c68ba3ce9b536" title="Applicable to &quot;loadFromRangeScan&quot; only! If set to false, the points from the scan are loaded...">addToExistingPointsMap</a>;      <span class="comment">//!&lt; Applicable to &quot;loadFromRangeScan&quot; only! If set to false, the points from the scan are loaded, clearing all previous content. Default is false.</span>
<a name="l00194"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#a1d68e811a16965f4dbe025882c7ed9ab">00194</a> <span class="comment"></span>                        <span class="keywordtype">bool</span>    <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#a1d68e811a16965f4dbe025882c7ed9ab" title="If set to true, far points (&lt;1m) are interpolated with samples at &quot;minDistSqrBetweenLaserPoints&quot; inte...">also_interpolate</a>;            <span class="comment">//!&lt; If set to true, far points (&lt;1m) are interpolated with samples at &quot;minDistSqrBetweenLaserPoints&quot; intervals (Default is false).</span>
<a name="l00195"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#aa032c43dc5ca9f32d577e0e2805739c6">00195</a> <span class="comment"></span>                        <span class="keywordtype">bool</span>    <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#aa032c43dc5ca9f32d577e0e2805739c6" title="If set to false (default=true) points in the same plane as the inserted scan and inside the free spac...">disableDeletion</a>;             <span class="comment">//!&lt; If set to false (default=true) points in the same plane as the inserted scan and inside the free space, are erased: i.e. they don&#39;t exist yet.</span>
<a name="l00196"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#a69db253ac9a0d83917bbd1bd6412840c">00196</a> <span class="comment"></span>                        <span class="keywordtype">bool</span>    <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#a69db253ac9a0d83917bbd1bd6412840c" title="If set to true (default=false), inserted points are &quot;fused&quot; with previously existent ones...">fuseWithExisting</a>;            <span class="comment">//!&lt; If set to true (default=false), inserted points are &quot;fused&quot; with previously existent ones. This shrink the size of the points map, but its slower.</span>
<a name="l00197"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#a4920a0aae2ad279c4cb13a3d45a1fe18">00197</a> <span class="comment"></span>                        <span class="keywordtype">bool</span>    <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#a4920a0aae2ad279c4cb13a3d45a1fe18" title="If set to true, only HORIZONTAL (in the XY plane) measurements will be inserted in the map (Default v...">isPlanarMap</a>;                 <span class="comment">//!&lt; If set to true, only HORIZONTAL (in the XY plane) measurements will be inserted in the map (Default value is false, thus 3D maps are generated). \sa  horizontalTolerance</span>
<a name="l00198"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#ac18819a87d2f88665183cd7c9830fa9e">00198</a> <span class="comment"></span>                        <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#ac18819a87d2f88665183cd7c9830fa9e" title="The tolerance in rads in pitch &amp; roll for a laser scan to be considered horizontal, considered only when isPlanarMap=true (default=0).">horizontalTolerance</a>;         <span class="comment">//!&lt; The tolerance in rads in pitch &amp; roll for a laser scan to be considered horizontal, considered only when isPlanarMap=true (default=0).</span>
<a name="l00199"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#ad367c8f31c4a0f080240f0b3a4ea280e">00199</a> <span class="comment"></span>                        <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_insertion_options.html#ad367c8f31c4a0f080240f0b3a4ea280e" title="The maximum distance between two points to interpolate between them (ONLY when also_interpolate=true)...">maxDistForInterpolatePoints</a>; <span class="comment">//!&lt; The maximum distance between two points to interpolate between them (ONLY when also_interpolate=true)</span>
<a name="l00200"></a>00200 <span class="comment"></span>
<a name="l00201"></a>00201                  };
<a name="l00202"></a>00202 
<a name="l00203"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a0f9ff5c1a7d19283a85856bfddb0e232">00203</a>                 <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_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_points_map.html#a0f9ff5c1a7d19283a85856bfddb0e232" title="The options used when inserting observations in the map.">insertionOptions</a>; <span class="comment">//!&lt; The options used when inserting observations in the map</span>
<a name="l00204"></a>00204 <span class="comment"></span><span class="comment"></span>
<a name="l00205"></a>00205 <span class="comment">                 /** Options used when evaluating &quot;computeObservationLikelihood&quot; in the derived classes.</span>
<a name="l00206"></a>00206 <span class="comment">                  * \sa CObservation::computeObservationLikelihood</span>
<a name="l00207"></a>00207 <span class="comment">                  */</span>
<a name="l00208"></a>00208                  <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_points_map_1_1_t_likelihood_options.html" title="Options used when evaluating &quot;computeObservationLikelihood&quot; in the derived classes.">TLikelihoodOptions</a>: <span class="keyword">public</span> 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="l00209"></a>00209                  {<span class="comment"></span>
<a name="l00210"></a>00210 <span class="comment">                        /** Initilization of default parameters</span>
<a name="l00211"></a>00211 <span class="comment">                         */</span>
<a name="l00212"></a>00212                         <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html" title="Options used when evaluating &quot;computeObservationLikelihood&quot; in the derived classes.">TLikelihoodOptions</a>( );
<a name="l00213"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html#af636a1604953a2b32fc50dea3a87489e">00213</a>                         <span class="keyword">virtual</span> <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html#af636a1604953a2b32fc50dea3a87489e">~TLikelihoodOptions</a>() {}
<a name="l00214"></a>00214 <span class="comment"></span>
<a name="l00215"></a>00215 <span class="comment">                        /** See utils::CLoadableOptions */</span>
<a name="l00216"></a>00216                         <span class="keywordtype">void</span>  loadFromConfigFile(
<a name="l00217"></a>00217                                 <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="l00218"></a>00218                                 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section);
<a name="l00219"></a>00219 <span class="comment"></span>
<a name="l00220"></a>00220 <span class="comment">                        /** See utils::CLoadableOptions */</span>
<a name="l00221"></a>00221                         <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="l00222"></a>00222 
<a name="l00223"></a>00223                         <span class="keywordtype">void</span> writeToStream(<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>;         <span class="comment">//!&lt; Binary dump to stream - for usage in derived classes&#39; serialization</span>
<a name="l00224"></a>00224 <span class="comment"></span>                        <span class="keywordtype">void</span> readFromStream(<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;in);                       <span class="comment">//!&lt; Binary dump to stream - for usage in derived classes&#39; serialization</span>
<a name="l00225"></a>00225 <span class="comment"></span>
<a name="l00226"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html#afb5171da06bc9532e5e3c28aa95ed7ab">00226</a>                         <span class="keywordtype">double</span>          <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html#afb5171da06bc9532e5e3c28aa95ed7ab" title="Sigma (standard deviation, in meters) of the exponential used to model the likelihood (default= 0...">sigma_dist</a>; <span class="comment">//!&lt; Sigma (standard deviation, in meters) of the exponential used to model the likelihood (default= 0.5meters)</span>
<a name="l00227"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html#a138e70c07962d476f3dccc2fba7a7f1c">00227</a> <span class="comment"></span>                        <span class="keywordtype">double</span>          <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html#a138e70c07962d476f3dccc2fba7a7f1c" title="Maximum distance in meters to consider for the numerator divided by &quot;sigma_dist&quot;, so that each point ...">max_corr_distance</a>; <span class="comment">//!&lt; Maximum distance in meters to consider for the numerator divided by &quot;sigma_dist&quot;, so that each point has a minimum (but very small) likelihood to avoid underflows (default=1.0 meters)</span>
<a name="l00228"></a><a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html#a35d3481056c5b08bd6fa33f59689fdf4">00228</a> <span class="comment"></span>                        uint32_t        <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html#a35d3481056c5b08bd6fa33f59689fdf4" title="Speed up the likelihood computation by considering only one out of N rays (default=10)">decimation</a>; <span class="comment">//!&lt; Speed up the likelihood computation by considering only one out of N rays (default=10)</span>
<a name="l00229"></a>00229 <span class="comment"></span>                 };
<a name="l00230"></a>00230 
<a name="l00231"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a3f290053399ae8e26f01c7d4f66ed110">00231</a>                  <a class="code" href="structmrpt_1_1slam_1_1_c_points_map_1_1_t_likelihood_options.html" title="Options used when evaluating &quot;computeObservationLikelihood&quot; in the derived classes.">TLikelihoodOptions</a>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a3f290053399ae8e26f01c7d4f66ed110">likelihoodOptions</a>;
<a name="l00232"></a>00232 
<a name="l00233"></a>00233 <span class="comment"></span>
<a name="l00234"></a>00234 <span class="comment">                /** Adds all the points from \a anotherMap to this map, without fusing.</span>
<a name="l00235"></a>00235 <span class="comment">                  *  This operation can be also invoked via the &quot;+=&quot; operator, for example:</span>
<a name="l00236"></a>00236 <span class="comment">                  *  \code</span>
<a name="l00237"></a>00237 <span class="comment">                  *   CSimplePointsMap m1, m2;</span>
<a name="l00238"></a>00238 <span class="comment">                  *   ...</span>
<a name="l00239"></a>00239 <span class="comment">                  *   m1.addFrom( m2 );  // Add all points of m2 to m1</span>
<a name="l00240"></a>00240 <span class="comment">                  *   m1 += m2;          // Exactly the same than above</span>
<a name="l00241"></a>00241 <span class="comment">                  *  \endcode</span>
<a name="l00242"></a>00242 <span class="comment">                  * \note The method in CPointsMap is generic but derived classes may redefine this virtual method to another one more optimized.</span>
<a name="l00243"></a>00243 <span class="comment">                  */</span>
<a name="l00244"></a>00244                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  addFrom(<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> &amp;anotherMap);
<a name="l00245"></a>00245 <span class="comment"></span>
<a name="l00246"></a>00246 <span class="comment">                /** This operator is synonymous with \a addFrom. \sa addFrom */</span>
<a name="l00247"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a3f4578b8ab47dab204792147caf1842b">00247</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__container__ops__grp.html#ga28127b8dfe78fea7644c4f2a3517cdef" title="a+=b (element-wise sum)">operator +=</a>(<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> &amp;anotherMap)
<a name="l00248"></a>00248                 {
<a name="l00249"></a>00249                         this-&gt;addFrom(anotherMap);
<a name="l00250"></a>00250                 }
<a name="l00251"></a>00251 <span class="comment"></span>
<a name="l00252"></a>00252 <span class="comment">                /** Insert the contents of another map into this one with some geometric transformation, without fusing close points.</span>
<a name="l00253"></a>00253 <span class="comment">                 * \param otherMap The other map whose points are to be inserted into this one.</span>
<a name="l00254"></a>00254 <span class="comment">                 * \param otherPose The pose of the other map in the coordinates of THIS map</span>
<a name="l00255"></a>00255 <span class="comment">                 * \sa fuseWith, addFrom</span>
<a name="l00256"></a>00256 <span class="comment">                 */</span>
<a name="l00257"></a>00257                 <span class="keywordtype">void</span>  insertAnotherMap(
<a name="l00258"></a>00258                         <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>        *otherMap,
<a name="l00259"></a>00259                         <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;otherPose);
<a name="l00260"></a>00260 
<a name="l00261"></a>00261                 <span class="comment">// --------------------------------------------------</span><span class="comment"></span>
<a name="l00262"></a>00262 <span class="comment">                /** @name File input/output methods</span>
<a name="l00263"></a>00263 <span class="comment">                    @{ */</span>
<a name="l00264"></a>00264 <span class="comment"></span>
<a name="l00265"></a>00265 <span class="comment">                /** Load from a text file. Each line should contain an &quot;X Y&quot; coordinate pair, separated by whitespaces.</span>
<a name="l00266"></a>00266 <span class="comment">                 *   Returns false if any error occured, true elsewere.</span>
<a name="l00267"></a>00267 <span class="comment">                 */</span>
<a name="l00268"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4b43f2c974fd73e4e69c3c51d9e76bc7">00268</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4b43f2c974fd73e4e69c3c51d9e76bc7" title="Load from a text file.">load2D_from_text_file</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;file) { <span class="keywordflow">return</span> load2Dor3D_from_text_file(file,<span class="keyword">false</span>); }
<a name="l00269"></a>00269 <span class="comment"></span>
<a name="l00270"></a>00270 <span class="comment">                /** Load from a text file. Each line should contain an &quot;X Y Z&quot; coordinate tuple, separated by whitespaces.</span>
<a name="l00271"></a>00271 <span class="comment">                 *   Returns false if any error occured, true elsewere.</span>
<a name="l00272"></a>00272 <span class="comment">                 */</span>
<a name="l00273"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a5053f8df3646f82f0e80b80c9cb86840">00273</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a5053f8df3646f82f0e80b80c9cb86840" title="Load from a text file.">load3D_from_text_file</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;file) { <span class="keywordflow">return</span> load2Dor3D_from_text_file(file,<span class="keyword">true</span>); }
<a name="l00274"></a>00274 <span class="comment"></span>
<a name="l00275"></a>00275 <span class="comment">                /** 2D or 3D generic implementation of \a load2D_from_text_file and load3D_from_text_file */</span>
<a name="l00276"></a>00276                 <span class="keywordtype">bool</span>  load2Dor3D_from_text_file(<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> <span class="keywordtype">bool</span> is_3D);
<a name="l00277"></a>00277 <span class="comment"></span>
<a name="l00278"></a>00278 <span class="comment">                /**  Save to a text file. Each line will contain &quot;X Y&quot; point coordinates.</span>
<a name="l00279"></a>00279 <span class="comment">                 *              Returns false if any error occured, true elsewere.</span>
<a name="l00280"></a>00280 <span class="comment">                 */</span>
<a name="l00281"></a>00281                 <span class="keywordtype">bool</span>  save2D_to_text_file(<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="l00282"></a>00282 <span class="comment"></span>
<a name="l00283"></a>00283 <span class="comment">                /**  Save to a text file. Each line will contain &quot;X Y Z&quot; point coordinates.</span>
<a name="l00284"></a>00284 <span class="comment">                 *     Returns false if any error occured, true elsewere.</span>
<a name="l00285"></a>00285 <span class="comment">                 */</span>
<a name="l00286"></a>00286                 <span class="keywordtype">bool</span>  save3D_to_text_file(<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="l00287"></a>00287 <span class="comment"></span>
<a name="l00288"></a>00288 <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="l00289"></a>00289 <span class="comment">                  */</span>
<a name="l00290"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a82d94f8aa153e3102610d18fc25f2fa6">00290</a>                 <span class="keywordtype">void</span>  saveMetricMapRepresentationToFile(
<a name="l00291"></a>00291                         <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>       &amp;filNamePrefix
<a name="l00292"></a>00292                         )<span class="keyword">const</span>
<a name="l00293"></a>00293 <span class="keyword">                </span>{
<a name="l00294"></a>00294                         std<a class="code" href="classstd_1_1string.html" title="STL class.">::string</a>             fil( filNamePrefix + <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>(<span class="stringliteral">&quot;.txt&quot;</span>) );
<a name="l00295"></a>00295                         save3D_to_text_file( fil );
<a name="l00296"></a>00296                 }
<a name="l00297"></a>00297 <span class="comment"></span>
<a name="l00298"></a>00298 <span class="comment">        /** Save the point cloud as a PCL PCD file, in either ASCII or binary format (requires MRPT built against PCL) \return false on any error */</span>
<a name="l00299"></a>00299         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> savePCDFile(<span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;filename, <span class="keywordtype">bool</span> save_as_binary) <span class="keyword">const</span>;
<a name="l00300"></a>00300 <span class="comment"></span>
<a name="l00301"></a>00301 <span class="comment">                /** @} */</span> <span class="comment">// End of: File input/output methods</span>
<a name="l00302"></a>00302                 <span class="comment">// --------------------------------------------------</span>
<a name="l00303"></a>00303 <span class="comment"></span>
<a name="l00304"></a>00304 <span class="comment">                /** Returns the number of stored points in the map.</span>
<a name="l00305"></a>00305 <span class="comment">                 */</span>
<a name="l00306"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4abadd7ddee0e92381c514fa23c29999">00306</a>                 <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4abadd7ddee0e92381c514fa23c29999" title="Returns the number of stored points in the map.">size</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x.size(); }
<a name="l00307"></a>00307 <span class="comment"></span>
<a name="l00308"></a>00308 <span class="comment">                /** Returns the number of stored points in the map (DEPRECATED, use &quot;size()&quot; instead better)</span>
<a name="l00309"></a>00309 <span class="comment">                 */</span>
<a name="l00310"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aabc4c43549b092019a61a8eeb0c194d7">00310</a>                 <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aabc4c43549b092019a61a8eeb0c194d7" title="Returns the number of stored points in the map (DEPRECATED, use &quot;size()&quot; instead better)">getPointsCount</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>(); }
<a name="l00311"></a>00311 <span class="comment"></span>
<a name="l00312"></a>00312 <span class="comment">                /** Access to a given point from map, as a 2D point. First index is 0.</span>
<a name="l00313"></a>00313 <span class="comment">                 * \return The return value is the weight of the point (the times it has been fused), or 1 if weights are not used.</span>
<a name="l00314"></a>00314 <span class="comment">                 * \exception Throws std::exception on index out of bound.</span>
<a name="l00315"></a>00315 <span class="comment">                 * \sa setPoint, getPointFast</span>
<a name="l00316"></a>00316 <span class="comment">                 */</span>
<a name="l00317"></a>00317                 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  getPoint(<span class="keywordtype">size_t</span> index,<span class="keywordtype">float</span> &amp;x,<span class="keywordtype">float</span> &amp;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<span class="keywordtype">float</span> &amp;z) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00318"></a>00318 <span class="comment">                /// \overload</span>
<a name="l00319"></a>00319 <span class="comment"></span>                <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  getPoint(<span class="keywordtype">size_t</span> index,<span class="keywordtype">float</span> &amp;x,<span class="keywordtype">float</span> &amp;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00320"></a>00320 <span class="comment">                /// \overload</span>
<a name="l00321"></a>00321 <span class="comment"></span>                <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  getPoint(<span class="keywordtype">size_t</span> index,<span class="keywordtype">double</span> &amp;x,<span class="keywordtype">double</span> &amp;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<span class="keywordtype">double</span> &amp;z) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00322"></a>00322 <span class="comment">                /// \overload</span>
<a name="l00323"></a>00323 <span class="comment"></span>                <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  getPoint(<span class="keywordtype">size_t</span> index,<span class="keywordtype">double</span> &amp;x,<span class="keywordtype">double</span> &amp;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) <span class="keyword">const</span>;<span class="comment"></span>
<a name="l00324"></a>00324 <span class="comment">                /// \overload</span>
<a name="l00325"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a3ce718a63c0733bcdfe0944267bfcce2">00325</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a3ce718a63c0733bcdfe0944267bfcce2">getPoint</a>(<span class="keywordtype">size_t</span> index,<a class="code" href="classmrpt_1_1poses_1_1_c_point2_d.html" title="A class used to store a 2D point.">CPoint2D</a> &amp;p)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a3ce718a63c0733bcdfe0944267bfcce2">getPoint</a>(index,p.x(),p.y()); }<span class="comment"></span>
<a name="l00326"></a>00326 <span class="comment">                /// \overload</span>
<a name="l00327"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aad3fb20bbc9e0c778596204b05dd0c62">00327</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aad3fb20bbc9e0c778596204b05dd0c62">getPoint</a>(<span class="keywordtype">size_t</span> index,<a class="code" href="classmrpt_1_1poses_1_1_c_point3_d.html" title="A class used to store a 3D point.">CPoint3D</a> &amp;p)<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aad3fb20bbc9e0c778596204b05dd0c62">getPoint</a>(index,p.x(),p.y(),p.z()); }<span class="comment"></span>
<a name="l00328"></a>00328 <span class="comment">                /// \overload</span>
<a name="l00329"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af597ecaafd5ec51b978e5173d0d1153b">00329</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af597ecaafd5ec51b978e5173d0d1153b">getPoint</a>(<span class="keywordtype">size_t</span> index,<a class="code" href="structmrpt_1_1math_1_1_t_point2_d.html" title="Lightweight 2D point.">mrpt::math::TPoint2D</a> &amp;p)<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af597ecaafd5ec51b978e5173d0d1153b">getPoint</a>(index,p.<a class="code" href="structmrpt_1_1math_1_1_t_point2_d.html#a084825c8b4d02df7b89d66f8b08e26f2" title="X coordinate.">x</a>,p.<a class="code" href="structmrpt_1_1math_1_1_t_point2_d.html#a1b6b3c44215ec8285ae97ff1ad1f6fcf" title="Y coordinate.">y</a>); }<span class="comment"></span>
<a name="l00330"></a>00330 <span class="comment">                /// \overload</span>
<a name="l00331"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a63456178721baa909f2c18020f582dc0">00331</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a63456178721baa909f2c18020f582dc0">getPoint</a>(<span class="keywordtype">size_t</span> index,<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">mrpt::math::TPoint3D</a> &amp;p)<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a63456178721baa909f2c18020f582dc0">getPoint</a>(index,p.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a5014ee49d97866d293568300b619a7e2" title="X coordinate.">x</a>,p.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#aec879c0d61d8446e93b7d09344931d37" title="Y coordinate.">y</a>,p.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a61df04839b9146696e696fc7af3bc307" title="Z coordinate.">z</a>); }
<a name="l00332"></a>00332 <span class="comment"></span>
<a name="l00333"></a>00333 <span class="comment">                /** Access to a given point from map, and its colors, if the map defines them (othersise, R=G=B=1.0). First index is 0.</span>
<a name="l00334"></a>00334 <span class="comment">                 * \return The return value is the weight of the point (the times it has been fused)</span>
<a name="l00335"></a>00335 <span class="comment">                 * \exception Throws std::exception on index out of bound.</span>
<a name="l00336"></a>00336 <span class="comment">                 */</span>
<a name="l00337"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a8815468742e10ec2cf542e0f856db539">00337</a>                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> getPoint( <span class="keywordtype">size_t</span> index, <span class="keywordtype">float</span> &amp;x, <span class="keywordtype">float</span> &amp;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>, <span class="keywordtype">float</span> &amp;z, <span class="keywordtype">float</span> &amp;R, <span class="keywordtype">float</span> &amp;G, <span class="keywordtype">float</span> &amp;B )<span class="keyword"> const</span>
<a name="l00338"></a>00338 <span class="keyword">                </span>{
<a name="l00339"></a>00339                         getPoint(index,x,y,z);
<a name="l00340"></a>00340                         R=G=B=1;
<a name="l00341"></a>00341                 }
<a name="l00342"></a>00342 <span class="comment"></span>
<a name="l00343"></a>00343 <span class="comment">                /** Just like \a getPoint() but without checking out-of-bound index and without returning the point weight, just XYZ.</span>
<a name="l00344"></a>00344 <span class="comment">                 */</span>
<a name="l00345"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4d2ba33d8a318da5a55829e5073b886b">00345</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4d2ba33d8a318da5a55829e5073b886b" title="Just like getPoint() but without checking out-of-bound index and without returning the point weight...">getPointFast</a>(<span class="keywordtype">size_t</span> index,<span class="keywordtype">float</span> &amp;x,<span class="keywordtype">float</span> &amp;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<span class="keywordtype">float</span> &amp;z)<span class="keyword"> const </span>{ x=this-&gt;x[index]; y=this-&gt;y[index]; z=this-&gt;z[index]; }
<a name="l00346"></a>00346 <span class="comment"></span>
<a name="l00347"></a>00347 <span class="comment">                /** Returns true if the point map has a color field for each point */</span>
<a name="l00348"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4976f7a84c65f882e06529b3ffc6e985">00348</a>                 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4976f7a84c65f882e06529b3ffc6e985" title="Returns true if the point map has a color field for each point.">hasColorPoints</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00349"></a>00349 <span class="comment"></span>
<a name="l00350"></a>00350 <span class="comment">                /** Changes a given point from map, with Z defaulting to 0 if not provided.</span>
<a name="l00351"></a>00351 <span class="comment">                 * \exception Throws std::exception on index out of bound.</span>
<a name="l00352"></a>00352 <span class="comment">                 */</span>
<a name="l00353"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aaf0d8a56ceb231e684fe18238479aebe">00353</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aaf0d8a56ceb231e684fe18238479aebe" title="Changes a given point from map, with Z defaulting to 0 if not provided.">setPoint</a>(<span class="keywordtype">size_t</span> index,<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> z) {
<a name="l00354"></a>00354                         <a class="code" href="mrpt__macros_8h.html#a8b01938f6fbebe5c4163b7c83a137d1d">ASSERT_BELOW_</a>(index,this-&gt;<a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>())
<a name="l00355"></a>00355                         setPointFast(index,x,y,z);
<a name="l00356"></a>00356                         mark_as_modified();
<a name="l00357"></a>00357                 }<span class="comment"></span>
<a name="l00358"></a>00358 <span class="comment">                /// \overload</span>
<a name="l00359"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ae1d0a9ae0b55fbf31a1f0f4b904d57b6">00359</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ae1d0a9ae0b55fbf31a1f0f4b904d57b6">setPoint</a>(<span class="keywordtype">size_t</span> index,<a class="code" href="classmrpt_1_1poses_1_1_c_point2_d.html" title="A class used to store a 2D point.">CPoint2D</a> &amp;p) {  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ae1d0a9ae0b55fbf31a1f0f4b904d57b6">setPoint</a>(index,p.x(),p.y(),0); }<span class="comment"></span>
<a name="l00360"></a>00360 <span class="comment">                /// \overload</span>
<a name="l00361"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4e00422cb502c214469d7eeaec60de2b">00361</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4e00422cb502c214469d7eeaec60de2b">setPoint</a>(<span class="keywordtype">size_t</span> index,<a class="code" href="classmrpt_1_1poses_1_1_c_point3_d.html" title="A class used to store a 3D point.">CPoint3D</a> &amp;p)  { <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a4e00422cb502c214469d7eeaec60de2b">setPoint</a>(index,p.x(),p.y(),p.z()); }<span class="comment"></span>
<a name="l00362"></a>00362 <span class="comment">                /// \overload</span>
<a name="l00363"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a755b43a1187bc6706b7f9ba75b5172ab">00363</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a755b43a1187bc6706b7f9ba75b5172ab">setPoint</a>(<span class="keywordtype">size_t</span> index,<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>) { <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a755b43a1187bc6706b7f9ba75b5172ab">setPoint</a>(index,x,y,0); }<span class="comment"></span>
<a name="l00364"></a>00364 <span class="comment">                /// \overload (RGB data is ignored in classes without color information)</span>
<a name="l00365"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a0fdaffa9c652c27a16e97283f88ed489">00365</a> <span class="comment"></span>                <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a0fdaffa9c652c27a16e97283f88ed489">setPoint</a>(<span class="keywordtype">size_t</span> index,<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> z, <span class="keywordtype">float</span> R, <span class="keywordtype">float</span> G, <span class="keywordtype">float</span> B) { <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a0fdaffa9c652c27a16e97283f88ed489">setPoint</a>(index,x,y,z); }
<a name="l00366"></a>00366 <span class="comment"></span>
<a name="l00367"></a>00367 <span class="comment">                /// Sets the point weight, which is ignored in all classes but those which actually store that field (Note: No checks are done for out-of-bounds index). \sa getPointWeight</span>
<a name="l00368"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aaeb151dbe5d18be6494e1c6882f6ba8a">00368</a> <span class="comment"></span>                <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aaeb151dbe5d18be6494e1c6882f6ba8a" title="Sets the point weight, which is ignored in all classes but those which actually store that field (Not...">setPointWeight</a>(<span class="keywordtype">size_t</span> index,<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> w) {  }<span class="comment"></span>
<a name="l00369"></a>00369 <span class="comment">                /// Gets the point weight, which is ignored in all classes (defaults to 1) but in those which actually store that field (Note: No checks are done for out-of-bounds index).  \sa setPointWeight</span>
<a name="l00370"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a38ec7522ec35ad0bb6c2d4987d647f92">00370</a> <span class="comment"></span>                <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a38ec7522ec35ad0bb6c2d4987d647f92" title="Gets the point weight, which is ignored in all classes (defaults to 1) but in those which actually st...">getPointWeight</a>(<span class="keywordtype">size_t</span> index)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 1; }
<a name="l00371"></a>00371 
<a name="l00372"></a>00372 <span class="comment"></span>
<a name="l00373"></a>00373 <span class="comment">                /** Provides a direct access to points buffer, or NULL if there is no points in the map.</span>
<a name="l00374"></a>00374 <span class="comment">                  */</span>
<a name="l00375"></a>00375                 <span class="keywordtype">void</span>  getPointsBuffer( <span class="keywordtype">size_t</span> &amp;outPointsCount, <span class="keyword">const</span> <span class="keywordtype">float</span> *&amp;xs, <span class="keyword">const</span> <span class="keywordtype">float</span> *&amp;ys, <span class="keyword">const</span> <span class="keywordtype">float</span> *&amp;zs ) <span class="keyword">const</span>;
<a name="l00376"></a>00376 <span class="comment"></span>
<a name="l00377"></a>00377 <span class="comment">                /** Provides a direct access to a read-only reference of the internal point buffer. \sa getAllPoints */</span>
<a name="l00378"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aa3fb0ae4aa2620bde91e0e859c8fd695">00378</a>                 <span class="keyword">inline</span> <span class="keyword">const</span> std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a> &amp; <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aa3fb0ae4aa2620bde91e0e859c8fd695" title="Provides a direct access to a read-only reference of the internal point buffer.">getPointsBufferRef_x</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> x; }<span class="comment"></span>
<a name="l00379"></a>00379 <span class="comment">                /** Provides a direct access to a read-only reference of the internal point buffer. \sa getAllPoints */</span>
<a name="l00380"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9aef705ea139d585ce0617eb1e03322d">00380</a>                 <span class="keyword">inline</span> <span class="keyword">const</span> std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a> &amp; <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9aef705ea139d585ce0617eb1e03322d" title="Provides a direct access to a read-only reference of the internal point buffer.">getPointsBufferRef_y</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>; }<span class="comment"></span>
<a name="l00381"></a>00381 <span class="comment">                /** Provides a direct access to a read-only reference of the internal point buffer. \sa getAllPoints */</span>
<a name="l00382"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a22a28b1fa66e48fd82dd0597e8da45dd">00382</a>                 <span class="keyword">inline</span> <span class="keyword">const</span> std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a> &amp; <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a22a28b1fa66e48fd82dd0597e8da45dd" title="Provides a direct access to a read-only reference of the internal point buffer.">getPointsBufferRef_z</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> z; }
<a name="l00383"></a>00383 <span class="comment"></span>
<a name="l00384"></a>00384 <span class="comment">                /** Returns a copy of the 2D/3D points as a std::vector of float coordinates.</span>
<a name="l00385"></a>00385 <span class="comment">                  * If decimation is greater than 1, only 1 point out of that number will be saved in the output, effectively performing a subsampling of the points.</span>
<a name="l00386"></a>00386 <span class="comment">                  * \sa getPointsBufferRef_x, getPointsBufferRef_y, getPointsBufferRef_z</span>
<a name="l00387"></a>00387 <span class="comment">                  * \tparam VECTOR can be std::vector&lt;float or double&gt; or any row/column Eigen::Array or Eigen::Matrix (this includes mrpt::vector_float and mrpt::vector_double).</span>
<a name="l00388"></a>00388 <span class="comment">                  */</span>
<a name="l00389"></a>00389                 <span class="keyword">template</span> &lt;<span class="keyword">class</span> VECTOR&gt;
<a name="l00390"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aca0f289c4c4caedd60604c349216ad5f">00390</a>                 <span class="keywordtype">void</span>  getAllPoints( VECTOR &amp;xs, VECTOR &amp;ys, VECTOR &amp;zs, <span class="keywordtype">size_t</span> decimation = 1 )<span class="keyword"> const</span>
<a name="l00391"></a>00391 <span class="keyword">                </span>{
<a name="l00392"></a>00392                         <a class="code" href="mrpt__macros_8h.html#a45b840af519f33816311acdbb28d7c10">MRPT_START</a>
<a name="l00393"></a>00393                         <a class="code" href="mrpt__macros_8h.html#a47eb5a445c2bf3d9190396510ea9683e">ASSERT_</a>(decimation&gt;0)
<a name="l00394"></a>00394                         <span class="keyword">const</span> <span class="keywordtype">size_t</span> Nout = x.size() / decimation;
<a name="l00395"></a>00395                         xs.resize(Nout);
<a name="l00396"></a>00396                         ys.resize(Nout);
<a name="l00397"></a>00397                         zs.resize(Nout);
<a name="l00398"></a>00398                         <span class="keywordtype">size_t</span> idx_in, idx_out;
<a name="l00399"></a>00399                         <span class="keywordflow">for</span> (idx_in=0,idx_out=0;idx_out&lt;Nout;idx_in+=decimation,++idx_out)
<a name="l00400"></a>00400                         {
<a name="l00401"></a>00401                                 xs[idx_out]=x[idx_in];
<a name="l00402"></a>00402                                 ys[idx_out]=<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>[idx_in];
<a name="l00403"></a>00403                                 zs[idx_out]=z[idx_in];
<a name="l00404"></a>00404                         }
<a name="l00405"></a>00405                         <a class="code" href="mrpt__macros_8h.html#a88a917260793b56abd83ad2a0d849eb1">MRPT_END</a>
<a name="l00406"></a>00406                 }
<a name="l00407"></a>00407 
<a name="l00408"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a62638c177a1a056808c8346bdcfbe19a">00408</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a62638c177a1a056808c8346bdcfbe19a">getAllPoints</a>(<a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint3D&gt;</a> &amp;ps,<span class="keywordtype">size_t</span> decimation=1)<span class="keyword"> const   </span>{
<a name="l00409"></a>00409                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a> dmy1,dmy2,dmy3;
<a name="l00410"></a>00410                         getAllPoints(dmy1,dmy2,dmy3,decimation);
<a name="l00411"></a>00411                         ps.resize(dmy1.size());
<a name="l00412"></a>00412                         <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;dmy1.size();i++)      {
<a name="l00413"></a>00413                                 ps[i].x=<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(dmy1[i]);
<a name="l00414"></a>00414                                 ps[i].y=<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(dmy2[i]);
<a name="l00415"></a>00415                                 ps[i].z=<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(dmy3[i]);
<a name="l00416"></a>00416                         }
<a name="l00417"></a>00417                 }
<a name="l00418"></a>00418 <span class="comment"></span>
<a name="l00419"></a>00419 <span class="comment">                /** Returns a copy of the 2D/3D points as a std::vector of float coordinates.</span>
<a name="l00420"></a>00420 <span class="comment">                  * If decimation is greater than 1, only 1 point out of that number will be saved in the output, effectively performing a subsampling of the points.</span>
<a name="l00421"></a>00421 <span class="comment">                  * \sa setAllPoints</span>
<a name="l00422"></a>00422 <span class="comment">                  */</span>
<a name="l00423"></a>00423                 <span class="keywordtype">void</span>  getAllPoints( <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;xs, <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;ys, <span class="keywordtype">size_t</span> decimation = 1 ) <span class="keyword">const</span>;
<a name="l00424"></a>00424 
<a name="l00425"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#accfde089a2cb721d2412d94a78d24e00">00425</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#accfde089a2cb721d2412d94a78d24e00">getAllPoints</a>(<a class="code" href="classstd_1_1vector.html">std::vector&lt;TPoint2D&gt;</a> &amp;ps,<span class="keywordtype">size_t</span> decimation=1)<span class="keyword"> const   </span>{
<a name="l00426"></a>00426                         std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a> dmy1,dmy2;
<a name="l00427"></a>00427                         getAllPoints(dmy1,dmy2,decimation);
<a name="l00428"></a>00428                         ps.resize(dmy1.size());
<a name="l00429"></a>00429                         <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;dmy1.size();i++)      {
<a name="l00430"></a>00430                                 ps[i].x=<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(dmy1[i]);
<a name="l00431"></a>00431                                 ps[i].y=<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(dmy2[i]);
<a name="l00432"></a>00432                         }
<a name="l00433"></a>00433                 }
<a name="l00434"></a>00434 <span class="comment"></span>
<a name="l00435"></a>00435 <span class="comment">                /** Provides a way to insert (append) individual points into the map: the missing fields of child</span>
<a name="l00436"></a>00436 <span class="comment">                  * classes (color, weight, etc) are left to their default values</span>
<a name="l00437"></a>00437 <span class="comment">                  */</span>
<a name="l00438"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aad8346e26d776369ba24711e70206b3d">00438</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aad8346e26d776369ba24711e70206b3d" title="Provides a way to insert (append) individual points into the map: the missing fields of child classes...">insertPoint</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> z=0 ) { insertPointFast(x,y,z); mark_as_modified(); }<span class="comment"></span>
<a name="l00439"></a>00439 <span class="comment">                /// \overload of \a insertPoint()</span>
<a name="l00440"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ab389147c86e55ae2043c46ec55af5fff">00440</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ab389147c86e55ae2043c46ec55af5fff">insertPoint</a>( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_point3_d.html" title="A class used to store a 3D point.">CPoint3D</a> &amp;p ) { <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ab389147c86e55ae2043c46ec55af5fff">insertPoint</a>(p.x(),p.y(),p.z()); }<span class="comment"></span>
<a name="l00441"></a>00441 <span class="comment">                /// \overload</span>
<a name="l00442"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af0ee824da205af075d588eee9b13849b">00442</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af0ee824da205af075d588eee9b13849b">insertPoint</a>( <span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">mrpt::math::TPoint3D</a> &amp;p ) { <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af0ee824da205af075d588eee9b13849b">insertPoint</a>(p.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a5014ee49d97866d293568300b619a7e2" title="X coordinate.">x</a>,p.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#aec879c0d61d8446e93b7d09344931d37" title="Y coordinate.">y</a>,p.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a61df04839b9146696e696fc7af3bc307" title="Z coordinate.">z</a>); }<span class="comment"></span>
<a name="l00443"></a>00443 <span class="comment">                /// \overload (RGB data is ignored in classes without color information)</span>
<a name="l00444"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9ef6b4d41470d42b8f3103d31b33db13">00444</a> <span class="comment"></span>                <span class="keyword">virtual</span> <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9ef6b4d41470d42b8f3103d31b33db13">insertPoint</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> z, <span class="keywordtype">float</span> R, <span class="keywordtype">float</span> G, <span class="keywordtype">float</span> B ) { <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9ef6b4d41470d42b8f3103d31b33db13">insertPoint</a>(x,y,z); }
<a name="l00445"></a>00445 <span class="comment"></span>
<a name="l00446"></a>00446 <span class="comment">                /** Set all the points at once from vectors with X,Y and Z coordinates (if Z is not provided, it will be set to all zeros).</span>
<a name="l00447"></a>00447 <span class="comment">                  * \tparam VECTOR can be mrpt::vector_float or std::vector&lt;float&gt; or any other column or row Eigen::Matrix.</span>
<a name="l00448"></a>00448 <span class="comment">                  */</span>
<a name="l00449"></a>00449                 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> VECTOR&gt;
<a name="l00450"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a2144cb76ac32d776db95f98a85ee7f8f">00450</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> setAllPointsTemplate(<span class="keyword">const</span> VECTOR &amp;X,<span class="keyword">const</span> VECTOR &amp;Y,<span class="keyword">const</span> VECTOR &amp;Z = VECTOR())
<a name="l00451"></a>00451                 {
<a name="l00452"></a>00452                         <span class="keyword">const</span> <span class="keywordtype">size_t</span> N = X.size();
<a name="l00453"></a>00453                         <a class="code" href="mrpt__macros_8h.html#a02c6e78d47a0bae723824559846cc673">ASSERT_EQUAL_</a>(X.size(),Y.size())
<a name="l00454"></a>00454                         <a class="code" href="mrpt__macros_8h.html#a47eb5a445c2bf3d9190396510ea9683e">ASSERT_</a>(Z.size()==0 || Z.size()==X.size())
<a name="l00455"></a>00455                         this-&gt;<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>(N);
<a name="l00456"></a>00456                         <span class="keyword">const</span> <span class="keywordtype">bool</span> z_valid = !Z.empty();
<a name="l00457"></a>00457                         <span class="keywordflow">if</span> (z_valid) <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;N;i++) { this-&gt;setPointFast(i,X[i],Y[i],Z[i]); }
<a name="l00458"></a>00458                         <span class="keywordflow">else</span>         <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0;i&lt;N;i++) { this-&gt;setPointFast(i,X[i],Y[i],0); }
<a name="l00459"></a>00459                         mark_as_modified();
<a name="l00460"></a>00460                 }
<a name="l00461"></a>00461 <span class="comment"></span>
<a name="l00462"></a>00462 <span class="comment">                /** Set all the points at once from vectors with X,Y and Z coordinates. \sa getAllPoints */</span>
<a name="l00463"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#adc878eb5f32d6b0900aad2bee5de7438">00463</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#adc878eb5f32d6b0900aad2bee5de7438" title="Set all the points at once from vectors with X,Y and Z coordinates.">setAllPoints</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;X,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;Y,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;Z) {
<a name="l00464"></a>00464                         setAllPointsTemplate(X,Y,Z);
<a name="l00465"></a>00465                 }
<a name="l00466"></a>00466 <span class="comment"></span>
<a name="l00467"></a>00467 <span class="comment">                /** Set all the points at once from vectors with X and Y coordinates (Z=0). \sa getAllPoints */</span>
<a name="l00468"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a74f949340a13dcccab1110c445060d84">00468</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a74f949340a13dcccab1110c445060d84" title="Set all the points at once from vectors with X and Y coordinates (Z=0).">setAllPoints</a>(<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;X,<span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp;Y) {
<a name="l00469"></a>00469                         setAllPointsTemplate(X,Y);
<a name="l00470"></a>00470                 }
<a name="l00471"></a>00471 <span class="comment"></span>
<a name="l00472"></a>00472 <span class="comment">                /** Get all the data fields for one point as a vector: depending on the implementation class this can be [X Y Z] or [X Y Z R G B], etc...</span>
<a name="l00473"></a>00473 <span class="comment">                  * \sa getPointAllFieldsFast, setPointAllFields, setPointAllFieldsFast</span>
<a name="l00474"></a>00474 <span class="comment">                  */</span>
<a name="l00475"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aaf601e3656906e94f1038e957314a2fa">00475</a>                 <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aaf601e3656906e94f1038e957314a2fa" title="Get all the data fields for one point as a vector: depending on the implementation class this can be ...">getPointAllFields</a>( <span class="keyword">const</span> <span class="keywordtype">size_t</span> index, <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp; point_data )<span class="keyword"> const </span>{
<a name="l00476"></a>00476                         <a class="code" href="mrpt__macros_8h.html#a8b01938f6fbebe5c4163b7c83a137d1d">ASSERT_BELOW_</a>(index,this-&gt;<a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>())
<a name="l00477"></a>00477                         getPointAllFieldsFast(index,point_data);
<a name="l00478"></a>00478                 }
<a name="l00479"></a>00479 <span class="comment"></span>
<a name="l00480"></a>00480 <span class="comment">                /** Set all the data fields for one point as a vector: depending on the implementation class this can be [X Y Z] or [X Y Z R G B], etc...</span>
<a name="l00481"></a>00481 <span class="comment">                  *  Unlike setPointAllFields(), this method does not check for index out of bounds</span>
<a name="l00482"></a>00482 <span class="comment">                  * \sa setPointAllFields, getPointAllFields, getPointAllFieldsFast</span>
<a name="l00483"></a>00483 <span class="comment">                  */</span>
<a name="l00484"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ad7814ba94edc58cb8115537af9f3e1b3">00484</a>                 <span class="keywordtype">void</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ad7814ba94edc58cb8115537af9f3e1b3" title="Set all the data fields for one point as a vector: depending on the implementation class this can be ...">setPointAllFields</a>( <span class="keyword">const</span> <span class="keywordtype">size_t</span> index, <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;float&gt;</a> &amp; point_data ){
<a name="l00485"></a>00485                         <a class="code" href="mrpt__macros_8h.html#a8b01938f6fbebe5c4163b7c83a137d1d">ASSERT_BELOW_</a>(index,this-&gt;<a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>())
<a name="l00486"></a>00486                         setPointAllFieldsFast(index,point_data);
<a name="l00487"></a>00487                 }
<a name="l00488"></a>00488 
<a name="l00489"></a>00489 <span class="comment"></span>
<a name="l00490"></a>00490 <span class="comment">                /** Delete points out of the given &quot;z&quot; axis range have been removed.</span>
<a name="l00491"></a>00491 <span class="comment">                  */</span>
<a name="l00492"></a>00492                 <span class="keywordtype">void</span>  clipOutOfRangeInZ(<span class="keywordtype">float</span> zMin, <span class="keywordtype">float</span> zMax);
<a name="l00493"></a>00493 <span class="comment"></span>
<a name="l00494"></a>00494 <span class="comment">                /** Delete points which are more far than &quot;maxRange&quot; away from the given &quot;point&quot;.</span>
<a name="l00495"></a>00495 <span class="comment">                  */</span>
<a name="l00496"></a>00496                 <span class="keywordtype">void</span>  clipOutOfRange(<span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_point2_d.html" title="A class used to store a 2D point.">CPoint2D</a>     &amp;point, <span class="keywordtype">float</span> maxRange);
<a name="l00497"></a>00497 <span class="comment"></span>
<a name="l00498"></a>00498 <span class="comment">                /** Remove from the map the points marked in a bool&#39;s array as &quot;true&quot;.</span>
<a name="l00499"></a>00499 <span class="comment">                  * \exception std::exception If mask size is not equal to points count.</span>
<a name="l00500"></a>00500 <span class="comment">                  */</span>
<a name="l00501"></a>00501                 <span class="keywordtype">void</span>  applyDeletionMask( <span class="keyword">const</span> <a class="code" href="classstd_1_1vector.html">std::vector&lt;bool&gt;</a> &amp;mask );
<a name="l00502"></a>00502 <span class="comment"></span>
<a name="l00503"></a>00503 <span class="comment">                /** Computes the matchings between this and another 2D/3D points map.</span>
<a name="l00504"></a>00504 <span class="comment">                   This includes finding:</span>
<a name="l00505"></a>00505 <span class="comment">                                - The set of points pairs in each map</span>
<a name="l00506"></a>00506 <span class="comment">                                - The mean squared distance between corresponding pairs.</span>
<a name="l00507"></a>00507 <span class="comment">                   This method is the most time critical one into the ICP algorithm.</span>
<a name="l00508"></a>00508 <span class="comment"></span>
<a name="l00509"></a>00509 <span class="comment">                 * \param  otherMap                                       [IN] The other map to compute the matching with.</span>
<a name="l00510"></a>00510 <span class="comment">                 * \param  otherMapPose                           [IN] The pose of the other map as seen from &quot;this&quot;.</span>
<a name="l00511"></a>00511 <span class="comment">                 * \param  maxDistForCorrespondence [IN] Maximum 2D distance between two points to be matched.</span>
<a name="l00512"></a>00512 <span class="comment">                 * \param  maxAngularDistForCorrespondence [IN] Maximum angular distance in radians to allow far points to be matched.</span>
<a name="l00513"></a>00513 <span class="comment">                 * \param  angularDistPivotPoint      [IN] The point from which to measure the &quot;angular distances&quot;</span>
<a name="l00514"></a>00514 <span class="comment">                 * \param  correspondences                        [OUT] The detected matchings pairs.</span>
<a name="l00515"></a>00515 <span class="comment">                 * \param  correspondencesRatio           [OUT] The number of correct correspondences.</span>
<a name="l00516"></a>00516 <span class="comment">                 * \param  sumSqrDist                             [OUT] The sum of all matched points squared distances.If undesired, set to NULL, as default.</span>
<a name="l00517"></a>00517 <span class="comment">                 * \param  covariance                             [OUT] The resulting matching covariance 3x3 matrix, or NULL if undesired.</span>
<a name="l00518"></a>00518 <span class="comment">                 * \param  onlyKeepTheClosest             [OUT] Returns only the closest correspondence (default=false)</span>
<a name="l00519"></a>00519 <span class="comment">                 *</span>
<a name="l00520"></a>00520 <span class="comment">                 * \sa computeMatching3DWith</span>
<a name="l00521"></a>00521 <span class="comment">                 */</span>
<a name="l00522"></a>00522                 <span class="keywordtype">void</span>  computeMatchingWith2D(
<a name="l00523"></a>00523                                 <span class="keyword">const</span> <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>     *otherMap,
<a name="l00524"></a>00524                                 <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="l00525"></a>00525                                 <span class="keywordtype">float</span>                maxDistForCorrespondence,
<a name="l00526"></a>00526                                 <span class="keywordtype">float</span>                maxAngularDistForCorrespondence,
<a name="l00527"></a>00527                                 <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="l00528"></a>00528                                 <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="l00529"></a>00529                                 <span class="keywordtype">float</span>                &amp;correspondencesRatio,
<a name="l00530"></a>00530                                 <span class="keywordtype">float</span>                *sumSqrDist        = NULL,
<a name="l00531"></a>00531                                 <span class="keywordtype">bool</span>                  onlyKeepTheClosest = <span class="keyword">false</span>,
<a name="l00532"></a>00532                                 <span class="keywordtype">bool</span>                  onlyUniqueRobust = <span class="keyword">false</span>,
<a name="l00533"></a>00533                                 <span class="keyword">const</span> <span class="keywordtype">size_t</span>          decimation_other_map_points = 1,
<a name="l00534"></a>00534                                 <span class="keyword">const</span> <span class="keywordtype">size_t</span>          offset_other_map_points = 0 ) <span class="keyword">const</span>;
<a name="l00535"></a>00535 <span class="comment"></span>
<a name="l00536"></a>00536 <span class="comment">                /** Computes the matchings between this and another 3D points map - method used in 3D-ICP.</span>
<a name="l00537"></a>00537 <span class="comment">                   This method finds the set of point pairs in each map.</span>
<a name="l00538"></a>00538 <span class="comment"></span>
<a name="l00539"></a>00539 <span class="comment">                   The method is the most time critical one into the ICP algorithm.</span>
<a name="l00540"></a>00540 <span class="comment"></span>
<a name="l00541"></a>00541 <span class="comment">                 * \param  otherMap                                       [IN] The other map to compute the matching with.</span>
<a name="l00542"></a>00542 <span class="comment">                 * \param  otherMapPose                           [IN] The pose of the other map as seen from &quot;this&quot;.</span>
<a name="l00543"></a>00543 <span class="comment">                 * \param  maxDistForCorrespondence   [IN] Maximum 2D linear distance between two points to be matched.</span>
<a name="l00544"></a>00544 <span class="comment">                 * \param  maxAngularDistForCorrespondence [IN] In radians: The aim is to allow larger distances to more distant correspondences.</span>
<a name="l00545"></a>00545 <span class="comment">                 * \param  angularDistPivotPoint      [IN] The point used to calculate distances from in both maps.</span>
<a name="l00546"></a>00546 <span class="comment">                 * \param  correspondences                        [OUT] The detected matchings pairs.</span>
<a name="l00547"></a>00547 <span class="comment">                 * \param  correspondencesRatio           [OUT] The ratio [0,1] of points in otherMap with at least one correspondence.</span>
<a name="l00548"></a>00548 <span class="comment">                 * \param  sumSqrDist                             [OUT] The sum of all matched points squared distances.If undesired, set to NULL, as default.</span>
<a name="l00549"></a>00549 <span class="comment">                 * \param  onlyKeepTheClosest         [IN] If set to true, only the closest correspondence will be returned. If false (default) all are returned.</span>
<a name="l00550"></a>00550 <span class="comment">                 *</span>
<a name="l00551"></a>00551 <span class="comment">                 * \sa compute3DMatchingRatio</span>
<a name="l00552"></a>00552 <span class="comment">                 */</span>
<a name="l00553"></a>00553                 <span class="keywordtype">void</span>  computeMatchingWith3D(
<a name="l00554"></a>00554                         <span class="keyword">const</span> <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>                                                *otherMap,
<a name="l00555"></a>00555                         <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="l00556"></a>00556                         <span class="keywordtype">float</span>                                                                   maxDistForCorrespondence,
<a name="l00557"></a>00557                         <span class="keywordtype">float</span>                                                                   maxAngularDistForCorrespondence,
<a name="l00558"></a>00558                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_point3_d.html" title="A class used to store a 3D point.">CPoint3D</a>                                                  &amp;angularDistPivotPoint,
<a name="l00559"></a>00559                         <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="l00560"></a>00560                         <span class="keywordtype">float</span>                                                                   &amp;correspondencesRatio,
<a name="l00561"></a>00561                         <span class="keywordtype">float</span>                                                                   *sumSqrDist     = NULL,
<a name="l00562"></a>00562                         <span class="keywordtype">bool</span>                                                                    onlyKeepTheClosest = <span class="keyword">true</span>,
<a name="l00563"></a>00563                         <span class="keywordtype">bool</span>                                                                    onlyUniqueRobust = <span class="keyword">false</span>,
<a name="l00564"></a>00564                         <span class="keyword">const</span> <span class="keywordtype">size_t</span>          decimation_other_map_points = 1,
<a name="l00565"></a>00565                         <span class="keyword">const</span> <span class="keywordtype">size_t</span>                            offset_other_map_points = 0 ) <span class="keyword">const</span>;
<a name="l00566"></a>00566 <span class="comment"></span>
<a name="l00567"></a>00567 <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="l00568"></a>00568 <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="l00569"></a>00569 <span class="comment">                 * \param  otherMap                                       [IN] The other map to compute the matching with.</span>
<a name="l00570"></a>00570 <span class="comment">                 * \param  otherMapPose                           [IN] The 6D pose of the other map as seen from &quot;this&quot;.</span>
<a name="l00571"></a>00571 <span class="comment">                 * \param  minDistForCorr                         [IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence.</span>
<a name="l00572"></a>00572 <span class="comment">                 * \param  minMahaDistForCorr             [IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence.</span>
<a name="l00573"></a>00573 <span class="comment">                 *</span>
<a name="l00574"></a>00574 <span class="comment">                 * \return The matching ratio [0,1]</span>
<a name="l00575"></a>00575 <span class="comment">                 * \sa computeMatchingWith2D</span>
<a name="l00576"></a>00576 <span class="comment">                 */</span>
<a name="l00577"></a>00577                 <span class="keywordtype">float</span>  compute3DMatchingRatio(
<a name="l00578"></a>00578                                 <span class="keyword">const</span> <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>                                                *otherMap,
<a name="l00579"></a>00579                                 <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="l00580"></a>00580                                 <span class="keywordtype">float</span>                                                                   minDistForCorr = 0.10f,
<a name="l00581"></a>00581                                 <span class="keywordtype">float</span>                                                                   minMahaDistForCorr = 2.0f
<a name="l00582"></a>00582                                 ) <span class="keyword">const</span>;
<a name="l00583"></a>00583 <span class="comment"></span>
<a name="l00584"></a>00584 <span class="comment">                /** Transform the range scan into a set of cartessian coordinated</span>
<a name="l00585"></a>00585 <span class="comment">                  *      points. The options in &quot;insertionOptions&quot; are considered in this method.</span>
<a name="l00586"></a>00586 <span class="comment">                  * \param rangeScan The scan to be inserted into this map</span>
<a name="l00587"></a>00587 <span class="comment">                  * \param robotPose The robot 3D pose, default to (0,0,0|0deg,0deg,0deg). It is used to compute the sensor pose relative to the robot actual pose. Recall sensor pose is embeded in the observation class.</span>
<a name="l00588"></a>00588 <span class="comment">                  *</span>
<a name="l00589"></a>00589 <span class="comment">                  *  Only ranges marked as &quot;valid=true&quot; in the observation will be inserted</span>
<a name="l00590"></a>00590 <span class="comment">                  *</span>
<a name="l00591"></a>00591 <span class="comment">                  *  \note Each derived class may enrich points in different ways (color, weight, etc..), so please refer to the description of the specific</span>
<a name="l00592"></a>00592 <span class="comment">                  *         implementation of mrpt::slam::CPointsMap you are using.</span>
<a name="l00593"></a>00593 <span class="comment">                  *  \note The actual generic implementation of this file lives in &lt;src&gt;/CPointsMap_crtp_common.h, but specific instantiations are generated at each derived class.</span>
<a name="l00594"></a>00594 <span class="comment">                  *</span>
<a name="l00595"></a>00595 <span class="comment">                  * \sa CObservation2DRangeScan, CObservation3DRangeScan</span>
<a name="l00596"></a>00596 <span class="comment">                  */</span>
<a name="l00597"></a>00597                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  loadFromRangeScan(
<a name="l00598"></a>00598                                 <span class="keyword">const</span> <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;rangeScan,
<a name="l00599"></a>00599                                 <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 ) = 0;
<a name="l00600"></a>00600 <span class="comment"></span>
<a name="l00601"></a>00601 <span class="comment">                /** Overload of \a loadFromRangeScan() for 3D range scans (for example, Kinect observations).</span>
<a name="l00602"></a>00602 <span class="comment">                  *</span>
<a name="l00603"></a>00603 <span class="comment">                  * \param rangeScan The scan to be inserted into this map</span>
<a name="l00604"></a>00604 <span class="comment">                  * \param robotPose The robot 3D pose, default to (0,0,0|0deg,0deg,0deg). It is used to compute the sensor pose relative to the robot actual pose. Recall sensor pose is embeded in the observation class.</span>
<a name="l00605"></a>00605 <span class="comment">                  *</span>
<a name="l00606"></a>00606 <span class="comment">                  *  \note Each derived class may enrich points in different ways (color, weight, etc..), so please refer to the description of the specific</span>
<a name="l00607"></a>00607 <span class="comment">                  *         implementation of mrpt::slam::CPointsMap you are using.</span>
<a name="l00608"></a>00608 <span class="comment">                  *  \note The actual generic implementation of this file lives in &lt;src&gt;/CPointsMap_crtp_common.h, but specific instantiations are generated at each derived class.</span>
<a name="l00609"></a>00609 <span class="comment">                  */</span>
<a name="l00610"></a>00610                 <span class="keyword">virtual</span> <span class="keywordtype">void</span>  loadFromRangeScan(
<a name="l00611"></a>00611                                 <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation3_d_range_scan.html" title="Declares a class derived from &quot;CObservation&quot; that encapsules a 3D range scan measurement (e...">CObservation3DRangeScan</a> &amp;rangeScan,
<a name="l00612"></a>00612                                 <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 ) = 0;
<a name="l00613"></a>00613 <span class="comment"></span>
<a name="l00614"></a>00614 <span class="comment">                /** Insert the contents of another map into this one, fusing the previous content with the new one.</span>
<a name="l00615"></a>00615 <span class="comment">                 *    This means that points very close to existing ones will be &quot;fused&quot;, rather than &quot;added&quot;. This prevents</span>
<a name="l00616"></a>00616 <span class="comment">                 *     the unbounded increase in size of these class of maps.</span>
<a name="l00617"></a>00617 <span class="comment">                 *              NOTICE that &quot;otherMap&quot; is neither translated nor rotated here, so if this is desired it must done</span>
<a name="l00618"></a>00618 <span class="comment">                 *               before calling this method.</span>
<a name="l00619"></a>00619 <span class="comment">                 * \param otherMap The other map whose points are to be inserted into this one.</span>
<a name="l00620"></a>00620 <span class="comment">                 * \param minDistForFuse Minimum distance (in meters) between two points, each one in a map, to be considered the same one and be fused rather than added.</span>
<a name="l00621"></a>00621 <span class="comment">                 * \param notFusedPoints If a pointer is supplied, this list will contain at output a list with a &quot;bool&quot; value per point in &quot;this&quot; map. This will be false/true according to that point having been fused or not.</span>
<a name="l00622"></a>00622 <span class="comment">                 * \sa loadFromRangeScan, addFrom</span>
<a name="l00623"></a>00623 <span class="comment">                 */</span>
<a name="l00624"></a>00624                 <span class="keywordtype">void</span>  fuseWith(
<a name="l00625"></a>00625                         <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>                      *anotherMap,
<a name="l00626"></a>00626                         <span class="keywordtype">float</span>                           minDistForFuse  = 0.02f,
<a name="l00627"></a>00627                         <a class="code" href="classstd_1_1vector.html">std::vector&lt;bool&gt;</a>       *notFusedPoints = NULL);
<a name="l00628"></a>00628 <span class="comment"></span>
<a name="l00629"></a>00629 <span class="comment">                /** Replace each point \f$ p_i \f$ by \f$ p&#39;_i = b \oplus p_i \f$ (pose compounding operator).</span>
<a name="l00630"></a>00630 <span class="comment">                  */</span>
<a name="l00631"></a>00631                 <span class="keywordtype">void</span>   changeCoordinatesReference(<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;b);
<a name="l00632"></a>00632 <span class="comment"></span>
<a name="l00633"></a>00633 <span class="comment">                /** Replace each point \f$ p_i \f$ by \f$ p&#39;_i = b \oplus p_i \f$ (pose compounding operator).</span>
<a name="l00634"></a>00634 <span class="comment">                  */</span>
<a name="l00635"></a>00635                 <span class="keywordtype">void</span>   changeCoordinatesReference(<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;b);
<a name="l00636"></a>00636 <span class="comment"></span>
<a name="l00637"></a>00637 <span class="comment">                /** Copy all the points from &quot;other&quot; map to &quot;this&quot;, replacing each point \f$ p_i \f$ by \f$ p&#39;_i = b \oplus p_i \f$ (pose compounding operator).</span>
<a name="l00638"></a>00638 <span class="comment">                  */</span>
<a name="l00639"></a>00639                 <span class="keywordtype">void</span>   changeCoordinatesReference(<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> &amp;other, <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;b);
<a name="l00640"></a>00640 <span class="comment"></span>
<a name="l00641"></a>00641 <span class="comment">                /** Returns true if the map is empty/no observation has been inserted.</span>
<a name="l00642"></a>00642 <span class="comment">                   */</span>
<a name="l00643"></a>00643                 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> isEmpty() <span class="keyword">const</span>;
<a name="l00644"></a>00644 <span class="comment"></span>
<a name="l00645"></a>00645 <span class="comment">                /** STL-like method to check whether the map is empty: */</span>
<a name="l00646"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a97b60ddee727ab5de5c62cc9cf52adf2">00646</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a97b60ddee727ab5de5c62cc9cf52adf2" title="STL-like method to check whether the map is empty:">empty</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> isEmpty(); }
<a name="l00647"></a>00647 <span class="comment"></span>
<a name="l00648"></a>00648 <span class="comment">                /** Returns a 3D object representing the map.</span>
<a name="l00649"></a>00649 <span class="comment">                  *  The color of the points is given by the static variables: COLOR_3DSCENE_R,COLOR_3DSCENE_G,COLOR_3DSCENE_B</span>
<a name="l00650"></a>00650 <span class="comment">                  * \sa mrpt::global_settings::POINTSMAPS_3DOBJECT_POINTSIZE</span>
<a name="l00651"></a>00651 <span class="comment">                  */</span>
<a name="l00652"></a>00652                 <span class="keyword">virtual</span> <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="l00653"></a>00653 <span class="comment"></span>
<a name="l00654"></a>00654 <span class="comment">                /** If the map is a simple points map or it&#39;s a multi-metric map that contains EXACTLY one simple points map, return it.</span>
<a name="l00655"></a>00655 <span class="comment">                        * Otherwise, return NULL</span>
<a name="l00656"></a>00656 <span class="comment">                        */</span>
<a name="l00657"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9846b0622be65148a62575533919eaa0">00657</a>                 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_simple_points_map.html" title="A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.">CSimplePointsMap</a> * <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9846b0622be65148a62575533919eaa0" title="If the map is a simple points map or it&#39;s a multi-metric map that contains EXACTLY one simple points ...">getAsSimplePointsMap</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> NULL; }
<a name="l00658"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a64c588c08d8ddbaf80c689c2ab06a72a">00658</a>                 <span class="keyword">virtual</span>       <a class="code" href="classmrpt_1_1slam_1_1_c_simple_points_map.html" title="A cloud of points in 2D or 3D, which can be built from a sequence of laser scans.">CSimplePointsMap</a> * <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a64c588c08d8ddbaf80c689c2ab06a72a">getAsSimplePointsMap</a>()       { <span class="keywordflow">return</span> NULL; }
<a name="l00659"></a>00659 
<a name="l00660"></a>00660 <span class="comment"></span>
<a name="l00661"></a>00661 <span class="comment">                /** This method returns the largest distance from the origin to any of the points, such as a sphere centered at the origin with this radius cover ALL the points in the map (the results are buffered, such as, if the map is not modified, the second call will be much faster than the first one). */</span>
<a name="l00662"></a>00662                 <span class="keywordtype">float</span>  getLargestDistanceFromOrigin() <span class="keyword">const</span>;
<a name="l00663"></a>00663 <span class="comment"></span>
<a name="l00664"></a>00664 <span class="comment">                /** Like \a getLargestDistanceFromOrigin() but returns in \a output_is_valid = false if the distance was not already computed, skipping its computation then, unlike getLargestDistanceFromOrigin() */</span>
<a name="l00665"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ab44fa5c6bce789384ea7a151a7b8fb1e">00665</a>                 <span class="keywordtype">float</span>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ab44fa5c6bce789384ea7a151a7b8fb1e" title="Like getLargestDistanceFromOrigin() but returns in output_is_valid = false if the distance was not al...">getLargestDistanceFromOriginNoRecompute</a>(<span class="keywordtype">bool</span> &amp;output_is_valid)<span class="keyword"> const </span>{
<a name="l00666"></a>00666                         output_is_valid = m_largestDistanceFromOriginIsUpdated;
<a name="l00667"></a>00667                         <span class="keywordflow">return</span> m_largestDistanceFromOrigin;
<a name="l00668"></a>00668                 }
<a name="l00669"></a>00669 <span class="comment"></span>
<a name="l00670"></a>00670 <span class="comment">                /** Computes the bounding box of all the points, or (0,0 ,0,0, 0,0) if there are no points.</span>
<a name="l00671"></a>00671 <span class="comment">                  *  Results are cached unless the map is somehow modified to avoid repeated calculations.</span>
<a name="l00672"></a>00672 <span class="comment">                  */</span>
<a name="l00673"></a>00673                 <span class="keywordtype">void</span> boundingBox( <span class="keywordtype">float</span> &amp;min_x,<span class="keywordtype">float</span> &amp;max_x,<span class="keywordtype">float</span> &amp;min_y,<span class="keywordtype">float</span> &amp;max_y,<span class="keywordtype">float</span> &amp;min_z,<span class="keywordtype">float</span> &amp;max_z ) <span class="keyword">const</span>;
<a name="l00674"></a>00674 
<a name="l00675"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#afb579f7666e1a32990e1656e4bfc79ec">00675</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#afb579f7666e1a32990e1656e4bfc79ec">boundingBox</a>(<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;pMin,<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html" title="Lightweight 3D point.">TPoint3D</a> &amp;pMax)<span class="keyword"> const    </span>{
<a name="l00676"></a>00676                         <span class="keywordtype">float</span> dmy1,dmy2,dmy3,dmy4,dmy5,dmy6;
<a name="l00677"></a>00677                         boundingBox(dmy1,dmy2,dmy3,dmy4,dmy5,dmy6);
<a name="l00678"></a>00678                         pMin.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a5014ee49d97866d293568300b619a7e2" title="X coordinate.">x</a>=dmy1;
<a name="l00679"></a>00679                         pMin.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#aec879c0d61d8446e93b7d09344931d37" title="Y coordinate.">y</a>=dmy2;
<a name="l00680"></a>00680                         pMin.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a61df04839b9146696e696fc7af3bc307" title="Z coordinate.">z</a>=dmy3;
<a name="l00681"></a>00681                         pMax.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a5014ee49d97866d293568300b619a7e2" title="X coordinate.">x</a>=dmy4;
<a name="l00682"></a>00682                         pMax.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#aec879c0d61d8446e93b7d09344931d37" title="Y coordinate.">y</a>=dmy5;
<a name="l00683"></a>00683                         pMax.<a class="code" href="structmrpt_1_1math_1_1_t_point3_d.html#a61df04839b9146696e696fc7af3bc307" title="Z coordinate.">z</a>=dmy6;
<a name="l00684"></a>00684                 }
<a name="l00685"></a>00685 
<a name="l00686"></a>00686                 <span class="keywordtype">void</span> extractCylinder( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_point2_d.html" title="A class used to store a 2D point.">CPoint2D</a> &amp;center, <span class="keyword">const</span> <span class="keywordtype">double</span> radius, <span class="keyword">const</span> <span class="keywordtype">double</span> zmin, <span class="keyword">const</span> <span class="keywordtype">double</span> zmax, <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> *outMap );
<a name="l00687"></a>00687 <span class="comment"></span>
<a name="l00688"></a>00688 <span class="comment">                /** @name Filter-by-height stuff</span>
<a name="l00689"></a>00689 <span class="comment">                        @{ */</span>
<a name="l00690"></a>00690 <span class="comment"></span>
<a name="l00691"></a>00691 <span class="comment">                /** Enable/disable the filter-by-height functionality \sa setHeightFilterLevels \note Default upon construction is disabled. */</span>
<a name="l00692"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ab9063f7c83687192a2f739863c8ba80f">00692</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ab9063f7c83687192a2f739863c8ba80f" title="Enable/disable the filter-by-height functionality.">enableFilterByHeight</a>(<span class="keywordtype">bool</span> enable=<span class="keyword">true</span>) { m_heightfilter_enabled=enable; }<span class="comment"></span>
<a name="l00693"></a>00693 <span class="comment">                /** Return whether filter-by-height is enabled \sa enableFilterByHeight */</span>
<a name="l00694"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#acbd445624ea8c62e5587342dc3ae4d6f">00694</a>                 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#acbd445624ea8c62e5587342dc3ae4d6f" title="Return whether filter-by-height is enabled.">isFilterByHeightEnabled</a>()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> m_heightfilter_enabled; }
<a name="l00695"></a>00695 <span class="comment"></span>
<a name="l00696"></a>00696 <span class="comment">                /** Set the min/max Z levels for points to be actually inserted in the map (only if \a enableFilterByHeight() was called before). */</span>
<a name="l00697"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a577223305acb3f6a9900a352c9522e86">00697</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a577223305acb3f6a9900a352c9522e86" title="Set the min/max Z levels for points to be actually inserted in the map (only if enableFilterByHeight(...">setHeightFilterLevels</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> _z_min, <span class="keyword">const</span> <span class="keywordtype">double</span> _z_max) { m_heightfilter_z_min=_z_min; m_heightfilter_z_max=_z_max; }<span class="comment"></span>
<a name="l00698"></a>00698 <span class="comment">                /** Get the min/max Z levels for points to be actually inserted in the map \sa enableFilterByHeight, setHeightFilterLevels */</span>
<a name="l00699"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a0e18ecb30fb7c35d4dcaf329c6b4f88d">00699</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a0e18ecb30fb7c35d4dcaf329c6b4f88d" title="Get the min/max Z levels for points to be actually inserted in the map.">getHeightFilterLevels</a>(<span class="keywordtype">double</span> &amp;_z_min, <span class="keywordtype">double</span> &amp;_z_max)<span class="keyword"> const </span>{ _z_min=m_heightfilter_z_min; _z_max=m_heightfilter_z_max; }
<a name="l00700"></a>00700 <span class="comment"></span>
<a name="l00701"></a>00701 <span class="comment">                /** @} */</span>
<a name="l00702"></a>00702 <span class="comment"></span>
<a name="l00703"></a>00703 <span class="comment">                /** The color [0,1] of points when extracted from getAs3DObject (default=blue) */</span>
<a name="l00704"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a8903a53dd6a311cb590084b05d36d8d6">00704</a>                 <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a8903a53dd6a311cb590084b05d36d8d6" title="The color [0,1] of points when extracted from getAs3DObject (default=blue)">COLOR_3DSCENE_R</a>;
<a name="l00705"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#abf258aab6bac3c1a3b8eb608851a65d8">00705</a>                 <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#abf258aab6bac3c1a3b8eb608851a65d8">COLOR_3DSCENE_G</a>;
<a name="l00706"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9e6d8616374de431d3e37426c547e6d2">00706</a>                 <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9e6d8616374de431d3e37426c547e6d2">COLOR_3DSCENE_B</a>;
<a name="l00707"></a>00707 
<a name="l00708"></a>00708 <span class="comment"></span>
<a name="l00709"></a>00709 <span class="comment">                /** Computes the likelihood of taking a given observation from a given pose in the world being modeled with this map.</span>
<a name="l00710"></a>00710 <span class="comment">                 * \param takenFrom The robot&#39;s pose the observation is supposed to be taken from.</span>
<a name="l00711"></a>00711 <span class="comment">                 * \param obs The observation.</span>
<a name="l00712"></a>00712 <span class="comment">                 * \return This method returns a likelihood in the range [0,1].</span>
<a name="l00713"></a>00713 <span class="comment">                 *</span>
<a name="l00714"></a>00714 <span class="comment">                 * \sa Used in particle filter algorithms, see: CMultiMetricMapPDF</span>
<a name="l00715"></a>00715 <span class="comment">                 * \note In CPointsMap this method is virtual so it can be redefined in derived classes, if desired.</span>
<a name="l00716"></a>00716 <span class="comment">                 */</span>
<a name="l00717"></a>00717                 <span class="keyword">virtual</span> <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="l00718"></a>00718 <span class="comment"></span>
<a name="l00719"></a>00719 <span class="comment">        /** @name PCL library support</span>
<a name="l00720"></a>00720 <span class="comment">            @{ */</span>
<a name="l00721"></a>00721 
<a name="l00722"></a>00722 <span class="comment"></span>
<a name="l00723"></a>00723 <span class="comment">        /** Use to convert this MRPT point cloud object into a PCL point cloud object.</span>
<a name="l00724"></a>00724 <span class="comment">          *  Usage example:</span>
<a name="l00725"></a>00725 <span class="comment">          *  \code</span>
<a name="l00726"></a>00726 <span class="comment">          *    mrpt::slam::CPointsCloud       pc;</span>
<a name="l00727"></a>00727 <span class="comment">          *    pcl::PointCloud&lt;pcl::PointXYZ&gt; cloud;</span>
<a name="l00728"></a>00728 <span class="comment">          *</span>
<a name="l00729"></a>00729 <span class="comment">          *    pc.getPCLPointCloud(cloud);</span>
<a name="l00730"></a>00730 <span class="comment">          *  \endcode</span>
<a name="l00731"></a>00731 <span class="comment">          */</span>
<a name="l00732"></a>00732         <span class="keyword">template</span> &lt;<span class="keyword">class</span> POINTCLOUD&gt;
<a name="l00733"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ac7ef4277ce42b02e575cbbbcee9817dd">00733</a>         <span class="keywordtype">void</span> getPCLPointCloud(POINTCLOUD &amp;cloud)<span class="keyword"> const</span>
<a name="l00734"></a>00734 <span class="keyword">        </span>{
<a name="l00735"></a>00735             <span class="keyword">const</span> <span class="keywordtype">size_t</span> nThis = this-&gt;<a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>();
<a name="l00736"></a>00736             <span class="comment">// Fill in the cloud data</span>
<a name="l00737"></a>00737             cloud.width    = nThis;
<a name="l00738"></a>00738             cloud.height   = 1;
<a name="l00739"></a>00739             cloud.is_dense = <span class="keyword">false</span>;
<a name="l00740"></a>00740             cloud.points.resize(cloud.width * cloud.height);
<a name="l00741"></a>00741             <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; nThis; ++i) {
<a name="l00742"></a>00742                 cloud.points[i].x =this-&gt;x[i];
<a name="l00743"></a>00743                 cloud.points[i].y =this-&gt;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>[i];
<a name="l00744"></a>00744                 cloud.points[i].z =this-&gt;z[i];
<a name="l00745"></a>00745             }
<a name="l00746"></a>00746         }
<a name="l00747"></a>00747 <span class="comment"></span>
<a name="l00748"></a>00748 <span class="comment">        /** @} */</span>
<a name="l00749"></a>00749 <span class="comment"></span>
<a name="l00750"></a>00750 <span class="comment">                /** @name Methods that MUST be implemented by children classes of KDTreeCapable</span>
<a name="l00751"></a>00751 <span class="comment">                        @{ */</span>
<a name="l00752"></a>00752 <span class="comment"></span>
<a name="l00753"></a>00753 <span class="comment">                /// Must return the number of data points</span>
<a name="l00754"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a71debc2cba084a2c63fbc04412f841f3">00754</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a71debc2cba084a2c63fbc04412f841f3" title="Must return the number of data points.">kdtree_get_point_count</a>()<span class="keyword"> const </span>{  <span class="keywordflow">return</span> this-&gt;<a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>(); }
<a name="l00755"></a>00755 <span class="comment"></span>
<a name="l00756"></a>00756 <span class="comment">                /// Returns the dim&#39;th component of the idx&#39;th point in the class:</span>
<a name="l00757"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ad45e1f1a45c016e4df2d54f6d233420a">00757</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ad45e1f1a45c016e4df2d54f6d233420a" title="Returns the dim&#39;th component of the idx&#39;th point in the class:">kdtree_get_pt</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> idx, <span class="keywordtype">int</span> dim)<span class="keyword"> const </span>{
<a name="l00758"></a>00758                         <span class="keywordflow">if</span> (dim==0) <span class="keywordflow">return</span> this-&gt;x[idx];
<a name="l00759"></a>00759                         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dim==1) <span class="keywordflow">return</span> this-&gt;<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>[idx];
<a name="l00760"></a>00760                         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dim==2) <span class="keywordflow">return</span> this-&gt;z[idx]; <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0;
<a name="l00761"></a>00761                 }
<a name="l00762"></a>00762 <span class="comment"></span>
<a name="l00763"></a>00763 <span class="comment">                /// Returns the distance between the vector &quot;p1[0:size-1]&quot; and the data point with index &quot;idx_p2&quot; stored in the class:</span>
<a name="l00764"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af949c6bbd44c833213e6842bc9048dd2">00764</a> <span class="comment"></span>                <span class="keyword">inline</span> <span class="keywordtype">float</span> kdtree_distance(<span class="keyword">const</span> <span class="keywordtype">float</span> *p1, <span class="keyword">const</span> <span class="keywordtype">size_t</span> idx_p2,<span class="keywordtype">size_t</span> <a class="code" href="namespacemrpt_1_1math.html#a632ae0aecf78103f87f18f9ac33f7170">size</a>)<span class="keyword"> const</span>
<a name="l00765"></a>00765 <span class="keyword">                </span>{
<a name="l00766"></a>00766                         <span class="keywordflow">if</span> (size==2)
<a name="l00767"></a>00767                         {
<a name="l00768"></a>00768                                 <span class="keyword">const</span> <span class="keywordtype">float</span> d0 = p1[0]-x[idx_p2];
<a name="l00769"></a>00769                                 <span class="keyword">const</span> <span class="keywordtype">float</span> d1 = p1[1]-<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>[idx_p2];
<a name="l00770"></a>00770                                 <span class="keywordflow">return</span> d0*d0+d1*d1;
<a name="l00771"></a>00771                         }
<a name="l00772"></a>00772                         <span class="keywordflow">else</span>
<a name="l00773"></a>00773                         {
<a name="l00774"></a>00774                                 <span class="keyword">const</span> <span class="keywordtype">float</span> d0 = p1[0]-x[idx_p2];
<a name="l00775"></a>00775                                 <span class="keyword">const</span> <span class="keywordtype">float</span> d1 = p1[1]-<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>[idx_p2];
<a name="l00776"></a>00776                                 <span class="keyword">const</span> <span class="keywordtype">float</span> d2 = p1[2]-z[idx_p2];
<a name="l00777"></a>00777                                 <span class="keywordflow">return</span> d0*d0+d1*d1+d2*d2;
<a name="l00778"></a>00778                         }
<a name="l00779"></a>00779                 }
<a name="l00780"></a>00780 
<a name="l00781"></a>00781                 <span class="comment">// Optional bounding-box computation: return false to default to a standard bbox computation loop.</span>
<a name="l00782"></a>00782                 <span class="comment">//   Return true if the BBOX was already computed by the class and returned in &quot;bb&quot; so it can be avoided to redo it again.</span>
<a name="l00783"></a>00783                 <span class="comment">//   Look at bb.size() to find out the expected dimensionality (e.g. 2 or 3 for point clouds)</span>
<a name="l00784"></a>00784                 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> BBOX&gt;
<a name="l00785"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a04e670ff64c79b8a66824bcf98ac7e5d">00785</a>                 <span class="keywordtype">bool</span> kdtree_get_bbox(BBOX &amp;bb)<span class="keyword"> const</span>
<a name="l00786"></a>00786 <span class="keyword">                </span>{
<a name="l00787"></a>00787                         <span class="keywordtype">float</span> min_z,max_z;
<a name="l00788"></a>00788                         this-&gt;boundingBox(
<a name="l00789"></a>00789                                 bb[0].low, bb[0].high,
<a name="l00790"></a>00790                                 bb[1].low, bb[1].high,
<a name="l00791"></a>00791                                 min_z,max_z);
<a name="l00792"></a>00792                         <span class="keywordflow">if</span> (bb.size()==3) {
<a name="l00793"></a>00793                                 bb[2].low = min_z; bb[2].high = max_z;
<a name="l00794"></a>00794                         }
<a name="l00795"></a>00795                         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00796"></a>00796                 }
<a name="l00797"></a>00797 
<a name="l00798"></a>00798 <span class="comment"></span>
<a name="l00799"></a>00799 <span class="comment">                /** @} */</span>
<a name="l00800"></a>00800 
<a name="l00801"></a>00801         <span class="keyword">protected</span>:
<a name="l00802"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a347bc872aaa9cf01b17a6f087fb8c6c1">00802</a>                 std<a class="code" href="classstd_1_1vector.html">::vector&lt;float&gt;</a>     x,<a class="code" href="namespace_eigen_1_1internal.html#a3d7a581aeb951248dc6fe114e9e05f07">y</a>,<a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a347bc872aaa9cf01b17a6f087fb8c6c1" title="The point coordinates.">z</a>;        <span class="comment">//!&lt; The point coordinates</span>
<a name="l00803"></a>00803 <span class="comment"></span>
<a name="l00804"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a90235c924f8595aea0ef5a10c2bea86a">00804</a>                 <a class="code" href="classmrpt_1_1slam_1_1_c_sin_cos_look_up_table_for2_d_scans.html" title="A smart look-up-table (LUT) of sin/cos values for 2D laser scans.">CSinCosLookUpTableFor2DScans</a>  <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a90235c924f8595aea0ef5a10c2bea86a" title="Cache of sin/cos values for the latest 2D scan geometries.">m_scans_sincos_cache</a>; <span class="comment">//!&lt; Cache of sin/cos values for the latest 2D scan geometries.</span>
<a name="l00805"></a>00805 <span class="comment"></span><span class="comment"></span>
<a name="l00806"></a>00806 <span class="comment">                /** Auxiliary variables used in &quot;getLargestDistanceFromOrigin&quot;</span>
<a name="l00807"></a>00807 <span class="comment">                  * \sa getLargestDistanceFromOrigin</span>
<a name="l00808"></a>00808 <span class="comment">                  */</span>
<a name="l00809"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9a36f0fde69940fce6bc648a35b4bbe3">00809</a>                 <span class="keyword">mutable</span> <span class="keywordtype">float</span>   <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a9a36f0fde69940fce6bc648a35b4bbe3" title="Auxiliary variables used in &quot;getLargestDistanceFromOrigin&quot;.">m_largestDistanceFromOrigin</a>;
<a name="l00810"></a>00810 <span class="comment"></span>
<a name="l00811"></a>00811 <span class="comment">                /** Auxiliary variables used in &quot;getLargestDistanceFromOrigin&quot;</span>
<a name="l00812"></a>00812 <span class="comment">                  * \sa getLargestDistanceFromOrigin</span>
<a name="l00813"></a>00813 <span class="comment">                  */</span>
<a name="l00814"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a095ebbf33aad995e1a67462194f669a4">00814</a>                 <span class="keyword">mutable</span> <span class="keywordtype">bool</span>    <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a095ebbf33aad995e1a67462194f669a4" title="Auxiliary variables used in &quot;getLargestDistanceFromOrigin&quot;.">m_largestDistanceFromOriginIsUpdated</a>;
<a name="l00815"></a>00815 
<a name="l00816"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af0f33257b75543f76629ff9f1ed2ab2f">00816</a>                 <span class="keyword">mutable</span> <span class="keywordtype">bool</span>    <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af0f33257b75543f76629ff9f1ed2ab2f">m_boundingBoxIsUpdated</a>;
<a name="l00817"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aa1e45bcc45cfb68847304766509a0055">00817</a>                 <span class="keyword">mutable</span> <span class="keywordtype">float</span>   m_bb_min_x,m_bb_max_x, m_bb_min_y,m_bb_max_y, <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aa1e45bcc45cfb68847304766509a0055">m_bb_min_z</a>,m_bb_max_z;
<a name="l00818"></a>00818 
<a name="l00819"></a>00819 <span class="comment"></span>
<a name="l00820"></a>00820 <span class="comment">                /** Called only by this class or children classes, set m_largestDistanceFromOriginIsUpdated=false and such. */</span>
<a name="l00821"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ad5028a5349d4f0b2f16bb490efa387cc">00821</a>                 <span class="keyword">inline</span> <span class="keywordtype">void</span> mark_as_modified()<span class="keyword"> const</span>
<a name="l00822"></a>00822 <span class="keyword">                </span>{
<a name="l00823"></a>00823                         m_largestDistanceFromOriginIsUpdated=<span class="keyword">false</span>;
<a name="l00824"></a>00824                         m_boundingBoxIsUpdated = <span class="keyword">false</span>;
<a name="l00825"></a>00825                         kdtree_mark_as_outdated();
<a name="l00826"></a>00826                 }
<a name="l00827"></a>00827 <span class="comment"></span>
<a name="l00828"></a>00828 <span class="comment">                /** This is a common version of CMetricMap::insertObservation() for point maps (actually, CMetricMap::internal_insertObservation),</span>
<a name="l00829"></a>00829 <span class="comment">                  *   so derived classes don&#39;t need to worry implementing that method unless something special is really necesary.</span>
<a name="l00830"></a>00830 <span class="comment">                  * See mrpt::slam::CPointsMap for the enumeration of types of observations which are accepted.</span>
<a name="l00831"></a>00831 <span class="comment">                  */</span>
<a name="l00832"></a>00832                 <span class="keywordtype">bool</span>  internal_insertObservation(
<a name="l00833"></a>00833                         <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="l00834"></a>00834                         <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);
<a name="l00835"></a>00835 <span class="comment"></span>
<a name="l00836"></a>00836 <span class="comment">                /** Helper method for ::copyFrom() */</span>
<a name="l00837"></a>00837                 <span class="keywordtype">void</span>  base_copyFrom(<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> &amp;obj);
<a name="l00838"></a>00838 
<a name="l00839"></a>00839 <span class="comment"></span>
<a name="l00840"></a>00840 <span class="comment">                /** @name PLY Import virtual methods to implement in base classes</span>
<a name="l00841"></a>00841 <span class="comment">                        @{ */</span><span class="comment"></span>
<a name="l00842"></a>00842 <span class="comment">                /** In a base class, reserve memory to prepare subsequent calls to PLY_import_set_face */</span>
<a name="l00843"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ad9ea76652470ebba193d23234d93dd56">00843</a>                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#ad9ea76652470ebba193d23234d93dd56" title="In a base class, reserve memory to prepare subsequent calls to PLY_import_set_face.">PLY_import_set_face_count</a>(<span class="keyword">const</span> <span class="keywordtype">size_t</span> N) {  }
<a name="l00844"></a>00844 <span class="comment"></span>
<a name="l00845"></a>00845 <span class="comment">                /** In a base class, will be called after PLY_import_set_vertex_count() once for each loaded point.</span>
<a name="l00846"></a>00846 <span class="comment">                  *  \param pt_color Will be NULL if the loaded file does not provide color info.</span>
<a name="l00847"></a>00847 <span class="comment">                  */</span>
<a name="l00848"></a>00848                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> PLY_import_set_vertex(<span class="keyword">const</span> <span class="keywordtype">size_t</span> idx, <span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_point3_df.html" title="Lightweight 3D point (float version).">mrpt::math::TPoint3Df</a> &amp;pt, <span class="keyword">const</span> <a class="code" href="structmrpt_1_1utils_1_1_t_colorf.html" title="A RGB color - floats in the range [0,1].">mrpt::utils::TColorf</a> *pt_color = NULL);<span class="comment"></span>
<a name="l00849"></a>00849 <span class="comment">                /** @} */</span>
<a name="l00850"></a>00850 <span class="comment"></span>
<a name="l00851"></a>00851 <span class="comment">                /** @name PLY Export virtual methods to implement in base classes</span>
<a name="l00852"></a>00852 <span class="comment">                        @{ */</span>
<a name="l00853"></a>00853 <span class="comment"></span>
<a name="l00854"></a>00854 <span class="comment">                /** In a base class, return the number of vertices */</span>
<a name="l00855"></a>00855                 <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> PLY_export_get_vertex_count() <span class="keyword">const</span>;
<a name="l00856"></a>00856 <span class="comment"></span>
<a name="l00857"></a>00857 <span class="comment">                /** In a base class, return the number of faces */</span>
<a name="l00858"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aea9230b8985aa6eb82d55110049343e8">00858</a>                 <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aea9230b8985aa6eb82d55110049343e8" title="In a base class, return the number of faces.">PLY_export_get_face_count</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; }
<a name="l00859"></a>00859 <span class="comment"></span>
<a name="l00860"></a>00860 <span class="comment">                /** In a base class, will be called after PLY_export_get_vertex_count() once for each exported point.</span>
<a name="l00861"></a>00861 <span class="comment">                  *  \param pt_color Will be NULL if the loaded file does not provide color info.</span>
<a name="l00862"></a>00862 <span class="comment">                  */</span>
<a name="l00863"></a>00863                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> PLY_export_get_vertex(
<a name="l00864"></a>00864                         <span class="keyword">const</span> <span class="keywordtype">size_t</span> idx,
<a name="l00865"></a>00865                         <a class="code" href="structmrpt_1_1math_1_1_t_point3_df.html" title="Lightweight 3D point (float version).">mrpt::math::TPoint3Df</a> &amp;pt,
<a name="l00866"></a>00866                         <span class="keywordtype">bool</span> &amp;pt_has_color,
<a name="l00867"></a>00867                         <a class="code" href="structmrpt_1_1utils_1_1_t_colorf.html" title="A RGB color - floats in the range [0,1].">mrpt::utils::TColorf</a> &amp;pt_color) <span class="keyword">const</span>;
<a name="l00868"></a>00868 <span class="comment"></span>
<a name="l00869"></a>00869 <span class="comment">                /** @} */</span>
<a name="l00870"></a>00870 <span class="comment"></span>
<a name="l00871"></a>00871 <span class="comment">                /** The minimum and maximum height for a certain laser scan to be inserted into this map</span>
<a name="l00872"></a>00872 <span class="comment">                   * \sa m_heightfilter_enabled */</span>
<a name="l00873"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af10f5171b41b28f17e93179bdfe98e55">00873</a>                 <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#af10f5171b41b28f17e93179bdfe98e55" title="The minimum and maximum height for a certain laser scan to be inserted into this map.">m_heightfilter_z_min</a>, m_heightfilter_z_max;
<a name="l00874"></a>00874 <span class="comment"></span>
<a name="l00875"></a>00875 <span class="comment">                /** Whether or not (default=not) filter the input points by height</span>
<a name="l00876"></a>00876 <span class="comment">                  * \sa m_heightfilter_z_min, m_heightfilter_z_max */</span>
<a name="l00877"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a663718e0db4253ff846bc8c3af4dba63">00877</a>                 <span class="keywordtype">bool</span> <a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a663718e0db4253ff846bc8c3af4dba63" title="Whether or not (default=not) filter the input points by height.">m_heightfilter_enabled</a>;
<a name="l00878"></a>00878 
<a name="l00879"></a>00879 
<a name="l00880"></a>00880                 <span class="comment">// Friend methods:</span>
<a name="l00881"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#a700526b4e30cabbc0586c55a7b6f6741">00881</a>                 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Derived&gt; <span class="keyword">friend</span> <span class="keyword">struct </span>detail::loadFromRangeImpl;
<a name="l00882"></a><a class="code" href="classmrpt_1_1slam_1_1_c_points_map.html#aafa381e2b3f5424967299d7ff37dc181">00882</a>                 <span class="keyword">template</span> &lt;<span class="keyword">class</span> Derived&gt; <span class="keyword">friend</span> <span class="keyword">struct </span>detail::pointmap_traits;
<a name="l00883"></a>00883 
<a name="l00884"></a>00884 
<a name="l00885"></a>00885         }; <span class="comment">// End of class def.</span>
<a name="l00886"></a>00886 
<a name="l00887"></a>00887         } <span class="comment">// End of namespace</span>
<a name="l00888"></a>00888 
<a name="l00889"></a>00889         <span class="keyword">namespace </span>global_settings
<a name="l00890"></a>00890         {<span class="comment"></span>
<a name="l00891"></a>00891 <span class="comment">                /** The size of points when exporting with getAs3DObject() (default=3.0)</span>
<a name="l00892"></a>00892 <span class="comment">                  * Affects to:</span>
<a name="l00893"></a>00893 <span class="comment">                  *             - mrpt::slam::CPointsMap and all its children classes.</span>
<a name="l00894"></a>00894 <span class="comment">                  */</span>
<a name="l00895"></a>00895                 <span class="keyword">extern</span> <a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> <span class="keywordtype">float</span> <a class="code" href="namespacemrpt_1_1global__settings.html#a82116abc80994c2092c0fc7f2d05d304" title="The size of points when exporting with getAs3DObject() (default=3.0) Affects to:">POINTSMAPS_3DOBJECT_POINTSIZE</a>;
<a name="l00896"></a>00896         }
<a name="l00897"></a>00897 } <span class="comment">// End of namespace</span>
<a name="l00898"></a>00898 
<a name="l00899"></a>00899 <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>