The TF2 Library and Erdf model of our robot, where we define the reference frames and connected them
through transformation matrices allowed us to solve the forward kinematics problem.
In other words, they allowed us to know the position and the orientation of the robot's gripper at
any given moment in time.
Given the position and the angle of each joint of the robot.
Now we are ready to face the opposite problem, which is defining the position and the orientation of
the robot's gripper in space and calculating the joint angles.
The motor position that brings the arm to the desired position.
But first, let's recap why we need the inverse kinematics.
Winning.
One of the previous lessons we tried to grasp an object using only these sliders that move the joint
separately.
We encountered some difficulties.
This was because we were trying to lower or raise the gripper or to move it to the right or to the left
without actually having direct control over the gripper movements, but only of the movements of the
robot's joints.
Instead what we would like to do and what would be more intuitive and user friendly is to directly control
the movement of the gripper without worrying about the values of each joint angle.
However, we can't completely ignore these angles.
We cannot overlook their existence because they represent the angle of the motor.
The position commands that we need to send to the robot's motors.
This is where the inverse kinematics comes into play.
Since we would like to think in absolute terms of the position and the orientation of the gripper in
space, but still we need to know the joint angles corresponding to a specific position and orientation
of the robot.
We need a mathematical tool that allows us to make this conversion.
And this is precisely the inverse kinematics.
The problem of the inverse kinematics is much more complex to solve because as you can see from this
illustration taken from the book Robotics by Vico Siciliano, Villani and Oriolo, there can be multiple
configurations, multiple joints combination that result in the robot's gripper being in the same position.
We see how the robot's gripper so the end effector can be in the same position using four different
configurations, namely four different combinations of the joint angles.
While the problem of direct kinematics as a unique solution, the inverse kinematic problem may have
multiple solution not unique and different from each other.
In some cases, there may even be no configuration at all that satisfies the condition.
Or also there might be infinite possible solutions.
For this reason, at least regarding the inverse kinematics, we are not going to study the mathematics
in detail, both because sometimes it is not possible to reach a unique solution and because often numerical
techniques are used to solve the inverse kinematic problem instead of analytical ones.
That is, algorithms that are used for optimization that recursively seek the best solution to an inverse
kinematics problem.
Again, the open source robotics community doesn't leave us alone in facing this problem.
In Russia, there is a library, a software called Movie2, which provides us not only with solvers
for inverse kinematics calculation, but also with a trajectory planning system for manipulator robots.
Move it to, like all the open source libraries needs to be configured and needs to know the urdf model
of the robot and a few other pieces of information.
Then it is capable of solving the inverse kinematic problem for any robot manipulator with any architecture.
Furthermore, it allows us to move the gripper into three dimensional space and automatically calculate
the trajectory that each robot joint must follow to move the gripper from its initial position to the
final one while avoiding obstacles.
In the next lesson, we will configure moving shoe for our robot.
Meaning for the Urdf model of our robot.
And once configured we can use its interface to directly move the gripper in space and send actions
directly to the gripper.