i
i
i
i
i
i
i
i
272 11. Navigation and Movement in VR
It is much simpler to understand IK in 2D, so this is where we will begin.
The solution of the 3D IK problem follows exactly the same conceptual argu-
ment as that used in 2D. It is only in setting up the problem that differences
occur; thus, we will use a 2D example to present a rigorous method of the
solution.
11.4.1 The IK Problem
For a robot used as a surrogate human on a production line, an important
design feature is that the hand can approach the working materials at the
correctangle.Todothis,theremustbe enough linkages from the place where
the robot is anchored to its hand and each link must have sufficient degrees
of freedom. If the robot can put its hand in the correct place then the next
question is how does it get there? It may be starting from a rest position or
the place in which it has just finished a previous task. From the operator ’s
point of view, it would be helpful if she only had to move the robots hand,
not adjust every link from base to hand. However, the hand is obviously at
the end of the articulated linkage, and it is the relative orientation of these
links that dictate where the hand is.
Let’s assume that each links orientation is given by the set (
1
,
2
, ...
n
).
To simplify matters, we can group these linkages into a vector given by ,
where
=
1 2
...
n
T
.
Similarly, we can say that the position of each linkage within the articulation
is given by X,where
X =
x
1
x
2
... x
n
T
.
We can then further say that the location of the end of the articulation X is
given by some function,
X = f (
). (11.8)
Thus, if we know the orientation of each of the links connected to the effec-
tor, we can compute its position. This process is called forward kinematics.
However, in a typical environment, the operator of the articulated linkage is
really only concerned with setting the position of the effector and not with
deriving it from linkage orientation values. Thus we enter the realm of in-
verse kinematics. That is, knowing the position we require the effector X to
take, can we determine the required position and orientation of the adjoining
linkages to take the effector to this position and orientation?
i
i
i
i
i
i
i
i
11.4. Inverse Kinematics 273
To solv e this problem, we must find the inverse of the function f () so that
we can write Equation (11.8) as
= f
1
(X). (11.9)
It should be stressed that it may not be possible for the effector to reach the
desired position X, and hence we call it a goal.
Since X and
are both vectors, it may be possible to rewrite Equa-
tion (11.8) in matrix form assuming the function f () is linear:
X = A
, (11.10)
and hence we can solve it for
by calculating the inverse of A:
= A
1
X.
Unfortunately, except for the simplest linkages, f () is a nonlinear function
and therefore it is not possible to express Equation (11.8) in the form given by
Equation (11.10). To solve this pr oblem, we must use an iterative technique
which is essentially the same as that used for finding the solution of a set of
simultaneous nonlinear equations. McCalla [2] (for example) describes the
usual procedure.
The key to inverse kinematics is to try to linearize Equation (11.8) by
expressing it in differential form:
X = f
( ) , (11.11)
and then incrementally stepping towards the solution. Since f () is a multi-
variable function, f
(), the Jacobian matrix of partial derivatives, is given by
J(
) =
X
1
1
X
1
2
...
X
1
n
X
2
1
X
2
2
...
X
2
n
... ... ... ...
X
m
1
X
m
2
...
X
m
n
.
By calculating an inverse for J, Equation (11.11) may be written:
= J
1
X.
i
i
i
i
i
i
i
i
274 11. Navigation and Movement in VR
The Jacobian J is of course dependent on , so an initial guess must be made
for the values
1
,
2
..
n
. In the case of the IK problem, the initial guess
is simply the current configuration. After the first step, we proceed to find a
new
by iterating:
n+1
=
n
+ =
n
+ J
1
X,
where n is a count of the number of iterations, and at each step J
1
is recal-
culated from the current
n
.
11.4.2 Solving the IK Problem in Two Dimensions
We will look at an example of a three-link articulation. Because it’s restricted
to two dimensions, it moves only in the plane of the page. When equations
have been obtained for this specific case, we will see how they may be ex-
tended to a system with n links. The links are fixed at one end, which we will
designate as the origin (0, 0). The other end, at point (x, y), is moved towards
a goal point, which it may or may not reach. We hope a solution to the IK
problem will reveal where it gets to.
A solution of Equation (11.9) gives us the orientation of each link in the
chain, and from that we can find out how close to the goal the endpoint
actually gets. F igure 11.7(a) illustrates several possible configurations for a
three-link articulation, and Figure 11.7(b) gives the notation used to specify
and solve the three-link IK problem. The first link is anchored at (0, 0) and
lies at an angle of
1
to the x-axis. The lengths of the links are l
1
, l
2
and
l
3
, and link 2 makes an angle of
2
from link 1. The endpoint P
4
lies at
coordinate (x, y).
Figure 11.7(b) shows us that if we know the values of P
1
(anchor point),
l
1
, l
2
, l
3
(lengths of the links),
1
,
2
and
3
(the relative orientation between
one link and the next) then the current position of every joint in the link is
fully specified (including the endpoint P
4
).
Since P
1
, l
1
, l
2
and l
3
are constant and independent of the orientation
of the linkage, only the
i
are the unknowns in our IK function, Equa-
tion (11.9). For our specific example,
P
4
= f(
1
,
2
,
3
).
Note carefully how
i
is specified as an angle measured anti-clockwise
from the direction in which link (i 1) is pointing to the direction in which
i
i
i
i
i
i
i
i
11.4. Inverse Kinematics 275
Figure 11.7. (a) Several possible orientations for a three-link two-dimensional artic-
ulated figure. In (1) and (2), the articulation reaches to the same endpoint. (b) A
three-link articulation.
link i is pointing. The first link angle
1
is referenced to the x-axis. Using
this information, we can write an expression for the (x, y)-coordinate of P
4
:
x
y
=
l
1
cos(
1
) + l
2
cos(
1
+
2
) + l
3
cos(
1
+
2
+
3
)
l
1
sin(
1
) + l
2
sin(
1
+
2
) + l
3
sin(
1
+
2
+
3
)
.
(11.12)
Equation (11.12) shows that f (
1
,
2
,
3
) is, as expected, a nonlinear
function. Therefore, we will need to solve the IK problem by linearizing
Equation (11.12) and iterating towards the desired goal position of P
4
.The
first step in this procedure is to obtain the Jacobian. For the 2D IK problem
i
i
i
i
i
i
i
i
276 11. Navigation and Movement in VR
of three links, this is the 2 × 3matrix:
J =
x
1
x
2
x
3
y
1
y
2
y
3
.
The terms
i
are obtained by differentiating Equation (11.12) to give
J =
J
11
J
12
J
13
J
21
J
22
J
23
, (11.13)
where
J
11
= l
1
sin(
1
) l
2
sin(
1
+
2
) l
3
sin(
1
+
2
+
3
);
J
12
= l
2
sin(
1
+
2
) l
3
sin(
1
+
2
+
3
);
J
13
= l
3
sin(
1
+
2
+
3
);
J
21
= l
1
cos(
1
) + l
2
cos(
1
+
2
) + l
3
cos(
1
+
2
+
3
);
J
22
= l
2
cos(
1
+
2
) + l
3
cos(
1
+
2
+
3
);
J
23
= l
3
cos(
1
+
2
+
3
).
Once J has been calculated, we are nearly ready to go through the iteration
process that moves P
4
towards its goal. An algorithm for this will be based on
the equations
n+1
=
n
+ J(
n
)
1
X;
X
n+1
= f (
n+1
).
Unfortunately, because J is a non-square matrix, we cannot just look to the
conventional methods such as Gauss elimination to obtain its inverse J
1
.
However, non-square matrices can have what is called a generalized inverse.Of
course, for underdetermined systems, there can be no unique solution, but a
generalized inverse of J is quite sufficient for our uses of IK. Appendix B gives
a little background about generalized inverses.
Iterating Towards the Goal
Having found a way to invert J, we develop an algorithm to iterate from one
configuration towards the goal. A suitable algorithm is given in Figure 11.8.
Step 4 of the algorithm provides the mechanism to test for convergence
of the IK solution procedure. It is based on ensuring that the norm of the
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.18.198