Skip to content

Commit f5d4b48

Browse files
committed
Update documentation
1 parent 1c4a618 commit f5d4b48

53 files changed

Lines changed: 259 additions & 90 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎2d_pose_SE2.html‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,38 @@ <h1>SE(2) matrix<a class="headerlink" href="#se-2-matrix" title="Link to this he
381381
</dl>
382382
</dd></dl>
383383
<dl class="py method">
384+
<dt class="sig sig-object py" id="spatialmath.pose2d.SE2.Ad">
385+
<span class="sig-name descname"><span class="pre">Ad</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2.Ad"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#spatialmath.pose2d.SE2.Ad" title="Link to this definition"></a></dt>
386+
<dd><p>Adjoint of SE(2)</p>
387+
<dl class="field-list simple">
388+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
389+
<dd class="field-odd"><p>adjoint matrix</p>
390+
</dd>
391+
<dt class="field-even">Return type<span class="colon">:</span></dt>
392+
<dd class="field-even"><p>ndarray(3,3)</p>
393+
</dd>
394+
</dl>
395+
<p><code class="docutils literal notranslate"><span class="pre">SE2.Ad</span></code> is the 3x3 adjoint matrix</p>
396+
<p>If the twist or spatial velocity <span class="math notranslate nohighlight">\(\nu = (v_x, v_y, \omega)^T\)</span>
397+
and the SE(2) represents the pose of {B} relative to {A},
398+
ie. <span class="math notranslate nohighlight">\({}^A {\bf T}_B\)</span>, and the adjoint is <span class="math notranslate nohighlight">\(\mathbf{A}\)</span> then
399+
<span class="math notranslate nohighlight">\({}^{A}\!\nu = \mathbf{A} {}^{B}\!\nu\)</span>.</p>
400+
<p>Example:</p>
401+
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span><span class="w"> </span><span class="nn">spatialmath</span><span class="w"> </span><span class="kn">import</span> <a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">SE2</span></a>
402+
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">SE2</span></a><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">)</span><span class="o">.</span><a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2.Ad" title="spatialmath.pose2d.SE2.Ad"><span class="n">Ad</span></a><span class="p">()</span>
403+
<span class="go">array([[ 0.9553, -0.2955, 2. ],</span>
404+
<span class="go"> [ 0.2955, 0.9553, -1. ],</span>
405+
<span class="go"> [ 0. , 0. , 1. ]])</span>
406+
</pre></div>
407+
</div>
408+
<dl class="field-list simple">
409+
<dt class="field-odd">Seealso<span class="colon">:</span></dt>
410+
<dd class="field-odd"><p><a class="reference internal" href="3d_pose_SE3.html#spatialmath.pose3d.SE3.Ad" title="spatialmath.pose3d.SE3.Ad"><code class="xref py py-meth docutils literal notranslate"><span class="pre">spatialmath.pose3d.SE3.Ad()</span></code></a>, <a class="reference internal" href="2d_pose_twist.html#spatialmath.twist.Twist2.ad" title="spatialmath.twist.Twist2.ad"><code class="xref py py-meth docutils literal notranslate"><span class="pre">spatialmath.twist.Twist2.ad()</span></code></a>,
411+
<a class="reference internal" href="func_2d.html#spatialmath.base.transforms2d.tr2adjoint2" title="spatialmath.base.transforms2d.tr2adjoint2"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2adjoint2()</span></code></a></p>
412+
</dd>
413+
</dl>
414+
</dd></dl>
415+
<dl class="py method">
384416
<dt class="sig sig-object py" id="spatialmath.pose2d.SE2.SE2">
385417
<span class="sig-name descname"><span class="pre">SE2</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.SE2" title="Link to this definition"></a></dt>
386418
<dd><p>Create SE(2) from SO(2)</p>

‎2d_pose_twist.html‎

