Author Topic: 6 DOF based physics games  (Read 11210 times)

Offline JayAr

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
on: October 22, 2010, 06:23:56 AM
Hi,

right now I'm trying to build a simple sports simulation (Baseball at the moment) with 6 Degrees of freedom.
To track the orientation of the Wiimote I Use Motion Plus which is supported by GlovePie.
For tracking the position I'm trying to do stereo tracking with two other Wiimotes, so 3 Wiimotes are used in the end.

I put IR LEDs on the Wiimote which should get tracked.

As a graphics engine, I use Ogre3D. This is actually not a game engine but only graphics but you can import all kinds of libraries. So for the physics I use the Bullet library, which works pretty good (documentation is not so good, however).

Right now I only have a baseball bat and can smash objects around ;), but I want to build some other applications like billiard or badminton/tennis. Maybe something where you have to push things around would be a good demonstration if the position tracking.

The orientation works ok with MotionPlus. The tracking works somehow, but a big problem is, that the viewing angle of the Wiimote is very small, so I need to stand far away to be able to make big movements. But the the IR LEDs (Vishay 6400) arent tracked so well...
So right now I have to build a good device to put on the Wiimote with lots of LEDs  that get tracked by the two other Wiimotes.

I only tested with coin cell batteries so far? Are those two weak so will it be better with real batteries?

Also one thing I noticed. The Wii Sports Resort Swordfight Demo is kind of a reference for me. I notice that the swords orientation is tracked very well, and the recalibration of the orientation of the sword is very good there.
If you rotate with MotionPlus for a long time the orientation gets wrong after a while, so the sword recalibrates when you move slowly. I also do this recalibration. Yaw gets recalibrated by pointing to the sensor bar. Pitch and Roll can be recalibrated, because GlovePie supports a value of the Wiimote which can track Pitch and Roll if your not moving too fast. So I use this value for recalibration of Pitch and Roll.
However, I fear that the full potential of MotionPlus is not supported enough by GlovePie. In an Iwata (President of Nintendo) Asks Interview he stated, that MotionPlus would support different sensors depending on how fast you rotate the Wiimote. So in Wii Sports Resort you can move the sword really fast for a pretty long time and it still points in a good direction, so the orientation doesnt get off so fast. I really wonder if its GlovePie which doesnt support the sensor which tracks fast movement, or if Im doing something wrong.

Edit: Ping Pong:


Billiard:



« Last Edit: January 09, 2011, 08:47:52 PM by JayAr »



Offline JayAr

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Reply #1 on: January 09, 2011, 08:48:09 PM
I tried it with IR LEDs on the Wiimote, but I want to try out IR-Array with reflective tape now, because I hope that the tape gets tracked under most Angles with which I hold the Wiimote against the Cameras



Offline zainey

  • *
  • Posts: 64
  • Karma: +2/-0
    • View Profile
Reply #2 on: January 09, 2011, 09:15:03 PM
Hi,

The sensitivity of the Wiimote is not always the best when started.

Have you tried maximising the IR sensitivity settings for the camera.

This can be programmed into the Wiimote during initialisation.

Look at these examples:

Adaptation from WiiBrew and FreeTrack:
http://glovepie.org/forum/viewtopic.php?f=2&t=523

Whiteboard use:
http://glovepie.org/forum/viewtopic.php?f=6&t=728

In my experience this can make a huge difference to the detection range.


In another experiment to get a wide field of view for the Wiimote I have used a fish-eye lens from an SLR camera for testing. The Wiiremote is positioned very close to the back of the lens and it works nicely. It has the advantage of a wide field of view (up to 180 view) and improved IR sensitivity from the big aperture, as well.

However, apart from testing the basic idea, I put the concept on the shelf - but it does work, if you can sort out the calibration issues.

Good Luck.
« Last Edit: January 09, 2011, 09:17:42 PM by zainey »



Offline fernandohildebrand

  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Reply #3 on: February 04, 2011, 03:03:08 PM
Well, have you seen the AiLive demo? Take a look. In truth you dont need that much to get really to 6DOF. Problem is both the acelerometer and gyroscope are way too sensitive and error cumulating.
All you really need is a filter (most advice Kalman), and eventual recalibration when IR comes to use.

I had this simple idea, where you use the Wiimote, MotionPlus, the regular sensor on tv, and add another in the back of the room, that way you get IR recalibration every time, even with your hand(wiimote) behind you.



