ETS.ik_NR
- ETS.ik_NR(Tep, q0=None, ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, pinv=True, pinv_damping=0.0)[source]
Fast numerical inverse kinematics using Newton-Raphson optimisation
- Parameters:
Tep (
ndarray|SE3) – the desired end-effector pose or pose trajectoryq0 (
ndarray|None) – initial joint configuration (random valid configuration if not supplied)ilimit (
int) – maximum number of iterations per searchslimit (
int) – maximum number of search attemptstol (
float) – final error tolerancemask (
ndarray|None) – a 6-vector weighting end-effector error priority (XYZ translation, XYZ rotation)joint_limits (
bool) – reject solutions with invalid joint configurationspinv (
int) – use the pseudo-inverse instead of the normal matrix inversepinv_damping (
float) – damping factor for the pseudo-inverse
- Returns:
tuple (q, success, iterations, searches, residual)
- Return type:
sol = ets.ik_NR(Tep)are the joint coordinates (n) corresponding to the robot end-effector poseTepwhich is anSE3orndarrayobject. This method can be used for robots with any number of degrees of freedom. This is a fast solver implemented in C++.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),
pinvmust be set toTrue.If
success == 0theqvalues will be valid numbers, but the solution will be in error. The amount of error is indicated by theresidual.Each iteration uses the Newton-Raphson optimisation method
\[\vec{q}_{k+1} = \vec{q}_k + {^0\mat{J}(\vec{q}_k)}^{-1} \vec{e}_k\]Examples
The following example gets the
etsof apandarobot object, makes a goal poseTep, and then solves for the joint coordinates which result in the poseTepusing theik_NRmethod.>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda().ets() >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854]) >>> panda.ik_NR(Tep) (array([-1.9204, 0.6377, 2.1494, -2.1664, -0.5755, 1.8434, 1.2343]), 1, 74, 7, 1.5663866774043808e-08)
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.
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).