| View previous topic :: View next topic |
| Author |
Message |
TiagoTiago
Joined: 20 Jan 2007 Posts: 711 Location: Brasil
Digg It |
Posted: Sun Jan 21, 2007 6:05 am Post subject: 6 dof 3d tracking, why it isn't avaiable (yet)? |
|
|
even if the Wiimote itself doesn't have 6 degreesof freedom 3d tracking as part of its raw sensor data, is it so hard to get the math required to calculate the reamaining data from the avaiable numbers reported by the Wiimote?
I mean, I personally am not an specialist in 3d math, but it seems the wiimote reports all the data required to get that (the acelerometer data combined with the angle datat combined with the data about the IR dots) |
|
| Back to top |
|
 |
TiagoTiago
Joined: 20 Jan 2007 Posts: 711 Location: Brasil
Digg It |
Posted: Sun Jan 21, 2007 9:11 am Post subject: |
|
|
ok, here is my first (of many I hope) contribuition to this cause
the following lines of code will map the distance from the sensor bar to the first analog axis, and display the raw value returned by the function on the debug thing
edit: now it will also read the roll angle (in a -80 to 80 degrees since near 90 it tends to flip out) based on 2 IR dots
| Code: | PPJoy1.Analog0 =MapRange(sqrt(sqr(Wiimote1.dot1x - Wiimote1.dot2x) + sqr(Wiimote1.dot1y- Wiimote1.dot2y)), 230, 800, -1, 1)// change the values to fit the range of the motion you are willing to make
PPJoy1.Analog1 = MapRange(atan((Wiimote1.dot1y- Wiimote1.dot2y)/(Wiimote1.dot1x- Wiimote1.dot2x)), -80, 80, -1, 1)
debug = sqrt(sqr(Wiimote1.dot1x - Wiimote1.dot2x) + sqr(Wiimote1.dot1y- Wiimote1.dot2y))
|
|
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Sun Jan 21, 2007 8:48 pm Post subject: |
|
|
| Yes it is that hard. To the point of being practically impossible. |
|
| Back to top |
|
 |
TiagoTiago
Joined: 20 Jan 2007 Posts: 711 Location: Brasil
Digg It |
Posted: Sun Jan 21, 2007 9:27 pm Post subject: |
|
|
| CarlKenner wrote: | | Yes it is that hard. To the point of being practically impossible. |
 |
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Sun Jan 21, 2007 11:23 pm Post subject: |
|
|
I like your distance detection though. That is cool.
When it isn't moving you can get reasonable roll angle measurement from the accelerometers. But when the Wiimote is moving it is hard to seperate roll from accleration using the accelerometers. Maybe there is a way to combine the two sources of roll data?
Since the pitch angle of the Wiimote is easy to measure (when the Wiimote isn't moving too much) using the accelerometers, you should be able to work out the vertical position of the wiimote based on the IR (taking into account the pitch and the distance and a bit of trigonometry). |
|
| Back to top |
|
 |
CarlKenner Site Admin
Joined: 29 Nov 2006 Posts: 614
Digg It |
Posted: Tue Jan 23, 2007 1:27 am Post subject: |
|
|
| OK, see my post in the Scripts forum for 5DOF Tracking. It can only track position while the wiimote is pointing towards the sensor bar. It can't distinguish yaw from x yet. |
|
| Back to top |
|
 |
TiagoTiago
Joined: 20 Jan 2007 Posts: 711 Location: Brasil
Digg It |
Posted: Wed Jan 24, 2007 3:34 pm Post subject: |
|
|
ok, I've placed 4 leds on the following dsposition
| Code: |
side view
|
|*
|
|*
|
| |*
|______|
front view
;;;;;;;;;
;;;;*;;;;
;;;;;;;;;
;;;;*;;;;
;;;;;;;;;
;;;;;;;;;
;*;;;;;*;
;;;;;;;;;
|
any sugestions on how to calculate 3d data based on 4 dot s liek that? and also perhaps a better disposition of the dots thant e one I choose?
edit: I forgot to add this, my idea with that pattern woudl be figuring out an algorithm tht woudl diferenntiate between the horizontal and the vertical pairs and use trigonometry to figure out the position and angle based on the ratio of the distance between each dot on the pairs and also based on the angle between the middle of the botom pair and the middle of the upper pair |
|
| Back to top |
|
 |
|