We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › WiiMote with darwiinremote and oscP5
Pages: 1 2 
WiiMote with darwiinremote and oscP5 (Read 8661 times)
WiiMote with darwiinremote and oscP5
Jul 17th, 2007, 3:34pm
 
Hey there! The friendly guy at sojamo.de provided us with a version of the darwiinremote for processing.

Unfortunately, I can't even get the examples to work, maybe just because of not knowing which address and which port to choose...

************************************
import processing.opengl.*;

import oscP5.*;
import netP5.*;

WiiController wiiController;

void setup() {
 size(400,400,OPENGL);
 frameRate(25);
 noStroke();
 smooth();
 wiiController = new WiiController();
}

void mousePressed() {
 // check the battery level of the wii controller
 wiiController.oscP5.send("/wii/batterylevel",new Object[] {},"192.168.1.34",5601);
 // turn force feedback of the wii controller off
 wiiController.oscP5.send("/wii/forcefeedback",new Object[] {new Integer(0)},"192.168.1.34",5601);
}

void keyPressed() {
 // turn forc feedback of the wii controller on
 wiiController.oscP5.send("/wii/forcefeedback",new Object[] {new Integer(1)},"192.168.1.34",5601);
}


void draw() {
 background(0);
 if(wiiController.buttonB) {fill(255); } else {fill(255,0,0);}
 pushMatrix();
   translate(100,100,0);
   rotateY(wiiController.roll/40.0);
   rotateX(wiiController.pitch/40.0);
   rect(0,0,100,100);
 popMatrix();
 rect(wiiController.x/4.0,wiiController.y/4.0,40,40);
}
******************************************************

So, how can I find out which settings to use instead of ""192.168.1.34",5601"?
Re: WiiMote with darwiinremote and oscP5
Reply #1 - Jul 18th, 2007, 11:19am
 
hi,
the numbers 192.168.1.34 and 5601 are the ip address and the port number of a remote machine. you only need them if you want to send something to darwiinremote.
if you run darwiinremoteosc and your processing app on the same machine you can use the local ip 127.0.0.1 instead of the one above.
to receive values from darwiinremote, the example should work fine. do the following:
(1) start darwiinremoteosc and press button 1 and 2 as requested by the app. make sure your wii controller is connected = in the eventlog there should be green and red lines.
(2) on the same machine start the processing wiiControllerExample as provided and things should be moving.

best,
andi
Re: WiiMote with darwiinremote and oscP5
Reply #2 - Jul 18th, 2007, 11:59am
 
Thanks a lot!

Is there a PC Version of DarwiinRemote, too? Could only find the OSX files...

And: Can the port be skipped when running it local only, or does it have to stay 5601?
Re: WiiMote with darwiinremote and oscP5
Reply #3 - Jul 18th, 2007, 5:37pm
 
darwiinremote is osx only, no pc version. but there is a pc project called glovepie that also supports wiimotes.

5601 is the port number that darwiinremoteosc is listening at for incoming messages. this port number is hard  coded. but the other way round, darwiinremoteosc sending messages, can be configured in the preferences of darwiinremoteosc.
Re: WiiMote with darwiinremote and oscP5
Reply #4 - Oct 30th, 2007, 6:27pm
 
I found one strange version that works with MIDI on this site

http://www.byteofinnovation.net/index.php?2007/10/27/17-wiimote-runs-in-processing

I have impression that is a little bit slower over MIDI but it works very fine.
Re: WiiMote with darwiinremote and oscP5
Reply #5 - Jan 22nd, 2008, 11:21pm
 
Hi,

I'm trying to use darwiinosc in a project and I am having a problem with the callback methods osc.plug(...).

