PDA

View Full Version : rotations in vizard


david
08-26-2003, 08:45 AM
:confused:

Hi, after trying some simple 90 deg rotations, I am a little puzzled. The help says that the order of rotations is pitch yaw and roll for euler angles. But when I use the .rotate command, the order that seems to happen is (according to the help file displaying the reference frame):
-for an geometry object, roll, yaw, pitch
-for viz.BODY_ORI, yaw, pitch, roll

seems to be happening in versions 1 and 2
Any thoughts?

farshizzo
08-26-2003, 04:58 PM
Hi,

All euler rotations in Vizard are yaw, pitch, roll. There seems to be a mistake in the documentation, sorry for the inconvenience. However, after reading your post I found that the roll for the BODY_ORI goes in the opposite direction. This will be fixed in the next release. Again, sorry for the confusion.

tobin
08-27-2003, 09:00 AM
While Vizard uses the yaw, pitch, roll convention for its Euler angles, it's relatively easy to construct your own rotations based on any Euler order. To do so, one can use the "vizmat" matrices library that provides lots of matrix-based operations at the Python programming level.

Here's an example showing how to rotate an object in XYZ Euler order instead of YXZ (yaw, pitch, roll). This example rotates the object 10 deg along each axis:

import vizmat

b = viz.add('myobject.wrl')

X = vizmat.Transform()
X.makeIdent()
X.postRot(X, 1,0,0, 10.0/180*math.pi)
X.postRot(X, 0,1,0, 10.0/180*math.pi)
X.postRot(X, 0,0,1, 10.0/180*math.pi)

b.update(X)

david
08-31-2003, 03:04 PM
this was helpfull, but I still have some interrogations:

When I use the following code:

import vizmat

my_view = viz.get(viz.MAIN_VIEWPOINT)
X = vizmat.Transform()
X.makeEuler(0,-90,0)
my_view.update(X)

I get what looks like a 90 degree pitch down (should not it be up?)

and if I use
X.makeEuler(90,0,0)
I get what looks like a roll, not a yaw

And finally when I use
X.makeEuler(0,0,90)
I get the yaw

Again, this is assuming the reference frame given in the help file:
user looking down Z axis, Y axis is up, X is on the side, but it is not consistent with what Farshizzo wrote (yaw,pitch,roll order, that I don't even get for an object, as I said before)

tobin
09-02-2003, 09:14 AM
Thanks again for pointing out this inconsistency. Since your earlier post, we have recognized that Vizard has a few inconsistencies with respect to Euler angle orders and that the vizmat libraries are "right-hand" whereas Vizard core commands are "left-hand". We intend to make all rotation commands clearly documented and self-consistent by release 2.11 (next week).

We appreciate your patience.

david
09-09-2003, 06:55 PM
This could be why I was stuck on what I thought was a geometric problem. I feel a lot better, thanks.

pkhoosh
02-24-2005, 12:05 AM
Is the Vizard rotate still yaw, pitch, roll or was this fixed?

farshizzo
02-24-2005, 10:57 AM
Yes, Vizard uses yaw,pitch,roll order for euler angles.