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.
IndexProcessing DevelopmentLibraries,  Tool Development › wrj4P5, WiiRemote P5 Library - Alpha
Pages: 1 2 3 4 5 6 ... 16
wrj4P5, WiiRemote P5 Library - Alpha (Read 93297 times)
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #45 - Jan 5th, 2008, 7:14am
 
blindfish wrote on Jan 5th, 2008, 1:47am:
Anyone had any luck getting anything out of irLights

i'm sorry for no test, blindfish.
because i have no sensor bar,  the IRSensor is not tested.
now, i have tested with a candle, but the IRSensor test is limmited.
here is alpha-003
https://sourceforge.jp/projects/wrj4p5/files/?release_id=28807#28807

[notes]
- length of irLights[] is always 4.
 - when no light is, it's value is (-1, -1, -1), in each mode.
 - when IRMode'ir' is Wrj4P5.EX, it's value is (x, y, -1). (default mode)
 - when IRMode'ir' is Wrj4P5.IR, it's value is (x, y, s)
      *where x:0to1, y:0to1, s:size. (origin is at Left-Bottom)
- if irMode'ir' is set to be Wrj4P5.IR, any extention is not available.
- bug fixed around irLights[]
- removed :  Wrj4P5(PApplet parent, boolean irMode)
- added : connect(boolean ir),  connect(int n, boolean ir)
- changed : sensed value of remote is mesured by G. (002 was mesured by mks)
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #46 - Jan 6th, 2008, 2:54pm
 
Cool, that has gone some way towards getting it working.  I've now had values returned on irLights[0] and irLights[1], but nothing on [2] and [3]... though it looks like [0] and [1] are lights on either side of the sensor bar so they will be enough to do something useful with.

However, getting data from the lights is very inconsistent - I've tried different ways to connect:

wii = new Wrj4P5(this).connect();
wii = new Wrj4P5(this).connect(true);
wii = new Wrj4P5(this).connect(1,true, false);

But whichever I try, getting data only seems to happen very occasionally - it almost seems completely random.

isIRSensorEnabled() mostly returns false and only occasionally returns true, but even when true irLights mostly returns (-1.0,-1.0,-1.0)...

Just in case I'm making a stupid mistake here's my test code.  Any suggestions greatly appreciated!

Many thanks!

Code:

import lll.wrj4P5.*;

Wrj4P5 wii;

void setup() {
size(400, 300);
background(0);

wii = new Wrj4P5(this).connect();
frameRate(30);
}

void draw() {

if (wii.isConnecting()) return;

background(0);
noStroke();

//println(wii.rimokon.isIRSensorEnabled());

if(wii.rimokon.isIRSensorEnabled()) {

if(wii.rimokon.irLights[0].x != -1) {
//println("x: " + wii.rimokon.irLights[0].x + " y: " + wii.rimokon.irLights[0].y + " size: " + wii.rimokon.irLights[0].z);
fill(255,0,0);
ellipse(wii.rimokon.irLights[0].x*width,wii.rimokon.irLights[0].y*height,10,10);

}

if(wii.rimokon.irLights[1].x != -1) {
//println("x: " + wii.rimokon.irLights[1].x + " y: " + wii.rimokon.irLights[1].y + " size: " + wii.rimokon.irLights[1].z);
fill(0,255,0);
ellipse(wii.rimokon.irLights[1].x*width,wii.rimokon.irLights[1].y*height,10,10);

}


}

}
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #47 - Jan 6th, 2008, 4:25pm
 
thank you for your trial, blindfish.
blindfish wrote on Jan 6th, 2008, 2:54pm:
I've now had values returned on irLights[0] and irLights[1], but nothing on [2] and [3]... though it looks like [0] and [1] are lights on either side of the sensor bar so they will be enough to do something useful with.
WiiRemote can recognize spots at most 4, so if you use two sensor bars (or 4 candles/IRLEDs), you will get 4 spots.
some applications uses 3 spots to get precise relative position and rotation, i know.
blindfish wrote on Jan 6th, 2008, 2:54pm:
However, getting data from the lights is very inconsistent - I've tried different ways to connect:
wii = new Wrj4P5(this).connect();
wii = new Wrj4P5(this).connect(true);
wii = new Wrj4P5(this).connect(1,true, false);
first code is BASIC mode. (extension available, but no size of spot)
  Wrp4P5.EX is constant for extension use.( and IR_BASIC mode)
second code is EXTENDED mode. (with size of spot, but no extensions)
third code is EXTENDED and  silent mode. (same as second code)
  Wrj4P5.IR is constant for IR_EXENDED mode.
blindfish wrote on Jan 6th, 2008, 2:54pm:
But whichever I try, getting data only seems to happen very occasionally - it almost seems completely random.