Offline JayAr

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Reply #4 on: March 06, 2011, 07:42:35 PM
Hi thanks for the ideas.

I tried the script in GlovePie which should change the Wiimote IR sensitivity, but it didnt really improve anything... I dont know if I did something wrong there.

@fernandohildebrand
Yes I saw the AILive demo, and I dont really know how they do tracking. Have you seen any documentation on how they do it in this demo?
What actually do you mean with "the sensor" on the TV? Do you mean the Sensor Bar? Would this be some "structur from motion" approach, where the IR Camera of the Controller is moved in space and therefore you get multiple pictures from which you calculate the 3D position? So only one IR-Camera and one Sensor Bar?
What exactly does the Kalman filter do?

Well to update what I did: In the beginning I used Stereo Tracking with 2 Wiimote-IR-Cameras, but the setup was the Cameras lying on the table with parallel axes. So the triangulation was very simple to calculate.
The problem was, when moving an IR Diode in y- or z-axes, the tracking was pretty good, but when I moved it in x-Axes (parallel to the image plane of the IR-Cameras) there was some serious jittering.

Now I dont do axes parrallel tracking anymore, but (I dont know if the word in English applies) convergent tracking, meaning the Wiimotes are angled towards each other (different orientation), and are quite distant from each other.
I show you an image wich makes the setup pretty clear:


 So first I do camera calibration with a tool called "EasyCalibrationTool" (http://research.microsoft.com/en-us/um/people/zhang/calib/). This gets me the internal and external camera parameters of the Wiimotes.
With the help of the internal and external parameters I calculate the position of the IR-Diode in world space coordinates.
But actually this kind of helps a little, meaning there is less jittering when moving the Diode in the x-Axes, but I was hoping it would reduce the jittering more.

But I saw some Algorithm now which could improve the calculation of the world space coordinates by minimization, at least I hope it does.

And I wonder if the Kalman Algorithm could help, or if it only applies to using ONE camera only??
« Last Edit: March 06, 2011, 07:56:54 PM by JayAr »



Offline JayAr

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Reply #5 on: March 15, 2011, 06:04:52 PM
Hi, all problems seem to be solved now! The tracking actually works pretty good.

There were issues with the camera calibration (with the EasyCameraCalibration Tool). You need a calibration plate with 4 Infrared LEDs and you make multiple pictures of those IR-LEDs in different orientations with one Wiimote. This gives you internal and external camera parameters. What I did wrong in the beginning was, because I wanted to calibrate two cameras, I made pictures of the calibration plate, with the constraint that both cameras have to actually see the calibration plate. The problem with this approach is, you cant turn the plate in extremely different orientations, because then theres always one wiimote which cant see the leds. But actually I need only ONE picture where both wiimotes can see the LEDs, and this picture gives you the external camera parameters (the calibration plate is actually the origin of the world coordinate system).
So now I make ONE picture with both cameras seeing the calibration plate. And the other pictures I make for only ONE camera at a time, so now I can turn the calibration plate in extreme angles.
Therefore the calibration works really good, and there is no jittering when Im far away. It only jitters when I move to the left or to the right, but the games actually dont suffer much from this.

So now I can go pretty far away from the cameras.

Plus I use two InfraRed LED Arryas (one for each wiimote) and reflective material (no reflective tape, this didnt work for me, I use reflective stuff from the bike shop;) It works really good with that).
And i made kind of an egg shape which I put on the top of the Wiimote and on this eggshape I put the reflective material. The eggshape looks pretty stupid, but it works good, because now the Infrared Cameras can track the egg shape very good, so you can hold the Wiimote in almost all angles, and the cameras dont loose the object they should track.

Maybe I post some videos at some time.
« Last Edit: March 15, 2011, 06:19:09 PM by JayAr »



Offline JayAr

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Reply #6 on: March 23, 2011, 10:35:39 AM
Hi,

so the first video shows the ping pong game and the player. Sorry, it starts after 10 seconds:

[youtube]http://www.youtube.com/watch?v=vMQFJ7bpbo4[/youtube]

The second video shows the billiard game:

[youtube]http://www.youtube.com/watch?v=2Jh2JP1XLbQ[/youtube]

The controls are simplified, meaning the player can only aim when holding the A-Button, afterwards he can only push the Queue forwards or backwards. I chose to simplify the controls, because it would be too hard to hit the ball on the right position and orientation, if you would have 6 DOF, instead of, well 1 ;O
« Last Edit: March 23, 2011, 11:04:14 AM by JayAr »