roll value in aka.wiiremote

Diane's icon

Hey guys and gals,
I was just wondering if anyone knew how to get the exact roll value into aka.wiiremote? It just gives you 0, 1, 2, or 3 and no values in between. Has anyone made a patch to convert this data? Thank you!
-Diane

Zachary Seldess's icon

Hi Diane,

You can deduce the roll by analyzing the 3-axis accelerometer data. Gravity effects each axis diffently as you rotate the Wii. Analyzing the continuous accelerometer data and the roll (1,2,3,4) state should give you all you need. I made an Wii OpenGL navigator using the above approach (www.zacharyseldess.com/z.glNav.html).

Try it out, and get back to us with a patch if you have further problems/questions.

best,
Zachary

Axiom-Crux's icon

I dont think thats the best way to do it, I would use the raw IR output from the "other" subpatch at the bottom right and do a bit of math between the points. I did this recently and it worked perfect, you got the exact angle of the remote, ill find it in a bit and post it if I have a minute
btw Zach, I could never get your wii abstractions working properly, I think you should add some of the key command toggles for on/off and such in the main help patch with toggles so you dont have to press keys to set that stuff, or can change key maps more easily. But yeah I tried all the obvious things, and couldnt really get it totally working. does it use the IR for anything or is it just tilt?
Oh and last question. I am setting up an installation right now, and I was originally using wiimotes for the controllers, but the wiimotes woulnd't connect properly, they would work sometimes and sometimes would just inexplicably not connect properly, or crash max. It is somethign to do with the bluetooth connection but I cant figure out what, I did everything right from the guide.

Zachary Seldess's icon

Sure, if you are interested in using the IR data, that's the way to go. I just prefer to keep the setup simple. The method I gave works without the need for IR.

Hmmm, the wii glNavs work fine for me. Have you read the .html documentation? You have to press the HOME button to toggle navigation on/off. And you have to open the z.wiiremote.pat file as well. The help file has a link to the html file that give you all the necessary info. It was made for Max4 though, so the html file no longer opens from the help patch, so just open it manually. I'll fix that and tweak other things at some point in the future. I just did a quick test two minutes ago. Here it is, just so you believe me ;P

best,
Zachary

Zachary Seldess's icon

Regarding Wiiremote connection, I'll tell what I do: I've found that if the Wii doesn't connect on the first try, it's unlikely to connect again until you restart Max, turn bluetooth off and then back on.

I know it sounds a bit idiotic, but I've found it to be the quickest method for getting these buggers connected.

So, in this order:
1. turn bluetooth on
2. start Max
3. connect Wii
4. if the Wiiremote doesn't connect, quite Max and turn off bluetooth
5. go back to step 1

If it doesn't work on the first try, it should on the 2nd or 3rd. I'm always able to get the connection in minutes this way.

best,
Zachary

Diane's icon

Hey thanks a lot guys, and Axiom-Crux it would be fantastic if you could post your patch for me to take a look at. I am already using the IR data in my patch so that's not an issue. But I haven't started using openGL yet and I don't really have time to learn it for this project, sadly. I've been looking at the IR data and I'm not sure how it is figuring out the roll value, even though it shows up continuously on the help patch's display. I'll keep trying and any help is appreciated. Thanks!
-Diane

Diane's icon

Nevermind! Found it! I was looking at the wrong subpatch, but next to the xy data in the ir subpatch they have a continuous angle in radians. Exactly what I needed, thanks!
-Diane

Zachary Seldess's icon

Ah, Axiom-Crux was right. That's by far the easiest way to do it. I did it differently in my glNavigator for very specific reasons (needed to have it work when held in two different ways - regular, and steering-wheel mode).

best,
Zachary

Axiom-Crux's icon

yes I read the help file and found the key to toggle it, but it just didn't move, Ill try it again later.

The wiimotes didn't work with the new mac minis that the museum got for me what a bust. I am going to make all my future controllers with the arduino from now on, I think it will be cooler this way anyway.