<!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>[mrpt-graphslam]</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> > <b>C++ reference</b> </div> <div align="right"> <a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a> </div> <!-- Generated by Doxygen 1.7.5 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><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> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> | <a href="#namespaces">Namespaces</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">[mrpt-graphslam]</div> </div> </div> <div class="contents"> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <p><small> <a href="index.html#libs">Back to list of all libraries</a> | <a href="modules.html">See all modules</a> </small> <br/> </p> <h2>Library <code>mrpt-graphslam</code></h2> <hr/> <p>Graph-SLAM: See the namespace <a class="el" href="namespacemrpt_1_1graphslam.html" title="SLAM methods related to graphs of pose constraints.">mrpt::graphslam</a> </p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="nested-classes"></a> Classes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structmrpt_1_1graphslam_1_1graphslam__traits.html">mrpt::graphslam::graphslam_traits</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Auxiliary traits template for use among graph-slam problems to make life easier with these complicated, long data type names. <a href="structmrpt_1_1graphslam_1_1graphslam__traits.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structmrpt_1_1graphslam_1_1_t_result_info_spa_lev_marq.html">mrpt::graphslam::TResultInfoSpaLevMarq</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Output information for <a class="el" href="group__mrpt__graphslam__grp.html#ga022f4a70be5ec7c432f46374e4bb9d66" title="Optimize a graph of pose constraints using the Sparse Pose Adjustment (SPA) sparse representation and...">mrpt::graphslam::optimize_graph_spa_levmarq()</a> <a href="structmrpt_1_1graphslam_1_1_t_result_info_spa_lev_marq.html#details">More...</a><br/></td></tr> <tr><td colspan="2"><h2><a name="namespaces"></a> Namespaces</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacemrpt_1_1graphslam.html">mrpt::graphslam</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><p>SLAM methods related to graphs of pose constraints. </p> <br/></td></tr> <tr><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr><td class="memTemplParams" colspan="2">template<class GRAPH_T > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__mrpt__graphslam__grp.html#ga022f4a70be5ec7c432f46374e4bb9d66">mrpt::graphslam::optimize_graph_spa_levmarq</a> (GRAPH_T &graph, <a class="el" href="structmrpt_1_1graphslam_1_1_t_result_info_spa_lev_marq.html">TResultInfoSpaLevMarq</a> &out_info, const <a class="el" href="classstd_1_1set.html">std::set</a>< <a class="el" href="namespacemrpt_1_1utils.html#a718b4f99645b7e9f6501c9b7bb2a2fe7">mrpt::utils::TNodeID</a> > *in_nodes_to_optimize=NULL, const <a class="el" href="namespacemrpt_1_1utils.html#a694777f2a3544999baea34e43a42eceb">mrpt::utils::TParametersDouble</a> &extra_params=<a class="el" href="namespacemrpt_1_1utils.html#a694777f2a3544999baea34e43a42eceb">mrpt::utils::TParametersDouble</a>(), typename <a class="el" href="structmrpt_1_1graphslam_1_1graphslam__traits.html">graphslam_traits</a>< GRAPH_T >::TFunctorFeedback functor_feedback=NULL)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Optimize a graph of pose constraints using the Sparse Pose Adjustment (SPA) sparse representation and a Levenberg-Marquartd optimizer. <a href="#ga022f4a70be5ec7c432f46374e4bb9d66"></a><br/></td></tr> </table> <hr/><h2>Function Documentation</h2> <a class="anchor" id="ga022f4a70be5ec7c432f46374e4bb9d66"></a><!-- doxytag: member="mrpt::graphslam::optimize_graph_spa_levmarq" ref="ga022f4a70be5ec7c432f46374e4bb9d66" args="(GRAPH_T &graph, TResultInfoSpaLevMarq &out_info, const std::set< mrpt::utils::TNodeID > *in_nodes_to_optimize=NULL, const mrpt::utils::TParametersDouble &extra_params=mrpt::utils::TParametersDouble(), typename graphslam_traits< GRAPH_T >::TFunctorFeedback functor_feedback=NULL)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class GRAPH_T > </div> <table class="memname"> <tr> <td class="memname">void mrpt::graphslam::optimize_graph_spa_levmarq </td> <td>(</td> <td class="paramtype">GRAPH_T & </td> <td class="paramname"><em>graph</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="structmrpt_1_1graphslam_1_1_t_result_info_spa_lev_marq.html">TResultInfoSpaLevMarq</a> & </td> <td class="paramname"><em>out_info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classstd_1_1set.html">std::set</a>< <a class="el" href="namespacemrpt_1_1utils.html#a718b4f99645b7e9f6501c9b7bb2a2fe7">mrpt::utils::TNodeID</a> > * </td> <td class="paramname"><em>in_nodes_to_optimize</em> = <code>NULL</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="namespacemrpt_1_1utils.html#a694777f2a3544999baea34e43a42eceb">mrpt::utils::TParametersDouble</a> & </td> <td class="paramname"><em>extra_params</em> = <code><a class="el" href="namespacemrpt_1_1utils.html#a694777f2a3544999baea34e43a42eceb">mrpt::utils::TParametersDouble</a>()</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">typename <a class="el" href="structmrpt_1_1graphslam_1_1graphslam__traits.html">graphslam_traits</a>< GRAPH_T >::TFunctorFeedback </td> <td class="paramname"><em>functor_feedback</em> = <code>NULL</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Optimize a graph of pose constraints using the Sparse Pose Adjustment (SPA) sparse representation and a Levenberg-Marquartd optimizer. </p> <p>This method works for all types of graphs derived from <em>CNetworkOfPoses</em> (see its reference <a class="el" 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...">mrpt::graphs::CNetworkOfPoses</a> for the list). The input data are all the pose constraints in <em>graph</em> (graph.edges), and the gross first estimations of the "global" pose coordinates (in graph.nodes).</p> <p>Note that these first coordinates can be obtained with <a class="el" 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...">mrpt::graphs::CNetworkOfPoses::dijkstra_nodes_estimate()</a>.</p> <p>The method implemented in this file is based on this work:</p> <ul> <li>"Efficient Sparse Pose Adjustment for 2D Mapping", Kurt Konolige et al., 2010. , but generalized for not only 2D but 2D and 3D poses, and using on-manifold optimization.</li> </ul> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramdir">[in,out]</td><td class="paramname">graph</td><td>The input edges and output poses. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">out_info</td><td>Some basic output information on the process. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">nodes_to_optimize</td><td>The list of nodes whose global poses are to be optimized. If NULL (default), all the node IDs are optimized (but that marked as <em>root</em> in the graph). </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">extra_params</td><td>Optional parameters, see below. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">functor_feedback</td><td>Optional: a pointer to a user function can be set here to be called on each LM loop iteration (eg to refresh the current state and error, refresh a GUI, etc.)</td></tr> </table> </dd> </dl> <p>List of optional parameters by name in "extra_params":</p> <ul> <li>"verbose": (default=0) If !=0, produce verbose ouput.</li> <li>"max_iterations": (default=100) Maximum number of Lev-Marq. iterations.</li> <li>"scale_hessian": (default=0.1) Multiplies the Hessian matrix by this scalar (may improve convergence speed).</li> <li>"initial_lambda": (default=0) <=0 means auto guess, otherwise, initial lambda value for the lev-marq algorithm.</li> <li>"tau": (default=1e-3) Initial tau value for the lev-marq algorithm.</li> <li>"e1": (default=1e-6) Lev-marq algorithm iteration stopping criterion #1: |gradient| < e1</li> <li>"e2": (default=1e-6) Lev-marq algorithm iteration stopping criterion #2: |delta_incr| < e2*(x_norm+e2)</li> </ul> <dl class="note"><dt><b>Note:</b></dt><dd>The following graph types are supported: <a class="el" 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...">mrpt::graphs::CNetworkOfPoses2D</a>, <a class="el" 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...">mrpt::graphs::CNetworkOfPoses3D</a>, <a class="el" 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...">mrpt::graphs::CNetworkOfPoses2DInf</a>, <a class="el" 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...">mrpt::graphs::CNetworkOfPoses3DInf</a></dd></dl> <dl><dt><b>Template Parameters:</b></dt><dd> <table class=""> <tr><td class="paramname">GRAPH_T</td><td>Normally a mrpt::graphs::CNetworkOfPoses<EDGE_TYPE,MAPS_IMPLEMENTATION>. Users won't have to write this template argument by hand, since the compiler will auto-fit it depending on the type of the graph object. </td></tr> </table> </dd> </dl> <dl class="see"><dt><b>See also:</b></dt><dd>The example "graph_slam_demo"</dd></dl> <dl class="note"><dt><b>Note:</b></dt><dd>Implementation can be found in file <em><a class="el" href="levmarq__impl_8h.html">levmarq_impl.h</a></em> </dd></dl> <p>Definition at line <a class="el" href="levmarq_8h_source.html#l00073">73</a> of file <a class="el" href="levmarq_8h_source.html">levmarq.h</a>.</p> <p>References <a class="el" href="mrpt__macros_8h_source.html#l00370">MRPT_START</a>, <a class="el" href="_c_time_logger_8h_source.html#l00080">mrpt::utils::CTimeLogger::enter()</a>, <a class="el" href="_c_time_logger_8h_source.html#l00085">mrpt::utils::CTimeLogger::leave()</a>, <a class="el" href="mrpt__macros_8h_source.html#l00288">ASSERT_ABOVE_</a>, <a class="el" href="levmarq_8h.html#a1c3b443696ddb6ac515b86e5c188d851">VERBOSE_PREFIX</a>, <a class="el" href="mrpt__macros_8h_source.html#l00305">ASSERTDEBMSG_</a>, <a class="el" href="mrpt__macros_8h_source.html#l00304">ASSERTDEB_</a>, <a class="el" href="stl__extensions_8h_source.html#l00196">mrpt::utils::find_in_vector()</a>, <a class="el" href="mrpt__macros_8h_source.html#l00285">ASSERT_EQUAL_</a>, <a class="el" href="group__mrpt__system__os.html#gae1184cfb1f617787dc4c9da98becbe3a">mrpt::system::os::memcpy()</a>, <a class="el" href="eigen__plugins_8h_source.html#l00271">norm_inf()</a>, <a class="el" href="math__frwds_8h_source.html#l00102">mrpt::math::UNINITIALIZED_MATRIX</a>, <a class="el" href="eigen__plugins_8h_source.html#l00046">begin()</a>, <a class="el" href="bits_8h_source.html#l00194">mrpt::utils::keep_max()</a>, <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html#abc4058c15d5a02f8d56853de8cbab18b">mrpt::math::CSparseMatrix::insert_entry_fast()</a>, <a class="el" href="_c_sparse_matrix_8h_source.html#l00272">mrpt::math::CSparseMatrix::insert_submatrix()</a>, <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html#a0ff96fdc90f43ad4bc9c2b4876e42089">mrpt::math::CSparseMatrix::compressFromTriplet()</a>, <a class="el" href="ops__containers_8h_source.html#l00115">mrpt::math::norm()</a>, <a class="el" href="bits_8h_source.html#l00161">mrpt::utils::square()</a>, <a class="el" href="namespacemrpt.html#a3a27af794b658df5491e2b7678f8ccb8">mrpt::format()</a>, <a class="el" href="_c_pose_or_point_8h_source.html#l00057">mrpt::poses::UNINITIALIZED_POSE</a>, <a class="el" href="_core_source.html#l00336">Eigen::Matrix::swap()</a>, <a class="el" href="graphslam_2include_2mrpt_2graphslam_2types_8h_source.html#l00082">mrpt::graphslam::TResultInfoSpaLevMarq::num_iters</a>, <a class="el" href="graphslam_2include_2mrpt_2graphslam_2types_8h_source.html#l00083">mrpt::graphslam::TResultInfoSpaLevMarq::final_total_sq_error</a>, and <a class="el" href="mrpt__macros_8h_source.html#l00374">MRPT_END</a>.</p> </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>