IKSolver - IK Solver Abstract Base Class

class roboticstoolbox.robot.IK.IKSolver(name='IK Solver', ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, seed=None)[source]

Bases: ABC

An abstract super class for numerical inverse kinematics (IK)

This class provides basic functionality to perform numerical IK. Superclasses can inherit this class and implement the solve method and redefine any other methods necessary.

Parameters:
  • name (str) – The name of the IK algorithm

  • ilimit (int) – How many iterations are allowed within a search before a new search is started

  • slimit (int) – How many searches are allowed before being deemed unsuccessful

  • tol (float) – Maximum allowed residual error E, where \(E = \tfrac{1}{2} \vec{e}^\top \mat{W}_e \vec{e}\) is a quadratic form in the 6-vector angle-axis pose error \(\vec{e}\) (see error()). Because E is quadratic, tol does not bound the linear-scale position/ orientation error directly — with the default unit weighting, components of \(\vec{e}\) are only guaranteed to be within roughly \(\sqrt{2 \cdot \text{tol}}\) (e.g. tol=1e-6 guarantees pose error on the order of 1e-3, not 1e-6). Pick tol accordingly if you need a specific linear-scale accuracy

  • mask (Union[ndarray, List[float], Tuple[float, ...], None]) – A 6 vector which assigns weights to Cartesian degrees-of-freedom error priority

  • joint_limits (bool) – Reject solutions with joint limit violations

  • seed (int | None) – A seed for the private RNG used to generate random joint coordinate vectors

See also

IK_NR Implements this class using the Newton-Raphson method

IK_GN Implements this class using the Gauss-Newton method

IK_LM Implements this class using the Levemberg-Marquadt method

IK_QP Implements this class using a quadratic programming approach

Changed in version 1.0.3: Added the abstract super class IKSolver

Methods

step(ets, Tep, q)

Abstract step method

solve(ets, Tep[, q0])

Solves the IK problem

error(Te, Tep)

Calculates the error between Te and Tep

Private Methods

_random_q(ets[, i])

Generate a random valid joint configuration using a private RNG

_check_jl(ets, q)

Checks if the joints are within their respective limits