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:rpc
Then, you can operate through the commands listed below.
>> target x y
where x
and y
are the new Cartesian coordinates of the target in the range [-250,250].
>> mode m
where m
is a string specifying the new mode among the following options:
t
for the Jacobian Transposeinv
for the Jacobian (Pseudo-)inversedls
for the Damped Least Squaresidle
for putting the controller in idle.
>> planner m
where m
can be on
or off
.
>> gain g k
where g
is gain value (K = g*eye(2)) and k
is parameter in DLS method.
>> visu v
where v
can be:
0
to stop visualization1
to start visualization2
to clear visualization