 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
FlyinWhee
Joined: 26 Dec 2006 Posts: 2
Digg It |
Posted: Tue Dec 26, 2006 5:40 am Post subject: Question about absolute positioning |
|
|
I was wondering, given the data obtained from the Wiimote's movement; be it in GlovePIE or any other interfacing method for the PC, if, and how, it would be possible to determine the position (X,Y,Z) of the wiimote in a defined space.
As far as I know, all movement with the wiimote is relative. as such, it would be possible to read a position as "the center", and interpret all accelerometer data from that point on to move the cursor around that spot. It would probably require setting the boudaries of that spot the make the data useable in the least...
But my question really is this, how do I figure movement in each direction from the data of the wiimote? I was looking at the data in WiinRemote, mostly, and the movement of the Wiimote other than rotation is eluding me; I don't see what changes when I go along any specific axis.
Any help will be appreciated, semi-concrete examples will be appreciated (in GlovePIE if nothing else), thank you. |
|
| Back to top |
|
 |
squeakypants
Joined: 09 Nov 2006 Posts: 99
Digg It |
Posted: Tue Dec 26, 2006 6:50 am Post subject: |
|
|
| The problem with accelerometers are that they can only fully track motion in a 0-gravity environment or while in conjunction with gyroscopes. However, if someone developed an algorithm to separate motion-based acceleration from gravitational, it would be possible (it would also make rotation-calculating much more accurate) |
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Tue Dec 26, 2006 9:50 pm Post subject: |
|
|
Currently GlovePIE attempts to seperate rotation as Pitch and Roll, from acceleration as RelAccX, RelAccY, and RelAccZ. It doesn't do a very good job though.
RelAccX, RelAccY and RelAccZ indicate the acceleration in m/s/s. You add the acceleration multiplied by the time since the last update to the velocity. Then you add the velocity multiplied by the time since the last update to the position.
Unfortunately I couldn't get it to calculate sensible velocities, let alone sensible positions. I'll have another go later. |
|
| Back to top |
|
 |
alecool
Joined: 11 Dec 2006 Posts: 18
Digg It |
Posted: Tue Dec 26, 2006 10:34 pm Post subject: |
|
|
I have made a small program using dark basic pro and glovepie, which sends the acceleration datas and IR positioning datas through PPjoy virtual joystick. I achieved to mahe a small sphere moves like the wiimote, but I have to keeps it in front of the sensor bar. I can use all of the datas given by the wiimote. I use the distance between the two IR points to get the depth of the wiimote, and the Y and X position to put these coordinates to the sphere. I can also use the pitch and roll to rotate the model. I can't give the program now cause i went back home for christmas, but I will make some improvements and show what is possible to do with this... _________________ French wiimote-on-PC user, so excuse my poor language  |
|
| Back to top |
|
 |
FlyinWhee
Joined: 26 Dec 2006 Posts: 2
Digg It |
Posted: Wed Dec 27, 2006 2:39 am Post subject: |
|
|
Well I'll fiddle around with what Carl posted, see If I can myself make some headway on the topic.
My idea is to make a small virtual space with planes that trigger events when the Wiimote crosses it, with a set of conditions.
The first idea is to make a much more logical air drum than what is currently available, but the ways of using such a flexible interface could be many.
Anyway, back to "work"! |
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Wed Dec 27, 2006 9:51 am Post subject: |
|
|
| alecool wrote: | | I have made a small program using dark basic pro and glovepie, which sends the acceleration datas and IR positioning datas through PPjoy virtual joystick. I achieved to mahe a small sphere moves like the wiimote, but I have to keeps it in front of the sensor bar. I can use all of the datas given by the wiimote. I use the distance between the two IR points to get the depth of the wiimote, and the Y and X position to put these coordinates to the sphere. I can also use the pitch and roll to rotate the model. I can't give the program now cause i went back home for christmas, but I will make some improvements and show what is possible to do with this... |
You should use something that is not a sphere, so you can show rotation. You can use Wiimote.Pitch and Wiimote.Roll to get reasonably good rotations. |
|
| Back to top |
|
 |
squeakypants
Joined: 09 Nov 2006 Posts: 99
Digg It |
Posted: Wed Dec 27, 2006 10:14 pm Post subject: |
|
|
I just got an amazing idea. I've been thinking "You can't get rid of the gravitational acceleration without knowing the rotation, so you need gyroscopes to work in conjunction to be able to know the non-gravitational acceleration." However, we have the IR sources! If you have 2 IR sources, you can easily find the roll, which alone factors out g-acceleration from the X and Y axes. However, this brings a problem in itself:
The g-acceleration is used to find rotation using the following formula (note, all following formulas disregard negatives, absolute value must be used in many cases):
| Code: | | (Axis1)/(Axis1 + Axis2) |
However, we know that if the acceleration is purely gravitational, which is needed for any of this to work, X+Y+Z = 1g. We can then say:
| Code: | | Axis1 + Axis2 = 1 - Axis3 |
We can then say:
| Code: | | (Axis1)/(1 - Axis3) |
The reason this is a problem is because we know that X+Y will only = 1 when Z = 0. So, if Z = anything other than 0, using the above method will subtract too much acceleration from X and Y. For example, if X, Y, and Z all = 1/3, then it will subtract 1/2 from X and Y instead of 1/3 because it isn't factoring in Z. How can we fix this?
3 IR points
I knew there was a reason to be able to pick up more than 2 IR points and that is why. I'm still not sure how in official games it does this (as the Wiimote detects the sensor bar as only 2 points). However, if you have 2 level points, and one above it (in a certain place however, the easiest would be either creating a right or isosceles triangle), it is simple math to be able to find the Roll and Pitch (and in essence, Yaw), which is enough to calculate the amount of g-acceleration going into each axis.
So, anyone up to the challenge of making a triangular sensor bar?
Last edited by squeakypants on Fri Dec 29, 2006 7:35 am; edited 1 time in total |
|
| Back to top |
|
 |
|
|
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
|