IK_LM - Levemberg-Marquadt Numerical IK
- class roboticstoolbox.robot.IK.IK_LM(name='IK Solver', ilimit=30, slimit=100, tol=1e-06, mask=None, joint_limits=True, seed=None, k=1.0, method='chan', kq=0.0, km=0.0, ps=0.0, pi=0.3, **kwargs)
Levemberg-Marquadt Numerical Inverse Kinematics Solver
A class which provides functionality to perform numerical inverse kinematics (IK) using the Levemberg-Marquadt method. See
stepmethod for mathematical description.
str) – The name of the IK algorithm
int) – How many iterations are allowed within a search before a new search is started
int) – How many searches are allowed before being deemed unsuccessful
float) – Maximum allowed residual error E
bool) – Reject solutions with joint limit violations
float) – Sets the gain value for the damping matrix Wn in the
stepmethod. See notes
method – One of “chan”, “sugihara” or “wampler”. Defines which method is used to calculate the damping matrix Wn in the
float) – The gain for joint limit avoidance. Setting to 0.0 will remove this completely from the solution
float) – The gain for maximisation. Setting to 0.0 will remove this completely from the solution
float) – The minimum angle/distance (in radians or metres) in which the joint is allowed to approach to its limit
The following example gets the
pandarobot object, instantiates the IK_LM solver class using default parameters, makes a goal pose
Tep, and then solves for the joint coordinates which result in the pose
>>> import roboticstoolbox as rtb >>> panda = rtb.models.Panda().ets() >>> solver = rtb.IK_LM() >>> Tep = panda.fkine([0, -0.3, 0, -2.2, 0, 2, 0.7854]) >>> solver.solve(panda, Tep) IKSolution(q=array([-1.6464, -1.1822, 1.0484, -2.1051, 1.0311, 1.4364, 0.0173]), success=True, iterations=188, searches=17, residual=3.9241014186806444e-08, reason='Success')
The value for the
kkwarg will depend on the
methodchosen and the arm you are using. Use the following as a rough guide
chan, k = 1.0 - 0.01,
wampler, k = 0.01 - 0.0001, and
sugihara, k = 0.1 - 0.0001
When using the 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.
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).
Changed in version 1.0.3: Added the Levemberg-Marquadt IK solver class
Performs a single iteration of the Levenberg-Marquadt optimisation
Solves the IK problem
Calculates the error between Te and Tep
Generate a random valid joint configuration using a private RNG
Checks if the joints are within their respective limits