diff --git a/AGENTS.md b/AGENTS.md index 44066f17f..9227e3346 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -49,6 +49,12 @@ description and ask first. `NDArray` for returned arrays. The shape goes in the docstring (`:type q: array_like(n)`, `:rtype: ndarray(6,n)`) where it adds information, not in the annotation. One definition means one place to change what "array-like" means. +- Docstring sections are reST, not NumPy style: a heading is ``.. rubric:: Examples`` (always + plural), ``.. rubric:: Notes`` or ``.. rubric:: References``, never an underlined title, and + cross-references are ``.. seealso:: :meth:`other```, never ``:seealso:`` (which Sphinx + does not know: it renders as one more field after the parameters). A ``.. versionadded::``, + ``.. versionchanged::`` or ``.. deprecated::`` names the release it ships in; the next + release is the one after the version in ``pyproject.toml``. - New code uses modern annotation syntax: `X | Y`, `X | None`, `list[X]`, `dict[K, V]`, not `Union`, `Optional`, `List` or `Dict`. - Type checking: `mypy` (config in `pyproject.toml`, run it from the repo root with no arguments). diff --git a/docs/source/IK/analytic.rst b/docs/source/IK/analytic.rst index 615f024c9..a9d3ae9d4 100644 --- a/docs/source/IK/analytic.rst +++ b/docs/source/IK/analytic.rst @@ -15,7 +15,7 @@ The same solution can be written out as source code in Python, C, C++ or Rust, f The ``ik`` extra also installs ``python-flint``, which makes the derivation much faster. Without it a warning is issued and SymPy is used instead, which gives the same results. It is not part of the ``all`` extra. -.. versionadded:: 1.6.0 +.. versionadded:: 1.5.0 The notebook `ik-symbolic.ipynb `_ works through the examples on this page, and more. diff --git a/docs/source/IK/ik.rst b/docs/source/IK/ik.rst index c8bcd390d..02f91ef2b 100644 --- a/docs/source/IK/ik.rst +++ b/docs/source/IK/ik.rst @@ -29,7 +29,7 @@ Member Meaning An ``IKSolution`` is a sequence of the rows of ``q``, so ``len(sol)`` is the number of poses and ``for q in sol`` visits them, and ``bool(sol)`` is ``success``. -.. versionchanged:: 1.4.5 +.. versionchanged:: 1.5.0 Iterating over the six members was removed, use the attributes or ``sol.astuple()``. The Toolbox has *three ways* to find a solution, shown in the figure. **Numerical** solvers start from a guess for :math:`\vec{q}` and iterate until the pose is reached. They work for any robot, and are written in Python, or in C++ for speed. **Analytic** solvers (see :doc:`analytic`) derive the equations of the inverse kinematics once, symbolically, and then solve them directly for any pose, with no guess and no iteration, giving all the solutions. They work for six-axis arms, and can write the solution out as source code with no dependency on the Toolbox. diff --git a/docs/source/IK/numerical.rst b/docs/source/IK/numerical.rst index ab190375a..660f93f96 100644 --- a/docs/source/IK/numerical.rst +++ b/docs/source/IK/numerical.rst @@ -175,7 +175,7 @@ If ``Tep`` is a trajectory of N poses, each pose is solved independently, starti * ``residual`` is the maximum over all poses, the worst case * ``reason`` is the reason given by the last pose that failed, if any -.. versionchanged:: 1.4.5 +.. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. .. rubric:: The Implemented IK Solvers @@ -200,7 +200,7 @@ Class Method Notes ik_gn ik_nr -.. rubric:: Example +.. rubric:: Examples In the following example, we create an IK Solver class and pass an :py:class:`~roboticstoolbox.ets.ETS.ETS` to it to solve the problem. This style may be preferable to experiments where you wish to compare the same solver on different robots. @@ -241,7 +241,7 @@ Additionally, these class-based solvers have been implemented as methods within ~roboticstoolbox.robot.Robot.Robot.ikine_NR -.. rubric:: Example +.. rubric:: Examples In the following example, we create a :py:class:`~roboticstoolbox.models.URDF.Panda` robot and use one of the IK solvers available within the :py:class:`~roboticstoolbox.robot.Robot.Robot` class. This style is far more convenient than the above example. diff --git a/src/roboticstoolbox/blocks/arm.py b/src/roboticstoolbox/blocks/arm.py index e3a4136b7..2b55cccb1 100644 --- a/src/roboticstoolbox/blocks/arm.py +++ b/src/roboticstoolbox/blocks/arm.py @@ -53,7 +53,7 @@ class FKine(FunctionBlock): Compute the end-effector pose as an SE(3) object as a function of the input joint configuration. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.fkine` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.fkine` """ nin = 1 @@ -124,7 +124,7 @@ class IKine(FunctionBlock): :note: The solution may not exist and is not unique. The solution will depend on the initial joint configuration ``q0``. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.ik_LM` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.ik_LM` """ nin = 1 @@ -232,7 +232,7 @@ class Jacobian(FunctionBlock): Jacobian can be computed in the world or end-effector frame, for spatial or analytical velocity, and its inverse, damped inverse or transpose can be returned. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.jacob0` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.jacob0` :meth:`~roboticstoolbox.robot.Robot.Robot.jacobe` :meth:`~roboticstoolbox.robot.Robot.Robot.jacob0_analytical` """ @@ -371,7 +371,7 @@ class ArmPlot(GraphicsBlock): Create a robot animation using the robot's ``plot`` method. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.plot` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.plot` """ nin = 1 @@ -471,7 +471,7 @@ class JTraj(SourceBlock): ``qf`` over the course of the simulation. A quintic (5th order) polynomial is used with default zero boundary conditions for velocity and acceleration. - :seealso: :func:`~roboticstoolbox.tools.trajectory.ctraj` + .. seealso:: :func:`~roboticstoolbox.tools.trajectory.ctraj` ``xplot`` :func:`~roboticstoolbox.tools.trajectory.jtraj` """ @@ -632,7 +632,7 @@ class CTraj(SourceBlock): to provide initial acceleration and final deceleration. Otherwise, motion is at constant velocity. - :seealso: :meth:`~spatialmath.pose3d.SE3.interp` + .. seealso:: :meth:`~spatialmath.pose3d.SE3.interp` :func:`~roboticstoolbox.tools.trajectory.ctraj` ``xplot`` :func:`~roboticstoolbox.tools.trajectory.jtraj` @@ -825,7 +825,7 @@ class Trapezoidal(SourceBlock): element, because ``trapezoidal_func`` returned arrays for a scalar time. - :seealso: ``ctraj``, ``xplot``, :func:`~roboticstoolbox.tools.trajectory.jtraj` + .. seealso:: ``ctraj``, ``xplot``, :func:`~roboticstoolbox.tools.trajectory.jtraj` """ nin = 0 @@ -916,7 +916,7 @@ class Traj(FunctionBlock): previously failed with an ``UnboundLocalError`` when the simulation started. The outputs are unchanged. - :seealso: :func:`spatialmath.base.mtraj` + .. seealso:: :func:`spatialmath.base.mtraj` """ nin = -1 @@ -1064,7 +1064,7 @@ class IDyn(FunctionBlock): .. todo:: end-effector wrench input, base wrench output, payload input - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.rne` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.rne` """ nin = 3 @@ -1134,7 +1134,7 @@ class Gravload(FunctionBlock): Compute generalized joint forces due to gravity for the input joint configuration. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.gravload` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.gravload` """ nin = 1 @@ -1197,7 +1197,7 @@ class Gravload_X(FunctionBlock): Compute end-effector wrench due to gravity for the input end-effector pose. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.gravload_x` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.gravload_x` :meth:`~roboticstoolbox.robot.Robot.Robot.gravload` """ @@ -1280,7 +1280,7 @@ class Inertia(FunctionBlock): Joint-space inertia matrix (mass matrix) as a function of joint configuration. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.inertia` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.inertia` """ nin = 1 @@ -1342,7 +1342,7 @@ class Inertia_X(FunctionBlock): Task-space inertia matrix as a function of end-effector pose. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.inertia_x` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.inertia_x` """ nin = 1 @@ -1424,7 +1424,7 @@ class FDyn(ContinuousBlock): for the input configuration and applied joint forces. The acceleration is integrated to obtain joint velocity and joint configuration. - :seealso: :meth:`~roboticstoolbox.robot.Robot.Robot.fdyn` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.fdyn` """ nin = 1 @@ -1523,7 +1523,7 @@ class FDyn_X(ContinuousBlock): acceleration for the input end-effector pose and applied end-effector wrench. The acceleration is integrated to obtain task-space velocity and task-space pose. - :seealso: ``fdyn_x`` + .. seealso:: ``fdyn_x`` """ nin = 1 diff --git a/src/roboticstoolbox/blocks/mobile.py b/src/roboticstoolbox/blocks/mobile.py index 0e19b9542..c36458531 100644 --- a/src/roboticstoolbox/blocks/mobile.py +++ b/src/roboticstoolbox/blocks/mobile.py @@ -59,7 +59,7 @@ class Bicycle(ContinuousBlock): * acceleration limit ``accel_max`` * steering limit ``steer_max`` - :seealso: :class:`~roboticstoolbox.mobile.Vehicle.Bicycle` :class:`Unicycle` :class:`DiffSteer` + .. seealso:: :class:`~roboticstoolbox.mobile.Vehicle.Bicycle` :class:`Unicycle` :class:`DiffSteer` """ nin = 2 @@ -173,7 +173,7 @@ class Unicycle(ContinuousBlock): * acceleration limit ``accel_max`` * steering limit ``steer_max`` - :seealso: :class:`~roboticstoolbox.mobile.Vehicle.Unicycle` :class:`Bicycle` :class:`DiffSteer` + .. seealso:: :class:`~roboticstoolbox.mobile.Vehicle.Unicycle` :class:`Bicycle` :class:`DiffSteer` """ @@ -278,7 +278,7 @@ class DiffSteer(ContinuousBlock): .. note:: Wheel velocity is defined such that if both are positive the vehicle moves forward. - :seealso: :class:`~roboticstoolbox.mobile.Vehicle.DiffSteer` :class:`Bicycle` :class:`Unicycle` + .. seealso:: :class:`~roboticstoolbox.mobile.Vehicle.DiffSteer` :class:`Bicycle` :class:`Unicycle` """ nin = 2 @@ -407,7 +407,7 @@ def __init__( :param blockargs: |GraphicsBlockOptions| :raises TypeError: ``animation`` is not a ``VehicleAnimationBase`` - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 the arguments ``path``, ``init``, ``scale`` and ``polyargs`` are deprecated, use ``path_style``, ``init_func``, ``limits`` and ``polygon_style`` instead. diff --git a/src/roboticstoolbox/blocks/spatial.py b/src/roboticstoolbox/blocks/spatial.py index b8b56a263..e5ca727af 100644 --- a/src/roboticstoolbox/blocks/spatial.py +++ b/src/roboticstoolbox/blocks/spatial.py @@ -40,7 +40,7 @@ class Tr2Delta(FunctionBlock): Difference between :math:`\mathbf{T}_1` and :math:`\mathbf{T}_2` as a 6-vector - :seealso: :class:`Delta2Tr` :func:`~spatialmath.base.transforms3d.tr2delta` + .. seealso:: :class:`Delta2Tr` :func:`~spatialmath.base.transforms3d.tr2delta` """ nin = 2 @@ -93,7 +93,7 @@ class Delta2Tr(FunctionBlock): 6-vector spatial displacement to transform. - :seealso: :class:`Tr2Delta` :func:`~spatialmath.base.transforms3d.delta2tr` + .. seealso:: :class:`Tr2Delta` :func:`~spatialmath.base.transforms3d.delta2tr` """ nin = 1 @@ -209,7 +209,7 @@ class TR2T(FunctionBlock): - float - :math:`z` component of translation. - :seealso: :func:`~spatialmath.base.transforms3d.transl` + .. seealso:: :func:`~spatialmath.base.transforms3d.transl` """ nin = 1 diff --git a/src/roboticstoolbox/blocks/uav.py b/src/roboticstoolbox/blocks/uav.py index 0db3ede7f..77c0cca04 100644 --- a/src/roboticstoolbox/blocks/uav.py +++ b/src/roboticstoolbox/blocks/uav.py @@ -95,7 +95,7 @@ class MultiRotor(ContinuousBlock): Australian National University, 2007. - Robotics, Vision & Control by Peter Corke, sec 4.2 in all editions - :seealso: :class:`MultiRotorMixer` :class:`MultiRotorPlot` + .. seealso:: :class:`MultiRotorMixer` :class:`MultiRotorPlot` """ nin = 1 @@ -517,7 +517,7 @@ class MultiRotorMixer(FunctionBlock): .. note:: Based on MATLAB code developed by Pauline Pounds 2004. - :seealso: :class:`MultiRotor` :class:`MultiRotorPlot` + .. seealso:: :class:`MultiRotor` :class:`MultiRotorPlot` """ nin = 4 @@ -638,7 +638,7 @@ class MultiRotorPlot(GraphicsBlock): .. note:: Based on MATLAB code developed by Pauline Pounds 2004. - :seealso: :class:`MultiRotor` :class:`MultiRotorMixer` + .. seealso:: :class:`MultiRotor` :class:`MultiRotorMixer` """ nin = 1 diff --git a/src/roboticstoolbox/ets/ET.py b/src/roboticstoolbox/ets/ET.py index d6691a92d..e2756a53e 100644 --- a/src/roboticstoolbox/ets/ET.py +++ b/src/roboticstoolbox/ets/ET.py @@ -140,8 +140,7 @@ def A(self, q: float | Sym = 0.0) -> ndarray: :returns: The SE(3) matrix value of the ET :rtype: ndarray - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -209,10 +208,7 @@ def Rx( angle, i.e. a revolute robot joint. ``j`` or ``flip`` can be set in this case. - See Also - -------- - :func:`ET` - :func:`isrotation` + .. seealso:: :func:`ET` :func:`isrotation` :SymPy: supported """ @@ -244,10 +240,7 @@ def Ry( angle, i.e. a revolute robot joint. ``j`` or ``flip`` can be set in this case. - See Also - -------- - :func:`ET` - :func:`isrotation` + .. seealso:: :func:`ET` :func:`isrotation` :SymPy: supported """ @@ -279,10 +272,7 @@ def Rz( angle, i.e. a revolute robot joint. ``j`` or ``flip`` can be set in this case. - See Also - -------- - :func:`ET` - :func:`isrotation` + .. seealso:: :func:`ET` :func:`isrotation` :SymPy: supported """ @@ -312,10 +302,7 @@ def tx( variable distance, i.e. a prismatic robot joint. ``j`` or ``flip`` can be set in this case. - See Also - -------- - :func:`ET` - :func:`istranslation` + .. seealso:: :func:`ET` :func:`istranslation` :SymPy: supported """ @@ -357,10 +344,7 @@ def ty( variable distance, i.e. a prismatic robot joint. ``j`` or ``flip`` can be set in this case. - See Also - -------- - :func:`ET` - :func:`istranslation` + .. seealso:: :func:`ET` :func:`istranslation` :SymPy: supported """ @@ -401,10 +385,7 @@ def tz( variable distance, i.e. a prismatic robot joint. ``j`` or ``flip`` can be set in this case. - See Also - -------- - :func:`ET` - :func:`istranslation` + .. seealso:: :func:`ET` :func:`istranslation` :SymPy: supported """ @@ -431,10 +412,7 @@ def SE3(cls, T: ndarray | SE3T, **kwargs: Any) -> ET: :returns: An elementary transform :rtype: ET - See Also - -------- - :func:`ET` - :func:`istranslation` + .. seealso:: :func:`ET` :func:`istranslation` :SymPy: supported """ diff --git a/src/roboticstoolbox/ets/ET2.py b/src/roboticstoolbox/ets/ET2.py index f7bee9829..c3be8778b 100644 --- a/src/roboticstoolbox/ets/ET2.py +++ b/src/roboticstoolbox/ets/ET2.py @@ -76,9 +76,7 @@ def R( - In the 2D case this is rotation around the normal to the xy-plane. - See Also - -------- - :func:`ET2`, :func:`isrotation` + .. seealso:: :func:`ET2`, :func:`isrotation` """ param = _resolve_param(param, eta) @@ -110,10 +108,7 @@ def tx( variable distance, i.e. a prismatic robot joint. ``j`` or ``flip`` can be set in this case. - See Also - -------- - :func:`ET2` - :func:`istranslation` + .. seealso:: :func:`ET2` :func:`istranslation` """ param = _resolve_param(param, eta) @@ -143,9 +138,7 @@ def ty( variable distance, i.e. a prismatic robot joint. ``j`` or ``flip`` can be set in this case. - See Also - -------- - :func:`ET2` + .. seealso:: :func:`ET2` """ param = _resolve_param(param, eta) @@ -160,10 +153,7 @@ def SE2(cls, T: ndarray | SE2T, **kwargs: Any) -> ET2: :returns: An elementary transform :rtype: ET2 - See Also - -------- - :func:`ET2` - :func:`istranslation` + .. seealso:: :func:`ET2` :func:`istranslation` :SymPy: supported """ diff --git a/src/roboticstoolbox/ets/ETS.py b/src/roboticstoolbox/ets/ETS.py index c4ad72701..a77536ea4 100644 --- a/src/roboticstoolbox/ets/ETS.py +++ b/src/roboticstoolbox/ets/ETS.py @@ -54,8 +54,7 @@ class ETS(BaseETS[ET]): :param arg: list of ETs or a single ET to initialise the ETS - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -75,14 +74,7 @@ class ETS(BaseETS[ET]): Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022). - See Also - -------- - ``rx`` - ``ry`` - ``rz`` - ``tx`` - ``ty`` - ``tz`` + .. seealso:: ``rx`` ``ry`` ``rz`` ``tx`` ``ty`` ``tz`` """ @@ -248,8 +240,7 @@ def replace(self, i: int, axis: str) -> None: exact, ``pi/2`` from SymPy, if the transform has a symbolic parameter or offset, and floating point otherwise. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -266,6 +257,7 @@ def replace(self, i: int, axis: str) -> None: .. runblock:: pycon + >>> from roboticstoolbox import ET >>> from spatialmath.base import symbol >>> L = symbol("L") >>> e = ET.Rz() * ET.tx(L) * ET.Rx() @@ -321,8 +313,7 @@ def replaced(self, i: int, axis: str) -> ETS: The sequence it is called on is not changed. See :meth:`replace` for what the transform is replaced by. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -350,8 +341,7 @@ def compile(self) -> ETS: ETs are compounded, leading to a constant ET which is denoted by ``SE3`` when displayed. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -361,9 +351,7 @@ def compile(self) -> ETS: >>> ets >>> ets.compile() - See Also - -------- - ``isconstant`` + .. seealso:: ``isconstant`` """ const = None ets = ETS() @@ -404,8 +392,7 @@ def insert( Inserts an ET or ETS into the ET sequence. The inserted ET is at position ``index``; an ETS is expanded and inserted element by element. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -448,8 +435,7 @@ def fkine( If ``q`` has multiple rows (mxn), it is considered a trajectory and the result is an ``SE3`` instance with ``m`` values. - Examples - -------- + .. rubric:: Examples The following example makes a ``panda`` robot object, gets the ets, and solves for the forward kinematics at the listed configuration. @@ -517,8 +503,7 @@ def eval( If ``q`` has multiple rows (mxn), it is considered a trajectory and the result is a 3d array with ``m`` planes. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -564,8 +549,7 @@ def jacob0( End-effector spatial velocity :math:`\nu = (v_x, v_y, v_z, \omega_x, \omega_y, \omega_z)^T` is related to joint velocity by :math:`{}^{E}\!\nu = \mathbf{J}_m(q) \dot{q}`. - Examples - -------- + .. rubric:: Examples The following example makes a ``Puma560`` robot object, and solves for the base-frame Jacobian at the zero joint angle configuration @@ -612,8 +596,7 @@ def jacobe( End-effector spatial velocity :math:`\nu = (v_x, v_y, v_z, \omega_x, \omega_y, \omega_z)^T` is related to joint velocity by :math:`{}^{E}\!\nu = \mathbf{J}_m(q) \dot{q}`. - Examples - -------- + .. rubric:: Examples The following example makes a ``Puma560`` robot object, and solves for the end-effector frame Jacobian at the zero joint angle configuration @@ -687,8 +670,7 @@ def hessian0( \mat{J}_{i,j} = \frac{d u_i}{d q_j} - Examples - -------- + .. rubric:: Examples The following example makes a ``Panda`` robot object, and solves for the base frame Hessian at the given joint angle configuration @@ -758,8 +740,7 @@ def hessiane( \mat{J}_{i,j} = \frac{d u_i}{d q_j} - Examples - -------- + .. rubric:: Examples The following example makes a ``Panda`` robot object, and solves for the end-effector frame Hessian at the given joint angle configuration @@ -811,8 +792,7 @@ def jacob0_analytical( ``'exp'`` exponential coordinate rates ================== ==================================== - Examples - -------- + .. rubric:: Examples Makes a robot object and computes the analytic Jacobian for the given joint configuration @@ -1014,8 +994,7 @@ def partial_fkine0(self, q: ArrayLike, n: int) -> NDArray: where the Jacobian is the first partial derivative and the Hessian is the second. - Examples - -------- + .. rubric:: Examples The following example makes a ``Panda`` robot object, and solves for the base-effector frame 4th derivative of the forward kinematics at the given @@ -1287,8 +1266,7 @@ def ik_LM( Wampler proposed :math:`\vec{w_n}` to be a constant. This is set through the ``k`` kwarg. - Examples - -------- + .. rubric:: Examples The following example gets the ``ets`` of a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose @@ -1400,8 +1378,7 @@ def ik_NR( \vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k - Examples - -------- + .. rubric:: Examples The following example gets the ``ets`` of a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose @@ -1527,8 +1504,7 @@ def ik_GN( the above provides the pseudoinverse solution. However, if :math:`\mat{J}(\vec{q}_k)` is singular, the above can not be computed and the GN solution is infeasible. - Examples - -------- + .. rubric:: Examples The following example gets the ``ets`` of a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose @@ -1627,7 +1603,7 @@ def ikine_LM( has shape (N, n), ``success`` is True only if every pose succeeded, and ``residual`` is the maximum over the poses. See :meth:`~roboticstoolbox.robot.IK.IKSolver.solve`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. @@ -1695,8 +1671,7 @@ def ikine_LM( Wampler proposed :math:`\vec{w_n}` to be a constant. This is set through the ``k`` kwarg. - Examples - -------- + .. rubric:: Examples The following example gets the ``ets`` of a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose @@ -1801,7 +1776,7 @@ def ikine_NR( has shape (N, n), ``success`` is True only if every pose succeeded, and ``residual`` is the maximum over the poses. See :meth:`~roboticstoolbox.robot.IK.IKSolver.solve`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. @@ -1819,8 +1794,7 @@ def ikine_NR( \vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k - Examples - -------- + .. rubric:: Examples The following example gets the ``ets`` of a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose @@ -1920,7 +1894,7 @@ def ikine_GN( has shape (N, n), ``success`` is True only if every pose succeeded, and ``residual`` is the maximum over the poses. See :meth:`~roboticstoolbox.robot.IK.IKSolver.solve`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. @@ -1953,8 +1927,7 @@ def ikine_GN( the above provides the pseudoinverse solution. However, if :math:`\mat{J}(\vec{q}_k)` is singular, the above can not be computed and the GN solution is infeasible. - Examples - -------- + .. rubric:: Examples The following example gets the ``ets`` of a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose @@ -2056,7 +2029,7 @@ def ikine_QP( has shape (N, n), ``success`` is True only if every pose succeeded, and ``residual`` is the maximum over the poses. See :meth:`~roboticstoolbox.robot.IK.IKSolver.solve`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. @@ -2134,8 +2107,7 @@ def ikine_QP( :math:`\dvec{q}^{-,+}` are the minimum and maximum joint velocities, and :math:`\dvec{\delta}^{-,+}` are the minimum and maximum slack velocities. - Examples - -------- + .. rubric:: Examples The following example gets the ``ets`` of a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose diff --git a/src/roboticstoolbox/ets/ETS2.py b/src/roboticstoolbox/ets/ETS2.py index 59014c2bd..bac687a21 100644 --- a/src/roboticstoolbox/ets/ETS2.py +++ b/src/roboticstoolbox/ets/ETS2.py @@ -58,7 +58,7 @@ class ETS2(BaseETS[ET2]): - Kinematic Derivatives using the Elementary Transform Sequence, J. Haviland and P. Corke - :seealso: ``r``, ``tx``, ``ty`` + .. seealso:: ``r``, ``tx``, ``ty`` """ def __init__( @@ -199,7 +199,7 @@ def compile(self) -> ETS2: ETs are compounded, leading to a constant ET which is denoted by ``SE3`` when displayed. - :seealso: ``isconstant`` + .. seealso:: ``isconstant`` """ const = None ets = ETS2() @@ -485,7 +485,7 @@ def jacobe(self, q: ArrayLike) -> Any: End-effector spatial velocity :math:`\nu = (v_x, v_y, \omega)^T` is related to joint velocity by :math:`{}^{e}\nu = {}^{e}\mathbf{J}_0(q) \dot{q}`. - :seealso: :func:`jacob0`, ``hessian0`` + .. seealso:: :func:`jacob0`, ``hessian0`` """ T = self.fkine(q, include_base=False).A diff --git a/src/roboticstoolbox/ets/_ET.py b/src/roboticstoolbox/ets/_ET.py index a1429bd96..a2959d789 100644 --- a/src/roboticstoolbox/ets/_ET.py +++ b/src/roboticstoolbox/ets/_ET.py @@ -379,8 +379,7 @@ def param(self) -> float | Sym | None: :returns: The constant value if set :rtype: float or Sym or None - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -475,8 +474,7 @@ def kind(self) -> str: :returns: The transform type and axis, e.g. ``"Rx"``, ``"tx"``, ``"SE3"`` :rtype: str - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -518,8 +516,7 @@ def ax(self) -> str | None: letter, or a compound/arbitrary ``SE3``/``SE2`` transform) :rtype: str or None - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -541,8 +538,7 @@ def isjoint(self) -> bool: :returns: True if a joint :rtype: bool - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -573,8 +569,7 @@ def offset(self) -> float | Sym: The offset may be symbolic. It is zero if it is exactly zero or, for a rotation, a whole number of turns of a symbolic angle. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -615,8 +610,7 @@ def isflip(self) -> bool: A flipped joint uses the negative of the joint variable, ie. it rotates or moves in the opposite direction. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -638,8 +632,7 @@ def isrotation(self) -> bool: :returns: True if a rotation :rtype: bool - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -661,8 +654,7 @@ def istranslation(self) -> bool: :returns: True if a translation :rtype: bool - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -703,8 +695,7 @@ def jindex(self) -> int | None: Allows an ET to be associated with a numbered joint in a robot. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -739,9 +730,7 @@ def iselementary(self) -> bool: - ET's may not actually be "elementary", it can be a complex mix of rotations and translations. - See Also - -------- - :func:`compile` + .. seealso:: :func:`compile` """ @@ -756,8 +745,7 @@ def inv(self) -> Any: The inverse of a given ET. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -792,8 +780,7 @@ def A(self, q: float | Sym = 0.0) -> ndarray: :returns: The SE(3) or SE(2) matrix value of the ET :rtype: ndarray - Examples - -------- + .. rubric:: Examples .. runblock:: pycon diff --git a/src/roboticstoolbox/ets/_ETS.py b/src/roboticstoolbox/ets/_ETS.py index 65b3ccc3e..54aef4650 100644 --- a/src/roboticstoolbox/ets/_ETS.py +++ b/src/roboticstoolbox/ets/_ETS.py @@ -145,8 +145,7 @@ def __str__(self, q: str | None = None) -> str: :returns: Pretty printed ETS :rtype: str - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -254,8 +253,7 @@ def _repr_pretty_(self, p: Any, cycle: bool) -> None: :param p: pretty printer handle (ignored) :param cycle: pretty printer flag (ignored) - Examples - -------- + .. rubric:: Examples In [1]: e Out [1]: R(q0) ⊕ tx(1) ⊕ R(q1) ⊕ tx(1) @@ -271,8 +269,7 @@ def joint_idx(self) -> NDArray: :returns: indices of transforms that are joints :rtype: ndarray - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -291,8 +288,7 @@ def joints(self) -> list[ETT]: :returns: list of ETs that are joints :rtype: list[BaseET] - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -369,8 +365,7 @@ def jindex_set(self) -> set[int]: # :returns: set of unique joint indices :rtype: set[int] - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -390,8 +385,7 @@ def jindices(self) -> NDArray: :returns: array of unique joint indices :rtype: ndarray - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -494,8 +488,7 @@ def qlim(self) -> NDArray: :rtype: ndarray(2,n) :raises ValueError: unset limits for a prismatic joint - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -551,8 +544,7 @@ def structure(self) -> str: :returns: a string indicating the joint types :rtype: str - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -576,8 +568,7 @@ def n(self) -> int: Counts the number of joints in the ETS. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -585,9 +576,7 @@ def n(self) -> int: >>> e = ET.Rx() * ET.tx(1) * ET.tz() >>> e.n - See Also - -------- - :func:`joints` + .. seealso:: :func:`joints` """ @@ -603,8 +592,7 @@ def m(self) -> int: Counts the number of transforms in the ETS. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -638,8 +626,7 @@ def inv(self) -> Self: :returns: Inverse of the ETS - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -672,8 +659,7 @@ def __getitem__(self, i: int | slice) -> ETT | Self: of the same concrete type as ``self`` (a slice of an ETS is still an ETS) - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -747,8 +733,7 @@ def random_q(self, i: int = 1) -> NDArray: Generates a random q vector within the joint limits defined by ``self.qlim``. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -824,8 +809,7 @@ def swap(self, i: int) -> None: order of the elements of ``q`` is unchanged even though the joints now appear in the opposite order in the sequence. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -895,8 +879,7 @@ def swapped(self, i: int) -> Self: The sequence it is called on is not changed. See :meth:`swap` for which transforms can be swapped. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1057,8 +1040,7 @@ def merge(self, i: int) -> None: Merging does not look at the neighbours of the result, so if removing a transform leaves two mergeable ones adjacent, call :meth:`merge` again. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1145,8 +1127,7 @@ def merged(self, i: int) -> Self: The sequence it is called on is not changed. See :meth:`merge` for which transforms can be merged and when the result is removed. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon diff --git a/src/roboticstoolbox/mobile/Animations.py b/src/roboticstoolbox/mobile/Animations.py index 1fcaa8ac1..37f6d5789 100644 --- a/src/roboticstoolbox/mobile/Animations.py +++ b/src/roboticstoolbox/mobile/Animations.py @@ -88,7 +88,7 @@ def add(self, ax: Axes | None = None, **kwargs: Any) -> None: The animation is not displayed until :meth:`update` is called. - :seealso: :meth:`update` + .. seealso:: :meth:`update` """ if ax is None: self._ax = plt.gca() @@ -106,7 +106,7 @@ def update(self, q: ArrayLike) -> None: The graphical depiction of the vehicle position or configuration is updated. - :seealso: :meth:`add` + .. seealso:: :meth:`add` """ self._update(q) @@ -159,7 +159,7 @@ def __init__(self, **kwargs: Any) -> None: .. note:: A marker can only indicate vehicle position, not orientation. - :seealso: :class:`VehicleBase` + .. seealso:: :class:`VehicleBase` """ super().__init__() if len(kwargs) == 0: @@ -229,7 +229,7 @@ def __init__( The polygon is scaled to an image with a length of ``scale`` in the vehicle x-direction, in the units of the plot. - :seealso: :class:`VehicleBase` :class:`matplotlib.patches.Polygon` + .. seealso:: :class:`VehicleBase` :class:`matplotlib.patches.Polygon` """ super().__init__() if isinstance(shape, str): @@ -371,7 +371,7 @@ def __init__( .. note:: The standard icons are provided in the package ``rtb-data`` - :seealso: :class:`Vehicle` + .. seealso:: :class:`Vehicle` """ super().__init__() if "." not in filename: diff --git a/src/roboticstoolbox/mobile/Bug2.py b/src/roboticstoolbox/mobile/Bug2.py index 8099cf918..e4f14c351 100644 --- a/src/roboticstoolbox/mobile/Bug2.py +++ b/src/roboticstoolbox/mobile/Bug2.py @@ -45,7 +45,8 @@ class Bug2(PlannerBase): :class:`PlannerBase`. It can produce very inefficient paths. :author: Kristian Gibson and Peter Corke, based on MATLAB version by Peter Corke - :seealso: :class:`PlannerBase` + + .. seealso:: :class:`PlannerBase` """ def __init__(self, **kwargs: Any) -> None: @@ -112,7 +113,7 @@ def run( cell centres using the occupancy grid's origin and cell size. The returned path and hit points use the same world coordinates. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 The robot is considered to have crossed the m-line when it is within :math:`\\sqrt{2}/2` cells of it, previously half a cell. A line at 45 degrees to the grid passes between two diagonal neighbours at that @@ -120,7 +121,7 @@ def run( that the robot was reported as trapped. This shortens the house floorplan example, from the bedroom to the kitchen, by one point. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 The robot leaves an obstacle only where the next step along the m-line is free. Previously it could leave, find the obstacle in the way, and hit it again from the same cell, so that cell appeared @@ -132,7 +133,7 @@ def run( to the kitchen has 1302 points rather than the 1307 of earlier versions. - :seealso: :meth:`Bug2.plot` + .. seealso:: :meth:`Bug2.plot` """ # make sure start and goal are set and valid diff --git a/src/roboticstoolbox/mobile/DistanceTransformPlanner.py b/src/roboticstoolbox/mobile/DistanceTransformPlanner.py index 298347c2c..cf0769a0f 100644 --- a/src/roboticstoolbox/mobile/DistanceTransformPlanner.py +++ b/src/roboticstoolbox/mobile/DistanceTransformPlanner.py @@ -38,7 +38,7 @@ class DistanceTransformPlanner(PlannerBase): :raises ValueError: ``metric`` is not recognised, or ``metric`` and ``distance`` are both given and are different - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``distance`` is deprecated, use ``metric``. It was never an argument (it was silently ignored), but code printed in the book uses it. @@ -81,7 +81,7 @@ class DistanceTransformPlanner(PlannerBase): :author: Peter Corke - :seealso: :meth:`plan` :meth:`query` :class:`PlannerBase` + .. seealso:: :meth:`plan` :meth:`query` :class:`PlannerBase` """ def __init__( @@ -170,7 +170,7 @@ def plan( minimum obstacle-free distance to the goal using the particular distance metric. - :seealso: :meth:`query` + .. seealso:: :meth:`query` """ if goal is not None: self.goal = goal @@ -229,10 +229,10 @@ def query( Repeatedly steps to the neighbouring cell with the lowest distance until the goal is reached. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``next`` was accepted but had no effect. - :seealso: :meth:`plan` + .. seealso:: :meth:`plan` """ if next is not None: warnings.warn( @@ -297,7 +297,7 @@ def next(self, position: ArrayLike2) -> NDArray | None: Return the robot position that is one step closer to the goal. Called by :meth:`query` to find a path from start to goal. - :seealso: :meth:`plan` :meth:`query` + .. seealso:: :meth:`plan` :meth:`query` """ if self.distancemap is None: raise RuntimeError("no plan computed, call plan() first") @@ -376,7 +376,7 @@ def plot_3d( Creates a 3D plot showing distance from the goal as a cost surface. Overlays the path if given. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``ls`` is deprecated, use ``path_style``. .. warning:: The visualization is poor because of Matplotlib's poor hidden diff --git a/src/roboticstoolbox/mobile/DstarPlanner.py b/src/roboticstoolbox/mobile/DstarPlanner.py index a78f90172..64bf9472b 100644 --- a/src/roboticstoolbox/mobile/DstarPlanner.py +++ b/src/roboticstoolbox/mobile/DstarPlanner.py @@ -368,7 +368,8 @@ class DstarPlanner(PlannerBase): >>> print(status) :thanks: based on D* grid planning included from `Python Robotics `_ - :seealso: :class:`PlannerBase` + + .. seealso:: :class:`PlannerBase` """ def __init__( @@ -423,7 +424,7 @@ def plan( :param progress: deprecated, has no effect :param summary: print the number of insertions, defaults to False - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``animate`` and ``progress`` were accepted but had no effect. Compute the minimum-cost obstacle-free distance to the goal from all @@ -509,7 +510,7 @@ def query( replanning. In this case the value returned by :meth:`nexpand` will increase, according to the severity of the replanning. - :seealso: :meth:`plan` + .. seealso:: :meth:`plan` """ self.validate_start_goal(start) c, r = self._costgrid.w2g(start) diff --git a/src/roboticstoolbox/mobile/DubinsPlanner.py b/src/roboticstoolbox/mobile/DubinsPlanner.py index 98fc27ea3..cae6177b8 100644 --- a/src/roboticstoolbox/mobile/DubinsPlanner.py +++ b/src/roboticstoolbox/mobile/DubinsPlanner.py @@ -399,7 +399,8 @@ class DubinsPlanner(PlannerBase): 79(3): 497–516. :thanks: based on Dubins path planning from `Python Robotics `_ - :seealso: :class:`ReedsSheppPlanner` :class:`PlannerBase` + + .. seealso:: :class:`ReedsSheppPlanner` :class:`PlannerBase` """ def __init__( diff --git a/src/roboticstoolbox/mobile/EKF.py b/src/roboticstoolbox/mobile/EKF.py index 84920ce07..52ac484ee 100644 --- a/src/roboticstoolbox/mobile/EKF.py +++ b/src/roboticstoolbox/mobile/EKF.py @@ -259,7 +259,7 @@ def __init__( pn = ekf.get_Pnorm() plt.plot(t, pn); - :seealso: :meth:`run` + .. seealso:: :meth:`run` """ if robot is not None: @@ -519,7 +519,7 @@ def history(self) -> list[EKFLog]: list. It contains, for that time step, estimated state and covariance, and sensor observation. - :seealso: :meth:`get_t` :meth:`get_xyt` :meth:`get_map` :meth:`get_P` + .. seealso:: :meth:`get_t` :meth:`get_xyt` :meth:`get_map` :meth:`get_P` :meth:`get_Pnorm` """ return self._history @@ -553,7 +553,7 @@ def landmarks(self) -> dict[int, list[int]]: The order in which the landmark was first seen. The first observed landmark has order 0 and so on. - :seealso: :meth:`landmark` + .. seealso:: :meth:`landmark` """ return self._landmarks @@ -567,7 +567,7 @@ def landmark(self, id: int) -> tuple[int, int]: The first observed landmark has order 0 and so on. - :seealso: :meth:`landmarks` :meth:`landmark_index` :meth:`landmark_mindex` + .. seealso:: :meth:`landmarks` :meth:`landmark_index` :meth:`landmark_mindex` """ try: l = self._landmarks[id] @@ -586,7 +586,7 @@ def landmark_index(self, id: int) -> int: The return value ``j`` is the index of the x-coordinate of the landmark in the EKF state vector, and ``j+1`` is the index of the y-coordinate. - :seealso: :meth:`landmark` + .. seealso:: :meth:`landmark` """ try: jx = self._landmarks[id][0] * 2 @@ -607,7 +607,7 @@ def landmark_mindex(self, id: int) -> int: The return value ``j`` is the index of the x-coordinate of the landmark in the map vector, and ``j+1`` is the index of the y-coordinate. - :seealso: :meth:`landmark` + .. seealso:: :meth:`landmark` """ try: return self._landmarks[id][0] * 2 @@ -679,7 +679,7 @@ def run(self, T: float, animate: bool = False) -> None: - execute the EKF - save information as a namedtuple to the history list for later display - :seealso: :meth:`history` :meth:`landmark` :meth:`landmarks` + .. seealso:: :meth:`history` :meth:`landmark` :meth:`landmarks` :meth:`get_xyt` :meth:`get_t` :meth:`get_map` :meth:`get_P` :meth:`get_Pnorm` :meth:`plot_xy` :meth:`plot_ellipse` :meth:`plot_error` :meth:`plot_map` :meth:`run_animation` @@ -741,7 +741,7 @@ def run_animation( - execute the EKF - save information as a namedtuple to the history list for later display - :seealso: :meth:`history` :meth:`landmark` :meth:`landmarks` + .. seealso:: :meth:`history` :meth:`landmark` :meth:`landmarks` :meth:`get_xyt` :meth:`get_t` :meth:`get_map` :meth:`get_P` :meth:`get_Pnorm` :meth:`plot_xy` :meth:`plot_ellipse` :meth:`plot_error` :meth:`plot_map` :meth:`run_animation` @@ -1106,7 +1106,7 @@ def get_t(self) -> NDArray: Return simulation time vector, starts at zero. The timestep is an attribute of the ``robot`` object. - :seealso: :meth:`run` :meth:`history` + .. seealso:: :meth:`run` :meth:`history` """ return np.array([h.t for h in self._history]) @@ -1117,7 +1117,7 @@ def get_xyt(self) -> NDArray | None: :return: vehicle trajectory where each row is configuration :math:`(x, y, \theta)` :rtype: ndarray(n,3) - :seealso: :meth:`plot_xy` :meth:`run` :meth:`history` + .. seealso:: :meth:`plot_xy` :meth:`run` :meth:`history` """ if self._est_vehicle: xyt = np.array([h.xest[:3] for h in self._history]) @@ -1138,7 +1138,7 @@ def plot_xy(self, *args: Any, block: bool | None = None, **kwargs: Any) -> None: Plot the estimated vehicle path in the xy-plane. - :seealso: :meth:`get_xyt` :meth:`plot_error` :meth:`plot_ellipse` ``plot_P`` + .. seealso:: :meth:`get_xyt` :meth:`plot_error` :meth:`plot_ellipse` ``plot_P`` :meth:`run` :meth:`history` """ xyt = self.get_xyt() @@ -1167,7 +1167,7 @@ def plot_ellipse( Plot ``N`` uncertainty ellipses spaced evenly along the trajectory. - :seealso: :meth:`get_P` :meth:`run` :meth:`history` + .. seealso:: :meth:`get_P` :meth:`run` :meth:`history` """ nhist = len(self._history) @@ -1233,7 +1233,7 @@ def plot_error( .. note:: Observations will decrease the uncertainty while periods of dead-reckoning increase it. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 - The ``confidence`` bounds are the interval that contains that fraction of a one-dimensional Gaussian, :math:`\pm 1.96\sigma` for 0.95. Earlier versions used the radius of a @@ -1247,7 +1247,7 @@ def plot_error( - Works for SLAM, where the state also holds the landmarks, and raises ``ValueError`` if the vehicle pose is not estimated. - :seealso: :meth:`get_P` :meth:`run` :meth:`history` + .. seealso:: :meth:`get_P` :meth:`run` :meth:`history` """ if not self._est_vehicle: raise ValueError("the vehicle pose is not part of the estimated state") @@ -1310,7 +1310,7 @@ def get_map(self) -> NDArray: Landmarks are returned in the order they were first observed. - :seealso: :meth:`landmarks` :meth:`run` :meth:`history` + .. seealso:: :meth:`landmarks` :meth:`run` :meth:`history` """ xy = [self.landmark_x(lm_id) for lm_id in self._landmarks] @@ -1345,17 +1345,17 @@ def plot_map( Plot a marker and, if ``ellipse_style`` is given, a covariance ellipse for each estimated landmark. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``marker`` and ``ellipse`` are deprecated, use ``marker_style`` and ``ellipse_style``. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 Each ellipse is now drawn with the covariance of its own landmark. Previously the covariance was taken from the wrong place in the state covariance matrix, so that the ellipses after the first were wrong, and in SLAM were not landmark covariances at all. - :seealso: :meth:`get_map` :meth:`run` :meth:`history` + .. seealso:: :meth:`get_map` :meth:`run` :meth:`history` """ for old, new, value in ( ("marker", "marker_style", marker), @@ -1421,7 +1421,7 @@ def get_P(self, k: int | None = None) -> NDArray | list[NDArray]: If ``k`` is given return covariance from simulation timestep ``k``, else return a list of all covariance matrices. - :seealso: :meth:`get_Pnorm` :meth:`run` :meth:`history` + .. seealso:: :meth:`get_Pnorm` :meth:`run` :meth:`history` """ if k is not None: return self._history[k].P @@ -1439,7 +1439,7 @@ def get_Pnorm(self, k: int | None = None) -> float | NDArray: If ``k`` is given return covariance norm from simulation timestep ``k``, else return all covariance norms as a 1D NumPy array. - :seealso: :meth:`get_P` :meth:`run` :meth:`history` + .. seealso:: :meth:`get_P` :meth:`run` :meth:`history` """ if k is not None: return np.sqrt(np.linalg.det(self._history[k].P)) @@ -1462,7 +1462,7 @@ def disp_P(self, P: NDArray, colorbar: bool | dict[str, Any] = False) -> None: .. note:: A log scale is used. - :seealso: :meth:`~matplotlib.axes.Axes.imshow` :func:`matplotlib.pyplot.colorbar` + .. seealso:: :meth:`~matplotlib.axes.Axes.imshow` :func:`matplotlib.pyplot.colorbar` """ z = np.log10(abs(P)) @@ -1490,7 +1490,7 @@ def get_transform(self, map: dict[int, ArrayLike] | NDArray) -> SE2: landmark is world frame and the estimated landmarks in the SLAM reference frame. - :seealso: :func:`~spatialmath.base.transforms2d.points2tr2` + .. seealso:: :func:`~spatialmath.base.transforms2d.points2tr2` """ p = [] q = [] diff --git a/src/roboticstoolbox/mobile/LatticePlanner.py b/src/roboticstoolbox/mobile/LatticePlanner.py index 486e9816d..21b89724b 100644 --- a/src/roboticstoolbox/mobile/LatticePlanner.py +++ b/src/roboticstoolbox/mobile/LatticePlanner.py @@ -150,7 +150,7 @@ class LatticePlanner(PlannerBase): >>> print(path.T) >>> print(status) - :seealso: :meth:`plan` :meth:`query` :class:`PlannerBase` + .. seealso:: :meth:`plan` :meth:`query` :class:`PlannerBase` """ def __init__( @@ -201,7 +201,7 @@ def plan( If an occupancy grid exists the if ``iterations`` is None the area of the grid will be completely filled. - :seealso: :meth:`query` + .. seealso:: :meth:`query` """ if iterations is None and self.occgrid is None: raise ValueError( @@ -305,7 +305,7 @@ def query( |``edges`` | successive edges of the graph ``LatticeEdge`` type | +-------------+-----------------------------------------------------+ - :seealso: :meth:`plan` + .. seealso:: :meth:`plan` """ vs, ds = self.graph.closest(start) diff --git a/src/roboticstoolbox/mobile/OccGrid.py b/src/roboticstoolbox/mobile/OccGrid.py index 5be204d2e..0ab03d8dd 100644 --- a/src/roboticstoolbox/mobile/OccGrid.py +++ b/src/roboticstoolbox/mobile/OccGrid.py @@ -381,7 +381,7 @@ def plot( half a cell beyond the outer centres. ``labels`` shows the edge cells whole. The field and supplied style dictionaries are not modified. - :seealso: :meth:`world_to_grid` :meth:`grid_to_world` + .. seealso:: :meth:`world_to_grid` :meth:`grid_to_world` """ if map is not None and field is not None: @@ -522,7 +522,7 @@ def line_world(self, p1: ArrayLike2, p2: ArrayLike2) -> NDArray: ``line_w`` is a shorthand for this method. - :seealso: :meth:`ravel` :meth:`world_to_grid` + .. seealso:: :meth:`ravel` :meth:`world_to_grid` """ gp1 = self.world_to_grid(p1) @@ -596,7 +596,7 @@ def __init__( >>> og = BinaryOccupancyGrid(workspace=[-5,5], cellsize=0.1, value=0) >>> print(og) - :seealso: :class:`OccupancyGrid` + .. seealso:: :class:`OccupancyGrid` """ if grid is not None: @@ -640,7 +640,7 @@ def isoccupied(self, p: ArrayLike2) -> bool: value. If the coordinate is outside the bounds of the occupancy grid it is considered to be occupied. - :seealso: :meth:`w2g` + .. seealso:: :meth:`w2g` """ c, r = self.w2g(p) # NumPy accepts negative indices by wrapping around to the opposite edge. @@ -662,7 +662,7 @@ def inflate(self, radius: float) -> None: Successive calls to ``inflate`` will compound the inflation. - :seealso: :func:`scipy.ndimage.binary_dilation` + .. seealso:: :func:`scipy.ndimage.binary_dilation` """ # Generate a circular structuring element r = round(radius / self._cellsize) @@ -693,7 +693,7 @@ class OccupancyGrid(BaseOccupancyGrid): >>> og = OccupancyGrid(workspace=[-5,5], cellsize=0.1, value=0.5) >>> print(og) - :seealso: :class:`BinaryOccupancyGrid` + .. seealso:: :class:`BinaryOccupancyGrid` """ def __str__(self) -> str: @@ -772,7 +772,7 @@ def iscollision(self, polygon: Polygon2 | NDArray) -> bool: The ``polygon`` is tested against polygons in the map, and returns True on the first collision. - :seealso: :meth:`add` :class:`~spatialmath.geom2d.Polygon2` + .. seealso:: :meth:`add` :class:`~spatialmath.geom2d.Polygon2` """ if not isinstance(polygon, Polygon2): polygon = Polygon2(polygon) diff --git a/src/roboticstoolbox/mobile/PRMPlanner.py b/src/roboticstoolbox/mobile/PRMPlanner.py index 1c802bf52..822817534 100644 --- a/src/roboticstoolbox/mobile/PRMPlanner.py +++ b/src/roboticstoolbox/mobile/PRMPlanner.py @@ -81,7 +81,8 @@ class PRMPlanner(PlannerBase): >>> print(path.T) :author: Peter Corke - :seealso: :class:`PlannerBase` + + .. seealso:: :class:`PlannerBase` """ def __init__( @@ -253,10 +254,10 @@ def plan( The roadmap is a ``UGraph``. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``animate`` was accepted but had no effect. - :seealso: :meth:`query` :meth:`graph` + .. seealso:: :meth:`query` :meth:`graph` """ if animate: warnings.warn( @@ -351,11 +352,11 @@ def plot( - the roadmap graph - the path - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``vertex`` and ``edge`` are deprecated, use ``vertex_style`` and ``edge_style``. - :seealso: :meth:`PlannerBase.plot` ``plot`` + .. seealso:: :meth:`PlannerBase.plot` ``plot`` """ for old, new, value in ( ("vertex", "vertex_style", vertex), diff --git a/src/roboticstoolbox/mobile/ParticleFilter.py b/src/roboticstoolbox/mobile/ParticleFilter.py index 5352c6c54..64fc1bdca 100644 --- a/src/roboticstoolbox/mobile/ParticleFilter.py +++ b/src/roboticstoolbox/mobile/ParticleFilter.py @@ -117,7 +117,7 @@ def __init__( .. note:: Set ``seed=None`` to get different behaviour from run to run. - :seealso: :meth:`run` + .. seealso:: :meth:`run` """ self._robot = robot self._sensor = sensor @@ -222,7 +222,7 @@ def history(self): list. It contains, for that time step, estimated state and covariance, and sensor observation. - :seealso: :meth:`get_t` :meth:`get_xyt` :meth:`get_std` + .. seealso:: :meth:`get_t` :meth:`get_xyt` :meth:`get_std` :meth:`get_Pnorm` """ return self._history @@ -336,7 +336,7 @@ def run(self, T=10, x0=None): - execute the particle filter - save information as a namedtuple to the history list for later display - :seealso: :meth:`history` :meth:`get_xyt` :meth:`get_t` :meth:`get_std` + .. seealso:: :meth:`history` :meth:`get_xyt` :meth:`get_t` :meth:`get_std` :meth:`plot_xy` """ @@ -416,7 +416,7 @@ def run_animation(self, T=10, x0=None, format=None, file=None): - execute the particle filter - save information as a namedtuple to the history list for later display - :seealso: :meth:`history` :meth:`get_xyt` :meth:`get_t` :meth:`get_std` + .. seealso:: :meth:`history` :meth:`get_xyt` :meth:`get_t` :meth:`get_std` :meth:`plot_xy` """ @@ -659,12 +659,12 @@ def get_xyt(self): :return: vehicle trajectory where each row is configuration :math:`(x, y, \theta)` :rtype: ndarray(n,3) - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 Returns the heading as well as the position, as documented and as :meth:`EKF.get_xyt` does. Previously the result had only the :math:`(x, y)` columns, ``xyt[:, :2]`` is that. - :seealso: :meth:`plot_xy` :meth:`run` :meth:`history` + .. seealso:: :meth:`plot_xy` :meth:`run` :meth:`history` """ return np.array([h.xest[:3] for h in self._history]) @@ -678,7 +678,7 @@ def get_std(self): Return the standard deviation :math:`(\sigma_x, \sigma_y)` of the particle cloud at each time step. - :seealso: :meth:`get_xyt` + .. seealso:: :meth:`get_xyt` """ return np.array([h.std for h in self._history]) @@ -695,7 +695,7 @@ def plot_xy(self, block=None, **kwargs): Plot the estimated vehicle path in the xy-plane. - :seealso: :meth:`get_xyt` + .. seealso:: :meth:`get_xyt` """ xyt = self.get_xyt() plt.plot(xyt[:, 0], xyt[:, 1], **kwargs) diff --git a/src/roboticstoolbox/mobile/PlannerBase.py b/src/roboticstoolbox/mobile/PlannerBase.py index c48733de1..a48eed68e 100644 --- a/src/roboticstoolbox/mobile/PlannerBase.py +++ b/src/roboticstoolbox/mobile/PlannerBase.py @@ -197,7 +197,7 @@ class PlannerBase: A planner raises ``ValueError`` for invalid arguments and ``NoPathError`` when a valid problem has no solution. - :seealso: :class:`~roboticstoolbox.mobile.OccGrid.BinaryOccupancyGrid` + .. seealso:: :class:`~roboticstoolbox.mobile.OccGrid.BinaryOccupancyGrid` """ def __init__( @@ -288,7 +288,7 @@ def start(self) -> R2 | R3 | None: The start is either a point :math:`(x, y)` or a configuration :math:`(x, y, \theta)`. - :seealso: :meth:`goal` + .. seealso:: :meth:`goal` """ return self._start @@ -311,7 +311,7 @@ def goal(self) -> R2 | R3 | None: The goal is either a point :math:`(x, y)` or a configuration :math:`(x, y, \theta)`. - :seealso: :meth:`start` + .. seealso:: :meth:`start` """ return self._goal @@ -357,7 +357,7 @@ def animate(self) -> bool: A movie file given to the constructor also implies animation. - :seealso: :meth:`animation_start` + .. seealso:: :meth:`animation_start` """ return self._animate or self._movie is not None @@ -402,7 +402,7 @@ def animation_start( A ``movie`` implies animation. - :seealso: :meth:`animation_frame` :meth:`animation_end` + .. seealso:: :meth:`animation_frame` :meth:`animation_end` """ if movie is None: movie = self._movie @@ -427,7 +427,7 @@ def animation_frame(self, pause: float = 0.05) -> None: Updates the display and adds a frame to the movie, if there is one. - :seealso: :meth:`animation_start` + .. seealso:: :meth:`animation_start` """ if pause > 0: plt.pause(pause) @@ -438,7 +438,7 @@ def animation_end(self) -> None: """ End an animation, closing the movie file if there is one - :seealso: :meth:`animation_start` + .. seealso:: :meth:`animation_start` """ if self._writer is not None: self._writer.done() @@ -463,7 +463,7 @@ def random(self) -> np.random.Generator: The generator is initialized with the seed provided at constructor time. - :seealso: :func:`numpy.random.default_rng` + .. seealso:: :func:`numpy.random.default_rng` """ return self._private_random @@ -495,7 +495,7 @@ def occgrid(self) -> BinaryOccupancyGrid | None: Returns the occupancy grid that was optionally inflated at constructor time. - :seealso: :meth:`validate_endpoint` :meth:`~roboticstoolbox.mobile.PlannerBase.isoccupied` + .. seealso:: :meth:`validate_endpoint` :meth:`~roboticstoolbox.mobile.PlannerBase.isoccupied` """ return self._occgrid @@ -512,7 +512,7 @@ def isoccupied(self, p: ArrayLike2 | ArrayLike3) -> bool: If there is no occupancy grid this function always returns False (free). - :seealso: :meth:`occgrid` :meth:`validate_endpoint` ``isoccupied`` + .. seealso:: :meth:`occgrid` :meth:`validate_endpoint` ``isoccupied`` """ if self.occgrid is None: return False @@ -532,7 +532,7 @@ def validate_endpoint( The coordinate is tested to be a free cell in the occupancy grid. - :seealso: :meth:`~roboticstoolbox.mobile.PlannerBase.isoccupied` :meth:`occgrid` + .. seealso:: :meth:`~roboticstoolbox.mobile.PlannerBase.isoccupied` :meth:`occgrid` """ if p is not None: pv = getvector(p, self._ndims, dtype=dtype) @@ -558,7 +558,7 @@ def progress_start(self, n: int) -> None: .. warning:: Requires that the ``progress`` package is installed. - :seealso: :meth:`progress_next` :meth:`progress_end` + .. seealso:: :meth:`progress_next` :meth:`progress_end` """ if self._progress: self._bar = FillingCirclesBar( @@ -580,7 +580,7 @@ def progress_next(self) -> None: .. warning:: Requires that the ``progress`` package is installed. - :seealso: :meth:`progress_start` :meth:`progress_end` + .. seealso:: :meth:`progress_start` :meth:`progress_end` """ if self._progress: self._bar.next() @@ -600,7 +600,7 @@ def progress_end(self) -> None: .. warning:: Requires that the ``progress`` package is installed. - :seealso: :meth:`progress_start` :meth:`progress_next` + .. seealso:: :meth:`progress_start` :meth:`progress_next` """ if self._progress: self._bar.finish() @@ -627,7 +627,7 @@ def validate_start_goal( value of None leaves the existing value unchanged. If either is invalid neither is stored. - :seealso: :meth:`validate_endpoint` :attr:`start` :attr:`goal` + .. seealso:: :meth:`validate_endpoint` :attr:`start` :attr:`goal` """ start_ = self.validate_endpoint(start, dtype=dtype) goal_ = self.validate_endpoint(goal, dtype=dtype) @@ -790,7 +790,7 @@ def plot( plotted on top, giving a line of alternating black and yellow dashes. A style given by the caller replaces these layers. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 The arguments ``line``, ``line_r``, ``path_marker``, ``path_marker_reverse``, ``start_marker``, ``goal_marker``, ``start_vehicle`` and ``goal_vehicle`` are deprecated, use @@ -799,13 +799,13 @@ def plot( ``path_marker`` and ``path_marker_reverse`` were accepted but had no effect. - :seealso: :meth:`~roboticstoolbox.mobile.PlannerBase.plot_bg` ``plot_poly`` + .. seealso:: :meth:`~roboticstoolbox.mobile.PlannerBase.plot_bg` ``plot_poly`` .. note:: Unknown keyword arguments are ignored, with a ``DeprecationWarning``, as they were silently by RTB 1.4.4 and earlier. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``labelvalues`` is deprecated, use ``labels``. It is the name used in the book, where it had no effect. @@ -1091,7 +1091,7 @@ def plot_bg( white outline (``path_effects``) so that it is legible on any gray. The axes are set to show every cell whole. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 Giving a dict as ``colorbar`` is deprecated, use ``colorbar=True`` with ``colorbar_style``. @@ -1112,7 +1112,7 @@ def plot_bg( ``DeprecationWarning``, as they were silently by RTB 1.4.4 and earlier. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``labelvalues`` is deprecated, use ``labels``. It is the name used in the book, where it had no effect. diff --git a/src/roboticstoolbox/mobile/PoseGraph.py b/src/roboticstoolbox/mobile/PoseGraph.py index cdb897819..b0b1876db 100644 --- a/src/roboticstoolbox/mobile/PoseGraph.py +++ b/src/roboticstoolbox/mobile/PoseGraph.py @@ -167,7 +167,7 @@ class PoseGraph: in IEEE Intelligent Transportation Systems Magazine, vol. 2, no. 4, pp. 31-43, winter 2010, doi: 10.1109/MITS.2010.939925. - :seealso: :meth:`optimize` :meth:`plot` :meth:`scanmap` + .. seealso:: :meth:`optimize` :meth:`plot` :meth:`scanmap` """ def __init__( @@ -403,7 +403,7 @@ def scan(self, i: int) -> tuple[NDArray, NDArray]: :return: range and bearing of each beam :rtype: ndarray(N), ndarray(N) - :seealso: :meth:`scanxy` + .. seealso:: :meth:`scanxy` """ v = self._scan_vertex(i) return v.range, v.theta @@ -419,7 +419,7 @@ def scanxy(self, i: int) -> NDArray: range less than the maximum range of the sensor :rtype: ndarray(2,N) - :seealso: :meth:`scan` + .. seealso:: :meth:`scan` """ range, theta = self.scan(i) range = np.where(range < self._maxrange, range, np.nan) @@ -438,7 +438,7 @@ def plot_scan(self, n: int | ArrayLike, pause: float = 1, **kwargs: Any) -> None Each scan is plotted in the sensor frame, in turn. - :seealso: :meth:`scanxy` + .. seealso:: :meth:`scanxy` """ style = dict(markersize=10) | kwargs for i in smb.getvector(n): @@ -489,11 +489,11 @@ def plot( :param eopt: deprecated, use ``edge_style`` :param kwargs: options passed to ``pgraph.UGraph.plot`` - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``vopt`` and ``eopt`` are deprecated, use ``vertex_style`` and ``edge_style``. - :seealso: :meth:`optimize` + .. seealso:: :meth:`optimize` """ for old, new, value in ( ("vopt", "vertex_style", vopt), @@ -540,7 +540,7 @@ def scanmatch(self, s1: int, s2: int) -> SE2: :raises ValueError: a vertex has no lidar scan :return: relative pose, found by iterative closest point - :seealso: :func:`spatialmath.base.ICP2d` + .. seealso:: :func:`spatialmath.base.ICP2d` """ p1 = self.scanxy(s1) p2 = self.scanxy(s2) @@ -566,7 +566,7 @@ def scanmap( .. note:: Scans are taken in vertex order, so the result depends on the current vertex poses, and is best made after :meth:`optimize`. - :seealso: :meth:`scanxy` :meth:`~roboticstoolbox.mobile.OccGrid.BaseOccupancyGrid.line_world` + .. seealso:: :meth:`scanxy` :meth:`~roboticstoolbox.mobile.OccGrid.BaseOccupancyGrid.line_world` """ indices = range(0, self.graph.n, step) bar = FillingCirclesBar( @@ -633,7 +633,7 @@ def optimize( :param kwargs: options passed to ``pgraph.UGraph.plot`` when animating :raises NotImplementedError: the graph has landmark vertices - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``vopt`` and ``eopt`` are deprecated, use ``vertex_style`` and ``edge_style``. @@ -641,7 +641,7 @@ def optimize( correction to all the poses, which are updated in place. Iteration stops early if the total error does not decrease. - :seealso: :meth:`linearize_and_solve` :meth:`plot` + .. seealso:: :meth:`linearize_and_solve` :meth:`plot` """ if any(v.type == "landmark" for v in self.graph): raise NotImplementedError("optimize does not support landmark vertices") @@ -705,7 +705,7 @@ def linearize_and_solve(self) -> float: The first vertex is anchored, since the measurements are all relative. - :seealso: :meth:`optimize` + .. seealso:: :meth:`optimize` """ t0 = time.time() diff --git a/src/roboticstoolbox/mobile/QuinticPolyPlanner.py b/src/roboticstoolbox/mobile/QuinticPolyPlanner.py index f3ec3c51b..25167a937 100644 --- a/src/roboticstoolbox/mobile/QuinticPolyPlanner.py +++ b/src/roboticstoolbox/mobile/QuinticPolyPlanner.py @@ -273,7 +273,7 @@ class QuinticPolyPlanner(PlannerBase): :thanks: based on quintic polynomial planning from `Python Robotics `_ - :seealso: :class:`PlannerBase` :class:`CurvaturePolyPlanner` + .. seealso:: :class:`PlannerBase` :class:`CurvaturePolyPlanner` """ def __init__( diff --git a/src/roboticstoolbox/mobile/RRTPlanner.py b/src/roboticstoolbox/mobile/RRTPlanner.py index 7343a398c..178b89e5c 100644 --- a/src/roboticstoolbox/mobile/RRTPlanner.py +++ b/src/roboticstoolbox/mobile/RRTPlanner.py @@ -99,7 +99,7 @@ class RRTPlanner(PlannerBase): print(status) - :seealso: :class:`DubinsPlanner` :class:`Vehicle` :class:`PlannerBase` + .. seealso:: :class:`DubinsPlanner` :class:`Vehicle` :class:`PlannerBase` """ def __init__( @@ -170,7 +170,7 @@ def plan( is True. If ``animate`` is True these points are displayed during the search process, otherwise a single figure is displayed at the end. - :seealso: :meth:`query` + .. seealso:: :meth:`query` """ # TODO use validate vehicle = self.vehicle @@ -305,7 +305,7 @@ def qrandom(self) -> NDArray: Returns a random configuration where position :math:`(x, y)` lies within the bounds of the ``map`` associated with this planner. - :seealso: :meth:`qrandom_free` + .. seealso:: :meth:`qrandom_free` """ workspace = self.map.workspace assert workspace is not None @@ -325,7 +325,7 @@ def qrandom_free(self) -> NDArray: y)` lies within the bounds of the ``map`` associated with this planner. Iterates on :meth:`qrandom` - :seealso: :meth:`qrandom` :meth:`iscollision` + .. seealso:: :meth:`qrandom` :meth:`iscollision` """ # iterate for a random freespace configuration while True: diff --git a/src/roboticstoolbox/mobile/ReedsSheppPlanner.py b/src/roboticstoolbox/mobile/ReedsSheppPlanner.py index 176013d6a..944f6a250 100644 --- a/src/roboticstoolbox/mobile/ReedsSheppPlanner.py +++ b/src/roboticstoolbox/mobile/ReedsSheppPlanner.py @@ -497,7 +497,8 @@ class ReedsSheppPlanner(PlannerBase): pp. 367–393. :thanks: based on Reeds-Shepp path planning from `Python Robotics `_ - :seealso: :class:`DubinsPlanner` :class:`PlannerBase` + + .. seealso:: :class:`DubinsPlanner` :class:`PlannerBase` """ def __init__( diff --git a/src/roboticstoolbox/mobile/Vehicle.py b/src/roboticstoolbox/mobile/Vehicle.py index bb032998d..fc75aec3a 100644 --- a/src/roboticstoolbox/mobile/Vehicle.py +++ b/src/roboticstoolbox/mobile/Vehicle.py @@ -202,7 +202,7 @@ def __init__( .. note:: Set ``seed=None`` to have it randomly initialized from the operating system. - :seealso: :class:`Bicycle` :class:`Unicycle` :class:`VehicleAnimationBase` + .. seealso:: :class:`Bicycle` :class:`Unicycle` :class:`VehicleAnimationBase` """ self._V = covar @@ -288,7 +288,7 @@ def f(self, x: ArrayLike, odo: ArrayLike, v: ArrayLike | None = None) -> NDArray .. note:: This is the state update equation used for EKF localization. - :seealso: :meth:`deriv` :meth:`Fx` :meth:`Fv` + .. seealso:: :meth:`deriv` :meth:`Fx` :meth:`Fv` """ odo = base.getvector(odo, 2) @@ -332,7 +332,7 @@ def Fx(self, x: ArrayLike, odo: ArrayLike) -> NDArray: Returns the Jacobian matrix :math:`\frac{\partial \vec{f}}{\partial \vec{x}}` for the given state and odometry. - :seealso: :meth:`f` :meth:`deriv` :meth:`Fv` + .. seealso:: :meth:`f` :meth:`deriv` :meth:`Fv` """ dd, dth = odo theta = x[2] @@ -360,7 +360,7 @@ def Fv(self, x: ArrayLike, odo: ArrayLike) -> NDArray: Returns the Jacobian matrix :math:`\frac{\partial \vec{f}}{\partial \vec{v}}` for the given state and odometry. - :seealso: :meth:`f` :meth:`deriv` :meth:`Fx` + .. seealso:: :meth:`f` :meth:`deriv` :meth:`Fx` """ dd, dth = odo theta = x[2] @@ -400,7 +400,7 @@ def control(self) -> ControlLike | None: >>> bike.control = RandomPath(workspace=10) >>> print(bike) - :seealso: :meth:`run` :meth:`eval_control` :obj:`scipy.interpolate.interp1d` :class:`~roboticstoolbox.mobile.drivers.VehicleDriverBase` + .. seealso:: :meth:`run` :meth:`eval_control` :obj:`scipy.interpolate.interp1d` :class:`~roboticstoolbox.mobile.drivers.VehicleDriverBase` """ return self._control @@ -434,7 +434,7 @@ def eval_control(self, control: ControlLike | None, x: ArrayLike) -> NDArray: Vehicle steering, speed and acceleration limits are applied to the result before being input to the vehicle model. - :seealso: :meth:`run` :meth:`control` :func:`scipy.interpolate.interp1d` + .. seealso:: :meth:`run` :meth:`control` :func:`scipy.interpolate.interp1d` """ u: ArrayLike if base.isvector(control, 2): @@ -506,7 +506,7 @@ def polygon(self, q: ArrayLike) -> Polygon2: ``q``. Can be used for collision checking using the :meth:`~spatialmath.geom2d.Polygon2.intersects` method. - :seealso: :class:`~spatialmath.geom2d.Polygon2` + .. seealso:: :class:`~spatialmath.geom2d.Polygon2` """ if self._polygon is None: raise ValueError("vehicle has no bounding polygon") @@ -534,7 +534,7 @@ def add_driver(self, driver: VehicleDriverBase) -> None: .. warning:: Deprecated. Use ``vehicle.control = driver`` instead. - :seealso: :class:`~roboticstoolbox.mobile.drivers.VehicleDriverBase` :meth:`control` + .. seealso:: :class:`~roboticstoolbox.mobile.drivers.VehicleDriverBase` :meth:`control` """ warnings.warn("add_driver is deprecated, use veh.control=driver instead") @@ -584,7 +584,7 @@ def run( attribute set by the constructor. * integration uses rectangular integration. - :seealso: :meth:`init` :meth:`step` :meth:`control` :meth:`run_animation` + .. seealso:: :meth:`init` :meth:`step` :meth:`control` :meth:`run_animation` """ self.init(control=control, animate=animate, x0=x0) @@ -663,7 +663,7 @@ def run_animation( attribute set by the constructor. * integration uses rectangular integration. - :seealso: :meth:`init` :meth:`step` :meth:`control` :meth:`run` + .. seealso:: :meth:`init` :meth:`step` :meth:`control` :meth:`run` """ fig, ax = plt.subplots() @@ -739,7 +739,7 @@ def init( If animation is enabled by constructor and no animation object is given, use a default ``VehiclePolygon("car")`` - :seealso: :class:`VehicleAnimationBase` :meth:`run` + .. seealso:: :class:`VehicleAnimationBase` :meth:`run` """ if x0 is not None: self._x = base.getvector(x0, 3) @@ -822,7 +822,7 @@ def step( .. note:: Vehicle control input limits are applied. - :seealso: :func:`control`, ``update``, :func:`run` + .. seealso:: :func:`control`, ``update``, :func:`run` """ # determine vehicle control if u is not None: @@ -898,7 +898,7 @@ def x(self) -> NDArray: :return: Vehicle state :math:`(x, y, \theta)` :rtype: ndarray(3) - :seealso: :meth:`q` + .. seealso:: :meth:`q` """ return self._x @@ -910,7 +910,7 @@ def q(self) -> NDArray: :return: Vehicle state :math:`(x, y, \theta)` :rtype: ndarray(3) - :seealso: :meth:`x` + .. seealso:: :meth:`x` """ return self._x @@ -925,7 +925,7 @@ def x0(self) -> NDArray: Set by :class:`VehicleBase` subclass constructor. The state is set to this value at the beginning of each simulation run. - :seealso: :meth:`run` + .. seealso:: :meth:`run` """ return self._x0 @@ -940,7 +940,7 @@ def x0(self, x0: ArrayLike) -> None: The state is set to this value at the beginning of each simulation run. Overrides the value set by :class:`VehicleBase` subclass constructor. - :seealso: :func:`run` + .. seealso:: :func:`run` """ self._x0 = base.getvector(x0, 3) @@ -963,7 +963,7 @@ def random(self) -> np.random.Generator: The generator is initialized with the seed provided at constructor time every time :meth:`init` is called. - :seealso: :meth:`init` :func:`numpy.random.default_rng` + .. seealso:: :meth:`init` :func:`numpy.random.default_rng` """ return self._random @@ -978,7 +978,7 @@ def x_hist(self) -> NDArray: The state :math:`(x, y, \theta)` at each time step resulting from a simulation run, one row per timestep. - :seealso: :meth:`run` + .. seealso:: :meth:`run` """ return np.array(self._x_hist) @@ -992,7 +992,7 @@ def speed_max(self) -> float: Set by :meth:`VehicleBase` subclass constructor. - :seealso: :meth:`accel_max` ``steer_max`` :meth:`u_limited` + .. seealso:: :meth:`accel_max` ``steer_max`` :meth:`u_limited` """ return self._speed_max @@ -1006,7 +1006,7 @@ def accel_max(self) -> float: Set by :meth:`VehicleBase` subclass constructor. - :seealso: :meth:`speed_max` ``steer_max`` :meth:`u_limited` + .. seealso:: :meth:`speed_max` ``steer_max`` :meth:`u_limited` """ return self._accel_max @@ -1021,7 +1021,7 @@ def dt(self) -> float: Set by :meth:`VehicleBase` subclass constructor. Used by :meth:`step` to update state. - :seealso: :meth:`run` + .. seealso:: :meth:`run` """ return self._dt @@ -1056,7 +1056,7 @@ def stopsim(self) -> None: A control function can stop the simulation initiated by the ``run`` method. - :seealso: :meth:`run` + .. seealso:: :meth:`run` """ self._stopsim = True @@ -1074,7 +1074,7 @@ def plot_xy(self, *args: Any, block: bool | None = None, **kwargs: Any) -> None: The :math:`(x,y)` trajectory from the simulation history is plotted as :math:`x` vs :math:`y`. - :seealso: :meth:`run` :meth:`plot_xyt` + .. seealso:: :meth:`run` :meth:`plot_xyt` """ xyt = self.x_hist plt.plot(xyt[:, 0], xyt[:, 1], *args, **kwargs) @@ -1093,7 +1093,7 @@ def plot_xyt(self, block: bool | None = None, **kwargs: Any) -> None: The :math:`(x,y, \theta)` trajectory from the simulation history is plotted against time. - :seealso: :meth:`run` :meth:`plot_xy` + .. seealso:: :meth:`run` :meth:`plot_xy` """ xyt = self.x_hist t = np.arange(xyt.shape[0]) * self._dt @@ -1135,7 +1135,7 @@ def __init__( where :math:`v` is the velocity in body frame x-direction, and :math:`\gamma` is the angle of the steered wheel. - :seealso: :meth:`f` :meth:`deriv` :meth:`Fx` meth:`Fv` :class:`VehicleBase` + .. seealso:: :meth:`f` :meth:`deriv` :meth:`Fx` meth:`Fv` :class:`VehicleBase` """ super().__init__(**kwargs) @@ -1174,7 +1174,7 @@ def radius_min(self) -> float: .. math:: \frac{l}{\tan \gamma_{max}} - :seealso: :meth:`curvature_max` + .. seealso:: :meth:`curvature_max` """ return self.l / np.tan(self.steer_max) @@ -1191,7 +1191,7 @@ def curvature_max(self) -> float: .. math:: \frac{\tan \gamma_{max}}{l} - :seealso: :meth:`radius_min` + .. seealso:: :meth:`radius_min` """ return 1.0 / self.radius_min @@ -1229,7 +1229,7 @@ def deriv(self, x: ArrayLike, u: ArrayLike, limits: bool = True) -> NDArray: If ``limits`` is True then speed, acceleration and steer-angle limits are applied to ``u``. - :seealso: :meth:`f` + .. seealso:: :meth:`f` """ # unpack some variables @@ -1292,7 +1292,7 @@ def __init__(self, W: float = 1, steer_max: float = np.inf, **kwargs: Any) -> No where :math:`v` is the velocity in body frame x-direction, and :math:`\omega` is the turn rate. - :seealso: :meth:`f` :meth:`deriv` :meth:`Fx` meth:`Fv` :class:`Vehicle` + .. seealso:: :meth:`f` :meth:`deriv` :meth:`Fx` meth:`Fv` :class:`Vehicle` """ super().__init__(**kwargs) self._W = W @@ -1337,7 +1337,7 @@ def deriv( of the vehicle width ``W``. If ``limits`` is True then speed, acceleration and turn-rate limits are applied to ``u``. - :seealso: :meth:`f` + .. seealso:: :meth:`f` """ if limits: u = self.u_limited(u) @@ -1397,7 +1397,7 @@ def __init__(self, W: float = 1, **kwargs: Any) -> None: where :math:`v = (v_R + v_L)/2` is the velocity in body frame x-direction, and :math:`\omega = (v_R - v_L)/W` is the turn rate. - :seealso: :meth:`f` :meth:`deriv` :meth:`Fx` meth:`Fv` :class:`Vehicle` + .. seealso:: :meth:`f` :meth:`deriv` :meth:`Fx` meth:`Fv` :class:`Vehicle` """ super().__init__(**kwargs) self._W = W @@ -1467,7 +1467,7 @@ def deriv(self, x: ArrayLike, u: ArrayLike, limits: bool = True) -> NDArray: If ``limits`` is True then speed and acceleration limits are applied to the wheel speeds ``u``. - :seealso: :meth:`f` + .. seealso:: :meth:`f` """ if limits: u = self.u_limited(u) @@ -1521,7 +1521,7 @@ def __init__( :math:`\omega = (v_R - v_L)/W` is the turn rate, and :math:`\delta` is the hitch angle. - :seealso: :meth:`f` :meth:`deriv` :meth:`Fx` meth:`Fv` :class:`Vehicle` + .. seealso:: :meth:`f` :meth:`deriv` :meth:`Fx` meth:`Fv` :class:`Vehicle` """ super().__init__(**kwargs) self._x0 = np.r_[x0] @@ -1592,7 +1592,7 @@ def deriv(self, x: ArrayLike, u: ArrayLike, limits: bool = True) -> NDArray: If ``limits`` is True then speed and acceleration limits are applied to the wheel speeds ``u``. - :seealso: :meth:`f` + .. seealso:: :meth:`f` """ if limits: u = self.u_limited(u) @@ -1652,7 +1652,7 @@ def __init__( :math:`(x,y)` is the position of the centre of vehicle, :math:`\theta` is the heading angle, and :math:`\delta_i` is the hitch angle for the `i`-th trailer. - :seealso: :class:`VehicleBase` :class:`Trailer` + .. seealso:: :class:`VehicleBase` :class:`Trailer` """ self.vehicle = vehicle self.trailers: list[Trailer] @@ -1689,7 +1689,7 @@ def polygon(self, q: ArrayLike) -> list[Polygon2]: ``q``. Can be used for collision checking using the :meth:`~spatialmath.geom2d.Polygon2.intersects` method. - :seealso: :class:`~spatialmath.geom2d.Polygon2` + .. seealso:: :class:`~spatialmath.geom2d.Polygon2` """ assert self.vehicle._polygon is not None polygons = [self.vehicle._polygon.transformed(SE2(q))] @@ -1764,7 +1764,7 @@ def run( attribute set by the constructor. * integration uses rectangular integration. - :seealso: :meth:`init` :meth:`step` :meth:`control` :meth:`run_animation` + .. seealso:: :meth:`init` :meth:`step` :meth:`control` :meth:`run_animation` """ self.init(control=control, animate=animate, x0=x0) @@ -1805,7 +1805,7 @@ def step( # type: ignore[override] .. note:: Vehicle control input limits are applied. - :seealso: :func:`control`, ``update``, :func:`run` + .. seealso:: :func:`control`, ``update``, :func:`run` """ # determine vehicle control if u is not None: @@ -1909,7 +1909,7 @@ def deriv(self, x: ArrayLike, u: ArrayLike, limits: bool = True) -> NDArray: If ``limits`` is True then speed and acceleration limits are applied to the wheel speeds ``u``. - :seealso: :meth:`VehicleBas.f` + .. seealso:: :meth:`VehicleBas.f` """ dx = self.vehicle.deriv(x[:3], u, limits) diff --git a/src/roboticstoolbox/mobile/drivers.py b/src/roboticstoolbox/mobile/drivers.py index 1ed2f4d03..93d9cbe16 100644 --- a/src/roboticstoolbox/mobile/drivers.py +++ b/src/roboticstoolbox/mobile/drivers.py @@ -42,7 +42,7 @@ class VehicleDriverBase(ABC): Abstract class for an agent that can drive a mobile robot. - :seealso: :class:`RandomPath` :class:`PurePursuit` + .. seealso:: :class:`RandomPath` :class:`PurePursuit` """ def __init__( @@ -69,7 +69,7 @@ def __init__( :param verbose: display debug information, defaults to False :param goalmarkerstyle: deprecated, use ``goal_style`` - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``goalmarkerstyle`` is deprecated, use ``goal_style`` instead. The workspace of the robot is a rectangular region defined by ``workspace`` @@ -271,7 +271,7 @@ def __init__( ``seed=None`` to have it randomly initialized from the operating system. - :seealso: ``Bicycle`` ``Unicycle`` :func:`~spatialmath.base.graphics.plotvol2` + .. seealso:: ``Bicycle`` ``Unicycle`` :func:`~spatialmath.base.graphics.plotvol2` """ # TODO options to specify region, maybe accept a Map object? @@ -352,7 +352,7 @@ def demand(self) -> R2: larger workspace dimension of the waypoint, a new random waypoint is chosen. - :seealso: ``VehicleBase`` + .. seealso:: ``VehicleBase`` """ if self._goal is None: @@ -438,7 +438,7 @@ def __init__( and the current goal point, which changes at every time step, is shown using ``goal_style``. - :seealso: :class:`RandomPath` ``VehicleBase`` + .. seealso:: :class:`RandomPath` ``VehicleBase`` """ super().__init__(**kwargs) diff --git a/src/roboticstoolbox/mobile/landmarkmap.py b/src/roboticstoolbox/mobile/landmarkmap.py index 4708055eb..ba5365d6f 100644 --- a/src/roboticstoolbox/mobile/landmarkmap.py +++ b/src/roboticstoolbox/mobile/landmarkmap.py @@ -59,7 +59,7 @@ class LandmarkMap: Peter Corke, Springer 2023 - :seealso: :class:`~roboticstoolbox.mobile.sensors.RangeBearingSensor` :class:`~roboticstoolbox.mobile.EKF.EKF` + .. seealso:: :class:`~roboticstoolbox.mobile.sensors.RangeBearingSensor` :class:`~roboticstoolbox.mobile.EKF.EKF` """ def __init__( @@ -84,7 +84,7 @@ def __init__( :raises ValueError: ``landmarks`` is not given, or is not a 2xN array or an integer - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 ``verbose`` has no effect and ``map`` is renamed ``landmarks``. """ if map is not None: diff --git a/src/roboticstoolbox/mobile/sensors.py b/src/roboticstoolbox/mobile/sensors.py index a96b95aab..610875d9a 100644 --- a/src/roboticstoolbox/mobile/sensors.py +++ b/src/roboticstoolbox/mobile/sensors.py @@ -165,7 +165,7 @@ def random(self) -> np.random.Generator: The generator is initialized with the seed provided at constructor time every time :meth:`init` is called. - :seealso: :meth:`init` + .. seealso:: :meth:`init` """ return self._random @@ -288,7 +288,7 @@ def __init__( >>> sensor = RangeBearingSensor(robot, map, range=(0.5, 20), angle=pi/4) >>> print(sensor) - :seealso: ``LandmarkMap`` :class:`~roboticstoolbox.mobile.EKF` + .. seealso:: ``LandmarkMap`` :class:`~roboticstoolbox.mobile.EKF` .. deprecated:: 1.4.0 The ``animate`` keyword, use ``plot`` instead. @@ -360,7 +360,7 @@ def init(self) -> None: - reset the landmark log - initialize plots - :seealso: :meth:`SensorBase.init` + .. seealso:: :meth:`SensorBase.init` """ super().init() self._landmarklog = [] @@ -419,7 +419,7 @@ def reading(self) -> tuple[NDArray | None, int | None]: - If ``animate`` option set and the angular and distance limits are set then display the sensor field of view as a polygon. - :seealso: :meth:`h` + .. seealso:: :meth:`h` """ # TODO probably should return K=0 to indicated invalid @@ -509,7 +509,7 @@ def visible(self) -> list[tuple[NDArray, int]]: lies with the sensing range and field of view of the sensor at the robot's current configuration. - :seealso: :meth:`isvisible` :meth:`h` + .. seealso:: :meth:`isvisible` :meth:`h` """ # get range/bearing to all landmarks z = self.h(self.robot.x) @@ -538,7 +538,7 @@ def isvisible(self, id: int) -> bool: The landmark ``id`` is visible if it lies with the sensing range and field of view of the sensor at the robot's current configuration. - :seealso: :meth:`visible` :meth:`h` + .. seealso:: :meth:`visible` :meth:`h` """ z = self.h(self.robot.x, id) @@ -587,7 +587,7 @@ def h(self, x: ArrayLike, landmark: int | ArrayLike | None = None) -> NDArray: - The landmark is assumed to be visible, field of view and range limits are not applied. - :seealso: :meth:`reading` :meth:`Hx` :meth:`Hw` :meth:`Hp` + .. seealso:: :meth:`reading` :meth:`Hx` :meth:`Hw` :meth:`Hp` """ # get the landmarks, one per row @@ -645,7 +645,7 @@ def Hx(self, x: ArrayLike, landmark: int | ArrayLike) -> NDArray: - ``sensor.Hx(q, id)`` is Jacobian for landmark ``id`` - ``sensor.h(q, p)`` is Jacobian for landmark with coordinates ``p`` - :seealso: :meth:`h` :meth:`Hp` :meth:`Hw` + .. seealso:: :meth:`h` :meth:`Hp` :meth:`Hw` """ if base.isinteger(landmark): @@ -681,7 +681,7 @@ def Hp(self, x: ArrayLike, landmark: int | ArrayLike) -> NDArray: - ``sensor.Hp(x, id)`` is Jacobian for landmark ``id`` - ``sensor.Hp(x, p)`` is Jacobian for landmark with coordinates ``p`` - :seealso: :meth:`h` :meth:`Hx` :meth:`Hw` + .. seealso:: :meth:`h` :meth:`Hx` :meth:`Hw` """ if base.isinteger(landmark): xf = self.map.landmark(landmark) @@ -717,7 +717,7 @@ def Hw(self, x: ArrayLike, landmark: int | ArrayLike | None) -> NDArray: .. note:: ``x`` and ``landmark`` are not used to compute this. - :seealso: :meth:`h` :meth:`Hx` :meth:`Hp` + .. seealso:: :meth:`h` :meth:`Hx` :meth:`Hp` """ return np.eye(2) @@ -735,7 +735,7 @@ def g(self, x: ArrayLike, z: ArrayLike) -> NDArray: Compute the world coordinate of a landmark given the observation ``z`` from a vehicle state with ``x``. - :seealso: :meth:`h` :meth:`Gx` :meth:`Gz` + .. seealso:: :meth:`h` :meth:`Gx` :meth:`Gz` """ range = z[0] @@ -762,7 +762,7 @@ def Gx(self, x: ArrayLike, z: ArrayLike) -> NDArray: Compute the Jacobian of the landmark position function with respect to landmark position :math:`\partial g/\partial x` - :seealso: :meth:`g` + .. seealso:: :meth:`g` """ theta = x[2] r, bearing = z @@ -788,7 +788,7 @@ def Gz(self, x: ArrayLike, z: ArrayLike) -> NDArray: Compute the Jacobian of the landmark position function with respect to sensor observation :math:`\partial g/\partial z` - :seealso: :meth:`g` + .. seealso:: :meth:`g` """ theta = x[2] r, bearing = z diff --git a/src/roboticstoolbox/mobile/workspace.py b/src/roboticstoolbox/mobile/workspace.py index 48b3434e0..b4dee2c29 100644 --- a/src/roboticstoolbox/mobile/workspace.py +++ b/src/roboticstoolbox/mobile/workspace.py @@ -60,7 +60,7 @@ def resolve_workspace(*sources: WorkspaceLike | None | Any) -> R4 | None: workspace = resolve_workspace(workspace, map, vehicle) - :seealso: :func:`~spatialmath.base.graphics.expand_dims` + .. seealso:: :func:`~spatialmath.base.graphics.expand_dims` """ for source in sources: if source is None: diff --git a/src/roboticstoolbox/models/DH/Ball.py b/src/roboticstoolbox/models/DH/Ball.py index 7f6f2064c..55ceae0d2 100755 --- a/src/roboticstoolbox/models/DH/Ball.py +++ b/src/roboticstoolbox/models/DH/Ball.py @@ -49,7 +49,7 @@ class Ball(DHRobot): O(log(n)) calculation of rigid body dynamics, Part 2", Int. J. Robotics Research, 18(9), pp 876-892. - :seealso: :func:`Hyper`, :func:`Ball` + .. seealso:: :func:`Hyper`, :func:`Ball` .. codeauthor:: Peter Corke """ diff --git a/src/roboticstoolbox/models/DH/Coil.py b/src/roboticstoolbox/models/DH/Coil.py index ab8da60fb..de8aa4c7a 100644 --- a/src/roboticstoolbox/models/DH/Coil.py +++ b/src/roboticstoolbox/models/DH/Coil.py @@ -44,7 +44,7 @@ class Coil(DHRobot): calculation of rigid body dynamics, Part 2", Int. J. Robotics Research, 18(9), pp 876-892. - :seealso: :func:`Hyper`, :func:`Ball` + .. seealso:: :func:`Hyper`, :func:`Ball` .. codeauthor:: Peter Corke """ diff --git a/src/roboticstoolbox/models/DH/Hyper.py b/src/roboticstoolbox/models/DH/Hyper.py index 3acb7e1a9..8310e3573 100644 --- a/src/roboticstoolbox/models/DH/Hyper.py +++ b/src/roboticstoolbox/models/DH/Hyper.py @@ -46,7 +46,7 @@ class Hyper(DHRobot): calculation of rigid body dynamics, Part 2", Int. J. Robotics Research, 18(9), pp 876-892. - :seealso: :func:`Coil`, :func:`Ball` + .. seealso:: :func:`Coil`, :func:`Ball` .. codeauthor:: Peter Corke """ diff --git a/src/roboticstoolbox/models/DH/Hyper3d.py b/src/roboticstoolbox/models/DH/Hyper3d.py index 04f01f3ff..ddcaba282 100644 --- a/src/roboticstoolbox/models/DH/Hyper3d.py +++ b/src/roboticstoolbox/models/DH/Hyper3d.py @@ -46,7 +46,7 @@ class Hyper3d(DHRobot): calculation of rigid body dynamics, Part 2", Int. J. Robotics Research, 18(9), pp 876-892. - :seealso: :func:`Coil`, :func:`Ball` + .. seealso:: :func:`Coil`, :func:`Ball` .. codeauthor:: Peter Corke """ diff --git a/src/roboticstoolbox/models/DH/Jaco.py b/src/roboticstoolbox/models/DH/Jaco.py index 1f5ed70c6..b31343c9d 100644 --- a/src/roboticstoolbox/models/DH/Jaco.py +++ b/src/roboticstoolbox/models/DH/Jaco.py @@ -41,7 +41,7 @@ class Jaco(DHRobot): :references: - "DH Parameters of Jaco" Version 1.0.8, July 25, 2013. - :seealso: :func:`Mico` + .. seealso:: :func:`Mico` """ def __init__(self, symbolic: bool = False) -> None: diff --git a/src/roboticstoolbox/models/DH/Mico.py b/src/roboticstoolbox/models/DH/Mico.py index 407d997b5..44085a4d0 100644 --- a/src/roboticstoolbox/models/DH/Mico.py +++ b/src/roboticstoolbox/models/DH/Mico.py @@ -39,7 +39,7 @@ class Mico(DHRobot): :references: - "DH Parameters of Mico" Version 1.0.8, July 25, 2013. - :seealso: :func:`Mico` + .. seealso:: :func:`Mico` """ def __init__(self, symbolic: bool = False) -> None: diff --git a/src/roboticstoolbox/models/DH/P8.py b/src/roboticstoolbox/models/DH/P8.py index 3572b010c..17d3bc8d0 100755 --- a/src/roboticstoolbox/models/DH/P8.py +++ b/src/roboticstoolbox/models/DH/P8.py @@ -48,7 +48,7 @@ class P8(DHRobot): .. codeauthor:: Peter Corke - :seealso: ``Puma560`` + .. seealso:: ``Puma560`` """ def __init__(self) -> None: diff --git a/src/roboticstoolbox/models/DH/Puma560.py b/src/roboticstoolbox/models/DH/Puma560.py index 6f75fe8fa..517b1943f 100755 --- a/src/roboticstoolbox/models/DH/Puma560.py +++ b/src/roboticstoolbox/models/DH/Puma560.py @@ -251,7 +251,7 @@ def ikine_a( a zero first link length and a lateral shoulder offset :math:`d_3`. It does not apply to other robots. Joint limits are not considered. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 Accepts an array as well as an :class:`SE3`, returns a single ``IKSolution`` for a trajectory like the numerical solvers (it was garbled, and failed for an unreachable pose), reports a pose diff --git a/src/roboticstoolbox/robot/BaseRobot.py b/src/roboticstoolbox/robot/BaseRobot.py index f38779388..9c2913481 100644 --- a/src/roboticstoolbox/robot/BaseRobot.py +++ b/src/roboticstoolbox/robot/BaseRobot.py @@ -427,9 +427,7 @@ def dynchanged(self, what: str | None = None) -> None: Called from a property setter to inform the robot that the cache of dynamic parameters is invalid. - See Also - -------- - :func:`roboticstoolbox.Link._dirties_frne` + .. seealso:: :func:`roboticstoolbox.Link._dirties_frne` """ @@ -461,8 +459,7 @@ def __getitem__(self, i: int | str) -> LinkType: :param i: link number or name :returns: i'th link or named link - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -636,8 +633,7 @@ def n(self) -> int: :returns: Number of joints - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -645,10 +641,7 @@ def n(self) -> int: >>> robot = rtb.models.DH.Puma560() >>> robot.n - See Also - -------- - :func:`nlinks` - :func:`nbranches` + .. seealso:: :func:`nlinks` :func:`nbranches` """ @@ -664,8 +657,7 @@ def nlinks(self) -> Any: :returns: Number of links - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -673,10 +665,7 @@ def nlinks(self) -> Any: >>> robot = rtb.models.DH.Puma560() >>> robot.nlinks - See Also - -------- - :func:`n` - :func:`nbranches` + .. seealso:: :func:`n` :func:`nbranches` """ @@ -692,8 +681,7 @@ def nbranches(self) -> int: :returns: number of branches in the robot's kinematic tree - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -701,10 +689,7 @@ def nbranches(self) -> int: >>> robot = rtb.models.ETS.Panda() >>> robot.nbranches - See Also - -------- - :func:`n` - :func:`nlinks` + .. seealso:: :func:`n` :func:`nlinks` """ return sum([link.nchildren == 0 for link in self.links]) + len(self.grippers) @@ -813,8 +798,7 @@ def hasdynamics(self) -> bool: methods on a kinematics-only model, and accept the zeros, now get a ``ValueError``. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -846,8 +830,7 @@ def hasgeometry(self) -> Any: :returns: Robot has geometry model - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -855,9 +838,7 @@ def hasgeometry(self) -> Any: >>> robot = rtb.models.DH.Puma560() >>> robot.hasgeometry - See Also - -------- - :func:`hascollision` + .. seealso:: :func:`hascollision` """ @@ -871,8 +852,7 @@ def hascollision(self) -> Any: :returns: Robot has collision model :returns: At least one link has associated collision model. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -880,9 +860,7 @@ def hascollision(self) -> Any: >>> robot = rtb.models.DH.Puma560() >>> robot.hascollision - See Also - -------- - :func:`hasgeometry` + .. seealso:: :func:`hasgeometry` """ @@ -923,7 +901,7 @@ def set_default_backend(cls, be: Any) -> None: been given one of its own by ``robot.default_backend = ...``. The robot's own value takes precedence. - :seealso: :attr:`default_backend` + .. seealso:: :attr:`default_backend` """ cls._class_default_backend = be @@ -1018,8 +996,7 @@ def qlim(self) -> NDArray: :raises ValueError: unset limits for a prismatic joint :returns: Array of joint limit values - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1078,8 +1055,7 @@ def structure(self) -> str: :returns: joint configuration string - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1114,8 +1090,7 @@ def prismaticjoints(self) -> list[bool]: :returns: array of joint type, True if prismatic - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1130,10 +1105,7 @@ def prismaticjoints(self) -> list[bool]: Fixed joints, that maintain a constant link relative pose, are not included. - See Also - -------- - :meth:`~roboticstoolbox.robot.Link.Link.isprismatic` - :func:`revolutejoints` + .. seealso:: :meth:`~roboticstoolbox.robot.Link.Link.isprismatic` :func:`revolutejoints` """ @@ -1146,8 +1118,7 @@ def revolutejoints(self) -> list[bool]: :returns: array of joint type, True if revolute - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1162,10 +1133,7 @@ def revolutejoints(self) -> list[bool]: Fixed joints, that maintain a constant link relative pose, are not included. - See Also - -------- - :meth:`~roboticstoolbox.robot.Link.Link.isrevolute` - :func:`prismaticjoints` + .. seealso:: :meth:`~roboticstoolbox.robot.Link.Link.isrevolute` :func:`prismaticjoints` """ @@ -1535,8 +1503,7 @@ def ets( :raises TypeError: a bad link argument :returns: elementary transform sequence - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1670,8 +1637,7 @@ def todegrees(self, q: Any) -> NDArray: :returns: If ``q`` is a matrix, with one column per joint, the conversion is :returns: performed columnwise. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1707,8 +1673,7 @@ def toradians(self, q: Any) -> NDArray: :param q: The joint configuration of the robot :returns: a vector of joint coordinates in radians and metres - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1735,8 +1700,7 @@ def isrevolute(self, j: Any) -> bool: :returns: True if revolute - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1746,10 +1710,7 @@ def isrevolute(self, j: Any) -> bool: >>> stanford = rtb.models.DH.Stanford() >>> stanford.isrevolute(1) - See Also - -------- - :meth:`~roboticstoolbox.robot.Link.Link.isrevolute` - :func:`revolutejoints` + .. seealso:: :meth:`~roboticstoolbox.robot.Link.Link.isrevolute` :func:`revolutejoints` """ return self.revolutejoints[j] @@ -1760,8 +1721,7 @@ def isprismatic(self, j: Any) -> bool: :returns: True if prismatic - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1771,10 +1731,7 @@ def isprismatic(self, j: Any) -> bool: >>> stanford = rtb.models.DH.Stanford() >>> stanford.isprismatic(1) - See Also - -------- - :meth:`~roboticstoolbox.robot.Link.Link.isprismatic` - :func:`prismaticjoints` + .. seealso:: :meth:`~roboticstoolbox.robot.Link.Link.isprismatic` :func:`prismaticjoints` """ @@ -1820,8 +1777,7 @@ def addconfiguration_attr(self, name: str, q: ArrayLike, unit: str = "rad") -> N :param name: Name of the joint configuration :param q: Joint configuration - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1839,9 +1795,7 @@ def addconfiguration_attr(self, name: str, q: ArrayLike, unit: str = "rad") -> N - Configuration is also added to the robot instance's dictionary of named configurations. - See Also - -------- - :meth:`addconfiguration` + .. seealso:: :meth:`addconfiguration` """ @@ -1859,8 +1813,7 @@ def addconfiguration(self, name: str, q: ArrayLike) -> None: :param name: Name of the joint configuration :param q: Joint configuration - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1869,9 +1822,7 @@ def addconfiguration(self, name: str, q: ArrayLike) -> None: >>> robot.addconfiguration_attr("mypos", [0.1, 0.2, 0.3, 0.4, 0.5, 0.6]) >>> robot.configs["mypos"] - See Also - -------- - :meth:`addconfiguration` + .. seealso:: :meth:`addconfiguration` """ @@ -1927,10 +1878,7 @@ def random_q(self) -> Any: :returns: Random joint configuration :rtype: ndarray(n) - See Also - -------- - :meth:`~roboticstoolbox.robot.Robot.Robot.qlim` - :meth:`~roboticstoolbox.robot.Link.Link.qlim` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.qlim` :meth:`~roboticstoolbox.robot.Link.Link.qlim` """ @@ -1945,8 +1893,7 @@ def hierarchy(self) -> None: :returns: Pretty print of the robot model - Examples - -------- + .. rubric:: Examples Makes a robot and prints the hierarchy @@ -2193,9 +2140,7 @@ def plot( actually be on the robot, ie. the lines to not necessarily represent the links of the robot. - See Also - -------- - :func:`teach` + .. seealso:: :func:`teach` """ @@ -2539,8 +2484,7 @@ def showgraph(self, display_graph: bool = True, **kwargs: Any) -> str | None: :param jtype: Arrowhead to node indicates revolute or prismatic type :param static: Show static joints in blue and bold - Examples - -------- + .. rubric:: Examples >>> import roboticstoolbox as rtb >>> panda = rtb.models.URDF.Panda() @@ -2549,9 +2493,7 @@ def showgraph(self, display_graph: bool = True, **kwargs: Any) -> str | None: .. image:: ../figs/panda-graph.svg :width: 600 - See Also - -------- - :func:`dotfile` :func:`graph` + .. seealso:: :func:`dotfile` :func:`graph` """ @@ -2621,9 +2563,7 @@ def dotfile( :param jtype: Arrowhead to node indicates revolute or prismatic type :param static: Show static joints in blue and bold - See Also - -------- - :func:`showgraph` :func:`graph` + .. seealso:: :func:`showgraph` :func:`graph` """ @@ -2779,7 +2719,7 @@ def graph( from IPython.display import Markdown, display display(Markdown(robot.graph(format="mermaid_fenced"))) - :seealso: :meth:`dotfile` :meth:`showgraph` + .. seealso:: :meth:`dotfile` :meth:`showgraph` """ graph_format = format.lower().replace("-", "_") diff --git a/src/roboticstoolbox/robot/DHLink.py b/src/roboticstoolbox/robot/DHLink.py index 676a93a2f..6e458b29f 100644 --- a/src/roboticstoolbox/robot/DHLink.py +++ b/src/roboticstoolbox/robot/DHLink.py @@ -37,7 +37,7 @@ def dyn_param_setter(self, value): If this is the case, then the parameters are re-serialized prior to invoking inverse dynamics. - :seealso: :meth:`~roboticstoolbox.robot.Link.Link._listen_dyn` + .. seealso:: :meth:`~roboticstoolbox.robot.Link.Link._listen_dyn` """ @wraps(func) @@ -515,7 +515,8 @@ def sigma(self) -> Any: :returns: joint type :rtype: int - :seealso: :func:`isrevolute`, :func:`isprismatic` + + .. seealso:: :func:`isrevolute`, :func:`isprismatic` - ``link.sigma`` is the joint type - ``link.sigma = ...`` checks and sets the joint type @@ -615,7 +616,7 @@ def A(self, q: float = 0.0) -> SE3: - The computation is different for standard and modified Denavit-Hartenberg parameters. - :seealso: :class:`RevoluteDH`, :class:`PrismaticDH`, + .. seealso:: :class:`RevoluteDH`, :class:`PrismaticDH`, :class:`RevoluteMDH`, :class:`PrismaticMDH` """ @@ -669,7 +670,7 @@ def isrevolute(self) -> Any: :return: True if revolute :rtype: bool - :seealso: :func:`sigma` + .. seealso:: :func:`sigma` """ if not self.sigma: @@ -685,7 +686,7 @@ def isprismatic(self) -> Any: :return: True if prismatic :rtype: bool - :seealso: :func:`sigma` + .. seealso:: :func:`sigma` """ if self.sigma: @@ -734,7 +735,7 @@ class RevoluteDH(DHLink): :references: - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7. - :seealso: :func:`PrismaticDH`, :func:`DHLink`, :func:`RevoluteMDH` + .. seealso:: :func:`PrismaticDH`, :func:`DHLink`, :func:`RevoluteMDH` """ def __init__( @@ -803,7 +804,7 @@ class PrismaticDH(DHLink): :references: - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7. - :seealso: :func:`RevoluteDH`, :func:`DHLink`, :func:`PrismaticMDH` + .. seealso:: :func:`RevoluteDH`, :func:`DHLink`, :func:`PrismaticMDH` """ def __init__( @@ -875,7 +876,7 @@ class RevoluteMDH(DHLink): :references: - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7. - :seealso: :func:`PrismaticMDH`, :func:`DHLink`, :func:`RevoluteDH` + .. seealso:: :func:`PrismaticMDH`, :func:`DHLink`, :func:`RevoluteDH` """ def __init__( @@ -947,7 +948,7 @@ class PrismaticMDH(DHLink): :references: - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 7. - :seealso: :func:`RevoluteMDH`, :func:`DHLink`, :func:`PrismaticDH` + .. seealso:: :func:`RevoluteMDH`, :func:`DHLink`, :func:`PrismaticDH` """ def __init__( diff --git a/src/roboticstoolbox/robot/DHRobot.py b/src/roboticstoolbox/robot/DHRobot.py index 4ec9317bd..660155310 100644 --- a/src/roboticstoolbox/robot/DHRobot.py +++ b/src/roboticstoolbox/robot/DHRobot.py @@ -677,7 +677,7 @@ def nbranches(self) -> Any: >>> robot = rtb.models.DH.Panda() >>> robot.nbranches - :seealso: :func:`n`, :func:`nlinks` + .. seealso:: :func:`n`, :func:`nlinks` """ return 1 @@ -1113,7 +1113,7 @@ def analytic_ik(self) -> AnalyticIK: default: ``pip install roboticstoolbox-python[ik]``. The extra also installs ``python-flint``, which makes the derivation much faster. - .. versionadded:: 1.6.0 + .. versionadded:: 1.5.0 """ key = tuple( (link.isrevolute, link.a, link.d, link.alpha, link.theta, link.offset) @@ -1158,7 +1158,7 @@ def ikine_analytic( derives the equations, see :meth:`analytic_ik`, and the solver is kept for the calls that follow. - .. versionadded:: 1.6.0 + .. versionadded:: 1.5.0 """ return self.analytic_ik().ikine(T, q0, joint_limits, weights) @@ -1189,7 +1189,7 @@ def ikine_6s(self, T: Any, config: Any, ikfunc: Any) -> Any: """ Analytic inverse kinematics for a robot with a spherical wrist - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 This came from the MATLAB Toolbox and is not general. It only handles the wrist, the user supplied ``ikfunc`` must solve the first three joints, and that is specific to one robot geometry. It also @@ -1611,7 +1611,7 @@ def hessian0( # type: ignore[override] - Kinematic Derivatives using the Elementary Transform Sequence, J. Haviland and P. Corke - :seealso: :func:`jacob0`, ``jacob_dot`` + .. seealso:: :func:`jacob0`, ``jacob_dot`` """ return self.ets().hessian0(q, J0) @@ -1703,7 +1703,7 @@ def rne( # type: ignore[override] inertia and joint friction. - If a model has no dynamic parameters set the result is zero. - :seealso: :func:`rne_python` + .. seealso:: :func:`rne_python` """ self._require_dynamics() @@ -1850,7 +1850,7 @@ def rne_python( - This version supports symbolic model parameters - Verified against MATLAB code - :seealso: :func:`rne` + .. seealso:: :func:`rne` """ self._require_dynamics() diff --git a/src/roboticstoolbox/robot/Dynamics.py b/src/roboticstoolbox/robot/Dynamics.py index e31362e63..dd6ca6950 100644 --- a/src/roboticstoolbox/robot/Dynamics.py +++ b/src/roboticstoolbox/robot/Dynamics.py @@ -72,8 +72,7 @@ def dynamics(self: RobotProto) -> None: The dynamic parameters (inertial and friction) are printed in a table, with one row per link. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -155,10 +154,7 @@ def friction(self: RobotProto, qd: NDArray) -> NDArray: ratios are tricky: the Puma560 robot has negative gear ratio for joints 1 and 3. - See Also - -------- - :meth:`~roboticstoolbox.robot.Robot.Robot.nofriction` - :meth:`~roboticstoolbox.robot.Link.Link.friction` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.nofriction` :meth:`~roboticstoolbox.robot.Link.Link.friction` """ @@ -184,10 +180,7 @@ def nofriction(self: RobotProto, coulomb: bool = True, viscous: bool = False) -> a robot with the same link parameters except the Coulomb and/or viscous friction parameter are set to zero. - See Also - -------- - :meth:`~roboticstoolbox.robot.Robot.Robot.friction` - :meth:`~roboticstoolbox.robot.Link.Link.nofriction` + .. seealso:: :meth:`~roboticstoolbox.robot.Robot.Robot.friction` :meth:`~roboticstoolbox.robot.Link.Link.nofriction` """ @@ -257,8 +250,7 @@ def fdyn( The function must return a Numpy array (n,) of joint forces/torques. - Examples - -------- + .. rubric:: Examples To apply zero joint torque to the robot without Coulomb friction: @@ -303,11 +295,7 @@ def fdyn( - Interpolation is performed using `SciPy interp1d `_ - See Also - -------- - :meth:`~roboticstoolbox.robot.DHRobot.DHRobot.accel` - :meth:`~roboticstoolbox.robot.DHRobot.DHRobot.nofriction`, - :meth:`~roboticstoolbox.robot.DHRobot.DHRobot.rne`. + .. seealso:: :meth:`~roboticstoolbox.robot.DHRobot.DHRobot.accel` :meth:`~roboticstoolbox.robot.DHRobot.DHRobot.nofriction`, :meth:`~roboticstoolbox.robot.DHRobot.DHRobot.rne`. """ self._require_dynamics() @@ -457,8 +445,7 @@ def accel(self: RobotProto, q: Any, qd: Any, torque: Any, gravity: Any = None) - where each row is the acceleration corresponding to the equivalent rows of q, qd, torque. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -792,8 +779,7 @@ def inertia(self: RobotProto, q: NDArray) -> NDArray: vector, and the result is a 3d-matrix (nxnxk) where each plane corresponds to the inertia for the corresponding row of q. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -811,9 +797,7 @@ def inertia(self: RobotProto, q: NDArray) -> NDArray: - The diagonal terms include the motor inertia reflected through the gear ratio. - See Also - -------- - :func:`cinertia` + .. seealso:: :func:`cinertia` """ self._require_dynamics() @@ -862,8 +846,7 @@ def coriolis(self: RobotProto, q: Any, qd: Any) -> Any: joint configuration, and the result (n,n,m) is a 3d-matrix where each plane corresponds to a row of ``q`` and ``qd``. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -961,8 +944,7 @@ def gravload( configuration vector, and the result is a matrix (nxm) each column being the corresponding joint torques. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1038,8 +1020,7 @@ def inertia_x( corresponds to the Cartesian inertia for the corresponding row of ``q``. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1054,9 +1035,7 @@ def inertia_x( .. warning:: Assumes that the operational space has 6 DOF. - See Also - -------- - :func:`inertia` + .. seealso:: :func:`inertia` """ @@ -1159,8 +1138,7 @@ def coriolis_x( joint configuration, and the result is an array (m,6,6) where each matrix corresponds to a row of ``q`` and ``qd``. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1178,11 +1156,7 @@ def coriolis_x( .. warning:: Assumes that the operational space has 6 DOF. - See Also - -------- - :func:`coriolis` - :func:`inertia_x` - :meth:`~roboticstoolbox.robot.Robot.Robot.hessian0` + .. seealso:: :func:`coriolis` :func:`inertia_x` :meth:`~roboticstoolbox.robot.Robot.Robot.hessian0` """ @@ -1272,8 +1246,7 @@ def gravload_x( configuration vector, and the result is a matrix (m,6) with one gravity wrench per row. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1288,9 +1261,7 @@ def gravload_x( .. warning:: Assumes that the operational space has 6 DOF. - See Also - -------- - :func:`gravload` + .. seealso:: :func:`gravload` """ @@ -1369,9 +1340,7 @@ def accel_x( numbers of joints. - Joint friction is considered. - See Also - -------- - :func:`accel` + .. seealso:: :func:`accel` """ @@ -1440,8 +1409,7 @@ def itorque(self: RobotProto, q: Any, qdd: Any) -> Any: joint configuration, and the result is a matrix (m,n) where each row is the corresponding joint torques. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1454,9 +1422,7 @@ def itorque(self: RobotProto, q: Any, qdd: Any) -> Any: - If the robot model contains non-zero motor inertia then this will be included in the result. - See Also - -------- - :func:`inertia` + .. seealso:: :func:`inertia` """ self._require_dynamics() diff --git a/src/roboticstoolbox/robot/IK.py b/src/roboticstoolbox/robot/IK.py index ab6fb0544..cb0ba4f14 100644 --- a/src/roboticstoolbox/robot/IK.py +++ b/src/roboticstoolbox/robot/IK.py @@ -127,7 +127,7 @@ class IKSolution: ``ik_GN`` (which now also return ``IKSolution``, see :meth:`~roboticstoolbox.ETS.ik_LM`) remain compatible with code that indexed the old bare tuple return - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 An ``IKSolution`` is now a sequence of the rows of ``q``, one per pose: ``len(sol)`` is the number of poses (1 for a single pose), and ``for q in sol`` and ``sol[i]`` give the joint vector of each pose. This @@ -210,7 +210,7 @@ def astuple(self) -> tuple: :returns: ``(q, success, iterations, searches, residual, reason)`` - This is what iterating over an ``IKSolution`` gave before 1.4.5. + This is what iterating over an ``IKSolution`` gave before 1.5.0. """ return ( self.q, @@ -383,7 +383,7 @@ def solve( - ``residual`` the *maximum* residual over all poses, the worst case - ``reason`` the reason given by the last pose that failed, if any - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is now the maximum over the poses, previously it was the minimum, which hid poses that were solved badly. """ diff --git a/src/roboticstoolbox/robot/Link.py b/src/roboticstoolbox/robot/Link.py index 148a85809..c052cb6b2 100644 --- a/src/roboticstoolbox/robot/Link.py +++ b/src/roboticstoolbox/robot/Link.py @@ -78,7 +78,7 @@ def _dirties_frne(func: Any) -> Any: def m(self, m_new): self._m = m_new - :seealso: :func:`DHLink._dyn_changed` + .. seealso:: :func:`DHLink._dyn_changed` """ @wraps(func) @@ -298,8 +298,7 @@ def Ts(self) -> NDArray | None: This property returns the constant part. If no constant part is given, this returns an identity matrix. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -477,8 +476,7 @@ def v(self) -> BaseET | None: identity) followed by an optional joint variable transform. This property returns the latter. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -548,7 +546,7 @@ def qlim(self) -> NDArray | None: - The limits are not widely enforced within the toolbox. - If no joint limits are specified the value is ``None`` - :seealso: :func:`~islimit` + .. seealso:: :func:`~islimit` """ if self.v: @@ -578,7 +576,7 @@ def qdlim(self) -> float | None: - The limits are not widely enforced within the toolbox. - If no joint velocity limits are specified the value is ``None`` - :seealso: :func:`~islimit` + .. seealso:: :func:`~islimit` """ return self._qdlim @@ -602,7 +600,7 @@ def tlim(self) -> float | None: - The limits are not widely enforced within the toolbox. - If no joint torque limits are specified the value is ``None`` - :seealso: :func:`~islimit` + .. seealso:: :func:`~islimit` """ return self._tlim @@ -628,8 +626,7 @@ def hasdynamics(self) -> bool: with only friction parameters, or one made with ``m=0``, now reports False. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -945,7 +942,7 @@ def G(self) -> float: The default was 0, which silently discarded the motor inertia and friction of a link that did not set ``G``. - :seealso: ``flip`` + .. seealso:: ``flip`` """ return self._G @@ -1022,8 +1019,7 @@ def isjoint(self) -> bool: This property returns the whether the Link contains the variable transform. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1096,8 +1092,7 @@ def parent(self) -> Self | None: This is a reference to the links parent in the kinematic chain - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1251,8 +1246,7 @@ def dyn(self, indent: int = 0) -> Any: the link object in a multi-line format. The properties shown are mass, centre of mass, inertia, friction, gear ratio and motor properties. - Examples - -------- + .. rubric:: Examples .. runblock:: pycon @@ -1261,7 +1255,7 @@ def dyn(self, indent: int = 0) -> Any: >>> print(robot.links[2]) # kinematic parameters >>> print(robot.links[2].dyn()) # dynamic parameters - :seealso: ``dyntable`` + .. seealso:: ``dyntable`` """ qlim = [0, 0] if self.qlim is None else self.qlim @@ -1299,7 +1293,7 @@ def _dyn2list(self, fmt: str = "{: .3g}") -> Any: properties of the link The properties included are mass, centre of mass, inertia, friction, gear ratio and motor properties. - :seealso: :func:`~dyn` + .. seealso:: :func:`~dyn` """ ANSITable( @@ -1413,7 +1407,7 @@ def islimit(self, q: float) -> Any: - If no limits are set always return False. - :seealso: :func:`qlim` + .. seealso:: :func:`qlim` """ if self.qlim is None: @@ -1538,7 +1532,7 @@ class Link(BaseLink): - ``Ts`` the constant part as a NumPy array, or None - ``v`` a pointer to an ETS object representing the joint variable, or None - :seealso: :class:`Link2`, ``DHLink`` + .. seealso:: :class:`Link2`, ``DHLink`` """ def __init__( diff --git a/src/roboticstoolbox/robot/PoERobot.py b/src/roboticstoolbox/robot/PoERobot.py index d5d2910d7..ed4127216 100644 --- a/src/roboticstoolbox/robot/PoERobot.py +++ b/src/roboticstoolbox/robot/PoERobot.py @@ -20,7 +20,7 @@ class PoELink(Link): This is a subclass of the base Link class. - :seealso: :class:`Link` + .. seealso:: :class:`Link` """ def __init__(self, twist: Any, name: str | None = None) -> None: @@ -143,7 +143,7 @@ def __init__(self, axis: Any, point: Any, **kwargs: Any) -> None: Construct a link and revolute joint for a PoE Robot. - :seealso: :class:`Link` :class:`Robot` + .. seealso:: :class:`Link` :class:`Robot` """ super().__init__(Twist3.UnitRevolute(axis, point), **kwargs) @@ -159,7 +159,7 @@ def __init__(self, axis: Any, **kwargs: Any) -> None: Construct a link and prismatic joint for a PoE Robot. - :seealso: :class:`Link` :class:`Robot` + .. seealso:: :class:`Link` :class:`Robot` """ super().__init__(Twist3.UnitPrismatic(axis), **kwargs) @@ -177,7 +177,7 @@ def __init__(self, links: Any, T0: Any, **kwargs: Any) -> None: This is a subclass of the abstract base Robot class that provides only forward kinematics and world-frame Jacobian. - :seealso: :class:`PoEPrismatic` :class:`PoERevolute` + .. seealso:: :class:`PoEPrismatic` :class:`PoERevolute` """ # add base link and end-effector link diff --git a/src/roboticstoolbox/robot/Robot.py b/src/roboticstoolbox/robot/Robot.py index 4509c3fe7..322d94775 100644 --- a/src/roboticstoolbox/robot/Robot.py +++ b/src/roboticstoolbox/robot/Robot.py @@ -1355,7 +1355,7 @@ def jtraj( polynomial in time from ``q0`` to ``qf``. It is the method form of :func:`~roboticstoolbox.tools.trajectory.jtraj`. - .. deprecated:: 1.4.5 + .. deprecated:: 1.5.0 Passing :class:`SE3` poses for ``q0`` or ``qf`` is deprecated and now raises ``TypeError``. The poses were converted to joint coordinates by inverse kinematics, which is never simple: which solution is chosen @@ -1369,7 +1369,7 @@ def jtraj( For a Cartesian trajectory see :func:`~roboticstoolbox.tools.trajectory.ctraj`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 The arguments are joint coordinates only, they were named ``T1`` and ``T2`` and could be poses. The ``**kwargs`` that were passed to the inverse kinematics method are gone. @@ -1377,7 +1377,7 @@ def jtraj( if isinstance(q0, SE3) or isinstance(qf, SE3): raise TypeError( - "jtraj no longer accepts SE3 poses, this was deprecated in 1.4.5. " + "jtraj no longer accepts SE3 poses, this was deprecated in 1.5.0. " "Solve the inverse kinematics explicitly and pass joint " "coordinates, e.g. robot.jtraj(robot.ikine_LM(T0).q, " "robot.ikine_LM(Tf).q, t)" diff --git a/src/roboticstoolbox/robot/RobotKinematics.py b/src/roboticstoolbox/robot/RobotKinematics.py index 6914c9566..8cde60735 100644 --- a/src/roboticstoolbox/robot/RobotKinematics.py +++ b/src/roboticstoolbox/robot/RobotKinematics.py @@ -97,8 +97,8 @@ def fkine( If ``q`` has multiple rows (mxn), it is considered a trajectory and the result is an ``SE3`` instance with ``m`` values. - Examples - -------- + .. rubric:: Examples + The following example makes a ``panda`` robot object, and solves for the forward kinematics at the listed configuration. @@ -176,8 +176,8 @@ def jacob0( End-effector spatial velocity :math:`\nu = (v_x, v_y, v_z, \omega_x, \omega_y, \omega_z)^T` is related to joint velocity by :math:`{}^{E}\!\nu = \mathbf{J}_m(q) \dot{q}`. - Examples - -------- + .. rubric:: Examples + The following example makes a ``Puma560`` robot object, and solves for the base-frame Jacobian at the zero joint angle configuration @@ -227,8 +227,8 @@ def jacobe( End-effector spatial velocity :math:`\nu = (v_x, v_y, v_z, \omega_x, \omega_y, \omega_z)^T` is related to joint velocity by :math:`{}^{E}\!\nu = \mathbf{J}_m(q) \dot{q}`. - Examples - -------- + .. rubric:: Examples + The following example makes a ``Puma560`` robot object, and solves for the end-effector frame Jacobian at the zero joint angle configuration @@ -332,8 +332,8 @@ def hessian0( \mat{J}_{i,j} = \frac{d u_i}{d q_j} - Examples - -------- + .. rubric:: Examples + The following example makes a ``Panda`` robot object, and solves for the base frame Hessian at the given joint angle configuration @@ -432,8 +432,8 @@ def hessiane( \mat{J}_{i,j} = \frac{d u_i}{d q_j} - Examples - -------- + .. rubric:: Examples + The following example makes a ``Panda`` robot object, and solves for the end-effector frame Hessian at the given joint angle configuration @@ -475,8 +475,8 @@ def partial_fkine0( where the Jacobian is the first partial derivative and the Hessian is the second. - Examples - -------- + .. rubric:: Examples + The following example makes a ``Panda`` robot object, and solves for the base-effector frame 4th defivative of the forward kinematics at the given joint angle configuration @@ -538,8 +538,8 @@ def jacob0_analytical( * - ``'exp'`` - exponential coordinate rates - Examples - -------- + .. rubric:: Examples + Makes a robot object and computes the analytic Jacobian for the given joint configuration @@ -674,8 +674,8 @@ def ik_LM( Wampler proposed :math:`\vec{w_n}` to be a constant. This is set through the ``k`` kwarg. - Examples - -------- + .. rubric:: Examples + The following example makes a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose ``Tep`` using the `ik_LM` method. @@ -812,8 +812,8 @@ def ik_NR( \vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k - Examples - -------- + .. rubric:: Examples + The following example gets a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose ``Tep`` using the `ik_NR` method. @@ -955,8 +955,8 @@ def ik_GN( the above provides the pseudoinverse solution. However, if :math:`\mat{J}(\vec{q}_k)` is singular, the above can not be computed and the GN solution is infeasible. - Examples - -------- + .. rubric:: Examples + The following example gets a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose ``Tep`` using the `ik_GN` method. @@ -1059,7 +1059,7 @@ def ikine_LM( has shape (N, n), ``success`` is True only if every pose succeeded, and ``residual`` is the maximum over the poses. See :meth:`~roboticstoolbox.robot.IK.IKSolver.solve`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. @@ -1127,8 +1127,8 @@ def ikine_LM( Wampler proposed :math:`\vec{w_n}` to be a constant. This is set through the ``k`` kwarg. - Examples - -------- + .. rubric:: Examples + The following example makes a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose ``Tep`` using the `ikine_LM` method. @@ -1158,18 +1158,18 @@ def ikine_LM( - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022). - See Also - -------- - :py:class:`~roboticstoolbox.robot.IK.IK_LM` - An IK Solver class which implements the Levenberg-Marquardt optimisation technique - ikine_NR - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_NR` class as a method within the :py:class:`Robot` class - ikine_GN - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_GN` class as a method within the :py:class:`Robot` class - ikine_QP - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_QP` class as a method within the :py:class:`Robot` class - :meth:`ik_LM` - The fast, C++-backed equivalent of this method (requires the compiled extension) + .. seealso:: + + :py:class:`~roboticstoolbox.robot.IK.IK_LM` + An IK Solver class which implements the Levenberg-Marquardt optimisation technique + ikine_NR + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_NR` class as a method within the :py:class:`Robot` class + ikine_GN + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_GN` class as a method within the :py:class:`Robot` class + ikine_QP + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_QP` class as a method within the :py:class:`Robot` class + :meth:`ik_LM` + The fast, C++-backed equivalent of this method (requires the compiled extension) .. versionchanged:: 1.0.4 @@ -1257,7 +1257,7 @@ def ikine_NR( has shape (N, n), ``success`` is True only if every pose succeeded, and ``residual`` is the maximum over the poses. See :meth:`~roboticstoolbox.robot.IK.IKSolver.solve`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. @@ -1277,8 +1277,8 @@ def ikine_NR( \vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k - Examples - -------- + .. rubric:: Examples + The following example gets a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose ``Tep`` using the `ikine_NR` method. @@ -1304,18 +1304,18 @@ def ikine_NR( - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022). - See Also - -------- - :py:class:`~roboticstoolbox.robot.IK.IK_NR` - An IK Solver class which implements the Newton-Raphson optimisation technique - ikine_LM - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_LM` class as a method within the :py:class:`~roboticstoolbox.ETS` class - ikine_GN - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_GN` class as a method within the :py:class:`~roboticstoolbox.ETS` class - ikine_QP - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_QP` class as a method within the :py:class:`~roboticstoolbox.ETS` class - :meth:`ik_NR` - The fast, C++-backed equivalent of this method (requires the compiled extension) + .. seealso:: + + :py:class:`~roboticstoolbox.robot.IK.IK_NR` + An IK Solver class which implements the Newton-Raphson optimisation technique + ikine_LM + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_LM` class as a method within the :py:class:`~roboticstoolbox.ETS` class + ikine_GN + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_GN` class as a method within the :py:class:`~roboticstoolbox.ETS` class + ikine_QP + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_QP` class as a method within the :py:class:`~roboticstoolbox.ETS` class + :meth:`ik_NR` + The fast, C++-backed equivalent of this method (requires the compiled extension) .. versionchanged:: 1.0.4 @@ -1402,7 +1402,7 @@ def ikine_GN( has shape (N, n), ``success`` is True only if every pose succeeded, and ``residual`` is the maximum over the poses. See :meth:`~roboticstoolbox.robot.IK.IKSolver.solve`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. @@ -1437,8 +1437,8 @@ def ikine_GN( the above provides the pseudoinverse solution. However, if :math:`\mat{J}(\vec{q}_k)` is singular, the above can not be computed and the GN solution is infeasible. - Examples - -------- + .. rubric:: Examples + The following example gets a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose ``Tep`` using the `ikine_GN` method. @@ -1464,18 +1464,18 @@ def ikine_GN( - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022). - See Also - -------- - :py:class:`~roboticstoolbox.robot.IK.IK_GN` - An IK Solver class which implements the Gauss-Newton optimisation technique - ikine_LM - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_LM` class as a method within the :py:class:`~roboticstoolbox.ETS` class - ikine_NR - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_NR` class as a method within the :py:class:`~roboticstoolbox.ETS` class - ikine_QP - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_QP` class as a method within the :py:class:`~roboticstoolbox.ETS` class - :meth:`ik_GN` - The fast, C++-backed equivalent of this method (requires the compiled extension) + .. seealso:: + + :py:class:`~roboticstoolbox.robot.IK.IK_GN` + An IK Solver class which implements the Gauss-Newton optimisation technique + ikine_LM + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_LM` class as a method within the :py:class:`~roboticstoolbox.ETS` class + ikine_NR + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_NR` class as a method within the :py:class:`~roboticstoolbox.ETS` class + ikine_QP + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_QP` class as a method within the :py:class:`~roboticstoolbox.ETS` class + :meth:`ik_GN` + The fast, C++-backed equivalent of this method (requires the compiled extension) .. versionchanged:: 1.0.4 @@ -1564,7 +1564,7 @@ def ikine_QP( has shape (N, n), ``success`` is True only if every pose succeeded, and ``residual`` is the maximum over the poses. See :meth:`~roboticstoolbox.robot.IK.IKSolver.solve`. - .. versionchanged:: 1.4.5 + .. versionchanged:: 1.5.0 For a trajectory, ``residual`` is the maximum over the poses, it was the minimum. @@ -1640,8 +1640,8 @@ def ikine_QP( :math:`\dvec{q}^{-,+}` are the minimum and maximum joint velocities, and :math:`\dvec{\delta}^{-,+}` are the minimum and maximum slack velocities. - Examples - -------- + .. rubric:: Examples + The following example gets a ``panda`` robot object, makes a goal pose ``Tep``, and then solves for the joint coordinates which result in the pose ``Tep`` using the `ikine_QP` method. @@ -1667,16 +1667,16 @@ def ikine_QP( - J. Haviland, and P. Corke. "Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications." arXiv preprint arXiv:2207.01794 (2022). - See Also - -------- - :py:class:`~roboticstoolbox.robot.IK.IK_QP` - An IK Solver class which implements a quadratic programming approach - ikine_LM - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_LM` class as a method within the :py:class:`~roboticstoolbox.ETS` class - ikine_GN - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_GN` class as a method within the :py:class:`~roboticstoolbox.ETS` class - ikine_NR - Implements the :py:class:`~roboticstoolbox.robot.IK.IK_NR` class as a method within the :py:class:`~roboticstoolbox.ETS` class + .. seealso:: + + :py:class:`~roboticstoolbox.robot.IK.IK_QP` + An IK Solver class which implements a quadratic programming approach + ikine_LM + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_LM` class as a method within the :py:class:`~roboticstoolbox.ETS` class + ikine_GN + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_GN` class as a method within the :py:class:`~roboticstoolbox.ETS` class + ikine_NR + Implements the :py:class:`~roboticstoolbox.robot.IK.IK_NR` class as a method within the :py:class:`~roboticstoolbox.ETS` class .. versionchanged:: 1.0.4 diff --git a/src/roboticstoolbox/robot/symbolic_ik_rr.py b/src/roboticstoolbox/robot/symbolic_ik_rr.py index a10ff397a..286a3e96b 100644 --- a/src/roboticstoolbox/robot/symbolic_ik_rr.py +++ b/src/roboticstoolbox/robot/symbolic_ik_rr.py @@ -1248,7 +1248,7 @@ class AnalyticIK(ABC): - :meth:`ikine` gives *one* solution for each pose, the nearest to ``q0``, for a pose or a trajectory, as :meth:`~roboticstoolbox.robot.Robot.Robot.ikine_LM` does - .. versionadded:: 1.6.0 + .. versionadded:: 1.5.0 """ #: name of the method, for messages diff --git a/src/roboticstoolbox/tools/data.py b/src/roboticstoolbox/tools/data.py index e28e701eb..ba1039b74 100644 --- a/src/roboticstoolbox/tools/data.py +++ b/src/roboticstoolbox/tools/data.py @@ -51,7 +51,7 @@ def rtb_load_matfile(filename: Any) -> Any: - MATLAB structs are converted to Python dicts, but extended so that elements can be accessed using dot notation. - :seealso: :func:`path_to_datafile` + .. seealso:: :func:`path_to_datafile` """ from scipy.io import loadmat @@ -98,7 +98,7 @@ def rtb_load_jsonfile(filename: Any) -> Any: - If the filename has no path component, eg. ``map1.mat`, it will be first be looked for in the folder ``roboticstoolbox/data``. - :seealso: :func:`path_to_datafile` + .. seealso:: :func:`path_to_datafile` """ import json @@ -129,7 +129,7 @@ def rtb_load_data(filename: Any, handler: Any, **kwargs: Any) -> Any: .. note:: If the filename has no path component, eg. ``foo.dat``, it will first be looked for in the folder ``roboticstoolbox/data``. - :seealso: :func:`path_to_datafile` + .. seealso:: :func:`path_to_datafile` """ path = rtb_path_to_datafile(filename, local=False) return handler(path, **kwargs) diff --git a/src/roboticstoolbox/tools/plot.py b/src/roboticstoolbox/tools/plot.py index 7f7b437de..3a1e1ff5d 100644 --- a/src/roboticstoolbox/tools/plot.py +++ b/src/roboticstoolbox/tools/plot.py @@ -169,7 +169,7 @@ def xplot( t = np.linspace(0, 2, 50) # with a time vector rtb.xplot(t, tg.q) - :seealso: :func:`~roboticstoolbox.tools.trajectory.jtraj`, :func:`numpy.unwrap` + .. seealso:: :func:`~roboticstoolbox.tools.trajectory.jtraj`, :func:`numpy.unwrap` .. versionchanged:: 1.5.0 ``block=None`` does not call ``plt.show``, as documented. It used to call diff --git a/src/roboticstoolbox/tools/trajectory.py b/src/roboticstoolbox/tools/trajectory.py index be1e73b97..fd6612019 100644 --- a/src/roboticstoolbox/tools/trajectory.py +++ b/src/roboticstoolbox/tools/trajectory.py @@ -197,7 +197,7 @@ def plot( - ``trapezoidal`` color code the different motion phases - ``jtraj`` general m-axis trajectory, show legend - :seealso: :func:`~quintic`, :func:`~trapezoidal` + .. seealso:: :func:`~quintic`, :func:`~trapezoidal` .. versionchanged:: 1.5.0 ``block=None`` does not call ``plt.show``, as documented. It used to call @@ -303,7 +303,7 @@ def qplot(self, **kwargs: Any) -> None: Plots a multi-axis trajectory, held within the object, as position against time. - :seealso: ``xplot`` + .. seealso:: ``xplot`` """ # deferred, the plot module is imported after this one by the package from roboticstoolbox.tools.plot import xplot @@ -383,7 +383,7 @@ def quintic( - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 3. - :seealso: :func:`trapezoidal`, :func:`mtraj`. + .. seealso:: :func:`trapezoidal`, :func:`mtraj`. """ tv: NDArray if isinstance(t, int): @@ -488,7 +488,7 @@ def quintic_func( ``method``. A zero or non-finite ``T`` raises ``ValueError``, where it previously gave a degenerate result. - :seealso: :func:`quintic` :func:`trapezoidal_func` + .. seealso:: :func:`quintic` :func:`trapezoidal_func` """ if method not in ("lstsq", "hermite"): raise ValueError(f"unknown method {method!r}, must be 'lstsq' or 'hermite'") @@ -656,7 +656,7 @@ def trapezoidal( - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 3. - :seealso: :func:`quintic`, :func:`trapezoidal_func` :func:`mtraj`. + .. seealso:: :func:`quintic`, :func:`trapezoidal_func` :func:`mtraj`. """ tv: NDArray @@ -863,7 +863,7 @@ def mtraj( :References: - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 3. - :seealso: :func:`quintic`, :func:`trapezoidal` + .. seealso:: :func:`quintic`, :func:`trapezoidal` """ if not callable(tfunc): @@ -932,7 +932,7 @@ def jtraj( - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 3. - :seealso: :func:`ctraj`, ``xplot``, :func:`~roboticstoolbox.tools.trajectory.jtraj` + .. seealso:: :func:`ctraj`, ``xplot``, :func:`~roboticstoolbox.tools.trajectory.jtraj` """ # print(f" --- jtraj: {q0} --> {q1} in {tv}") if isinstance(t, int): @@ -1040,7 +1040,7 @@ def ctraj( :References: - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 3. - :seealso: ``trapezoidal``, + .. seealso:: ``trapezoidal``, ``interp`` """ @@ -1164,7 +1164,7 @@ def mstraj( :References: - Robotics, Vision & Control in Python, 3e, P. Corke, Springer 2023, Chap 3. - :seealso: :func:`trapezoidal`, :func:`ctraj`, :func:`mtraj` + .. seealso:: :func:`trapezoidal`, :func:`ctraj`, :func:`mtraj` """ # q0 is overwritten below by the last point of the linear motion, as it diff --git a/src/roboticstoolbox/tools/trchain.py b/src/roboticstoolbox/tools/trchain.py index 9dcd58946..9c1f8a60c 100644 --- a/src/roboticstoolbox/tools/trchain.py +++ b/src/roboticstoolbox/tools/trchain.py @@ -197,7 +197,7 @@ def trchain( calls to named functions. Names other than joint variables are supplied by ``variables``. - :seealso: :func:`trchain2`, :class:`roboticstoolbox.ETS` + .. seealso:: :func:`trchain2`, :class:`roboticstoolbox.ETS` """ result = _evaluate_chain(chain, q, unit, qvar, variables, _TRANSFORMS_3D, 4) return result if return_tokens else result[0] @@ -226,7 +226,7 @@ def trchain2( The chain contains ``R`` (or ``Rz``), ``Tx``, and ``Ty`` tokens. Expressions are evaluated as described by :func:`trchain`. - :seealso: :func:`trchain`, :class:`roboticstoolbox.ETS2` + .. seealso:: :func:`trchain`, :class:`roboticstoolbox.ETS2` """ result = _evaluate_chain(chain, q, unit, qvar, variables, _TRANSFORMS_2D, 3) return result if return_tokens else result[0] diff --git a/tests/test_Robot.py b/tests/test_Robot.py index b2032274a..fed0e8795 100644 --- a/tests/test_Robot.py +++ b/tests/test_Robot.py @@ -1093,7 +1093,7 @@ def test_jtraj_unexpected_keyword(self): r.jtraj(r.qz, r.qr, 5, foo=1) def test_jtraj_rejects_poses(self): - # deprecated in 1.4.5, the message says what to do instead + # deprecated in 1.5.0, the message says what to do instead for r in (rtb.models.Panda(), rtb.models.DH.Puma560()): T = r.fkine(r.qr) diff --git a/tests/test_mobile_bug2.py b/tests/test_mobile_bug2.py index c9380b747..94f3dddb2 100644 --- a/tests/test_mobile_bug2.py +++ b/tests/test_mobile_bug2.py @@ -74,7 +74,7 @@ def test_diagonal_m_line_through_corners(self): nt.assert_array_equal(path[-1], [17, 17]) def test_house_path_length(self): - # the example in the book, Fig 5.5: 1302 points since 1.4.5, 1307 before + # the example in the book, Fig 5.5: 1302 points since 1.5.0, 1307 before from roboticstoolbox import rtb_load_matfile house = rtb_load_matfile("data/house.mat") diff --git a/tests/test_planner_unknown_keywords.py b/tests/test_planner_unknown_keywords.py index 89ca25ca4..ba1947114 100644 --- a/tests/test_planner_unknown_keywords.py +++ b/tests/test_planner_unknown_keywords.py @@ -1,7 +1,7 @@ """ Unknown keyword arguments to the planners' constructor and plot methods. -RTB 1.4.4 silently swallowed them (``**unused``), RTB 1.4.5 first made them an +RTB 1.4.4 silently swallowed them (``**unused``), RTB 1.5.0 first made them an error, which broke code printed in the book, for example ``dx.plot(nonsense=True)``. They are ignored with a ``DeprecationWarning``. """