NewtonUserJointAddLinearRow sanity check

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: NewtonUserJointAddLinearRow sanity check

Postby JoeWright » Tue Jan 06, 2009 12:47 pm

Justing thinking - the shoulder joint is going to be a nightmare to specify. Its almost unlimited but not quite.

Joe
JoeWright
 
Posts: 69
Joined: Sat Apr 30, 2005 1:42 pm

Re: NewtonUserJointAddLinearRow sanity check

Postby JoeWright » Sat Jan 10, 2009 4:39 pm

Julio Jerez wrote:let us say that

a02 = -sin (y)

is is cleat that we can get y form

y = asin(-a02)

by here is the problem

since sin (y) = sin (180 - y)


I had a bit more of a think about this. I rewrote the general form of the rotation as follows (excuse the formatting):

{ {Cos[y] Cos[z], -Cos[y] Sin[z], Sin[y]},
{Cos[z] Sin[x] Sin[y] + Cos[x] Sin[z], Cos[x] Cos[z] - Sin[x] Sin[y] Sin[z], -Cos[y] Sin[x]},
{-Cos[x] Cos[z] Sin[y] + Sin[x] Sin[z], Cos[z] Sin[x] + Cos[x] Sin[y] Sin[z], Cos[x] Cos[y]} }

Which is the same as yours except for the odd plus or minus (I was basing it on elementry rotation matrices).

Then, I made a series of substitutions from a arbitary example { {a,b,c}, {d,e,f}, {g,h,i} } into the matrix to give:

{{a, b, c},
{-a c f Sec[y]^2 - b i Sec[y]^2, -b c f Sec[y]^2 + a i Sec[y]^2, f},
{b f Sec[y]^2 - a c i Sec[y]^2, -a f Sec[y]^2 - b c i Sec[y]^2, i} }

Leaving terms involving cos(y). I had thought you could then use atan2(sin(y),cos(y)) but know thinking about it, the squaring of sec(y) means that we can't reconstruct? The thing is, you can reconstruct from a single rotation matrix about y because you have the individual cos(y) and sin(y) terms:

{ {Cos[y], 0, Sin[y]}, {0, 1, 0}, {-Sin[y], 0, Cos[y]} }

So is it only under multiplication of the three matrices that the sign gets lost?

Thanks, Joe
JoeWright
 
Posts: 69
Joined: Sat Apr 30, 2005 1:42 pm

Re: NewtonUserJointAddLinearRow sanity check

Postby JoeWright » Mon Jan 12, 2009 6:30 pm

I've been fiddling about with my programme so I could see how specify and extracting euler angles corresponds. I now am really starting to to get an understanding for why the beta angle is [-pi/2, pi/2] and not [-pi,pi] as when beta is outside this range, its equivalent to beta being in the range but alpha and gamma being offset by pi.

There's a couple of things I've got to work out in what I'm doing but I think I'm close to getting consistent euler angles that I can then apply limits to. So I'm thinking that there's probably a method with quaternions that I can base on your custom ball and socket joint that will allow the contraint rows to take from 'current orientation' to 'where it should be'.

Will post tomorrow hopefully.

Joe
JoeWright
 
Posts: 69
Joined: Sat Apr 30, 2005 1:42 pm

Re: NewtonUserJointAddLinearRow sanity check

Postby Julio Jerez » Tue Jan 13, 2009 12:30 am

Oh I have let you down, the bug are piling because I was working on a new feature, and I the engine was in state of changes.
Plus I was also fix soem very critical bug.

if you download teh SDK you can see what the feature was.
Now it is almost finish and I can check some, the bug and request repoored by people.
Julio Jerez
Moderator
Moderator
 
Posts: 11154
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonUserJointAddLinearRow sanity check

Postby JoeWright » Tue Jan 13, 2009 6:59 am

No problem. Its actually forced me to get my head round the problem more which has improved my understanding no end.

Cheers, Joe
JoeWright
 
Posts: 69
Joined: Sat Apr 30, 2005 1:42 pm

Re: NewtonUserJointAddLinearRow sanity check

Postby JoeWright » Thu Jan 15, 2009 3:15 pm

Julio, can I ask your advice?

I've finally got a system where I can move the child body around, and as a test I specify euler angles to move it. In the constraint callback I'm extracting the euler angles and I'm finding (as long as I restrict the y angle to [-pi/2,pi/2]) that I'm consistently getting equality with my test angles. So, in that sense the system is working exactly how I want it.

However, I am wondering if this is the way I want to do it. What I'm trying to do is have a roughly approximate human body. I want joints where I can specify the limits of the rotations around each joint between body parts. What I was planning was to use euler angles. I'm extracting them correctly now so, if any are outside bounds I can construct a desired position to constrain to (using quarternions or whatever). But I'm starting to get a better feel for euler rotations and it seems to me the order that the angles are specified is critical (since the matrix is the composition of 3 basic rotation matrices [I'm using an xyz form]).

I'm not sure, but is this a good way to achieve my goal? Or should I be using a different system? Things are starting to work but I'm starting to worry as well.

Thanks, Joe
JoeWright
 
Posts: 69
Joined: Sat Apr 30, 2005 1:42 pm

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest