aka.wiiremote IR x y coordinates

johno's icon

Alright Folks,

Just started a project using johnny lee's wii-remote ideas and aka.wiiremote. The first hurdle I've come across is what are the X Y coordinates being output from the infrared tracking section of the aka object. Are they in any way related to video screen size - 640 x 480 etc. - or are they just 0 - 1000. I've searched the forum plenty as I can't be the only one who has come up against this problem. Any help would be greatly appreciated

Cheers,
Johno

Axiom-Crux's icon

regardless, you can use scale object to map them to a different set of values.

bdc's icon

The X Y coordinates are raw data and not mapped to a specific screen size. The wii console does the mapping to the screen.

Brad

Axiom-Crux's icon

After reading this, I wound up spending the night creating mr lee's wii head tracker. It works great so far!

I recommend using the raw data and not the IR mapped data, this way you get 1-4 tracked points representing the IR leds or any other infra red light. you can get this by toggling the extraoutput attribute, and then going into the "other" subpatcher at the bottom right. Then you can use these points to do a ton of things, like get the z position by subtracting the x and y axis of the two leds from the sensor bar. this is how I was able to do the head tracker, otherwise with the regular IR output, you only get x+y and rotation.

I'm curious, have you had any issues with your wiimotes connecting to max? about half the time I sync them, they will only output accelerometer and button data, and don't take any commands in (like LED or vibrate), and when they connect like that, I cant use the disconnect command either, I have to hit the sync button on the remote to try and reconnect it which sometimes crashes max. It usually works after a few tries, but I am going to be using these for a museum piece, so I'm curious if there is anything I can do to fix this issue?

johno's icon

Cheers for the posts guys.

Axiom -
The only difference I can think of in setting up my wii-mote is that I didn't realize for quite a while that you didn't have to use the OSX bluetooth setup assistant as well as the connect button in the aka help file. Essentially I was setting up the wii-mote twice - once with OSX and once with MAX every time I used it. I haven't had any of the problems you've mentioned. It has been a little funny connecting every now and then but the worst case scenario has been to restart MAX, which is hardly a big problem. I don't know if this helps at all.

I know what you're saying about using the scale object - its something that I'm going to have to do anyway. But do the X Y raw IR output values depend on how far the LED's are from the wii-mote? Basically I suppose what I'm really asking is what arguments did you have in your scale object?
Also I'm not too sure how you got your Z value. I think our setups are quite different. Currently I'm in very early prototyping stage, which means that I have my wii-mote sitting beside my computer and I'm holding a circuit of two LEDs about a meter in front of it and trying to make judgments based on what the "extra outputs" box is showing me.
One more question is did you have trouble in clearly labeling each IR source as a specific number. I'm finding that sometimes my number one LED becomes number two in the patch and two sometimes jumps to three. I know this isn't a huge issue and they can be labeled by using gate objects (or something like that) but just thought I'd ask. It would be helpful to know this before I get stuck in building the patch.
I hope I haven't melted your head with too many questions. The help you've given has already shed some light on the subject for me.

Thanks again
Johno

PS I know I said the last question would be my last one but curiosity has gotten hold of my typing fingers. What's the project you're working on for the gallery? I'm really interested to hear what other folk are doing with wii tracking

Axiom-Crux's icon

Im not sure if I understand all the questions but Ill give you some info:

I got the z distance by subtracting the x and y of the first two raw IR points and then adding those subtracted values together, this gives me the size of the sensor bar. Also there is that led size output that gives somewhat useful info, the leds get bigger whne you get closer and such, but really I haven't found much use for it yet. As far as the values Im using, there not really useful to anyone else since it all depends on your led distance from each other, the distance of the remote, and where you want to end up using the data in the end. One thing that was kindof useful was that if you add a select object with the value of the raw output when no LED is recognized, then the right side of the select will output only the usable position values, and the left side will bang whenever the led dissapears
as far as led2 becomming 3 or whatever, your getting some kindof other light coming in, or its reflecting one of your leds off something. Try checking out darwinremote and watch the IR data viewer in there to see where your leds are and you might learn alot.

