ETS.ikine_GN

ETS.ikine_GN(Tep, q0=None, ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, seed=None, pinv=False, kq=0.0, km=0.0, ps=0.0, pi=0.3, **kwargs)[source]

Gauss-Newton numerical inverse kinematics solver

Parameters:
  • Tep (ndarray | SE3) – the desired end-effector pose

  • q0 (Union[ndarray, List[float], Tuple[float, ...], None]) – the initial joint coordinate vector

  • ilimit (int) – maximum iterations allowed per search

  • slimit (int) – maximum search attempts before failure

  • tol (float) – maximum allowed residual error E

  • mask (Union[ndarray, List[float], Tuple[float, ...], None]) – a 6-vector weighting Cartesian DoF error priority

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

  • seed (int | None) – seed for the RNG used to generate random joint configurations

  • pinv (bool) – use the pseudo-inverse in the step method instead of the normal inverse

  • kq (float) – gain for joint limit avoidance (0.0 disables)

  • km (float) – gain for manipulability maximisation (0.0 disables)

  • ps (float) – minimum joint approach distance to limit (radians or metres)

  • pi (ndarray | float) – null-space influence distance (radians or metres)

Returns:

IK solution

A method which provides functionality to perform numerical inverse kinematics (IK) using the Gauss-Newton method.

See the Inverse Kinematics Docs Page for more details and for a tutorial on numerical IK, see here.

When using this method with redundant robots (>6 DoF), pinv must be set to True.

Each iteration uses the Gauss-Newton optimisation method

\[\begin{split}\vec{q}_{k+1} &= \vec{q}_k + \left( {\mat{J}(\vec{q}_k)}^\top \mat{W}_e \ {\mat{J}(\vec{q}_k)} \right)^{-1} \bf{g}_k \\ \bf{g}_k &= {\mat{J}(\vec{q}_k)}^\top \mat{W}_e \vec{e}_k\end{split}\]

where \(\mat{J} = {^0\mat{J}}\) is the base-frame manipulator Jacobian. If \(\mat{J}(\vec{q}_k)\) is non-singular, and \(\mat{W}_e = \mat{1}_n\), then the above provides the pseudoinverse solution. However, if \(\mat{J}(\vec{q}_k)\) is singular, the above can not be computed and the GN solution is infeasible.

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 Tep using the ikine_GN method.

>>> import roboticstoolbox as rtb
>>> panda = rtb.models.Panda().ets()
>>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854])
>>> panda.ikine_GN(Tep)
IKSolution(q=array([-1.9191,  0.4025, -1.4427, -2.1148,  1.4821,  0.8744, -0.9293]), success=False, iterations=100, searches=100, residual=0.0, reason='iteration and search limit reached, 100 numpy.LinAlgError encountered')

Notes

When using this method, the initial joint coordinates \(q_0\), should correspond to a non-singular manipulator pose, since it uses the manipulator Jacobian.

This class supports null-space motion to assist with maximising manipulability and avoiding joint limits. These are enabled by setting kq and km to non-zero values.

References

  • J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part I: Kinematics, Velocity, and Applications.” arXiv preprint arXiv:2207.01796 (2022).

  • J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).

See also

ikine_LM() ikine_NR() ikine_QP()

Changed in version 1.0.4: Added the Gauss-Newton IK solver method on the ETS class