Skip to content

Commit

Permalink
Add docs from pypose/pypose
Browse files Browse the repository at this point in the history
  • Loading branch information
pyposebot committed Sep 18, 2024
1 parent 7e735b8 commit f602d28
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
13 changes: 5 additions & 8 deletions docs/preview/pr/353/_modules/pypose/lietensor/convert/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,8 @@ <h1>Source code for pypose.lietensor.convert</h1><div class="highlight"><pre>

<div class="viewcode-block" id="quat2unit"><a class="viewcode-back" href="../../../../generated/pypose.quat2unit/#pypose.quat2unit">[docs]</a><span class="k">def</span> <span class="nf">quat2unit</span><span class="p">(</span><span class="nb">input</span><span class="p">:</span> <span class="n">LieTensor</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="mf">1e-12</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">LieTensor</span><span class="p">:</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&#39;&#39;&#39;</span>
<span class="sd"> Normalize the quaternion part of a ``LieTensor``, which has to be a Lie Group.</span>
<span class="sd"> If input is a Lie algebra, then do nothing and return the input tensor.</span>
<span class="sd"> Normalize the quaternion part of a ``LieTensor``, which has to be a Lie group.</span>
<span class="sd"> If input is a not a Lie group, then do nothing and return the input.</span>
<span class="sd"> If the quaternion parts are zeros, then initilize identity quaternions.</span>

<span class="sd"> The quaternion parts :math:`v` are normalized as</span>
Expand All @@ -1090,11 +1090,7 @@ <h1>Source code for pypose.lietensor.convert</h1><div class="highlight"><pre>
<span class="sd"> Return:</span>
<span class="sd"> :obj:`LieTensor`: the output LieTensor.</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">LieTensor</span><span class="p">),</span> <span class="s2">&quot;Input should be a LieTensor&quot;</span>

<span class="k">if</span> <span class="nb">input</span><span class="o">.</span><span class="n">ltype</span> <span class="ow">in</span> <span class="n">liealgebra</span><span class="p">:</span>
<span class="k">return</span> <span class="nb">input</span>
<span class="k">elif</span> <span class="nb">input</span><span class="o">.</span><span class="n">ltype</span> <span class="ow">in</span> <span class="n">liegroup</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">LieTensor</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="nb">input</span><span class="o">.</span><span class="n">ltype</span> <span class="ow">in</span> <span class="n">liegroup</span><span class="p">):</span>
<span class="n">data</span> <span class="o">=</span> <span class="nb">input</span><span class="o">.</span><span class="n">tensor</span><span class="p">()</span>
<span class="k">if</span> <span class="nb">input</span><span class="o">.</span><span class="n">ltype</span> <span class="ow">in</span> <span class="p">[</span><span class="n">SO3_type</span><span class="p">,</span> <span class="n">RxSO3_type</span><span class="p">]:</span>
<span class="n">data</span><span class="p">[</span><span class="o">...</span><span class="p">,</span> <span class="p">:</span><span class="mi">4</span><span class="p">]</span> <span class="o">=</span> <span class="n">normalize</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="o">...</span><span class="p">,</span> <span class="p">:</span><span class="mi">4</span><span class="p">],</span> <span class="n">p</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">dim</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">eps</span><span class="o">=</span><span class="n">eps</span><span class="p">)</span>
Expand All @@ -1105,7 +1101,8 @@ <h1>Source code for pypose.lietensor.convert</h1><div class="highlight"><pre>
<span class="n">output</span><span class="o">.</span><span class="n">rotation</span><span class="p">()</span><span class="o">.</span><span class="n">identity_</span><span class="p">()</span>
<span class="k">return</span> <span class="n">output</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="s2">&quot;LieType of Input LieTensor not recognized.&quot;</span></div>
<span class="n">warnings</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s2">&quot;Input is not Lie group, doing thing and returning input..&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="nb">input</span></div>
</pre></div>

</article>
Expand Down
2 changes: 1 addition & 1 deletion docs/preview/pr/353/convert/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ <h1>Convert<a class="headerlink" href="#convert" title="Permalink to this headin
<td><p>Convert a <a class="reference internal" href="../generated/pypose.LieTensor/#pypose.LieTensor" title="pypose.LieTensor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">LieTensor</span></code></a> into matrix form.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="../generated/pypose.quat2unit/#pypose.quat2unit" title="pypose.quat2unit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">quat2unit</span></code></a></p></td>
<td><p>Normalize the quaternion part of a <code class="docutils literal notranslate"><span class="pre">LieTensor</span></code>, which has to be a Lie Group.</p></td>
<td><p>Normalize the quaternion part of a <code class="docutils literal notranslate"><span class="pre">LieTensor</span></code>, which has to be a Lie group.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="../generated/pypose.cart2homo/#pypose.cart2homo" title="pypose.cart2homo"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cart2homo</span></code></a></p></td>
<td><p>Converts batched Cartesian coordinates to Homogeneous coordinates by adding ones to last dimension.</p></td>
Expand Down
4 changes: 2 additions & 2 deletions docs/preview/pr/353/generated/pypose.quat2unit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ <h1>pypose.quat2unit<a class="headerlink" href="#pypose-quat2unit" title="Permal
<dl class="py function">
<dt class="sig sig-object py" id="pypose.quat2unit">
<span class="sig-prename descclassname"><span class="pre">pypose.</span></span><span class="sig-name descname"><span class="pre">quat2unit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">input</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">eps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1e-12</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/pypose/lietensor/convert/#quat2unit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pypose.quat2unit" title="Permalink to this definition"></a></dt>
<dd><p>Normalize the quaternion part of a <code class="docutils literal notranslate"><span class="pre">LieTensor</span></code>, which has to be a Lie Group.
If input is a Lie algebra, then do nothing and return the input tensor.
<dd><p>Normalize the quaternion part of a <code class="docutils literal notranslate"><span class="pre">LieTensor</span></code>, which has to be a Lie group.
If input is a not a Lie group, then do nothing and return the input.
If the quaternion parts are zeros, then initilize identity quaternions.</p>
<p>The quaternion parts <span class="math">\(v\)</span> are normalized as</p>
<div class="math">
Expand Down
2 changes: 1 addition & 1 deletion docs/preview/pr/353/searchindex.js

Large diffs are not rendered by default.

0 comments on commit f602d28

Please sign in to comment.