10.08.2013 Views

thesis - Computer Graphics Group - Charles University - Univerzita ...

thesis - Computer Graphics Group - Charles University - Univerzita ...

thesis - Computer Graphics Group - Charles University - Univerzita ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.4. JOINTS 99<br />

primary constraints, equals<br />

a = ˆ M −1 · F = M −1 · ( F + J T · λ F ), (7.1)<br />

which can be seen as a modified version of the equation of motion (5.23) that directly incorporates the effects of<br />

the primary constraints.<br />

If we have a set of auxiliary constraints formulated in the matrix form as Jaux · a = caux, where a is the total<br />

acceleration of the system after all forces are applied, then the constraint force to maintain the auxiliary constraints<br />

will again equal J T aux · µ, where µ is the vector of Lagrange multipliers due to these constraints. By utilizing (7.1),<br />

we realize that it is required that<br />

Jaux · ( ˆ M −1 · ( Ftotal + J T aux · µ)) = caux, (7.2)<br />

which says that auxiliary constraints and primary constraints must hold (the conditions on the primary constraints<br />

are “hidden” in ˆ M −1 ). This can be rewritten as Jaux · ˆ M −1 · J T aux · µ = caux − Jaux · ˆ M −1 · Ftotal. Considering that<br />

auxiliary constraints might impose limits on µ, we obtain a LCP in the form of A · µ + b = 0 with µlo ≤ µhi limits,<br />

where A = Jaux · ˆ M −1 · J T aux and b = Jaux · ˆ M −1 · Ftotal − caux. If we had access to ˆ M −1 we could build A and b<br />

exactly in the same way like we did it at (6.8). The good news is that matrix ˆ M −1 need not actually be computed<br />

at all and the coefficients of A and b can be computed in terms of F , M −1 and J T · λ F from (7.1). Indeed, the<br />

i-th column of matrix A, denoted Ai, can be computed as Ai = (Jaux · ˆ M −1 · J T aux)i = Jaux · ( ˆ M −1 · J T aux)i =<br />

Jaux · ( ˆ M −1 · (J T aux)i) = Jaux · (M −1 · ((J T aux)i + J T · λ (J T aux ) i )) and b = Jaux · (M −1 · ( Ftotal + J T · λ Ftotal )) − caux.<br />

The solver identifies the primary and auxiliary constraints, orders the block columns (rows) of matrix H ′ , builds<br />

and solves the LCP to obtain the auxiliary constraint force J T aux · µ (that anticipates the response of the primary<br />

constraints to Ftotal + J T aux · µ) and exerts it on the system, yielding the new total external force Ftotal + J T aux · µ.<br />

Primary constraint force J T · λ Ftotal+J T aux ·µ is then computed with respect to Ftotal +J T aux · µ and exerted. Primary<br />

constraints will obviously hold then and auxiliary constraints will hold as well, because the effects of the primary<br />

constraint force were anticipated when µ was computed, see (7.2).<br />

7.3.6 LCP Solver<br />

Linear Complementarity Problem Solver library abstracts LCP problems and implements<br />

LCP solvers. Class BasicLCP abstracts pure and mixed LCP problems, class LoHiLCP lo-hi<br />

LCP problems. There are several solver implementations — DebugBasicLCPSolver solves<br />

basic LCP problems and proceeds directly as described by Baraff in [7], BasicLCPSolver is<br />

the optimized version of the basic LCP solver and LoHiLCPSolver is the generalized basic<br />

solver outlined in section (6.2.5) capable of solving lo-hi LCP problems. BasicLCPSolver and<br />

LoHiLCPSolver solvers are implemented as template classes parametrized by traits classes that<br />

hide the manipulation with the slices of matrix A and vectors b, λ, λ lo , λ hi . That way, we are<br />

able to provide optimized and unoptimized variants of the solvers, where the optimized versions<br />

permute rows and columns of A (and the rows of vectors b, λ, λ lo , λ hi ) during the course of<br />

solving the LCP in order to minimize memory transfers while updating ACC and allow to access<br />

ACC slices efficiently. These optimization tricks were adopted from [22].<br />

7.4 Joints<br />

Simulator library provides the implementation of certain joint classes that can be used to connect<br />

bodies by virtual hinges or nails, restrict and control rotations about specified axes, implement<br />

various motors, etc. Joints allow to build articulated structures and simulate other types of<br />

objects than mere rigid bodies.<br />

Built-in joint support can be separated to two categories, the category of anchors, used to<br />

anchor bodies, and the category of motors, allowing to control joint angles, displacements along<br />

axes, rotation speeds, etc. Since joints are (basically) formulated in terms of their Jacobian blocks,<br />

right-hand side vectors and softness parameters, one can implement new joint types by providing

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!