With this code example, we aim to guide you through the theory and the practical implementation of those methods that are traditionally employed to solve the Inverse Kinematics (IK) problem.
In particular, we explore the pros and cons of the following algorithms for the Differential IK applied to the 2-links serial manipulator shown in the animation below:
- Jacobian Transpose
- Jacobian (Pseudo-)inverse
- Damped Least Squares
Finally, we will also see the advantages of relying on trajectory planning.
Once you launched the application in app/scripts, establish a RPC communication with the controller by doing:
yarp rpc /tutorial_inverse-kinematics-controller/cmd:rpcThen, you can operate through the commands listed below.
>> target x ywhere x and y are the new Cartesian coordinates of the target in the range [-250,250].
>> mode mwhere m is a string specifying the new mode among the following options:
tfor the Jacobian Transposeinvfor the Jacobian (Pseudo-)inversedlsfor the Damped Least Squaresidlefor putting the controller in idle.
>> planner mwhere m can be on or off.
>> gain g kwhere g is gain value (K = g*eye(2)) and k is parameter in DLS method.
>> visu vwhere v can be:
0to stop visualization1to start visualization2to clear visualization
