Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanuppal committed Apr 30, 2024
1 parent 0b3eef8 commit 5988a03
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 53 deletions.
32 changes: 20 additions & 12 deletions docs/_writing.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>scan matching: an ICP Implementation</title>
<title>scan matching: an ICP Instance</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
Expand Down Expand Up @@ -73,29 +73,37 @@

</div><!-- top -->
<div><div class="header">
<div class="headertitle"><div class="title">an ICP Implementation</div></div>
<div class="headertitle"><div class="title">an ICP Instance</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>An ICP implementation should reside in a single C++ source file, e.g., <code>my_icp.cpp</code>. You should declare a <code>final</code> class named <code>MyICP</code> that inherits <code>public <a class="el" href="classicp_1_1_i_c_p.html" title="Interface for iterative closest points; please read the Detailed Description for usage information.">icp::ICP</a></code> that must provide the following functionality:</p>
<div class="textblock"><p>To write an ICP instance, create a C++ source file with at least the following:</p>
<ol type="1">
<li>A <code>final</code> class that inherits from <code>public <a class="el" href="classicp_1_1_i_c_p.html" title="Interface for iterative closest points; please read the Detailed Description for usage information.">icp::ICP</a></code></li>
<li>A static initialization variable (described below)</li>
</ol>
<p>The class must define the following behavior:</p>
<ul>
<li><code>MyICP()</code></li>
<li><code>~MyICP() override</code></li>
<li>A constructor that calls the <code><a class="el" href="classicp_1_1_i_c_p.html" title="Interface for iterative closest points; please read the Detailed Description for usage information.">icp::ICP</a></code> constructor</li>
<li>An overridden destructor (which may do nothing)</li>
<li><code>void iterate() override</code></li>
</ul>
<p>You may optionally override the following methods:</p>
<p>In <code>iterate</code>, the point clouds are given by the instance variables <code>a</code> and <code>b</code>. There are also <code>pair</code> and <code>dist</code> instance variables, each allocated to have size <code>a.size()</code>. At the end of <code>iterate</code>, the <code>transform</code> instance variable should have been updated (although the update may be zero).</p>
<p>Optionally, the class can override:</p>
<ul>
<li><code>setup() override</code></li>
<li><code>const std::vector&lt;Vector&gt;&amp; a, const std::vector&lt;Vector&gt;&amp; b) override</code></li>
<li><code>void setup() override</code></li>
<li><code>void trim(const std::vector&lt;Vector&gt;&amp; a, const std::vector&lt;Vector&gt;&amp; b) override</code></li>
</ul>
<p>Finally, define the following static variable:</p>
<p><code>trim</code> should initialize the instance variables <code>a</code> and <code>b</code> from the given point clouds <code>a</code> and <code>b</code>. The default behavior is to copy them over directly.</p>
<p>The static initialization is required so that users can instantiate your ICP instance. Define</p>
<div class="fragment"><div class="line"> ++</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">bool</span> static_initialization = []() {</div>
<div class="line"> assert(ICP::register_method(<span class="stringliteral">&quot;my_icp&quot;</span>, []() -&gt; std::unique_ptr&lt;ICP&gt; {</div>
<div class="line"> <span class="keywordflow">return</span> std::make_unique&lt;MyICP&gt;();</div>
<div class="line"> assert(ICP::register_method(<span class="stringliteral">&quot;name_of_instance&quot;</span>, []() -&gt; std::unique_ptr&lt;ICP&gt; {</div>
<div class="line"> <span class="keywordflow">return</span> std::make_unique&lt;NameOfClass&gt;();</div>
<div class="line"> }));</div>
<div class="line"> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}();</div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- fragment --><p>where <code>"name_of_instance"</code> is the name of your ICP implementation and <code>NameOfClass</code> is the name of the class. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Expand Down
2 changes: 1 addition & 1 deletion docs/classicp_1_1_i_c_p.html
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a80a0f5b00b3b9bf1403fdafe
</div><div class="memdoc">

<p>Perform <a class="el" href="classicp_1_1_i_c_p.html" title="Interface for iterative closest points; please read the Detailed Description for usage information.">ICP</a> for the point clouds <code>a</code> and <code>b</code> provided with <a class="el" href="#ab5a0481925dfd8d0ba2ea9b5f4b7fb79" title="Begins the ICP process for point clouds a and b with an initial guess for the transform t.">ICP::begin</a> until the cost is below <code>convergence_threshold</code> or until no progress is being made. </p>
<p>At least <code>burn_in</code> iterations will be performed.</p>
<p>At least <code>burn_in</code> iterations will be performed. Start with zero burn-in, and slowly increase if convergence requirements are not met.</p>
<dl class="section return"><dt>Returns</dt><dd>Information about the convergence. </dd></dl>

<p class="definition">Definition at line <a class="el" href="icp_8cpp_source.html#l00062">62</a> of file <a class="el" href="icp_8cpp_source.html">icp.cpp</a>.</p>
Expand Down
10 changes: 5 additions & 5 deletions docs/icp_8cpp_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// Set relative to centroid</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <a class="code hl_variable" href="classicp_1_1_i_c_p.html#a7f34fb6c33262204472719180ead46d4">a_cm</a> = <a class="code hl_function" href="namespaceicp.html#acc0c99b29d9d6fa5275e5a04d7d36f4c">get_centroid</a>(this-&gt;a);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <a class="code hl_variable" href="classicp_1_1_i_c_p.html#a679d20d77b2c458c4d4620f143fc72a7">b_cm</a> = <a class="code hl_function" href="namespaceicp.html#acc0c99b29d9d6fa5275e5a04d7d36f4c">get_centroid</a>(this-&gt;a);</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <a class="code hl_variable" href="classicp_1_1_i_c_p.html#a679d20d77b2c458c4d4620f143fc72a7">b_cm</a> = <a class="code hl_function" href="namespaceicp.html#acc0c99b29d9d6fa5275e5a04d7d36f4c">get_centroid</a>(this-&gt;b);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">for</span> (<a class="code hl_typedef" href="namespaceicp.html#aba583ee22f8131f5494d90fb3a611bd5">Vector</a>&amp; point: this-&gt;<a class="code hl_variable" href="classicp_1_1_i_c_p.html#a8fa6d4d0a46ee621097c821afe7e5985">a</a>) {</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> point -= <a class="code hl_variable" href="classicp_1_1_i_c_p.html#a7f34fb6c33262204472719180ead46d4">a_cm</a>;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> }</div>
Expand Down Expand Up @@ -159,7 +159,7 @@
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// Repeat until convergence</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">while</span> (<a class="code hl_variable" href="classicp_1_1_i_c_p.html#a8187f14a280850840917e85240d5e222">current_cost</a> &gt; convergence_threshold || <a class="code hl_variable" href="classicp_1_1_i_c_p.html#a8187f14a280850840917e85240d5e222">current_cost</a> == INFINITY</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> || result.iteration_count &lt;= burn_in) {</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> || result.iteration_count &lt; burn_in) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// Store previous iteration results</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_variable" href="classicp_1_1_i_c_p.html#a27d1d41afc1f064cc278c13720dca476">previous_cost</a> = <a class="code hl_variable" href="classicp_1_1_i_c_p.html#a8187f14a280850840917e85240d5e222">current_cost</a>;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <a class="code hl_struct" href="structicp_1_1_r_b_transform.html">RBTransform</a> previous_transform = <a class="code hl_variable" href="classicp_1_1_i_c_p.html#a47adf7aba7ca4afbdd308abaa4613bb1">transform</a>;</div>
Expand Down Expand Up @@ -258,9 +258,9 @@
<div class="ttc" id="anamespaceicp_html_aba583ee22f8131f5494d90fb3a611bd5"><div class="ttname"><a href="namespaceicp.html#aba583ee22f8131f5494d90fb3a611bd5">icp::Vector</a></div><div class="ttdeci">Eigen::Vector2d Vector</div><div class="ttdef"><b>Definition</b> <a href="geo_8h_source.html#l00015">geo.h:15</a></div></div>
<div class="ttc" id="anamespaceicp_html_acc0c99b29d9d6fa5275e5a04d7d36f4c"><div class="ttname"><a href="namespaceicp.html#acc0c99b29d9d6fa5275e5a04d7d36f4c">icp::get_centroid</a></div><div class="ttdeci">Vector get_centroid(const std::vector&lt; Vector &gt; &amp;points)</div><div class="ttdef"><b>Definition</b> <a href="geo_8cpp_source.html#l00010">geo.cpp:10</a></div></div>
<div class="ttc" id="astructicp_1_1_i_c_p_1_1_convergence_report_html"><div class="ttname"><a href="structicp_1_1_i_c_p_1_1_convergence_report.html">icp::ICP::ConvergenceReport</a></div><div class="ttdef"><b>Definition</b> <a href="icp_8h_source.html#l00079">icp.h:79</a></div></div>
<div class="ttc" id="astructicp_1_1_methods_html"><div class="ttname"><a href="structicp_1_1_methods.html">icp::Methods</a></div><div class="ttdef"><b>Definition</b> <a href="icp_8h_source.html#l00132">icp.h:132</a></div></div>
<div class="ttc" id="astructicp_1_1_methods_html_a9b86e25dc92c562e4014a9e70abda5e3"><div class="ttname"><a href="structicp_1_1_methods.html#a9b86e25dc92c562e4014a9e70abda5e3">icp::Methods::registered_method_names</a></div><div class="ttdeci">std::vector&lt; std::string &gt; registered_method_names</div><div class="ttdef"><b>Definition</b> <a href="icp_8h_source.html#l00133">icp.h:133</a></div></div>
<div class="ttc" id="astructicp_1_1_methods_html_ae4fc50c0fa6121e1d9fe81db29d3ef00"><div class="ttname"><a href="structicp_1_1_methods.html#ae4fc50c0fa6121e1d9fe81db29d3ef00">icp::Methods::registered_method_constructors</a></div><div class="ttdeci">std::vector&lt; std::function&lt; std::unique_ptr&lt; ICP &gt;(void)&gt; &gt; registered_method_constructors</div><div class="ttdef"><b>Definition</b> <a href="icp_8h_source.html#l00135">icp.h:135</a></div></div>
<div class="ttc" id="astructicp_1_1_methods_html"><div class="ttname"><a href="structicp_1_1_methods.html">icp::Methods</a></div><div class="ttdef"><b>Definition</b> <a href="icp_8h_source.html#l00134">icp.h:134</a></div></div>
<div class="ttc" id="astructicp_1_1_methods_html_a9b86e25dc92c562e4014a9e70abda5e3"><div class="ttname"><a href="structicp_1_1_methods.html#a9b86e25dc92c562e4014a9e70abda5e3">icp::Methods::registered_method_names</a></div><div class="ttdeci">std::vector&lt; std::string &gt; registered_method_names</div><div class="ttdef"><b>Definition</b> <a href="icp_8h_source.html#l00135">icp.h:135</a></div></div>
<div class="ttc" id="astructicp_1_1_methods_html_ae4fc50c0fa6121e1d9fe81db29d3ef00"><div class="ttname"><a href="structicp_1_1_methods.html#ae4fc50c0fa6121e1d9fe81db29d3ef00">icp::Methods::registered_method_constructors</a></div><div class="ttdeci">std::vector&lt; std::function&lt; std::unique_ptr&lt; ICP &gt;(void)&gt; &gt; registered_method_constructors</div><div class="ttdef"><b>Definition</b> <a href="icp_8h_source.html#l00137">icp.h:137</a></div></div>
<div class="ttc" id="astructicp_1_1_r_b_transform_html"><div class="ttname"><a href="structicp_1_1_r_b_transform.html">icp::RBTransform</a></div><div class="ttdoc">Rigid-body transformation.</div><div class="ttdef"><b>Definition</b> <a href="geo_8h_source.html#l00019">geo.h:19</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
Expand Down
Loading

0 comments on commit 5988a03

Please sign in to comment.