Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GVR: change default unity quaternion of HEAD to Madgwick filter's quaternion in android?

Discussion in 'AR/VR (XR) Discussion' started by IdeoG, Oct 14, 2017.

  1. IdeoG

    IdeoG

    Joined:
    Oct 14, 2017
    Posts:
    22
    Hello there,
    I'm young Unity VR developer. Developing VR games, I have observed that my phone - Samsung Galaxy S7 has lack in angle position calculation, e.g. Z axis has huge lack in angle, even at rest position.
    I figured out some good terms algorithms, e.g. Madgwick filter, that gives better stability.
    So is there opportunity to change default unity quaternion to Madgwick's?

    Best regards,
    Alex.
     
  2. SiliconDroid

    SiliconDroid

    Joined:
    Feb 20, 2017
    Posts:
    302
    Hi,

    Galaxy S7 has no problem giving a solid Z axis rotation signal (roll axis in HMD).

    The mobile VR SDKs compatible with that phone (GoogleVR and Oculus) are both using good Kalman filtering and achieving smooth signals with low latency already.

    If your phone is glitching then something's wrong, have you tried loading a Cardboard game off GooglePlay to see if that gives solid rotational tracking. It may be that you are implementing your application in unity incorrectly.
     
  3. IdeoG

    IdeoG

    Joined:
    Oct 14, 2017
    Posts:
    22
    Hi SiliconDroid,
    I'm a little bit surprised to hear that GoogleVR is using Kalman filtering. Is it using magnetometer at all?
    Z angle has lack with 1 degree per second. I haven't solved this problem yet.
    I created empty project, then added some boxes. After that i imported GoogleVR package. I don't know how can i implement incorrectly my application. It's weird.
    Any suggestion?

    Best regards,
    Alex.
     
  4. IdeoG

    IdeoG

    Joined:
    Oct 14, 2017
    Posts:
    22
    Does anybody interest in answering this question?
     
  5. nat42

    nat42

    Joined:
    Jun 10, 2017
    Posts:
    353
    Have you tried rebooting the phone and then recalibrating the compass in Google Maps (follow the directions to swing the phone around in a figure 8 pattern until the range of angles it gives for your orientation on the map is like 30 degrees) ?

    NB: ignoring the question, because it sounds like you want to solve your device issues, not re-write the SDK algorithm
     
  6. IdeoG

    IdeoG

    Joined:
    Oct 14, 2017
    Posts:
    22
    Hello, nat42.
    I calibrated compass by 2 different ways, as you recommended (i have got orientation of map within 30 degrees), and by software *#0*#, which is more precise.
    I have noticed that after phone rebooting compass is uncalibrated, even if i calibrate it before. Also, phone calibration doesn't solve my problem.

    Best regards,
    Alex.
     
  7. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734