From 162b05d2ca273f0e3d2fd9694d316fcf869cd5fd Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Thu, 15 Oct 2026 10:42:10 +1000 Subject: [PATCH] docs: fix the math block in the tr2adjoint and tr2adjoint2 docstrings The formula never rendered and would not have rendered correctly: - ``.. math:`` has a single colon, so reST treated the block as a comment. - \skew is not a macro defined in docs/source/conf.py (\sk and \vex are). - the braces of \skew{...} were unbalanced. - there was a stray trailing X, and Ad was set in italic. Write it with the project's macros, and use \SE{n} rather than \SE3, which only worked because \SE takes one argument. The 3D docstring also named tr2jac and its sizes; name tr2adjoint and give 6x6 for SE(3), 3x3 for SO(3). Co-Authored-By: Claude Sonnet 5.5 --- spatialmath/base/transforms2d.py | 6 +++--- spatialmath/base/transforms3d.py | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spatialmath/base/transforms2d.py b/spatialmath/base/transforms2d.py index 6aad235c..059d6845 100644 --- a/spatialmath/base/transforms2d.py +++ b/spatialmath/base/transforms2d.py @@ -790,11 +790,11 @@ def tr2adjoint2(T): Computes an adjoint matrix that maps the Lie algebra between frames. - .. math: + .. math:: - Ad(\mat{T}) \vec{X} X = \vee \left( \mat{T} \skew{\vec{X} \mat{T}^{-1} \right) + \mathrm{Ad}(\mat{T})\,\vec{X} = \vex{\mat{T}\,\sk{\vec{X}}\,\mat{T}^{-1}} - where :math:`\mat{T} \in \SE2`. + where :math:`\mat{T} \in \SE{2}`. ``tr2jac2(T)`` is an adjoint matrix (6x6) that maps spatial velocity or differential motion between frame {B} to frame {A} which are attached to the diff --git a/spatialmath/base/transforms3d.py b/spatialmath/base/transforms3d.py index c552c797..6a792f6a 100644 --- a/spatialmath/base/transforms3d.py +++ b/spatialmath/base/transforms3d.py @@ -2732,15 +2732,15 @@ def tr2adjoint(T): Computes an adjoint matrix that maps the Lie algebra between frames. - .. math: + .. math:: - Ad(\mat{T}) \vec{X} X = \vee \left( \mat{T} \skew{\vec{X} \mat{T}^{-1} \right) + \mathrm{Ad}(\mat{T})\,\vec{X} = \vex{\mat{T}\,\sk{\vec{X}}\,\mat{T}^{-1}} - where :math:`\mat{T} \in \SE3`. + where :math:`\mat{T} \in \SE{3}`. - ``tr2jac(T)`` is an adjoint matrix (6x6) that maps spatial velocity or - differential motion between frame {B} to frame {A} which are attached to the - same moving body. The pose of {B} relative to {A} is represented by the + ``tr2adjoint(T)`` is an adjoint matrix (6x6 for SE(3), 3x3 for SO(3)) that + maps spatial velocity or differential motion between frame {B} to frame {A} + which are attached to the same moving body. The pose of {B} relative to {A} is represented by the homogeneous transform T = :math:`{}^A {\bf T}_B`. .. runblock:: pycon