WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Frequency of data

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> General OSX Wiimote
View previous topic :: View next topic  
Author Message
schogla



Joined: 30 Mar 2007
Posts: 8

Digg It
PostPosted: Fri Mar 30, 2007 2:44 pm    Post subject: Frequency of data

What is the temporal resolution of the wiimote? anyone know

am doing some stuff with The AKAwiiremote in max msp and it appears that at most it seems to be packets of data at 100hz or 30 hz

can that be right?? I know for gaming less sensitve info is needed due to the 50 hz refresh rate of most screens but it seesm an aweful waste if it isonly giving new info every 30ms

??

ANy ideas
Back to top
View user's profile Send private message Visit poster's website
wic



Joined: 26 Mar 2007
Posts: 57
Location: Sweden

Digg It
PostPosted: Wed Apr 25, 2007 10:46 pm    Post subject:

The wiimote sends data at a maximum rate of 100Hz. There are two modes: continuous or "when-changed". Continuous gives you a constant 100Hz. When-changed sends data each time a new button/ir/acc reading has changed, also maximum of 100hz.
Back to top
View user's profile Send private message
schogla



Joined: 30 Mar 2007
Posts: 8

Digg It
PostPosted: Tue May 08, 2007 9:05 am    Post subject: Resolution

Hi thanks - I am currently using the MAXMSP object for accessing wii accel data - have calibratyed it to real world values and it is not bad

I have noted thet in teh source code in Wiimote.c there is the following
stipulation in the code for 10ms is it possible to change this here to up thew resolution?

I am not much of a programer but a motion researcher studying performance etc.... any ideas all.

I will post my calibration results in another thread I started a while back

B




"Boolean wiiremote_connect(WiiRemoteRef wiiremote)
{
IOReturn ret;
short i;

if (wiiremote->device == nil)
return false;

// connect the device
for (i=0; i<kTrial; i++)
{
ret = IOBluetoothDeviceOpenConnection(wiiremote->device, nil, nil);
if ( ret == kIOReturnSuccess)
break;
usleep(10000); // wait 10ms
}
if (i==kTrial)
return false;

wiiremote->disconnectNotification = IOBluetoothDeviceRegisterForDisconnectNotification(wiiremote->device, myDisconnectedFunc, (void *)wiiremote);

// performs an SDP query
for (i=0; i<kTrial; i++)
{
ret = IOBluetoothDevicePerformSDPQuery(wiiremote->device, nil, nil);
if ( ret == kIOReturnSuccess)
break;
usleep(10000); // wait 10ms
}
if (i==kTrial)
return false;

// open L2CAPChannel : BluetoothL2CAPPSM = 17
for (i=0; i<kTrial; i++)
{
ret = IOBluetoothDeviceOpenL2CAPChannelSync(wiiremote->device, &(wiiremote->cchan), 17, myEventListener, (void *)wiiremote);
if ( ret == kIOReturnSuccess)
break;
usleep(10000); // wait 10ms
}
if (i==kTrial)
{
wiiremote->cchan = nil;
IOBluetoothDeviceCloseConnection(wiiremote->device);
//wiiremote->device = nil; // remove in B5
return false;
}
IOBluetoothObjectRetain(wiiremote->cchan); // add in B5

// open L2CAPChannel : BluetoothL2CAPPSM = 19
for (i=0; i<kTrial; i++)
{
ret = IOBluetoothDeviceOpenL2CAPChannelSync(wiiremote->device, &(wiiremote->ichan), 19, myEventListener, (void *)wiiremote);
if ( ret == kIOReturnSuccess)
break;
usleep(10000); // wait 10ms
}
if (i==kTrial)
{
wiiremote->ichan = nil;
IOBluetoothL2CAPChannelCloseChannel(wiiremote->cchan);
IOBluetoothObjectRelease(wiiremote->cchan); // add in B5
IOBluetoothDeviceCloseConnection(wiiremote->device);
//wiiremote->device = nil; // remove in B5
return false;
}
IOBluetoothObjectRetain(wiiremote->ichan); // add in B5

wiiremote_motionsensor(wiiremote, true);
wiiremote_irsensor(wiiremote, false);
wiiremote_vibration(wiiremote, false);
wiiremote_led(wiiremote, false, false, false, false);
wiiremote_expansionport(wiiremote, false);

for(i = 0; i< kTrial; i++) // add in B5
{
readData(wiiremote, 0x0010, 16);
usleep(10000); // wait 10ms
}

return true;
}
Back to top
View user's profile Send private message Visit poster's website
wic



Joined: 26 Mar 2007
Posts: 57
Location: Sweden

Digg It
PostPosted: Tue May 08, 2007 9:41 am    Post subject:

Hi

I'm afraid the maximum output from the wiimote is 100Hz. At least we dont know any way to change that. The limitation is definately in the wiimote. I dont know about the code you posted, using sleeps seems odd to me. Anyway, the rate it easy to measure: put the wiimote in continuous mode, (or just spin the wiimote on its strap) then count the samples for a few seconds and divide that number by the time. If you dont get 100samples/sec, then your software is doing it wrong.

Btw, I am very interested in hearing about any results you can get out of the wiimote regarding precision, calibration etc. So if you have anything, dont hesitate to post your results and conclusions!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> General OSX Wiimote All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group