Comments on: Weld Constraint http://www.codezealot.org/archives/337 Development blog and open source repository by William Bittle Fri, 26 Dec 2014 01:32:52 +0000 hourly 1 http://wordpress.org/?v=4.0.1 By: c0der http://www.codezealot.org/archives/337#comment-48881 Wed, 19 Dec 2012 23:06:10 +0000 http://www.codezealot.org/?p=337#comment-48881 Thanks William, that helps.

I have temporarily just applied the revolute joint and restricted angle joint separately to both bodies and it seems to be doing the trick.

For the elbow angle:

currAngleDiff = body1.orientation – body2.orientation
if(currAngleDiff.z>=0 && currAngleDiff.z<=radians(130) skip constraint, assuming the arm is straight at first at angle zero

Hope that helps anyone

]]>
By: William http://www.codezealot.org/archives/337#comment-48873 Wed, 19 Dec 2012 20:41:08 +0000 http://www.codezealot.org/?p=337#comment-48873 Yeah, working in 3D is much harder since multiplying out the matrices symbolically is messy. The good thing is, once you have identified the Jacobian you don’t really have to go much further (one reason to go further is to find places where you can improve performance). You can just use the equations below, fill in all the numbers and do the matrix multiplication then.


This should yield a 6×6 matrix (each row has 2 3×3 columns). To solve this we need to have a b vector that is 6×1.


We can see that the first row will yield a 3×1 as will the bottom. So we should be able to solve this 6 variable system using whatever linear equation solver you would like to use. To solve this you must invert the 6×6. You can use , , , etc just be careful of singularities and the respective algorithm’s restrictions.

Another option is to use an application like Mathematica (or something similar) to simplify the matrices symbolically (since it isn’t really hard, just tedious).

Hope that helps,
William

]]>
By: c0der http://www.codezealot.org/archives/337#comment-48835 Wed, 19 Dec 2012 10:58:56 +0000 http://www.codezealot.org/?p=337#comment-48835 Hi William,

When combining a revolute joint and an angle constraint to form the 2×2 block K matrix consisting of four 3×3 matrices below for an elbow joint with restricted angular movement, how do I invert this matrix to solve for lambda, which seems like another matrix of two 3×1 vectors as follows:

A*lambda = b

A = JM^-1JT

A11 = Ma^-1 + [~ra]TIa^-1[~ra] + Mb^-1 + [~rb]TIb^-1[~rb]
A12 = [~ra]TIa^-1 + [~rb]TIb^-1
A21 = Ia^-1[~ra] + Ib^-1[~rb]
A22 = Ia^-1 + Ib^-1

b = -Jvi

b11 = -va – [~ra]Twa + vb + [~rb]Twb
b12 = -wa + wb

A*lambda = b

I am working in 3D, so multiplying the matrices out gets really messy

Thanks for another great tutorial

]]>
By: Constraints Composition – Weld Constraint | The Little Balance http://www.codezealot.org/archives/337#comment-8302 Fri, 06 May 2011 09:40:53 +0000 http://www.codezealot.org/?p=337#comment-8302 […] CodeZealot This entry was posted in Actionscript, Physics, Programming and tagged actionscript, constraints, physics, programming. Bookmark the permalink. ← Constrained Dynamics – A Tour In Physics Constraints […]

]]>