IK_QP  Numerical IK with Quadratic Programming
 class roboticstoolbox.robot.IK.IK_QP(name='IK Solver', ilimit=30, slimit=100, tol=1e06, mask=None, joint_limits=True, seed=None, kj=0.01, ks=1.0, kq=0.0, km=0.0, ps=0.0, pi=0.3, **kwargs)[source]
Bases:
IKSolver
Quadratic Progamming Numerical Inverse Kinematics Solver
A class which provides functionality to perform numerical inverse kinematics (IK) using a quadratic progamming approach. See
step
method for mathematical description. Parameters:
name (
str
) – The name of the IK algorithmilimit (
int
) – How many iterations are allowed within a search before a new search is startedslimit (
int
) – How many searches are allowed before being deemed unsuccessfultol (
float
) – Maximum allowed residual error Emask (
Union
[ndarray
,List
[float
],Tuple
[float
],Set
[float
],None
]) – A 6 vector which assigns weights to Cartesian degreesoffreedom error priorityjoint_limits (
bool
) – Reject solutions with joint limit violationsseed (
Optional
[int
]) – A seed for the private RNG used to generate random joint coordinate vectorskj – A gain for joint velocity norm minimisation
ks – A gain which adjusts the cost of slack (intentional error)
kq (
float
) – The gain for joint limit avoidance. Setting to 0.0 will remove this completely from the solutionkm (
float
) – The gain for maximisation. Setting to 0.0 will remove this completely from the solutionps (
float
) – The minimum angle/distance (in radians or metres) in which the joint is allowed to approach to its limitpi (
Union
[ndarray
,float
]) – The influence angle/distance (in radians or metres) in null space motion becomes active
 Raises:
ImportError – If the package
qpsolvers
is not installed
Examples
The following example gets the
ets
of apanda
robot object, instantiates theIK_QP
solver class using default parameters, makes a goal poseTep
, and then solves for the joint coordinates which result in the poseTep
using thesolve
method.Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'solver' is not defined
Notes
When using the this method, the initial joint coordinates \(q_0\), should correspond to a nonsingular manipulator pose, since it uses the manipulator Jacobian. When the the problem is solvable, it converges very quickly.
References
J. Haviland, and P. Corke. “Manipulator Differential Kinematics Part II: Acceleration and Advanced Applications.” arXiv preprint arXiv:2207.01794 (2022).
See also
Changed in version 1.0.3: Added the Quadratic Programming IK solver class
Methods

Performs a single iteration of the GaussNewton optimisation method 

Solves the IK problem 

Calculates the error between Te and Tep 
Private Methods

Generate a random valid joint configuration using a private RNG 

Checks if the joints are within their respective limits 