PDA

View Full Version : angle conversion


DSparrow
04-20-2004, 08:02 PM
Hello,
For an experiment my team is conducting, we need to analyze data in the form of degrees. Is there any way to get the data from an Intersense Inertiacube to convert to degrees in Vizard? If so how can this be done? Any help at all is greatly appreciated.

farshizzo
04-21-2004, 10:52 AM
Hi,

The data coming from the inertiacube should be the yaw,pitch, and roll in degrees by default. Example:isense = viz.add('intersense.dls')

data = isense.get()
yaw = data[3]
pitch = data[4]
roll = data[5]There is an option to have the inertiacube return quaternions, but if you didn't explicitly set that option, then it should be returning degrees by default. Let me know if the above code still doesn't return degrees. Good luck!

DSparrow
04-21-2004, 11:49 AM
I have been using the code, but the data i get in return is in negative numbers. Specifically, we are looking at the pitch, data[4] from the array i think, but it returns the following from a resting position with the person wearing the HMD loking up :
-4.51560783386 (resting point)
-4.51560783386
-4.51560783386
-5.21056461334
-6.53081417084
-6.53005409241
-6.64580345154
-7.05755376816
-9.14772891998
-11.3136796951
-12.8152256012
-14.2895698547
-15.4270544052
-17.0076580048
-18.5268325806
-18.4219417572
-16.7005977631
-10.3614425659

should I just ignore the negative sign?
Thanks again for the help.

farshizzo
04-21-2004, 12:41 PM
Hi,

Is the inertiacube linked to a viewpoint? If it is, have you tried getting the euler angles from the viewpoint instead of the inertiacube. Example:euler = viz.get(viz.VIEW_EULER)
yaw = euler[0]
pitch = euler[1]
roll = euler[2]This method might return some more reasonable values. The problem with euler angles is that multiple combinations of (yaw,pitch,roll) can return the same orientation. So sometimes you can get pretty strange values.