I have been experimenting with leds streight taped to watch+hearing aid batteries. I need to find a way to make a bit better final setup that will keep the batteries powered consistently without constantly changing batteries. how are you powering yours? I also got a wireless sensor bar which works pretty good, but as its desiged to be on a tv and far away its kinda hard to use on my laptop sitting on my lap.

Ill post a patch when I get it perfected. Im hoping to get an exact jitter copy of the head tracker, and so far its great, but not quite as convincing as his, man its hard to perfect those values, he really got it looking like a window.

Axiom-Crux's icon

oh and about the glitches in connection. So are you saying you never have any issues? when you hit connect, it always connects and outputs everything just fine?

johno's icon

Cheers for getting back to me, man. You've been most helpful again. I'd been reading about this darwinremote but never realised that it was an installable program. I'm about to install it now.
I get what you mean now about working out the Z plane - sounds pretty handy.
I'm really liking your select object idea as well. I'll give it a shot tomorrow (its getting late over here).

I've built a little circuit with 3 4 Volt LED's - 2 infra red and one colored one - the colored one is just to show that the circuit is actually running. I've got these connected in series with a 220ohm resistor and a 9 volt battery. Its not the best set up - there's wire hanging all over the place - but its good enough for testing.
I've got to have this project open to the public at some point and I've been racking my brain to come up with the best solution for the user's IR source. The best and easiest one that I can see is in Johnny Lee's White Board hack where he fits an LED into the top of a pen and fits an on/off switch in it. In theory its easy to make and everyone is used to holding pens. The other really good one that I've seen is this one

but I gotta say that it looks like a proper pain in the ass to construct his thumbelina thing (you'll know what I mean when you watch the video). That site is pretty interesting in general if you haven't seen it before.

As for connection issues I really haven't had any worth talking about. I've definitely never crashed Max from the Wii. I'm really hoping I'm not jinxing myself right now! I recently downloaded the newest aka.wiiremote release as the one I had, although it never gave me any issues was pretty old. I'm sure you've thought about this already but I just thought its worth mentioning. From reading about on forums it seems to be a little bit of luck of the draw with connection issues.

Keep me up to date with your progress and I'll do the same with you - its always nice to know what fellow Maxers are up to.

I'm sending tracking info to Pure Data to create visuals in there (I find Gem easier in PD). I still haven't thought about audio yet - its the next step. Once I get sorted and de-mess-ify the patches I'll post them so you can have a look about. Don't know if you use PD but I'm sure you'll have no worries figuring out how I'm using it.

One other thing I've just thought of is that I'm using Max 4.6 for this project. I have Max 5 but I've seen a few issues arise with aka.wiiremote in Max 5 so I decided to not even go there. My philosophy is; with projects like this its best to stick with what you know works, although I'm really missing the Max 5 keyboard shortcuts.

Gonna scoot for a beer before I hit the sack. This has turned into quite an essay - unexpectedly. Anyway I'll be in touch and thanks again for your help

John

avantronica's icon

folks
fwiw - i found that the straight aka.wiiremote object crashed Max5 for me constantly
I gave disis.aka.wiiremote a go and it works just fine (it only adds support for wii fit board) - does the trick (for me)
worth a go if you want to work in 5, and who doesn't !
cheers

kala's icon

Disis.aka.wiiremote works fine for me (acceleration and buttons) except for the IR sensors or the nunchunk. I Can't get data from these controlers.
Any issues ?

avantronica's icon

@kala
hey
just checked the nunchuk works just fine
even adding it on after the wiimote was paired
fwiw - this pairing process is fickle (and then some)
experiment to see which connection strategy works for you
(be sure to resend 'expansion 1' message to the object after the nunchuk is added) (refer to original object help file)
don't have 9v battery or candle to test IR sorry
nor wii fit unfortunately

if at first you don't succeed ... try, try again

hth