02-11-2010 09:20 AM
Yes, those exact examples gave me the idea that calculating yaw might just be around the corner.
I had a hard time finding the formula though, but with someone giving me the code-
float calc_yaw(struct ir_t* ir) { float x; x = ir->ax - 512; x *= WIIMOTE_FOV_COEFFICIENT / 512.0; return RAD_TO_DEGREE( atanf(x) ); }
-along with a good explanation (since I can hardly read code) I managed to put this into LabVIEW.. I even got the 3D graph to work with it.
Here's what it looks like:
I had to divide the yaw data by 50 (which was chosen arbitrarily really) so the 3D graph would respond more accurately.
It's a bit messy I know.. but does it look okay?
I've attached the vi in case of interest.
02-20-2010 09:26 AM - edited 02-20-2010 09:35 AM
I found an article which explains how to acquire the 3D position of the wiimote using only a 2 LED (sensor) bar.
z-distance (distance between wiimote and LEDs) =
ledDistanceInMM
------------------------------------------------
2 × tan (angle) × screenHeightInMM
angle =
radiansPerPixel × pointDist
------------------------------------
2
x-distance = sin (radiansPerPixel × (avgX − 0.5 × screenWidthInPixels))×z-distance
relativeVerticalAngle = (avgY − 0.5 × screenHeightInPixels) × radiansPerPixel
y-distance = −0.5 − sin (relativeVerticalAngle + cameraVerticalAngle) × z-distance
(If the sensor bar was placed above the screen it would have been +0.5 instead of -0.5)
02-20-2010 09:30 AM - edited 02-20-2010 09:34 AM
As you can see I tried to recreate these formulas in LabVIEW:
The thing is, when I bring my wiimote closer to the screen, the values of x- and y-distance change along with it.. something tells me that isn't right.
I've attached the vi in in case of interest.
Interactive 3D Design Using Nintendo Wii Remote
02-20-2010 09:51 AM - edited 02-20-2010 09:53 AM
Why in your calculation for Z distance do you have a calculation of 194 divided by the array? Everything before that matches you typed in formula for Z distance, but I don't see a number divided by anything in that formula.
Never mind, I just realized your line of dashes is supposed to represent a division bar. I thought it was just a separator between your different formulas.
02-21-2010 08:55 AM - edited 02-21-2010 08:56 AM
Yeah that's right, didn't mean to confuse.
So for z-distance it looks like this:
194 (mm)
----------------
2 x tan (angle) x 327.3(mm)
Where angle is
((Pi/4) / 1024)× pointDist
--------------------------------
2
pointDist = Sqrt(dx * dx + dy * dy)
dx = firstPoint.x - secondPoint.x
dy = firstPoint.y - secondPoint.y
(I did some creative programming here I guess since I didn't have the second points, but I did have the Midpoints. So I subtracted the Midpoints from the First points, multiplied the answers by 2 and then squared those numbers.)
02-22-2010 03:57 PM
02-25-2010 06:59 AM
I'm trying to communicate with the Wiimote in LabVIEW 7.1 using this library:
http://wiimotelib.codeplex.com/releases/view/21997
When calling the property "WiimoteState" LabVIEW says that WiimoteState doesn't have any properties:
Whem I'm doing exact the same in LabVIEW 8.6, I can see its properties.
Am I doing something wrong in LabView 7.1 or is it just not possible to use this dll in Labview 7.1?
02-26-2010 02:10 PM
Hello,
I wonder if this information applies to your situation: http://digital.ni.com/public.nsf/allkb/D71B8CC03F39872B862571060071130B?OpenDocument . Make sure that your conditions are met that are listed in that knowledgebase. It might also be useful to check the versions of the .NET framework that you have installed.
-Zach
02-26-2010 02:16 PM
Hi,
Does anyone know if it is possible to read the battery status of the wiimote using the VI's created by Sam Shearman?
03-01-2010 09:52 AM
I believe I have been through all of them and I haven't found an application like that.
The WiimoteTest.exe file which is part of Brian Peek's library I think shows your battery status if that's any use to you.