Sophie

Sophie

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

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>CNetworkOfPoses.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">CNetworkOfPoses.h</div>  </div>
</div>
<div class="contents">
<a href="_c_network_of_poses_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 CONSTRAINED_POSE_NETWORK_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define CONSTRAINED_POSE_NETWORK_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_pose_p_d_f_gaussian_8h.html">mrpt/poses/CPosePDFGaussian.h</a>&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="_c_pose3_d_p_d_f_gaussian_8h.html">mrpt/poses/CPose3DPDFGaussian.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="_c_pose_p_d_f_gaussian_inf_8h.html">mrpt/poses/CPosePDFGaussianInf.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="_c_pose3_d_p_d_f_gaussian_inf_8h.html">mrpt/poses/CPose3DPDFGaussianInf.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="_c_directed_graph_8h.html">mrpt/graphs/CDirectedGraph.h</a>&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="_c_directed_tree_8h.html">mrpt/graphs/CDirectedTree.h</a>&gt;</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;<a class="code" href="_c_serializable_8h.html">mrpt/utils/CSerializable.h</a>&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;<a class="code" href="_c_file_g_z_input_stream_8h.html">mrpt/utils/CFileGZInputStream.h</a>&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;<a class="code" href="_c_file_g_z_output_stream_8h.html">mrpt/utils/CFileGZOutputStream.h</a>&gt;</span>
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;<a class="code" href="traits__map_8h.html">mrpt/utils/traits_map.h</a>&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;<a class="code" href="stl__extensions_8h.html">mrpt/utils/stl_extensions.h</a>&gt;</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#include &lt;<a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html">mrpt/graphs/link_pragmas.h</a>&gt;</span>
<a name="l00046"></a>00046 
<a name="l00047"></a>00047 <span class="comment">// The main class in this file is CNetworkOfPoses, a generic basic template for</span>
<a name="l00048"></a>00048 <span class="comment">//  predefined 2D/3D graphs of pose contraints.</span>
<a name="l00049"></a>00049 <span class="keyword">namespace </span>mrpt
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051         <span class="keyword">namespace </span>graphs
<a name="l00052"></a>00052         {
<a name="l00053"></a>00053                 <span class="keyword">using</span> mrpt<a class="code" href="namespacemrpt_1_1utils.html#a718b4f99645b7e9f6501c9b7bb2a2fe7" title="The type for node IDs in graphs of different types.">::utils::TNodeID</a>;
<a name="l00054"></a>00054                 <span class="keyword">using namespace </span>mrpt::utils;
<a name="l00055"></a>00055 <span class="comment"></span>
<a name="l00056"></a>00056 <span class="comment">                /** Internal functions for MRPT */</span>
<a name="l00057"></a>00057                 <span class="keyword">namespace </span>detail
<a name="l00058"></a>00058                 {
<a name="l00059"></a>00059                         <span class="keyword">template</span> &lt;<span class="keyword">class</span> GRAPH_T&gt; <span class="keyword">struct </span>graph_ops;
<a name="l00060"></a>00060 <span class="comment">//                      template&lt;class GRAPH_T&gt; void save_graph_of_poses_from_text_file(const GRAPH_T *g, const std::string &amp;fil);</span>
<a name="l00061"></a>00061 <span class="comment">//                      template&lt;class GRAPH_T&gt; void load_graph_of_poses_from_text_file(GRAPH_T* g, const std::string &amp;fil);</span>
<a name="l00062"></a>00062 <span class="comment">//                      template&lt;class GRAPH_T&gt; void graph_of_poses_dijkstra_init(GRAPH_T *g);</span>
<a name="l00063"></a>00063 <span class="comment">//                      template&lt;class GRAPH_T&gt; size_t graph_of_poses_collapse_dup_edges(GRAPH_T *g);</span>
<a name="l00064"></a>00064 <span class="comment">//                      template&lt;class GRAPH_T&gt; double graph_edge_sqerror(const GRAPH_T *g, const typename mrpt::graphs::CDirectedGraph&lt;typename GRAPH_T::constraint_t&gt;::edges_map_t::const_iterator &amp;itEdge, bool ignoreCovariances );</span>
<a name="l00065"></a>00065 <span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">                        /** An empty structure */</span>
<a name="l00067"></a>00067                         <span class="keyword">struct </span>node_annotations_empty {  };
<a name="l00068"></a>00068                 }
<a name="l00069"></a>00069 <span class="comment"></span>
<a name="l00070"></a>00070 <span class="comment">                /** A directed graph of pose constraints, with edges being the relative pose between pairs of nodes indentified by their numeric IDs (of type TNodeID).</span>
<a name="l00071"></a>00071 <span class="comment">                  *  A link or edge between two nodes &quot;i&quot; and &quot;j&quot;, that is, the pose \f$ p_{ij} \f$, holds the relative position of &quot;j&quot; with respect to &quot;i&quot;.</span>
<a name="l00072"></a>00072 <span class="comment">                  *   These poses are stored in the edges in the format specified by the template argument CPOSE. Users should employ the following derived classes</span>
<a name="l00073"></a>00073 <span class="comment">                  *   depending on the desired representation of edges:</span>
<a name="l00074"></a>00074 <span class="comment">                  *      - mrpt::graphs::CNetworkOfPoses2D    : 2D edges as a simple CPose2D (x y phi)</span>
<a name="l00075"></a>00075 <span class="comment">                  *      - mrpt::graphs::CNetworkOfPoses3D    : 3D edges as a simple CPose3D (x y z yaw pitch roll)</span>
<a name="l00076"></a>00076 <span class="comment">                  *      - mrpt::graphs::CNetworkOfPoses2DInf : 2D edges as a Gaussian PDF with information matrix ( CPosePDFGaussianInf )</span>
<a name="l00077"></a>00077 <span class="comment">                  *      - mrpt::graphs::CNetworkOfPoses3DInf : 3D edges as a Gaussian PDF with information matrix ( CPose3DPDFGaussianInf )</span>
<a name="l00078"></a>00078 <span class="comment">                  *      - mrpt::graphs::CNetworkOfPoses2DCov : 2D edges as a Gaussian PDF with covariance matrix ( CPosePDFGaussian ). It&#39;s more efficient to use the information matrix version instead!</span>
<a name="l00079"></a>00079 <span class="comment">                  *      - mrpt::graphs::CNetworkOfPoses3DCov : 3D edges as a Gaussian PDF with covariance matrix ( CPose3DPDFGaussian ). It&#39;s more efficient to use the information matrix version instead!</span>
<a name="l00080"></a>00080 <span class="comment">                  *</span>
<a name="l00081"></a>00081 <span class="comment">                  *  Two main members store all the information in this class:</span>
<a name="l00082"></a>00082 <span class="comment">                  *             - \a edge  (in the base class mrpt::graphs::CDirectedGraph::edge): A map from pairs of node ID -&gt; pose constraints.</span>
<a name="l00083"></a>00083 <span class="comment">                  *             - \a nodes : A map from node ID -&gt; estimated pose of that node (actually, read below on the template argument MAPS_IMPLEMENTATION).</span>
<a name="l00084"></a>00084 <span class="comment">                  *</span>
<a name="l00085"></a>00085 <span class="comment">                  *  Graphs can be loaded and saved to text file in the format used by TORO &amp; HoG-man (more on the format &lt;a href=&quot;http://www.mrpt.org/Robotics_file_formats&quot; &gt;here&lt;/a&gt; ),</span>
<a name="l00086"></a>00086 <span class="comment">                  *   using \a loadFromTextFile and \a saveToTextFile.</span>
<a name="l00087"></a>00087 <span class="comment">                  *</span>
<a name="l00088"></a>00088 <span class="comment">                  *  This class is the base for representing networks of poses, which are the main data type of a series</span>
<a name="l00089"></a>00089 <span class="comment">                  *   of SLAM algorithms implemented in the library mrpt-slam, in the namespace mrpt::graphslam.</span>
<a name="l00090"></a>00090 <span class="comment">                  *</span>
<a name="l00091"></a>00091 <span class="comment">                  *  For tools to visualize graphs as 2D/3D plots, see the namespace mrpt::opengl::graph_tools in the library mrpt-opengl.</span>
<a name="l00092"></a>00092 <span class="comment">                  *</span>
<a name="l00093"></a>00093 <span class="comment">                  *  The template arguments are:</span>
<a name="l00094"></a>00094 <span class="comment">                  *             - CPOSE: The type of the edges, which hold a relative pose (2D/3D, just a value or a Gaussian, etc.)</span>
<a name="l00095"></a>00095 <span class="comment">                  *             - MAPS_IMPLEMENTATION: Can be either mrpt::utils::map_traits_stdmap or mrpt::utils::map_traits_map_as_vector. Determines the type of the list of global poses (member \a nodes).</span>
<a name="l00096"></a>00096 <span class="comment">                  *</span>
<a name="l00097"></a>00097 <span class="comment">                  * \sa mrpt::graphslam</span>
<a name="l00098"></a>00098 <span class="comment">                  * \ingroup mrpt_graphs_grp</span>
<a name="l00099"></a>00099 <span class="comment">                  */</span>
<a name="l00100"></a>00100                 <span class="keyword">template</span>&lt;
<a name="l00101"></a>00101                         <span class="keyword">class </span>CPOSE, <span class="comment">// Type of edges</span>
<a name="l00102"></a>00102                         <span class="keyword">class </span>MAPS_IMPLEMENTATION = <a class="code" href="structmrpt_1_1utils_1_1map__traits__stdmap.html" title="Traits for using a std::map&lt;&gt; (sparse representation)">map_traits_stdmap</a>, <span class="comment">// Use std::map&lt;&gt; vs. std::vector&lt;&gt;</span>
<a name="l00103"></a>00103                         <span class="keyword">class </span>NODE_ANNOTATIONS = mrpt::graphs::detail::node_annotations_empty,
<a name="l00104"></a>00104                         <span class="keyword">class </span>EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty
<a name="l00105"></a>00105                         &gt;
<a name="l00106"></a>00106                 <span class="keyword">class </span>CNetworkOfPoses : <span class="keyword">public</span> mrpt::graphs::CDirectedGraph&lt; CPOSE, EDGE_ANNOTATIONS &gt;
<a name="l00107"></a>00107                 {
<a name="l00108"></a>00108                 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00109"></a>00109 <span class="comment">                        /** @name Typedef&#39;s</span>
<a name="l00110"></a>00110 <span class="comment">                            @{ */</span>
<a name="l00111"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a2b28a76b8b0f6db2ec2110511c28f828">00111</a>                         <span class="keyword">typedef</span> mrpt<a class="code" href="classmrpt_1_1graphs_1_1_c_directed_graph.html">::graphs::CDirectedGraph&lt;CPOSE,EDGE_ANNOTATIONS&gt;</a> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a2b28a76b8b0f6db2ec2110511c28f828" title="The base class &quot;CDirectedGraph&lt;CPOSE,EDGE_ANNOTATIONS&gt;&quot; */.">BASE</a>;      <span class="comment">//!&lt; The base class &quot;CDirectedGraph&lt;CPOSE,EDGE_ANNOTATIONS&gt;&quot; */</span>
<a name="l00112"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a9e356853f95f522495be2883f2b125b9">00112</a> <span class="comment"></span>                        <span class="keyword">typedef</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html" title="A directed graph of pose constraints, with edges being the relative pose between pairs of nodes inden...">CNetworkOfPoses&lt;CPOSE,MAPS_IMPLEMENTATION,NODE_ANNOTATIONS,EDGE_ANNOTATIONS&gt;</a> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a9e356853f95f522495be2883f2b125b9" title="My own type.">self_t</a>; <span class="comment">//!&lt; My own type</span>
<a name="l00113"></a>00113 <span class="comment"></span>
<a name="l00114"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a33527a2b73636d0012ba4c511b05dea5">00114</a>                         <span class="keyword">typedef</span> CPOSE              <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a33527a2b73636d0012ba4c511b05dea5" title="The type of PDF poses in the contraints (edges) (=CPOSE template argument)">constraint_t</a>;        <span class="comment">//!&lt; The type of PDF poses in the contraints (edges) (=CPOSE template argument)</span>
<a name="l00115"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ae0f5e3857e0d7ccc77b7b2abd1c72abd">00115</a> <span class="comment"></span>                        <span class="keyword">typedef</span> NODE_ANNOTATIONS   <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ae0f5e3857e0d7ccc77b7b2abd1c72abd" title="The extra annotations in nodes, apart from a constraint_no_pdf_t.">node_annotations_t</a>;  <span class="comment">//!&lt; The extra annotations in nodes, apart from a \a constraint_no_pdf_t</span>
<a name="l00116"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a75e33fdd563d79b9eb5243b2ad12adcf">00116</a> <span class="comment"></span>                        <span class="keyword">typedef</span> EDGE_ANNOTATIONS   <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a75e33fdd563d79b9eb5243b2ad12adcf" title="The extra annotations in edges, apart from a constraint_t.">edge_annotations_t</a>;  <span class="comment">//!&lt; The extra annotations in edges, apart from a \a constraint_t</span>
<a name="l00117"></a>00117 <span class="comment"></span>
<a name="l00118"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a8f0d390603072e70a09aa819a47f1c4b">00118</a>                         <span class="keyword">typedef</span> MAPS_IMPLEMENTATION         <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a8f0d390603072e70a09aa819a47f1c4b" title="The type of map&#39;s implementation (=MAPS_IMPLEMENTATION template argument)">maps_implementation_t</a>; <span class="comment">//!&lt; The type of map&#39;s implementation (=MAPS_IMPLEMENTATION template argument)</span>
<a name="l00119"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a11996ae62368446ff5d1dc514a9f6b9e">00119</a> <span class="comment"></span>                        <span class="keyword">typedef</span> <span class="keyword">typename</span> CPOSE::type_value  <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a11996ae62368446ff5d1dc514a9f6b9e" title="The type of edges or their means if they are PDFs (that is, a simple &quot;edge&quot; value)">constraint_no_pdf_t</a>;   <span class="comment">//!&lt; The type of edges or their means if they are PDFs (that is, a simple &quot;edge&quot; value)</span>
<a name="l00120"></a>00120 <span class="comment"></span><span class="comment"></span>
<a name="l00121"></a>00121 <span class="comment">                        /** The type of each global pose in \a nodes: an extension of the \a constraint_no_pdf_t pose with any optional user-defined data */</span>
<a name="l00122"></a>00122                         <span class="keyword">struct </span>global_pose_t : <span class="keyword">public</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a11996ae62368446ff5d1dc514a9f6b9e" title="The type of edges or their means if they are PDFs (that is, a simple &quot;edge&quot; value)">constraint_no_pdf_t</a>, <span class="keyword">public</span> NODE_ANNOTATIONS
<a name="l00123"></a>00123                         {
<a name="l00124"></a>00124                                 <span class="comment">// Replicate possible constructors:</span>
<a name="l00125"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses_1_1global__pose__t.html#a5deafda9fa46a727d516c85fb905340a">00125</a>                                 <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses_1_1global__pose__t.html#a5deafda9fa46a727d516c85fb905340a">global_pose_t</a>() : <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a11996ae62368446ff5d1dc514a9f6b9e" title="The type of edges or their means if they are PDFs (that is, a simple &quot;edge&quot; value)">constraint_no_pdf_t</a>() { }
<a name="l00126"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses_1_1global__pose__t.html#aebf4ab6aa0564d405d32540e87ea074e">00126</a>                                 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ARG1&gt; <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses_1_1global__pose__t.html#aebf4ab6aa0564d405d32540e87ea074e">global_pose_t</a>(<span class="keyword">const</span> ARG1 &amp;a1) : <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a11996ae62368446ff5d1dc514a9f6b9e" title="The type of edges or their means if they are PDFs (that is, a simple &quot;edge&quot; value)">constraint_no_pdf_t</a>(a1) { }
<a name="l00127"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses_1_1global__pose__t.html#a40c58ce0c5eb14ad04481d7b89632f96">00127</a>                                 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ARG1,<span class="keyword">typename</span> ARG2&gt; <span class="keyword">inline</span> <a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses_1_1global__pose__t.html#a40c58ce0c5eb14ad04481d7b89632f96">global_pose_t</a>(<span class="keyword">const</span> ARG1 &amp;a1,<span class="keyword">const</span> ARG2 &amp;a2) : <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a11996ae62368446ff5d1dc514a9f6b9e" title="The type of edges or their means if they are PDFs (that is, a simple &quot;edge&quot; value)">constraint_no_pdf_t</a>(a1,a2) { }
<a name="l00128"></a>00128                         };
<a name="l00129"></a>00129 <span class="comment"></span>
<a name="l00130"></a>00130 <span class="comment">                        /** A map from pose IDs to their global coordinates estimates, with uncertainty */</span>
<a name="l00131"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#abdbfe33f29a34d4356768003a37cb8e2">00131</a>                         <span class="keyword">typedef</span> <span class="keyword">typename</span> MAPS_IMPLEMENTATION::template <a class="code" href="classstd_1_1map.html" title="STL class.">map&lt;TNodeID,CPOSE&gt;</a>     <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#abdbfe33f29a34d4356768003a37cb8e2" title="A map from pose IDs to their global coordinates estimates, with uncertainty.">global_poses_pdf_t</a>;
<a name="l00132"></a>00132 <span class="comment"></span>
<a name="l00133"></a>00133 <span class="comment">                        /** A map from pose IDs to their global coordinates estimates, without uncertainty (the &quot;most-likely value&quot;) */</span>
<a name="l00134"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a126602ce589ff9039d000fb95c32c0c6">00134</a>                         <span class="keyword">typedef</span> <span class="keyword">typename</span> MAPS_IMPLEMENTATION::template <a class="code" href="classstd_1_1map.html">map&lt;TNodeID,global_pose_t&gt;</a> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a126602ce589ff9039d000fb95c32c0c6" title="A map from pose IDs to their global coordinates estimates, without uncertainty (the &quot;most-likely valu...">global_poses_t</a>;
<a name="l00135"></a>00135 <span class="comment"></span>
<a name="l00136"></a>00136 <span class="comment">                        /** @} */</span>
<a name="l00137"></a>00137 
<a name="l00138"></a>00138 <span class="comment"></span>
<a name="l00139"></a>00139 <span class="comment">                        /** @name Data members</span>
<a name="l00140"></a>00140 <span class="comment">                            @{ */</span>
<a name="l00141"></a>00141 <span class="comment"></span>
<a name="l00142"></a>00142 <span class="comment">                        /** The nodes (vertices) of the graph, with their estimated &quot;global&quot; (with respect to \a root) position, without an associated covariance.</span>
<a name="l00143"></a>00143 <span class="comment">                          * \sa dijkstra_nodes_estimate</span>
<a name="l00144"></a>00144 <span class="comment">                          */</span>
<a name="l00145"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ad7ed942c40716b8c387205ed4bb5423a">00145</a>                         <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a126602ce589ff9039d000fb95c32c0c6" title="A map from pose IDs to their global coordinates estimates, without uncertainty (the &quot;most-likely valu...">global_poses_t</a>  <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ad7ed942c40716b8c387205ed4bb5423a" title="The nodes (vertices) of the graph, with their estimated &quot;global&quot; (with respect to root) position...">nodes</a>;
<a name="l00146"></a>00146 <span class="comment"></span>
<a name="l00147"></a>00147 <span class="comment">                        /** The ID of the node that is the origin of coordinates, used as reference by all coordinates in \nodes. By default, root is the ID &quot;0&quot;. */</span>
<a name="l00148"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#adee1f9ffb91303fa1ea909eaa23c61bc">00148</a>                         <a class="code" href="namespacemrpt_1_1utils.html#a718b4f99645b7e9f6501c9b7bb2a2fe7" title="The type for node IDs in graphs of different types.">TNodeID</a>         <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#adee1f9ffb91303fa1ea909eaa23c61bc" title="The ID of the node that is the origin of coordinates, used as reference by all coordinates in ...">root</a>;
<a name="l00149"></a>00149 <span class="comment"></span>
<a name="l00150"></a>00150 <span class="comment">                        /** False (default) if an edge i-&gt;j stores the normal relative pose of j as seen from i: \f$ \Delta_i^j = j \ominus i \f$</span>
<a name="l00151"></a>00151 <span class="comment">                          * True if an edge i-&gt;j stores the inverse relateive pose, that is, i as seen from j: \f$ \Delta_i^j = i \ominus j \f$</span>
<a name="l00152"></a>00152 <span class="comment">                          */</span>
<a name="l00153"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a90863011f1177a9920171ede6b8ca8aa">00153</a>                         <span class="keywordtype">bool</span>            <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a90863011f1177a9920171ede6b8ca8aa" title="False (default) if an edge i-&gt;j stores the normal relative pose of j as seen from i:  True if an edge...">edges_store_inverse_poses</a>;
<a name="l00154"></a>00154 <span class="comment"></span>
<a name="l00155"></a>00155 <span class="comment">                        /** @} */</span>
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 <span class="comment"></span>
<a name="l00158"></a>00158 <span class="comment">                        /** @name I/O file methods</span>
<a name="l00159"></a>00159 <span class="comment">                            @{ */</span>
<a name="l00160"></a>00160 <span class="comment"></span>
<a name="l00161"></a>00161 <span class="comment">                        /** Saves to a text file in the format used by TORO &amp; HoG-man (more on the format &lt;a href=&quot;http://www.mrpt.org/Robotics_file_formats&quot; &gt;here&lt;/a&gt; )</span>
<a name="l00162"></a>00162 <span class="comment">                          *  For 2D graphs only VERTEX2 &amp; EDGE2 entries will be saved, and VERTEX3 &amp; EDGE3 entries for 3D graphs.</span>
<a name="l00163"></a>00163 <span class="comment">                          *  Note that EQUIV entries will not be saved, but instead several EDGEs will be stored between the same node IDs.</span>
<a name="l00164"></a>00164 <span class="comment">                          * \sa saveToBinaryFile, loadFromTextFile</span>
<a name="l00165"></a>00165 <span class="comment">                          * \exception On any error</span>
<a name="l00166"></a>00166 <span class="comment">                          */</span>
<a name="l00167"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a412155ad1b3752c9777745d4a246407f">00167</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a412155ad1b3752c9777745d4a246407f" title="Saves to a text file in the format used by TORO &amp; HoG-man (more on the format here ) For 2D graphs on...">saveToTextFile</a>( <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;fileName )<span class="keyword"> const </span>{
<a name="l00168"></a>00168                                 <a class="code" href="structmrpt_1_1graphs_1_1detail_1_1graph__ops.html" title="a helper struct with static template functions">detail::graph_ops&lt;self_t&gt;::save_graph_of_poses_from_text_file</a>(<span class="keyword">this</span>,fileName);
<a name="l00169"></a>00169                         }
<a name="l00170"></a>00170 <span class="comment"></span>
<a name="l00171"></a>00171 <span class="comment">                        /** Loads from a text file in the format used by TORO &amp; HoG-man (more on the format &lt;a href=&quot;http://www.mrpt.org/Robotics_file_formats&quot; &gt;here&lt;/a&gt; )</span>
<a name="l00172"></a>00172 <span class="comment">                          *   Recognized line entries are: VERTEX2, VERTEX3, EDGE2, EDGE3, EQUIV.</span>
<a name="l00173"></a>00173 <span class="comment">                          *   If an unknown entry is found, a warning is dumped to std::cerr (only once for each unknown keyword).</span>
<a name="l00174"></a>00174 <span class="comment">                          *   An exception will be raised if trying to load a 3D graph into a 2D class (in the opposite case, missing 3D data will default to zero).</span>
<a name="l00175"></a>00175 <span class="comment">                          * \param fileName The file to load.</span>
<a name="l00176"></a>00176 <span class="comment">                          * \param collapse_dup_edges If true, \a collapseDuplicatedEdges will be called automatically after loading (note that this operation may take significant time for very large graphs).</span>
<a name="l00177"></a>00177 <span class="comment">                          * \sa loadFromBinaryFile, saveToTextFile</span>
<a name="l00178"></a>00178 <span class="comment">                          * \exception On any error, as a malformed line or loading a 3D graph in a 2D graph.</span>
<a name="l00179"></a>00179 <span class="comment">                          */</span>
<a name="l00180"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ad7a2677376c6255772509d0e82fee89f">00180</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ad7a2677376c6255772509d0e82fee89f" title="Loads from a text file in the format used by TORO &amp; HoG-man (more on the format here ) Recognized lin...">loadFromTextFile</a>( <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> collapse_dup_edges = <span class="keyword">true</span> ) {
<a name="l00181"></a>00181                                 <a class="code" href="structmrpt_1_1graphs_1_1detail_1_1graph__ops.html" title="a helper struct with static template functions">detail::graph_ops&lt;self_t&gt;::load_graph_of_poses_from_text_file</a>(<span class="keyword">this</span>,fileName);
<a name="l00182"></a>00182                                 <span class="keywordflow">if</span> (collapse_dup_edges) this-&gt;collapseDuplicatedEdges();
<a name="l00183"></a>00183                         }
<a name="l00184"></a>00184 <span class="comment"></span>
<a name="l00185"></a>00185 <span class="comment">                        /** @} */</span>
<a name="l00186"></a>00186 <span class="comment"></span>
<a name="l00187"></a>00187 <span class="comment">                        /** @name Utility methods</span>
<a name="l00188"></a>00188 <span class="comment">                            @{ */</span>
<a name="l00189"></a>00189 <span class="comment"></span>
<a name="l00190"></a>00190 <span class="comment">                        /** Spanning tree computation of a simple estimation of the global coordinates of each node just from the information in all edges, sorted in a Dijkstra tree based on the current &quot;root&quot; node.</span>
<a name="l00191"></a>00191 <span class="comment">                          *  Note that &quot;global&quot; coordinates are with respect to the node with the ID specified in \a root.</span>
<a name="l00192"></a>00192 <span class="comment">                          * \note This method takes into account the value of \a edges_store_inverse_poses</span>
<a name="l00193"></a>00193 <span class="comment">                          * \sa node, root</span>
<a name="l00194"></a>00194 <span class="comment">                          */</span>
<a name="l00195"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a5050d30406681b2bc2dd62830d5bc85b">00195</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a5050d30406681b2bc2dd62830d5bc85b" title="Spanning tree computation of a simple estimation of the global coordinates of each node just from the...">dijkstra_nodes_estimate</a>() { <a class="code" href="structmrpt_1_1graphs_1_1detail_1_1graph__ops.html" title="a helper struct with static template functions">detail::graph_ops&lt;self_t&gt;::graph_of_poses_dijkstra_init</a>(<span class="keyword">this</span>); }
<a name="l00196"></a>00196 <span class="comment"></span>
<a name="l00197"></a>00197 <span class="comment">                        /** Look for duplicated edges (even in opposite directions) between all pairs of nodes and fuse them.</span>
<a name="l00198"></a>00198 <span class="comment">                          *  Upon return, only one edge remains between each pair of nodes with the mean &amp; covariance (or information matrix) corresponding to the Bayesian fusion of all the Gaussians.</span>
<a name="l00199"></a>00199 <span class="comment">                          * \return Overall number of removed edges.</span>
<a name="l00200"></a>00200 <span class="comment">                          */</span>
<a name="l00201"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a4fbe45ec3544ca53d629a701b2f3913c">00201</a>                         <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a4fbe45ec3544ca53d629a701b2f3913c" title="Look for duplicated edges (even in opposite directions) between all pairs of nodes and fuse them...">collapseDuplicatedEdges</a>() { <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1graphs_1_1detail_1_1graph__ops.html" title="a helper struct with static template functions">detail::graph_ops&lt;self_t&gt;::graph_of_poses_collapse_dup_edges</a>(<span class="keyword">this</span>); }
<a name="l00202"></a>00202 <span class="comment"></span>
<a name="l00203"></a>00203 <span class="comment">                        /** Computes the overall square error from all the pose constraints (edges) with respect to the global poses in \nodes</span>
<a name="l00204"></a>00204 <span class="comment">                          *  If \a ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.</span>
<a name="l00205"></a>00205 <span class="comment">                          * \sa getEdgeSquareError</span>
<a name="l00206"></a>00206 <span class="comment">                          * \exception std::exception On global poses not in \a nodes</span>
<a name="l00207"></a>00207 <span class="comment">                          */</span>
<a name="l00208"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#aca1c63c9a12604f985f30112325671ad">00208</a>                         <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#aca1c63c9a12604f985f30112325671ad" title="Computes the overall square error from all the pose constraints (edges) with respect to the global po...">getGlobalSquareError</a>(<span class="keywordtype">bool</span> ignoreCovariances = <span class="keyword">true</span>)<span class="keyword"> const </span>{
<a name="l00209"></a>00209                                 <span class="keywordtype">double</span> sqErr=0;
<a name="l00210"></a>00210                                 <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_directed_graph.html">BASE</a><a class="code" href="eigen__plugins_8h.html#a8dbda719917732693c56cee228465ed9">::edges_map_t::const_iterator</a> last_it=<a class="code" href="classmrpt_1_1graphs_1_1_c_directed_graph.html">BASE</a>::edges.<a class="code" href="classmrpt_1_1graphs_1_1_c_directed_graph.html#a265aeeb118a342f8773badf2d0242d6d">end</a>();
<a name="l00211"></a>00211                                 <span class="keywordflow">for</span> (<span class="keyword">typename</span> <a class="code" href="classstd_1_1multimap_1_1const__iterator.html" title="STL iterator class.">BASE::edges_map_t::const_iterator</a> itEdge=BASE::edges.<a class="code" href="eigen__plugins_8h.html#ab295fd8164bf1b1acecbcb29520d62b7">begin</a>();itEdge!=last_it;++itEdge)
<a name="l00212"></a>00212                                         sqErr+=<a class="code" href="structmrpt_1_1graphs_1_1detail_1_1graph__ops.html" title="a helper struct with static template functions">detail::graph_ops&lt;self_t&gt;::graph_edge_sqerror</a>(<span class="keyword">this</span>,itEdge,ignoreCovariances);
<a name="l00213"></a>00213                                 <span class="keywordflow">return</span> sqErr;
<a name="l00214"></a>00214                         }
<a name="l00215"></a>00215 <span class="comment"></span>
<a name="l00216"></a>00216 <span class="comment">                        /** Computes the square error of one pose constraints (edge) with respect to the global poses in \nodes</span>
<a name="l00217"></a>00217 <span class="comment">                          *  If \a ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.</span>
<a name="l00218"></a>00218 <span class="comment">                          * \exception std::exception On global poses not in \a nodes</span>
<a name="l00219"></a>00219 <span class="comment">                          */</span>
<a name="l00220"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ad85b9c5e002cedbb600cf1361b5fe965">00220</a>                         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ad85b9c5e002cedbb600cf1361b5fe965" title="Computes the square error of one pose constraints (edge) with respect to the global poses in  If igno...">getEdgeSquareError</a>(<span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="classstd_1_1multimap_1_1const__iterator.html" title="STL iterator class.">BASE::edges_map_t::const_iterator</a> &amp;itEdge, <span class="keywordtype">bool</span> ignoreCovariances = <span class="keyword">true</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="structmrpt_1_1graphs_1_1detail_1_1graph__ops.html" title="a helper struct with static template functions">detail::graph_ops&lt;self_t&gt;::graph_edge_sqerror</a>(<span class="keyword">this</span>,itEdge,ignoreCovariances); }
<a name="l00221"></a>00221 <span class="comment"></span>
<a name="l00222"></a>00222 <span class="comment">                        /** Computes the square error of one pose constraints (edge) with respect to the global poses in \nodes</span>
<a name="l00223"></a>00223 <span class="comment">                          *  If \a ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.</span>
<a name="l00224"></a>00224 <span class="comment">                          * \exception std::exception On edge not existing or global poses not in \a nodes</span>
<a name="l00225"></a>00225 <span class="comment">                          */</span>
<a name="l00226"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#aed449b8431bc7c752602c1acf3dca09f">00226</a>                         <span class="keywordtype">double</span> getEdgeSquareError(<span class="keyword">const</span> <a class="code" href="namespacemrpt_1_1utils.html#a718b4f99645b7e9f6501c9b7bb2a2fe7" title="The type for node IDs in graphs of different types.">TNodeID</a> from_id, <span class="keyword">const</span> <a class="code" href="namespacemrpt_1_1utils.html#a718b4f99645b7e9f6501c9b7bb2a2fe7" title="The type for node IDs in graphs of different types.">TNodeID</a> to_id, <span class="keywordtype">bool</span> ignoreCovariances = <span class="keyword">true</span> )<span class="keyword"> const</span>
<a name="l00227"></a>00227 <span class="keyword">                        </span>{
<a name="l00228"></a>00228                                 <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_directed_graph.html">BASE</a><a class="code" href="eigen__plugins_8h.html#a8dbda719917732693c56cee228465ed9">::edges_map_t::const_iterator</a> itEdge = <a class="code" href="classmrpt_1_1graphs_1_1_c_directed_graph.html">BASE</a>::edges.find( std::make_pair(from_id,to_id) );
<a name="l00229"></a>00229                                 <a class="code" href="mrpt__macros_8h.html#ad30ea0382c594c0e2efe88212e9352b0">ASSERTMSG_</a>(itEdge!=BASE::edges.<a class="code" href="eigen__plugins_8h.html#ade5b39864c905cbb824d0ff6eb0d888c">end</a>(),<a class="code" href="namespacemrpt.html#a3a27af794b658df5491e2b7678f8ccb8" title="A std::string version of C sprintf.">format</a>(<span class="stringliteral">&quot;Request for edge %u-&gt;%u that doesn&#39;t exist in graph.&quot;</span>,static_cast&lt;unsigned int&gt;(from_id),static_cast&lt;unsigned int&gt;(to_id)));
<a name="l00230"></a>00230                                 <span class="keywordflow">return</span> getEdgeSquareError(itEdge,ignoreCovariances);
<a name="l00231"></a>00231                         }
<a name="l00232"></a>00232 <span class="comment"></span>
<a name="l00233"></a>00233 <span class="comment">                        /** Empty all edges, nodes and set root to ID 0. */</span>
<a name="l00234"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ad5aa90f5955844cee5f8ac5279409fd4">00234</a>                         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#ad5aa90f5955844cee5f8ac5279409fd4" title="Empty all edges, nodes and set root to ID 0.">clear</a>() {
<a name="l00235"></a>00235                                 <a class="code" href="classmrpt_1_1graphs_1_1_c_directed_graph.html">BASE</a>::edges.clear();
<a name="l00236"></a>00236                                 nodes.clear();
<a name="l00237"></a>00237                                 root = 0;
<a name="l00238"></a>00238                                 edges_store_inverse_poses = <span class="keyword">false</span>;
<a name="l00239"></a>00239                         }
<a name="l00240"></a>00240 <span class="comment"></span>
<a name="l00241"></a>00241 <span class="comment">                        /** Return number of nodes in the list \nodes of global coordinates (may be differente that all nodes appearing in edges)</span>
<a name="l00242"></a>00242 <span class="comment">                          * \sa mrpt::graphs::CDirectedGraph::countDifferentNodesInEdges</span>
<a name="l00243"></a>00243 <span class="comment">                          */</span>
<a name="l00244"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#aaaa9239749ca20089ab0f6ac4904b763">00244</a>                         <span class="keyword">inline</span> <span class="keywordtype">size_t</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#aaaa9239749ca20089ab0f6ac4904b763" title="Return number of nodes in the list  of global coordinates (may be differente that all nodes appearing...">nodeCount</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> nodes.size(); }
<a name="l00245"></a>00245 <span class="comment"></span>
<a name="l00246"></a>00246 <span class="comment">                        /**  @} */</span>
<a name="l00247"></a>00247 <span class="comment"></span>
<a name="l00248"></a>00248 <span class="comment">                        /** @name Ctors &amp; Dtors</span>
<a name="l00249"></a>00249 <span class="comment">                            @{ */</span>
<a name="l00250"></a>00250 <span class="comment"></span>
<a name="l00251"></a>00251 <span class="comment">                        /** Default constructor (just sets root to &quot;0&quot; and edges_store_inverse_poses to &quot;false&quot;) */</span>
<a name="l00252"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a294c11fda3b26aa4bf3e6ceae4010b21">00252</a>                         <span class="keyword">inline</span> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a294c11fda3b26aa4bf3e6ceae4010b21" title="Default constructor (just sets root to &quot;0&quot; and edges_store_inverse_poses to &quot;false&quot;)">CNetworkOfPoses</a>() : root(0), edges_store_inverse_poses(false) { }
<a name="l00253"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a9e9e6ffb56c5c1035655781fbd9e7196">00253</a>                         <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html#a9e9e6ffb56c5c1035655781fbd9e7196">~CNetworkOfPoses</a>() { }<span class="comment"></span>
<a name="l00254"></a>00254 <span class="comment">                        /** @} */</span>
<a name="l00255"></a>00255                 };
<a name="l00256"></a>00256 
<a name="l00257"></a><a class="code" href="_c_network_of_poses_8h.html#aa8ef131fd093e86426cd42d6ce0bd0fd">00257</a> <span class="preprocessor">#define DEFINE_SERIALIZABLE_GRAPH  \</span>
<a name="l00258"></a>00258 <span class="preprocessor">                protected: \</span>
<a name="l00259"></a>00259 <span class="preprocessor">                        virtual void  writeToStream(CStream &amp;out, int *version) const { \</span>
<a name="l00260"></a>00260 <span class="preprocessor">                                if (version) *version = 0; \</span>
<a name="l00261"></a>00261 <span class="preprocessor">                                else out &lt;&lt; nodes &lt;&lt; edges &lt;&lt; root;  \</span>
<a name="l00262"></a>00262 <span class="preprocessor">                        } \</span>
<a name="l00263"></a>00263 <span class="preprocessor">                        virtual void readFromStream(CStream &amp;in, int version) { \</span>
<a name="l00264"></a>00264 <span class="preprocessor">                                switch(version) \</span>
<a name="l00265"></a>00265 <span class="preprocessor">                                { \</span>
<a name="l00266"></a>00266 <span class="preprocessor">                                case 0: { in &gt;&gt; nodes &gt;&gt; edges &gt;&gt; root; } break; \</span>
<a name="l00267"></a>00267 <span class="preprocessor">                                default: MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(version) \</span>
<a name="l00268"></a>00268 <span class="preprocessor">                                }; \</span>
<a name="l00269"></a>00269 <span class="preprocessor">                        }</span>
<a name="l00270"></a>00270 <span class="preprocessor"></span>
<a name="l00271"></a>00271 
<a name="l00272"></a>00272 <span class="comment"></span>
<a name="l00273"></a>00273 <span class="comment">                /** \addtogroup mrpt_graphs_grp</span>
<a name="l00274"></a>00274 <span class="comment">                    @{ */</span>
<a name="l00275"></a>00275 
<a name="l00276"></a>00276                 <span class="comment">// Define serializable versions of the template above for each specific kind of &quot;edge&quot;:</span>
<a name="l00277"></a>00277 
<a name="l00278"></a>00278                 <span class="comment">// This must be added to any CSerializable derived class:</span>
<a name="l00279"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses2_d_ptr.html#af370a99b958352cf1c33f96691a6286d">00279</a>                 <a class="code" href="_c_serializable_8h.html#a4f65adffe92332a1a157f834338b1d49" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE</a>( <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses2_d.html" title="The specialization of CNetworkOfPoses for poses of type CPose2D (not a PDF!), also implementing seria...">CNetworkOfPoses2D</a>, <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> )
<a name="l00280"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses3_d_ptr.html#a5f48ae9d410272de332be626e3cb9267">00280</a>                 <a class="code" href="_c_serializable_8h.html#a4f65adffe92332a1a157f834338b1d49" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE</a>( <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses3_d.html" title="The specialization of CNetworkOfPoses for poses of type CPose3D (not a PDF!), also implementing seria...">CNetworkOfPoses3D</a>, <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> )
<a name="l00281"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses2_d_cov_ptr.html#ab03ec881a785a84fb4f4eb0b1db01ee3">00281</a>                 <a class="code" href="_c_serializable_8h.html#a4f65adffe92332a1a157f834338b1d49" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE</a>( <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses2_d_cov.html" title="The specialization of CNetworkOfPoses for poses of type CPosePDFGaussian, also implementing serializa...">CNetworkOfPoses2DCov</a>, <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> )
<a name="l00282"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses3_d_cov_ptr.html#ab5c8a62d3ac2c6526d4bd3d7e0fd8567">00282</a>                 <a class="code" href="_c_serializable_8h.html#a4f65adffe92332a1a157f834338b1d49" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE</a>( <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses3_d_cov.html" title="The specialization of CNetworkOfPoses for poses of type CPose3DPDFGaussian, also implementing seriali...">CNetworkOfPoses3DCov</a>, <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> )
<a name="l00283"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses2_d_inf_ptr.html#adf366288222d3f69b7954c749c9f03b8">00283</a>                 <a class="code" href="_c_serializable_8h.html#a4f65adffe92332a1a157f834338b1d49" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE</a>( <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses2_d_inf.html" title="The specialization of CNetworkOfPoses for poses of type CPosePDFGaussianInf, also implementing serial...">CNetworkOfPoses2DInf</a>, <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> )
<a name="l00284"></a><a class="code" href="structmrpt_1_1graphs_1_1_c_network_of_poses3_d_inf_ptr.html#a007f66ed9a03c27f90e10a41f1a0e20d">00284</a>                 <a class="code" href="_c_serializable_8h.html#a4f65adffe92332a1a157f834338b1d49" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_LINKAGE</a>( <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses3_d_inf.html" title="The specialization of CNetworkOfPoses for poses of type CPose3DPDFGaussianInf, also implementing seri...">CNetworkOfPoses3DInf</a>, <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> )
<a name="l00285"></a>00285 <span class="comment"></span>
<a name="l00286"></a>00286 <span class="comment">                /** The specialization of CNetworkOfPoses for poses of type CPose2D (not a PDF!), also implementing serialization.</span>
<a name="l00287"></a>00287 <span class="comment">                  * \sa CNetworkOfPoses, CNetworkOfPoses2D, CNetworkOfPoses3D, CNetworkOfPoses2DInf, CNetworkOfPoses3DInf</span>
<a name="l00288"></a>00288 <span class="comment">                  */</span>
<a name="l00289"></a>00289                 class <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses2_d.html" title="The specialization of CNetworkOfPoses for poses of type CPose2D (not a PDF!), also implementing seria...">CNetworkOfPoses2D</a> : public <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html" title="A directed graph of pose constraints, with edges being the relative pose between pairs of nodes inden...">CNetworkOfPoses</a>&lt;<a class="code" href="classmrpt_1_1poses_1_1_c_pose2_d.html" title="A class used to store a 2D pose.">CPose2D</a>,<a class="code" href="structmrpt_1_1utils_1_1map__traits__stdmap.html" title="Traits for using a std::map&lt;&gt; (sparse representation)">map_traits_stdmap</a>&gt;, public mrpt::utils::<a class="code" href="classmrpt_1_1utils_1_1_c_serializable.html" title="The virtual base class which provides a unified interface for all persistent objects in MRPT...">CSerializable</a>
<a name="l00290"></a>00290                 {
<a name="l00291"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses2_d.html#a702d4751587c2619e6a3f2b285d18cf7">00291</a>                         <a class="code" href="_c_object_8h.html#a89a1b701b9898005d954af26d92766fe" title="This declaration must be inserted in all CObject classes definition, within the class declaration...">DEFINE_MRPT_OBJECT</a>( <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses2_d.html" title="The specialization of CNetworkOfPoses for poses of type CPose2D (not a PDF!), also implementing seria...">CNetworkOfPoses2D</a> ) <span class="comment">// Should be DEFINE_SERIALIZABLE but the next macro defines what that macro only declared.</span>
<a name="l00292"></a>00292                         <a class="code" href="_c_network_of_poses_8h.html#aa8ef131fd093e86426cd42d6ce0bd0fd">DEFINE_SERIALIZABLE_GRAPH</a>
<a name="l00293"></a>00293                 };
<a name="l00294"></a>00294 <span class="comment"></span>
<a name="l00295"></a>00295 <span class="comment">                /** The specialization of CNetworkOfPoses for poses of type CPose3D (not a PDF!), also implementing serialization.</span>
<a name="l00296"></a>00296 <span class="comment">                  * \sa CNetworkOfPoses, CNetworkOfPoses2D, CNetworkOfPoses3D, CNetworkOfPoses2DInf, CNetworkOfPoses3DInf</span>
<a name="l00297"></a>00297 <span class="comment">                  */</span>
<a name="l00298"></a>00298                 class <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> CNetworkOfPoses3D : public <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html" title="A directed graph of pose constraints, with edges being the relative pose between pairs of nodes inden...">CNetworkOfPoses</a>&lt;<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>,map_traits_stdmap&gt;, public mrpt::utils::CSerializable
<a name="l00299"></a>00299                 {
<a name="l00300"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses3_d.html#a3c071398408c7ec85cbffa6060929784">00300</a>                         <a class="code" href="_c_object_8h.html#a89a1b701b9898005d954af26d92766fe" title="This declaration must be inserted in all CObject classes definition, within the class declaration...">DEFINE_MRPT_OBJECT</a>( CNetworkOfPoses3D ) <span class="comment">// Should be DEFINE_SERIALIZABLE but the next macro defines what that macro only declared.</span>
<a name="l00301"></a>00301                         DEFINE_SERIALIZABLE_GRAPH
<a name="l00302"></a>00302                 };
<a name="l00303"></a>00303 <span class="comment"></span>
<a name="l00304"></a>00304 <span class="comment">                /** The specialization of CNetworkOfPoses for poses of type CPosePDFGaussian, also implementing serialization.</span>
<a name="l00305"></a>00305 <span class="comment">                  * \sa CNetworkOfPoses, CNetworkOfPoses2D, CNetworkOfPoses3D, CNetworkOfPoses2DInf, CNetworkOfPoses3DInf</span>
<a name="l00306"></a>00306 <span class="comment">                  */</span>
<a name="l00307"></a>00307                 class <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> CNetworkOfPoses2DCov : public <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html" title="A directed graph of pose constraints, with edges being the relative pose between pairs of nodes inden...">CNetworkOfPoses</a>&lt;<a class="code" href="classmrpt_1_1poses_1_1_c_pose_p_d_f_gaussian.html" title="Declares a class that represents a Probability Density function (PDF) of a 2D pose ...">CPosePDFGaussian</a>,map_traits_stdmap&gt;, public mrpt::utils::CSerializable
<a name="l00308"></a>00308                 {
<a name="l00309"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses2_d_cov.html#a854b4690afe8dd99b1b569bdd0d34353">00309</a>                         <a class="code" href="_c_object_8h.html#a89a1b701b9898005d954af26d92766fe" title="This declaration must be inserted in all CObject classes definition, within the class declaration...">DEFINE_MRPT_OBJECT</a>( CNetworkOfPoses2DCov )      <span class="comment">// Should be DEFINE_SERIALIZABLE but the next macro defines what that macro only declared.</span>
<a name="l00310"></a>00310                         DEFINE_SERIALIZABLE_GRAPH
<a name="l00311"></a>00311                 };
<a name="l00312"></a>00312 <span class="comment"></span>
<a name="l00313"></a>00313 <span class="comment">                /** The specialization of CNetworkOfPoses for poses of type CPose3DPDFGaussian, also implementing serialization.</span>
<a name="l00314"></a>00314 <span class="comment">                  * \sa CNetworkOfPoses, CNetworkOfPoses2D, CNetworkOfPoses3D, CNetworkOfPoses2DInf, CNetworkOfPoses3DInf</span>
<a name="l00315"></a>00315 <span class="comment">                  */</span>
<a name="l00316"></a>00316                 class <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> CNetworkOfPoses3DCov : public <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html" title="A directed graph of pose constraints, with edges being the relative pose between pairs of nodes inden...">CNetworkOfPoses</a>&lt;<a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d_p_d_f_gaussian.html" title="Declares a class that represents a Probability Density function (PDF) of a 3D pose ...">CPose3DPDFGaussian</a>,map_traits_stdmap&gt;, public mrpt::utils::CSerializable
<a name="l00317"></a>00317                 {
<a name="l00318"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses3_d_cov.html#a6ed60903cc942580f0d6fc4dd2f26eda">00318</a>                         <a class="code" href="_c_object_8h.html#a89a1b701b9898005d954af26d92766fe" title="This declaration must be inserted in all CObject classes definition, within the class declaration...">DEFINE_MRPT_OBJECT</a>( CNetworkOfPoses3DCov )      <span class="comment">// Should be DEFINE_SERIALIZABLE but the next macro defines what that macro only declared.</span>
<a name="l00319"></a>00319                         DEFINE_SERIALIZABLE_GRAPH
<a name="l00320"></a>00320                 };
<a name="l00321"></a>00321 <span class="comment"></span>
<a name="l00322"></a>00322 <span class="comment">                /** The specialization of CNetworkOfPoses for poses of type CPosePDFGaussianInf, also implementing serialization.</span>
<a name="l00323"></a>00323 <span class="comment">                  * \sa CNetworkOfPoses, CNetworkOfPoses2D, CNetworkOfPoses3D, CNetworkOfPoses2DInf, CNetworkOfPoses3DInf</span>
<a name="l00324"></a>00324 <span class="comment">                  */</span>
<a name="l00325"></a>00325                 class <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> CNetworkOfPoses2DInf : public <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html" title="A directed graph of pose constraints, with edges being the relative pose between pairs of nodes inden...">CNetworkOfPoses</a>&lt;<a class="code" href="classmrpt_1_1poses_1_1_c_pose_p_d_f_gaussian_inf.html" title="A Probability Density function (PDF) of a 2D pose  as a Gaussian with a mean and the inverse of the c...">CPosePDFGaussianInf</a>,map_traits_stdmap&gt;, public mrpt::utils::CSerializable
<a name="l00326"></a>00326                 {
<a name="l00327"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses2_d_inf.html#ad929b32521b99ed1ec2fc8503490d425">00327</a>                         <a class="code" href="_c_object_8h.html#a89a1b701b9898005d954af26d92766fe" title="This declaration must be inserted in all CObject classes definition, within the class declaration...">DEFINE_MRPT_OBJECT</a>( CNetworkOfPoses2DInf )      <span class="comment">// Should be DEFINE_SERIALIZABLE but the next macro defines what that macro only declared.</span>
<a name="l00328"></a>00328                         DEFINE_SERIALIZABLE_GRAPH
<a name="l00329"></a>00329                 };
<a name="l00330"></a>00330 <span class="comment"></span>
<a name="l00331"></a>00331 <span class="comment">                /** The specialization of CNetworkOfPoses for poses of type CPose3DPDFGaussianInf, also implementing serialization.</span>
<a name="l00332"></a>00332 <span class="comment">                  * \sa CNetworkOfPoses, CNetworkOfPoses2D, CNetworkOfPoses3D, CNetworkOfPoses2DInf, CNetworkOfPoses3DInf</span>
<a name="l00333"></a>00333 <span class="comment">                  */</span>
<a name="l00334"></a>00334                 class <a class="code" href="graphs_2include_2mrpt_2graphs_2link__pragmas_8h.html#a3b882a8c668190aac3741eceef62ea38">GRAPHS_IMPEXP</a> CNetworkOfPoses3DInf : public <a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses.html" title="A directed graph of pose constraints, with edges being the relative pose between pairs of nodes inden...">CNetworkOfPoses</a>&lt;<a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d_p_d_f_gaussian_inf.html" title="Declares a class that represents a Probability Density function (PDF) of a 3D pose  as a Gaussian des...">CPose3DPDFGaussianInf</a>,map_traits_stdmap&gt;, public mrpt::utils::CSerializable
<a name="l00335"></a>00335                 {
<a name="l00336"></a><a class="code" href="classmrpt_1_1graphs_1_1_c_network_of_poses3_d_inf.html#a5c3afc15002267a92f0b9c14fc3945ce">00336</a>                         <a class="code" href="_c_object_8h.html#a89a1b701b9898005d954af26d92766fe" title="This declaration must be inserted in all CObject classes definition, within the class declaration...">DEFINE_MRPT_OBJECT</a>( CNetworkOfPoses3DInf )      <span class="comment">// Should be DEFINE_SERIALIZABLE but the next macro defines what that macro only declared.</span>
<a name="l00337"></a>00337                         DEFINE_SERIALIZABLE_GRAPH
<a name="l00338"></a>00338                 };
<a name="l00339"></a>00339 <span class="comment"></span>
<a name="l00340"></a>00340 <span class="comment">                /** @} */</span>  <span class="comment">// end of grouping</span>
<a name="l00341"></a>00341         } <span class="comment">// End of namespace</span>
<a name="l00342"></a>00342 } <span class="comment">// End of namespace</span>
<a name="l00343"></a>00343 
<a name="l00344"></a>00344 
<a name="l00345"></a>00345 <span class="comment">// Implementation of templates (in a separate file for clarity)</span>
<a name="l00346"></a>00346 <span class="preprocessor">#include &quot;CNetworkOfPoses_impl.h&quot;</span>
<a name="l00347"></a>00347 <span class="preprocessor"></span>
<a name="l00348"></a>00348 <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>