I have the exact same code running without problems in my PApplet class, but when I move the OSC stuff to another class (which doesn't extend PApplet), it doesn't work and gives me the following message:
Code:

### [2008/1/22 17:14:20] ERROR @ OscP5 ERROR. an error occured while forwarding an OscMessage
to a method in your program. please check your code for any
possible errors that might occur in the method where incoming
OscMessages are parsed e.g. check for casting errors, possible
nullpointers, array overflows ... .
method in charge : buttonEvent java.lang.reflect.InvocationTargetException


What's odd is that I get the following trace at startup:
Code:

### [2008/1/22 17:14:13] PROCESS @ OscPlug plugging class net.silentlycrashing.gestures.WiimoteGestureAnalyzer | addrPattern:/wii/button/b typetag:i method:buttonEvent


Any ideas what the problem could be? Does the class I pass to osc.plug(...) have to extend PApplet?

Thanks,
Re: WiiMote with darwiinremote and oscP5
Reply #6 - Jan 23rd, 2008, 9:01am
 
hi,
messages passed to a plugged method dont need to be in an PApplet extended class, works for any class.
the message you get may be the result of some errors that occurred within the plugged function itself, in your case buttonEvent.
if you comment out everything in this function and just put in
Code:

println("got a button Event");

here, you shouldn't be getting the error anymore, and the oddities may be in the code that is commented.
hope this helps.

on another note, i guess you are working on the gesture lib. since there is another wiimote library for processing, i would like to suggest that you may consider to implement an interface to access the wii parameters from that library as well?

best,
andi
Re: WiiMote with darwiinremote and oscP5
Reply #7 - Jan 23rd, 2008, 4:15pm
 
Hi Andi,

Thanks for the help, you're right I had a null object in my function that was screwing everything up.

I am working on a gesture lib actually, it currently only works with the mouse, but a Wiimote version should be ready soon. About the other Wiimote library for Processing, are you referring to wrj4P5 I haven't looked at that one yet, but since it's shareware and alpha, I think I may just stick to darwiinosc...
Re: WiiMote with darwiinremote and oscP5
Reply #8 - Jan 23rd, 2008, 5:12pm
 
yep, wrj5P5 i was referring to. with the interface i was mentioning earlier i meant, maybe it would be good if one could forward his own input values e.g.

Code:

theWiimoteGestureAnalyzer.setInputX(theX);

theWiimoteGestureAnalyzer.setInputY(theY);



then, whenever you receive an input e.g. from darwiinosc you call these methods. just a rough thought.

advantage:
this way any input(-device) could be analyzed
the lib doesnt have to depend on oscP5 in this case

downside:
in case of darwiinosc you would need to do the osc parsing in each sketch individually since it wouldnt be handled by the gesture lib.

anyhow, looking forward to the lib.
update on darwiinosc: i added nunchuk and IR sensor support in the latest version.

best,
andi
Re: WiiMote with darwiinremote and oscP5
Reply #9 - Jan 24th, 2008, 4:01am
 
sorry for interruption.
wrj4p5 run now with,
-WiiremoteJ v1.2 by Cha0s (not opensource but free to
use)
and
-JSR82 Libs
-for Win, BlueCove2.0.2+(WIDCOMM or BlueSoleil stuck)
-for Linux, avetanaBT+(BlueZ)
-for OSX, BlueCove2.0.2+(OSX standard BTStuck)
there is no need of avetanabluetooth.jar(commercial base).
Re: WiiMote with darwiinremote and oscP5
Reply #10 - Jan 25th, 2008, 9:20pm
 
Hey Andi,

Thanks for the advice, I actually already have a more general "GestureAnalyzer" which just accepts Points as input. The WiimoteGestureAnalyzer is just an out-of-the-box child class that automatically plugs into the osc messages from darwiinosc. About dependence on oscP5, it's not really a big concern to me, it's a pretty popular library Smiley

And here's the link to the gesture lib.

Cheers,
Re: WiiMote with darwiinremote and oscP5
Reply #11 - Jan 31st, 2008, 5:24am
 
Hi,

I am new to processing and java. Where can I find the WiiController class file and how do I use it?
Re: WiiMote with darwiinremote and oscP5
Reply #12 - Jan 31st, 2008, 5:37am
 
if you download darwiinosc from code.google/darwiinosc, a processing example using the WiiController class is provided in the p5/wiiControllerExample folder.
Re: WiiMote with darwiinremote
Reply #13 - Mar 13th, 2008, 11:44pm
 
Hello all>>wii<<wanna be controllers>
i'm new in it>>so>>i'm trying things with quartz composer?!!
my intrest is the IR and thats very buggi,>>so ennyone here maybe???
Re: WiiMote with darwiinremote and oscP5
Reply #14 - Mar 13th, 2008, 11:45pm
 
.mac only [[0]]-[[@]]
Pages: 1 2