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)