isIRSensorEnabled() mostly returns false and only occasionally returns true, but even when true irLights mostly returns (-1.0,-1.0,-1.0)...
hmmm, i thought the isIREnabled() tell us the IRSensor is not disabled. but it would tell us there is no spot, i start thinking.
one more thing, the sensitivity of IRCamera in the WiiRemote is unknown. can you set the power of the sensor bar up via your wii
blindfish wrote on Jan 6th, 2008, 2:54pm:
Code:

   if(wii.rimokon.isIRSensorEnabled()) {
           //println("x: " + wii.rimokon.irLights[0].x + "  y: " + wii.rimokon.irLights[0].y + "  size: " + wii.rimokon.irLights[0].z);
           //println("x: " + wii.rimokon.irLights[1].x + "  y: " + wii.rimokon.irLights[1].y + "  size: " + wii.rimokon.irLights[1].z);
your code is seem to be OK. woud you try without isIRSensorEnabled ?
and
because my 3DVector class "LOC" has toString() implimentation, you can write
// println(wii.rimokon.irLights[0])
instead of
// println("x: " + wii.rimokon.irLights[0].x + "  y: " + wii.rimokon.irLights[0].y + "  size: " + wii.rimokon.irLights[1].z);
(importing LOC may be needed)

Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #48 - Jan 6th, 2008, 10:52pm
 
OK... I've done some more testing.

I still have no idea why it doesn't always work, but when it does it's fine... it's just not nearly reliable enough.  If I had to guess I'd say it might be something to do with the 'public WiiRemote addTalker' in WiiRimokon (line 61)...  On line 67 should it be testing against the variable 'ir' or 'isIR'.  I'm not yet good enough at all this to test this myself - and I could of course be completely wrong...

When it has worked I've had it register 3 lights when I get close to the sensor bar (mine is wireless and has 6 LEDs), though mostly it just registers 2 - though as I said before it's usually 2 at either end which is ideal.

I'm not too bothered about the size of the lights at the moment as it should be possible to use the distance between the lights to calculate distance between the sensor bar and the remote... though it would be interesting to see how sensitive it is to size, as this might be useful in determining the yaw of the remote.

isIREnabled seems pointless - you don't need a sensor bar to see that it returns fairly random values...

If you can fix the reliability problem that would be fantastic!
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #49 - Jan 7th, 2008, 1:30am
 
blindfish wrote on Jan 6th, 2008, 10:52pm:
OK... I've done some more testing.

I still have no idea why it doesn't always work, but when it does it's fine... it's just not nearly reliable enough.  If I had to guess I'd say it might be something to do with the 'public WiiRemote addTalker' in WiiRimokon (line 61)...  On line 67 should it be testing against the variable 'ir' or 'isIR'.  I'm not yet good enough at all this to test this myself - and I could of course be completely wrong...


ok, i will do more test on this week end.

blindfish wrote on Jan 6th, 2008, 10:52pm:
When it has worked I've had it register 3 lights when I get close to the sensor bar (mine is wireless and has 6 LEDs), though mostly it just registers 2 - though as I said before it's usually 2 at either end which is ideal.


i know the sensor bar of nintendo has 5 LEDs on each end.
does your wireless one have 3 LEDs on each end
im afraid your test is performed too near distance.
because the spot is the image on the ircamera, there is a minimum distance for proper use of ir-sensor.
please check this on your sensor-bar's manual.
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #50 - Jan 12th, 2008, 4:59am
 
hi, blindfish.

i have tested the IR sensor functionality of Wrj4P5 003.
it seemed OK. see
http://www.geocities.jp/classiclll_newweb/IR_Sensor_Test/applet/index.html

i think
Classiclll wrote on Jan 7th, 2008, 1:30am:
i'm afraid your test is performed too near.
too.

the angle of view of IR_Sensor is about 40 degree, i've heard.
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #51 - Jan 12th, 2008, 12:41pm
 
Classiclll wrote on Jan 12th, 2008, 4:59am:
hi, blindfish.

i have tested the IR sensor functionality of Wrj4P5 003.
it seemed OK. see
http://www.geocities.jp/classiclll_newweb/IR_Sensor_Test/applet/index.html

i think
too.

the angle of view of IR_Sensor is about 40 degree, i've heard.



Thanks for testing this further.  It's definitely not anything to do with being too close: I've got the sensor bar about 2-3 metres away and when it works it works perfectly...  it just doesn't work often enough  Sad

I guess it could be a hardware/software issue on my machine...  Though the actual connection to the remote works fine, it simply doesn't seem to be getting the IR data.  I'll test you demo - if I don't have any problems with that then I'll know it's something in my code.

Many thanks!
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #52 - Jan 12th, 2008, 1:43pm
 
i think i can understand your situation.
any feedback is welcome.
i hope you enjoy.
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #53 - Jan 14th, 2008, 8:11am
 
BlueCove Ver2.0.2 (for PPC/Intel Mac OSX) released!
http://www.bluecove.org/
I have tested on PPCMac replacing my avetana, and it ran well.
so, Wrj4P5 now needs

- bluecove-2.0.2.jar (and Apple BTstack)for OSX (both PPC and Intel)
- avetanaBT.jar and BlueZ(BTstack for Linux) for Linux
- BlueCove-2.0.2.jar and WIDCOMM(BTstack for Windows) for Windows

 * BlueSoleil(another BTstack for Windows) may be buggy.
 * BTstack built in Windows( by MS ) does not support L2CAP protocol on Bluetooth.
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #54 - Jan 14th, 2008, 10:48am
 
That's a good news  \\(*0*)//
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #55 - Jan 17th, 2008, 3:50pm
 
Wrj4P5 alpha-004 released!
https://sourceforge.jp/projects/wrj4p5

[note]
WiiRemoteJ v1.2 released
see http://www.wiili.org/forum/wiiremotej-tips-t2815.html

1. a workaround in WiiRemoteJ to avoid a bug in BlueSoleil
2. new support of WiiGuitar

so, Wij4P5 support WiiGuitar too,
and, BlueSoleil(BTstack for windows) + BlueCove2.0.2 may be run well
* a functinality of WiiGuitar support is not tested because i have not the WiiGuitar

public class PApplet {
 //added
 void guitarPressed(GuitarEvent ev, int rid)
 void guitarReleased(GuitarEvent ev, int rid)
}

public class Wrj4P5 {
 //added
 WiiGuitar guitar
 WiiGuitar guitar(int rid)
}

public class WiiRimokon {
 //added
 WiiGuitar guitar
}

public class WiiGuitar {
 Loc stick            // latest sensed 2D(Loc) location(%) of the stick.
 float whammy  // latest sensed pressure(%) of the WhammyBar.
}

public class GuitarEvent {
 final static int BLUE
 final static int GREEN
 final static int ORANGE
 final static int RED
 final static int STRUM_DOWN
 final static int STRUM_UP
 final static int YELLOW
 final static int MINUS
 final static int PLUS
//
 boolean isAnyPressed(int button)  
 boolean isOnlyPressed(int button)
 boolean isPressed(int button)
 boolean wasOnlyPressed(int button)
 boolean wasPressed(int button)
 boolean wasReleased(int button)
 Loc getStick()   // get the current stick 2D(Loc) position. (-1 to 1)
 float getWhammyBar()  // get the current amount the whammy bar is pushed. (0 to 1)
}
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #56 - Jan 26th, 2008, 10:44am
 
Anyone had any luck on windows? I'm using bluecove with bluesoleil and what I have now is a message "trying to find a wii" and nothing happens then. In my bluesoleil software I can see how it searches for a new device and finds my wiimote, but nothing changes on processing side.
I've tried different ways, but with the same result.
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #57 - Jan 26th, 2008, 12:56pm
 
hi  w0rse
i can not test on your situatin, but is the followings help for you?
http://www.wiili.org/forum/help---und-gt-error-getting-device---not-supported-on-bluesole-t3388.html
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #58 - Jan 26th, 2008, 3:20pm
 
I run the example: http://www.geocities.jp/classiclll_newweb/P5aber/applet/index.html

an got the error:

Exception in thread "Thread-2" java.lang.NoClassDefFoundError: javax/bluetooth/DiscoveryListener
at lll.wrj4P5.Wrj4P5.connect(Wrj4P5.java:202)

i install Bluesoleil (just turn bluetooth on, not connect to the wiimote)

I've installed all needet libs:

Processing\libraries\wrj4P5\Library
- avetanaBluetooth.jar (renamed bluecove library)
- loc.jar
- WiiRemoteJ.jar
- wrj4P5.jar

Processing\libraries\loc\Library
- loc.jar

but i does not work! Sad

please help.
Re: wrj4P5, WiiRemote P5 Library - Alpha
Reply #59 - Jan 26th, 2008, 4:05pm
 
kspksp wrote on Jan 26th, 2008, 3:20pm:
I run the example:
Exception in thread "Thread-2" java.lang.NoClassDefFoundError: javax/bluetooth/DiscoveryListener
at lll.wrj4P5.Wrj4P5.connect(Wrj4P5.java:202)
hi kspksp.
what your version of JRE, BlueCove, WiiremoteJ and Wrj4P5
WiiremoteJ does not run on the Processing with java.(including JRE1.4)

kspksp wrote on Jan 26th, 2008, 3:20pm:
i install Bluesoleil (just turn bluetooth on, not connect to the wiimote)
some problem seem to be exist arround the bluesoleil.
see
http://www.wiili.org/forum/help---und-gt-error-getting-device---not-supported-on-bluesole-t3388.html

kspksp wrote on Jan 26th, 2008, 3:20pm:
I've installed all needet libs:
Processing\libraries\wrj4P5\Library
- avetanaBluetooth.jar (renamed bluecove library)
- loc.jar
- WiiRemoteJ.jar
- wrj4P5.jar
renaming is no needed.
newest are BlueCove2.0.2(or 2.0.3_Snapshot), WiiremoteJv1.2 and Wrj4P5 alpha004.
Pages: 1 2 3 4 5 6 ... 16