Lines changed: 80 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,42 @@ <h1>se(2) twist<a class="headerlink" href="#se-2-twist" title="Link to this head
322322
</div>
323323
</dd></dl>
324324
<dl class="py method">
325+
<dt class="sig sig-object py" id="spatialmath.twist.Twist2.Ad">
326+
<span class="sig-name descname"><span class="pre">Ad</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/twist.html#Twist2.Ad"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#spatialmath.twist.Twist2.Ad" title="Link to this definition"></a></dt>
327+
<dd><p>Adjoint of 2D twist</p>
328+
<dl class="field-list simple">
329+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
330+
<dd class="field-odd"><p>adjoint matrix</p>
331+
</dd>
332+
<dt class="field-even">Return type<span class="colon">:</span></dt>
333+
<dd class="field-even"><p>ndarray(3,3)</p>
334+
</dd>
335+
</dl>
336+
<p><code class="docutils literal notranslate"><span class="pre">S.Ad()</span></code> is the 3x3 adjoint matrix of the corresponding
337+
homogeneous transformation.</p>
338+
<p>For a twist representing motion from frame {B} to {A}, the adjoint will
339+
transform a twist relative to frame {A} to one relative to frame {B}.</p>
340+
<p>Example:</p>
341+
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span><span class="w"> </span><span class="nn">spatialmath</span><span class="w"> </span><span class="kn">import</span> <a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">Twist2</span></a>
342+
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">S</span></a> <span class="o">=</span> <a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">Twist2</span></a><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">])</span>
343+
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2.Ad" title="spatialmath.twist.Twist2.Ad"><span class="n">S</span><span class="o">.</span><span class="n">Ad</span></a><span class="p">()</span>
344+
<span class="go">array([[ 0.9553, -0.2955, 2.119 ],</span>
345+
<span class="go"> [ 0.2955, 0.9553, -0.6873],</span>
346+
<span class="go"> [ 0. , 0. , 1. ]])</span>
347+
</pre></div>
348+
</div>
349+
<div class="admonition note">
350+
<p class="admonition-title">Note</p>
351+
<p>This method computes the equivalent SE(2) matrix, then the adjoint
352+
of that.</p>
353+
</div>
354+
<dl class="field-list simple">
355+
<dt class="field-odd">Seealso<span class="colon">:</span></dt>
356+
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.twist.Twist2.ad" title="spatialmath.twist.Twist2.ad"><code class="xref py py-func docutils literal notranslate"><span class="pre">Twist2.ad()</span></code></a>, <a class="reference internal" href="#spatialmath.twist.Twist2.SE2" title="spatialmath.twist.Twist2.SE2"><code class="xref py py-func docutils literal notranslate"><span class="pre">Twist2.SE2()</span></code></a>, <a class="reference internal" href="#spatialmath.twist.Twist2.exp" title="spatialmath.twist.Twist2.exp"><code class="xref py py-func docutils literal notranslate"><span class="pre">Twist2.exp()</span></code></a></p>
357+
</dd>
358+
</dl>
359+
</dd></dl>
360+
<dl class="py method">
325361
<dt class="sig sig-object py" id="spatialmath.twist.Twist2.SE2">
326362
<span class="sig-name descname"><span class="pre">SE2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">theta</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unit</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'rad'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/twist.html#Twist2.SE2"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#spatialmath.twist.Twist2.SE2" title="Link to this definition"></a></dt>
327363
<dd><p>Convert 2D twist to SE(2) matrix</p>
@@ -553,6 +589,47 @@ <h1>se(2) twist<a class="headerlink" href="#se-2-twist" title="Link to this head
553589
<span class="sig-name descname"><span class="pre">__truediv__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">right</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.twist.Twist2.__truediv__" title="Link to this definition"></a></dt>
554590
<dd></dd></dl>
555591
<dl class="py method">
592+
<dt class="sig sig-object py" id="spatialmath.twist.Twist2.ad">
593+
<span class="sig-name descname"><span class="pre">ad</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/twist.html#Twist2.ad"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#spatialmath.twist.Twist2.ad" title="Link to this definition"></a></dt>
594+
<dd><p>Logarithm of adjoint of 2D twist</p>
595+
<dl class="field-list simple">
596+
<dt class="field-odd">Returns<span class="colon">:</span></dt>
597+
<dd class="field-odd"><p>logarithm of adjoint matrix</p>
598+
</dd>
599+
<dt class="field-even">Return type<span class="colon">:</span></dt>
600+
<dd class="field-even"><p>ndarray(3,3), or list of ndarray if the twist is a sequence</p>
601+
</dd>
602+
</dl>
603+
<p><code class="docutils literal notranslate"><span class="pre">S.ad()</span></code> is the 3x3 matrix representation of the Lie bracket with
604+
the twist <code class="docutils literal notranslate"><span class="pre">S</span></code>, such that for twists <code class="docutils literal notranslate"><span class="pre">S</span></code> and <code class="docutils literal notranslate"><span class="pre">T</span></code></p>
605+
<div class="math notranslate nohighlight">
606+
\[\mathrm{ad}(S) \vec{T} = \vee \left( [S] [T] - [T] [S] \right)\]</div>
607+
<p>where <span class="math notranslate nohighlight">\([S]\)</span> is the augmented skew-symmetric matrix of the twist.
608+
For <span class="math notranslate nohighlight">\(S = (v_x, v_y, \omega)\)</span> it is</p>
609+
<div class="math notranslate nohighlight">
610+
\[\begin{split}\begin{pmatrix} 0 &amp; -\omega &amp; v_y \\ \omega &amp; 0 &amp; -v_x \\ 0 &amp; 0 &amp; 0 \end{pmatrix}\end{split}\]</div>
611+
<p>Example:</p>
612+
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span><span class="w"> </span><span class="nn">spatialmath</span><span class="w"> </span><span class="kn">import</span> <a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">SE2</span></a><span class="p">,</span> <a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">Twist2</span></a>
613+
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">T</span></a> <span class="o">=</span> <a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">SE2</span></a><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">)</span>
614+
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">S</span></a> <span class="o">=</span> <a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">Twist2</span></a><span class="p">(</span><a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">T</span></a><span class="p">)</span>
615+
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2.ad" title="spatialmath.twist.Twist2.ad"><span class="n">S</span><span class="o">.</span><span class="n">ad</span></a><span class="p">()</span>
616+
<span class="go">array([[ 0. , -0.3 , 1.835 ],</span>
617+
<span class="go"> [ 0.3 , 0. , -1.2925],</span>
618+
<span class="go"> [ 0. , 0. , 0. ]])</span>
619+
</pre></div>
620+
</div>
621+
<div class="admonition note">
622+
<p class="admonition-title">Note</p>
623+
<p>An alternative approach to computing the adjoint is to
624+
exponentiate this 3x3 matrix.</p>
625+
</div>
626+
<dl class="field-list simple">
627+
<dt class="field-odd">Seealso<span class="colon">:</span></dt>
628+
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.twist.Twist2.Ad" title="spatialmath.twist.Twist2.Ad"><code class="xref py py-func docutils literal notranslate"><span class="pre">Twist2.Ad()</span></code></a></p>
629+
</dd>
630+
</dl>
631+
</dd></dl>
632+
<dl class="py method">
556633
<dt class="sig sig-object py" id="spatialmath.twist.Twist2.append">
557634
<span class="sig-name descname"><span class="pre">append</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">item</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.twist.Twist2.append" title="Link to this definition"></a></dt>
558635
<dd><p>Append a value to an instance (BasePoseList superclass method)</p>
@@ -717,11 +794,11 @@ <h1>se(2) twist<a class="headerlink" href="#se-2-twist" title="Link to this head
717794
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span><span class="w"> </span><span class="nn">spatialmath</span><span class="w"> </span><span class="kn">import</span> <a class="sphinx-codeautolink-a" href="3d_pose_twist.html#spatialmath.twist.Twist3" title="spatialmath.twist.Twist3"><span class="n">Twist3</span></a>
718795
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="3d_pose_twist.html#spatialmath.twist.Twist3" title="spatialmath.twist.Twist3"><span class="n">S</span></a> <span class="o">=</span> <a class="sphinx-codeautolink-a" href="3d_pose_twist.html#spatialmath.twist.Twist3" title="spatialmath.twist.Twist3"><span class="n">Twist3</span></a><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rand</span><span class="p">())</span>
719796
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="3d_pose_twist.html#spatialmath.twist.Twist3" title="spatialmath.twist.Twist3"><span class="n">S</span></a>
720-
<span class="go">Twist3([-0.56161, -0.17775, -1.4684, -2.5655, 0.54875, 0.025398])</span>
797+
<span class="go">Twist3([0.47871, 0.33403, 0.22081, -0.18623, 1.706, -1.6123])</span>
721798
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="3d_pose_twist.html#spatialmath.twist.Twist3.inv" title="spatialmath.twist.Twist3.inv"><span class="n">S</span><span class="o">.</span><span class="n">inv</span></a><span class="p">()</span>
722-
<span class="go">Twist3([0.56161, 0.17775, 1.4684, 2.5655, -0.54875, -0.025398])</span>
799+
<span class="go">Twist3([-0.47871, -0.33403, -0.22081, 0.18623, -1.706, 1.6123])</span>
723800
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="3d_pose_twist.html#spatialmath.twist.Twist3" title="spatialmath.twist.Twist3"><span class="n">S</span></a> <span class="o">*</span> <a class="sphinx-codeautolink-a" href="3d_pose_twist.html#spatialmath.twist.Twist3.inv" title="spatialmath.twist.Twist3.inv"><span class="n">S</span><span class="o">.</span><span class="n">inv</span></a><span class="p">()</span>
724-
<span class="go">Twist3([5.7778e-34, -2.2204e-16, -1.9429e-16, 0, 1.3878e-17, 6.9389e-18])</span>
801+
<span class="go">Twist3([1.6653e-16, 1.3878e-17, -2.7756e-17, 1.3878e-17, -2.7756e-17, 0])</span>
725802
</pre></div>
726803
</div>
727804
</dd></dl>
@@ -912,28 +989,6 @@ <h1>se(2) twist<a class="headerlink" href="#se-2-twist" title="Link to this head
912989
</div>
913990
</dd></dl>
914991
<dl class="py property">
915-
<dt class="sig sig-object py" id="spatialmath.twist.Twist2.ad">
916-
<span class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></span><span class="sig-name descname"><span class="pre">ad</span></span><a class="headerlink" href="#spatialmath.twist.Twist2.ad" title="Link to this definition"></a></dt>
917-
<dd><p>Twist2.ad Logarithm of adjoint</p>
918-
<ul class="simple">
919-
<li><p><code class="docutils literal notranslate"><span class="pre">S.ad()</span></code> is the logarithm of the adjoint matrix of the corresponding
920-
homogeneous transformation.</p></li>
921-
</ul>
922-
<p>Example:</p>
923-
<div class="highlight-pycon notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span><span class="w"> </span><span class="nn">spatialmath</span><span class="w"> </span><span class="kn">import</span> <a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">SE2</span></a><span class="p">,</span> <a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">Twist2</span></a>
924-
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">T</span></a> <span class="o">=</span> <a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">SE2</span></a><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mf">0.3</span><span class="p">)</span>
925-
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">S</span></a> <span class="o">=</span> <a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2" title="spatialmath.twist.Twist2"><span class="n">Twist2</span></a><span class="p">(</span><a class="sphinx-codeautolink-a" href="2d_pose_SE2.html#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><span class="n">T</span></a><span class="p">)</span>
926-
<span class="gp">&gt;&gt;&gt; </span><a class="sphinx-codeautolink-a" href="2d_pose_twist.html#spatialmath.twist.Twist2.unit" title="spatialmath.twist.Twist2.unit"><span class="n">S</span><span class="o">.</span><span class="n">unit</span></a><span class="p">()</span>
927-
<span class="go">Twist2([4.3083, 6.1166, 1])</span>
928-
</pre></div>
929-
</div>
930-
<dl class="field-list simple">
931-
<dt class="field-odd">Seealso<span class="colon">:</span></dt>
932-
<dd class="field-odd"><p>SE3.Ad.</p>
933-
</dd>
934-
</dl>
935-
</dd></dl>
936-
<dl class="py property">
937992
<dt class="sig sig-object py" id="spatialmath.twist.Twist2.isprismatic">
938993
<span class="property"><span class="k"><span class="pre">property</span></span><span class="w"> </span></span><span class="sig-name descname"><span class="pre">isprismatic</span></span><a class="headerlink" href="#spatialmath.twist.Twist2.isprismatic" title="Link to this definition"></a></dt>
939994
<dd><p>Test for prismatic twist (superclass property)</p>

0 commit comments

Comments
 (0)