roboticstoolbox.robot.IK.IK_LM.solve

IK_LM.solve(ets, Tep, q0=None)

Solves the IK problem

Parameters:
  • ets (ETS) – The ETS representing the manipulators kinematics

  • Tep (SE3 | ndarray | Sequence[float]) – The desired end-effector pose

  • q0 (ndarray | Sequence[float] | None) – The initial joint coordinates, a vector (n,), or a matrix (m, n) whose rows are the starting points of the first m searches (any further searches start from random valid coordinates)

Returns:

An IKSolution containing joint coordinates q, success flag, iterations, searches, residual error value, and reason string if applicable

Return type:

IKSolution

This method will attempt to solve the IK problem and obtain joint coordinates which result the the end-effector pose Tep.

If Tep is an SE3 containing more than one pose, or an array with shape (N, 4, 4), it is treated as a trajectory of N poses. Each pose is solved independently, using the same initial coordinates q0 (and the same random restarts) for every pose, so consecutive solutions are not guaranteed to lie on the same IK branch. The returned IKSolution has:

  • q with shape (N, n), one row per pose

  • success True only if every pose was solved

  • iterations and searches summed over all poses

  • residual the maximum residual over all poses, the worst case

  • reason the reason given by the last pose that failed, if any

Changed in version 1.4.5: For a trajectory, residual is now the maximum over the poses, previously it was the minimum, which hid poses that were solved badly.