| View previous topic :: View next topic |
| Author |
Message |
Perry3D
Joined: 08 Dec 2007 Posts: 4
Digg It |
Posted: Sat Dec 08, 2007 5:37 pm Post subject: IR-Mode Extended |
|
|
Hi.
I'm trying to get the size of the IR-Lights. So, i enabled the IR-sensor with extended mode. But now the listener fires no events. In basic mode everything works fine, except the size .
I use bluecove on widcomm and Windows XP SP2 with an MSI bluetooth stick.
The simple code:
| Code: | public static void main(String[] args) {
try {
WiiRemote remote = WiiRemoteJ.findRemote();
remote.addWiiRemoteListener(new WRLImpl(remote));
remote.setInterleaved(true);
remote.setAccelerometerEnabled(false);
remote.setIRSensorEnabled(true, WRIREvent.EXTENDED);
if (remote.isExtensionEnabled()) System.out.println("Extension enabled");
else System.out.println("No Extension");
System.out.println("IR-Mode: "+remote.getIRMode());
} catch (Exception e) {
e.printStackTrace();
}
}
public void IRInputReceived(WRIREvent evt)
{
for (IRLight light : evt.getIRLights())
{
if (light != null)
{
System.out.println("X: "+light.getX());
System.out.println("Y: "+light.getY());
System.out.println("Size: "+light.getSize());
}
}
} |
What can i do?
Perry |
|
| Back to top |
|
 |
Cha0s Site Admin
Joined: 17 Jan 2007 Posts: 449
Digg It |
Posted: Sun Dec 09, 2007 5:35 am Post subject: Re: IR-Mode Extended |
|
|
| Perry3D wrote: | | Code: | | remote.setInterleaved(true); |
|
First, interleaved input gives you "full" data, not extended. Second, it does not work, as no one knows the format for it. Take out that line and try it again.
| WiiRemoteJ javadoc wrote: | | Only Basic and Extended modes are implemented at this time. |
So don't try full mode.  _________________ Cha0s |
|
| Back to top |
|
 |
Perry3D
Joined: 08 Dec 2007 Posts: 4
Digg It |
Posted: Sun Dec 09, 2007 2:43 pm Post subject: |
|
|
| I only try the extended mode. With interleaving on and off: same result. |
|
| Back to top |
|
 |
Cha0s Site Admin
Joined: 17 Jan 2007 Posts: 449
Digg It |
Posted: Mon Dec 10, 2007 8:22 am Post subject: |
|
|
| Code: | public static void main(String[] args) {
try {
WiiRemote remote = WiiRemoteJ.findRemote();
WiiRemoteAdapter aListener = new WiiRemoteAdapter()
{
public void IRInputReceived(WRIREvent evt)
{
for (IRLight light : evt.getIRLights())
{
if (light != null)
{
System.out.println("X: "+light.getX());
System.out.println("Y: "+light.getY());
System.out.println("Size: "+light.getSize());
}
}
}
}
remote.addWiiRemoteListener(aListener);
remote.setIRSensorEnabled(true, WRIREvent.EXTENDED);
System.out.println("IR-Mode: "+remote.getIRMode());
} catch (Exception e) {
e.printStackTrace();
}
}
} |
Try that. I didn't test it, so I'm not sure if it'll work, but it should. Note that you were trying to put the listener code in something that wasn't a listener. That IRInputReceived thing needs to be in the listener you add to the remote. (Note that all the other stuff that WRLImpl does won't work, but you should get IR output). _________________ Cha0s |
|
| Back to top |
|
 |
wimfikkert
Joined: 29 Jan 2008 Posts: 1
Digg It |
Posted: Fri Apr 11, 2008 1:27 pm Post subject: |
|
|
Hi all,
Have been working with WiiRemoteJ for some time now. I am able to find myself around pretty ok.
However, today I have been struggling with the IR light size. I cannot seem to get it at all. In BASIC mode (setIRSensorEnabled(true, WRIREvent.BASIC)) the locations are found with -1 size (as expected). However, in EXTENDED mode (setIRSensorEnabled(true, WRIREvent.EXTENDED)) I do not get ANY IR lights although IRInputReceived(...) is being fired all the time with null values for each of the 4 light sources.
The lights are working fine according to my IR camera (not mobile or webcam). The code you posted above also has the same issue Chaos. When opening light sources using a C lib, for example, they work just fine with accurate size. I am using Java 1.6, bluecode 2.0.2, widcomm BT stack and the WiiRemoteJ 1.3 download from this site.
Does someone have a possible solution for me?
Cheers and thanks in advance,
Wim |
|
| Back to top |
|
 |
aallison
Joined: 20 Feb 2008 Posts: 1 Location: Stanford, CA
Digg It |
Posted: Fri Apr 18, 2008 3:06 am Post subject: Re: IR Extended |
|
|
The exact same problem happened to me. A couple of things you might try that helped me.
1. Remove the device from your bluetooth devices before starting your app
2. Turning bluetooth services completely off for a minute or so then turning it back on, then running your app.
3. Ensure IR lights are working (which I believe you did)
4. Reboot your computer (last ditch effort)
Granted, I am a bit superstitious about a few of those. But 1 definitely helps ensure you can connect to the device. After a bit of testing, step 2 seems to help get actual IR data points, in both BASIC and EXTENDED mode. It is pretty grumpy about it though.
-Abel |
|
| Back to top |
|
 |
|