Does exists a solution to remove flickering of the Wiimote gyro ?

I want know if exists a solution, or some parameters, to remove flickering of the Wii Remote Plus, because I made a little game application, that involves the Physics, but the objects flicker too:

  • In the scene, the dynamic objects slide over a table, and the Input behavior of the Wii Remote Plus gyroscope, is not the same as the input behavior of the arrow keys, on the Keyboard !

  • The flickering of input (I think), is because Wii Remote Plus, reads 60 times per second the processing signal; thus, it is not very much smoothly by rotating objects with gyroscope!

1)Does exists some adjustable parameters on “PPJoy”? (the “Timing”, in the version 0.8.4.5 are disabled (grayed out), and cannot be modified at all!)

2)Does exists some options on “Glovepie 0.45”, to add some scripting line code, that smooth the rotational movements of the gyro, of the Wii Remote Plus?

3)Do anything know if exists some Physics parameters, that should be adjusted in “Unity3D v.3.4.2f5” ?

Where can I get more information?

Anyone have a suggestion?

Help, please!

Thanks!
Horsepower.

I don’t know what exactly the gyroscope returns, but if it’s a Vector3 you can use a Lerp filter to smooth out the values read - that’s often used with Input.acceleration, a very jerky signal without any filtering.

Supposing you’re reading the gyroscope value in a Vector3 variable called gyro, you could use this:

var smoothGyro: Vector3 = Vector3.zero; // smoothed gyro value
var speed: float = 1.5; // the lower the speed, the higher the smoothness

function Start(){
  while (true){ // filters the gyro value continuously:
    var gyro:Vector3 = //<- read the gyro value and assign it to this variable
    smoothGyro = Vector3.Lerp(smoothGyro, gyro, speed*Time.deltaTime);
    yield; // repeats the loop next update
  }
}

The variable smoothGyro contains a filtered version of the raw gyro signal - read it when needed.

I don’t use Input.acceleration Script.

I use GlovePIE 0.45 that interfaces to Unity3D, to have more control, and it is more simple (I think!).

Thus, Yes!: I have used “Lerp” filter to smooth out the values.

My modified “Rotate Behaviour Script”, that finally I already writed, run correctly.

I hope I’ve done a good work to compile it, in that manner! I am not sure, but it works without errors:


var maxVert: float = 90; // define the max vertical angle (to each side)
var maxHor: float = 90;  // define the max horizontal angle (to each side)
private var initRot: Quaternion;

function Start(){
  initRot = transform.rotation;
}

function Update(){
  var angV = Input.GetAxis("Vertical") * maxVert;
  var angH = Input.GetAxis("Horizontal") * maxHor;
  var target  = initRot * Quaternion.Euler(-angV, 0, angH);

  // Dampen towards the target rotation

  transform.rotation = Quaternion.Slerp(transform.rotation, target,
  					   Time.deltaTime * 2);;
}

Do it’s correct?

It run OK!

And smooth very well the signal;

IF I put:

“Time.deltaTime * 1)”

it is more smoothed but exaggerated; the input command doesn’t respond very quickly to gyroscope

Instead with:

“Time.deltaTime * 2)”

it’s OK!