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

GyroDroid - Access each and every sensor on Android devices [RELEASED]

Discussion in 'Assets and Asset Store' started by pfc, Aug 19, 2011.

  1. DevIb

    DevIb

    Joined:
    Feb 12, 2015
    Posts:
    5
    hi PFC the minimalCensor works fine on android but when i build it with IOS (iphone 6) wrong behavior like it's to the floor but it's working, i think it's something with the xyz axes, it's inverted or something, thanks for your time
     
    Jokonut likes this.
  2. ronjart

    ronjart

    Joined:
    May 16, 2013
    Posts:
    100
    Any news on Unity 5 support?
     
  3. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    The thread title said [Relased] instead of [Released].

    But somehow that's the only reason I discovered this amazing asset! Is this some kind of marketing trick? Like subconscious attraction to errors? @_@
     
  4. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    @ronjart: That is in the works as soon as we find the time for it. Hopefully before the official release.
    @Gekigengar: The ability to edit the thread title just came with the latest forum updates, before that it was not possible–thanks for the reminder, will change it!
     
  5. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    GyroDroid 5.2 is live in the Assetstore! It mainly adds support for Unity 5 as well as fixing some minor bugs.
     
  6. AndreasO

    AndreasO

    Joined:
    Sep 25, 2012
    Posts:
    90
    Is Windows Phone 8 going to be supported anytime soon?
     
  7. Jickelsen

    Jickelsen

    Joined:
    May 4, 2012
    Posts:
    2
    How do I use the game rotation vector? Looking at the examples, it should be

    Sensor.Activate(Sensor.Type.GameRotationVector);

    and then either

    transform.rotation = Sensor.rotationQuaternion;

    which doesn't produce any rotation at all, or the alternative example from the comments in the file:

    transform.rotation = Sensor.QuaternionFromRotationVector(Sensor.rotationVector);

    However this gives me the following error

    error CS0120: An object reference is required to access non-static member `Sensor.QuaternionFromRotationVector(UnityEngine.Vector3)'

    I have also tried
    transform.rotation = Sensor.QuaternionFromRotationVector(Sensor.gameRotationVector);
    but of course this gives me the same error.
     
  8. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    @geno2k That depends on requests, until now there wasn't so much interest in supporting Windows Phone (it still has a very low percentage). Of course if there is more interest we will look into it.

    @Jickelsen Just use
    Sensor.Activate(Sensor.Type.GameRotationVector)
    and then
    Sensor.gameRotationVector.

    If you want to use QuaternionFromRotationVector, you will have to make a slight change in Sensor.cs: change
    protected static Sensor Singleton
    to
    public static Sensor Singleton, and then use
    Sensor.Singleton.QuaternionFromRotationVector(Sensor.gameRotationVector)
     
  9. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Just an FYI, I'm also highly interested in Windows phone support and BlackBerry 10 as well! Playmaker support would be tremendous. :D This asset looks to be a lifesaver for me. Thanks.
     
  10. DertyMunky

    DertyMunky

    Joined:
    Oct 12, 2013
    Posts:
    1
    How do I get the step counter to work? It starts at -5 and when I walk it will eventually change to what appears to be a random number, then the app says it stopped working and shuts down.
     
  11. alias

    alias

    Joined:
    May 14, 2013
    Posts:
    11

    hey peter

    this script of yours works like a charm. up,down,left and right.
    i got only one problem my scene is played in a different orientation
    my scene when played is face down on my telephone,. and it needs
    to be upright.

    could you help me out with your script so i can adjust the begin orientation
    so it matches the unity xyz coordinate system.
     
    Last edited: May 15, 2015
  12. OverDavide

    OverDavide

    Joined:
    Mar 23, 2015
    Posts:
    1
    [iPHONE FIX - for Accelerometer with GyroDroid and Vuforia] SOLVED AFTER 40h of work!!!

    I want to share with you my knowledge for using Augmented reality without a marker on a iPhone/iPAD

    1) Follow this guide
    http://forum.unity3d.com/threads/gy...d-devices-released.101279/page-3#post-1342611

    2) Then change the class SwitchableSensorCamera to this

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class SwitchableSensorCamera : MonoBehaviour
    5. {
    6.     private Quaternion initialCameraRotation = Quaternion.identity;
    7.     private Quaternion sensorFix;
    8.    
    9.     void Start () {  
    10.         initialCameraRotation = Quaternion.identity;
    11.        
    12.         SensorHelper.ActivateRotation();
    13.     }
    14.    
    15.     void Update () {
    16.  
    17.         sensorFix =  new Quaternion( SensorHelper.rotation.x,SensorHelper.rotation.y, -SensorHelper.rotation.z, -SensorHelper.rotation.w);
    18.  
    19.         transform.rotation = initialCameraRotation * sensorFix;
    20.  
    21.  
    22.     }
    23.     void OnEnable() {
    24.  
    25.         sensorFix =  new Quaternion( SensorHelper.rotation.x,SensorHelper.rotation.y, -SensorHelper.rotation.z, -SensorHelper.rotation.w);
    26.  
    27.         initialCameraRotation = transform.rotation * Quaternion.Inverse(sensorFix);
    28.  
    29.     }
    30. }

    Enjoy!
    I left my head inside a quaternion... ;)


     
    FaberVi likes this.
  13. alias

    alias

    Joined:
    May 14, 2013
    Posts:
    11
    does anyone knows about
    fixing the facedown orientation so its upright.
    So my phone is displaying the scene correct when its layed down. it needs too be displaying
    it in upwards position.

    here is the script that i am using, i tried fiddeling with the parameters but
    that was a no go.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;

    3. public class rotate : MonoBehaviour {

    4. float xRot, yRot, zRot;
    5. public float rotSpeed = 20f;

    6. void Update ()
    7. {
    8. // This tilts the axis of the camera like shaking a head yes
    9. xRot = Input.acceleration.z * -180f;
    10. // This tilts like a driving wheel to make it like shaking head no
    11. yRot = Input.acceleration.x * -180f;
    12. zRot = 0f;
    13. transform.rotation = Quaternion.Lerp(transform.rotation, Quaternion.Euler(new Vector3(xRot, yRot, zRot)), Time.deltaTime * rotSpeed);
    14. }

    15. }
     
  14. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    @DirtyMunke that is a known issue, will be fixed with next release.
    @OverDavide thanks for sharing!
    @alias already replied to your email about that specific problem.
    @everyone we will consider partial Windows Phone support for future releases, thanks for the interest!
     
    christougher likes this.
  15. swastiksoni

    swastiksoni

    Joined:
    Dec 23, 2013
    Posts:
    9
    Hi pfc,
    I am working on a project where I need to find the direction vector on android device in landscape mode relative to the earth coordinates. Basically I need to know the position coordinate of phone and the direction its pointing to (in landscape) relative to earth coordinates. Please let me know if GyroDroid can help me find the direction vector and if there is any sample prefab doing the same. I will look forward to buy the assets.
    thanks,
     
  16. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    @swastiksoni For getting the earth coordinates, please use the LocationService provided by Unity. The direction you can get from GyroDroid in two ways: if you only need magnetic direction (not up/down), use the compass; if you want a full vector, you can just use Sensor.rotation on an object and then use transform.forward to get the pointing vector, which already will be in "earth space". The MinimalSensorCamera example contains exactly that camera behaviour. Hope that helps!
     
  17. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    You can "scale" an object if you move away from it or you get close with this library? Of course, always using the library Vuforia. It also contains functions for calibration of the gyroscope?

    PS: I also would be interested in that example on the use of GPS and your library. Could you post a code sample? thanks :)
     
    Last edited: Jun 26, 2015
  18. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    @D3m0n I don't really get what you mean - GyroDroid is independent to Vuforia, there are some common usecases (enhancing the AR by using the sensors), but these are by now directly implemented in Vuforia itself. Also, GyroDroid does not contain special support for GPS besides the functionality integrated in Unity.
     
  19. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    Thanks anyway I solved! What I wanted to do was be able towards and away from an object with the camera using the gyroscope and / or GPS. About the "stabilize augmented reality" have occurred in other forums that some are using the following formula and they found it really accurate! I am attaching a screen of what is written ..

    it is possible to insert this method of correction in your library?
     

    Attached Files:

  20. MiLO83

    MiLO83

    Joined:
    Jan 11, 2013
    Posts:
    3
    Hi PrefrontalCortex!
    I have purchased and implemented GyroDroid in several of my apps!
    I have never had any problem with it.

    However, on my other device my aiming which uses TurntableSensorCamera drifts and jutters.
    I realize this may not be a GyroDroid issue, but I just got this device "used" yesterday from a friend to replace my Nexus 7 that's touch screen works only on 1 side. I can barely aim on the new device. Do you have any suggestions? The same issue occurs on the GyroDroid play store demo. Slip slidin away! Is there a method to calibrate something? I tried doing figure 8s..
    I assume this to be a device issue but I figure you may have a solution like an app I can recalibrate with or some code to smooth it out? Really was looking forward to playing my game on my replacement device and I cant its too jittery and drifts.
    Thx! (Device is Samsung Mega 1st gen)
    Not your fault but suggestions?
    MiLO83
     
  21. atuljust1

    atuljust1

    Joined:
    Sep 18, 2015
    Posts:
    1
    hey its a very good plugin , I am new be... I integrated gyrodroid in my app, its working , now i want to this.......if any device doesnt have gyro sensors.... then it will debug your device does not have gyro sensors.... how to that i am using minimal sensor script ..questios is- if device doesnt have gyor sensor (rotation) it will show or debug false???
    please help me in that
     
    FaberVi likes this.
  22. akshaypramoth

    akshaypramoth

    Joined:
    Oct 11, 2015
    Posts:
    1
    Hi , I have a problem.. I Use Redmi a 2 prime.. I downloaded your demo from playstore.. but when i click on the rotation vector nothing is happening.. i see no rotation at all.. and also i tried using the gyro package to test it.. and the value it shows is 354.. It was working fine before but not now.. Can you please help me out?
     
  23. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    Last edited: Oct 29, 2015
  24. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    @atuljust1 to access which method is currently used, you have to modify SensorHelper.cs lightly:
    add this somewhere:
    Code (CSharp):
    1. public static CurrentType {
    2.         get { return current; }
    3.     }
    Now you can use SensorHelper.CurrentType to determine which fallback is used. If it is "AccelerationOnly" you know that the device has no support for 360° things.

    @akshaypramoth That looks like a device issue, probably sensors are not good with this one. Can you try another sensor-using app?

    @D3m0n Android uses Sensor Fusion internally and combines that into a virtual sensor called RotationVector which is indeed available through GyroDroid.
     
    FaberVi likes this.
  25. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    @pfc I found several problems with the use of sensors on Android 6.0 and the new version of Unity 5.2.3f1. Iphone 4 on the gyro works while on the iPhone 5 no. Could you update the plugin and check these issues?

    Update: Same problem with Android 6.0, Nexus 5 and Unity 5.3.0f4... Gyro not working.
     
    Last edited: Dec 14, 2015
  26. ElmarKleijn

    ElmarKleijn

    Joined:
    May 11, 2009
    Posts:
    87
    Hi D3m0n,

    I had the same issue (Nexus 5/6.0). I just updated a minute ago to 6.0.1 (to test if it would fix it) and it seems to work again (!)? :)

    Cheers,

    Almar
     
    FaberVi likes this.
  27. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    Yeah! But on iphone 5 IOS 8.0 still does not work!
     
  28. izm1252

    izm1252

    Joined:
    Dec 24, 2015
    Posts:
    7
    [tips]
    I use this assets for iOS and use in Unity 5.1.
    In this assets script "SensorDeviceIPhone.cs" contains many unity version magic number .
    and current version (GyroDroid 5.2) is written for below 5.0.x.

    If you want to use this assets with latest Unity5.1( 5.2,5.3....) ,you should replace code.

    UNITY_5_0

    to

    UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3



    @pfc I'm looking forward to update this :D
     
    FaberVi likes this.
  29. ThumpieBunnyEve

    ThumpieBunnyEve

    Joined:
    Feb 17, 2016
    Posts:
    1
    I'm using an Astro Tab A735, it's not rooted, and once reset to defaults. It has a number of sensors that apps like "Bubble Level" can access. But those exact same sensors Gyrodroid cant seem to find equipped or accessible in any way! I am a COMPLETE noob to android. Gyrodroid is not the only app failing to find my level/gyro data. freePie and HeadTracker also cant find those sensors. But BubbleLevel can? i cant find any help at all on what to do. Theres no menu in the tablet to help, troubbleshoot, nor explain whats wrong. Google misses the mark on almost every search attempt for my supposedly disabled sensors. What can i do?! Please Help!
     
  30. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    Hi @all, sorry for the long wait for a reply.

    @D3m0n what exactly is not working? Can you still reproduce it using the fixes that @izm1252 posted (changing the UNITY_5_X defines)?

    @izm1252 thanks for posting that hotfix. These will of course be included in the next update of GyroDroid, just not sure when that will happen (contracts and work stuff always come in the way). There is an ongoing request by us assetstore sellers to have better ways to allow for forward-compatibility instead of requiring updates whenever a new Unity point release pops up.

    @ThumpieBunnyEve That is a really cheap Android tab, I have no idea about the quality of the internal sensors. Can you post a screenshot of what GyroDroid sees in the statistics scene? Problem could e.g. be that your phone reports having a RotationVector sensor, but actually returns zeros for it and only has a functioning accelerometer. In this case, you can use a different GyroDroid fallback method (you'll find how to in the MinimalSensorCamera.cs script and in the ReadMe), to force it to not use the RotationVector even if the device says its there.
     
  31. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Was wondering if Windows 10 support will be happening as it is also a mobile platform. My game is all about the camera movement scripts and I'd love to be able to build for windows phones and tablets. Thx.
     
    Last edited: Feb 29, 2016
  32. izm1252

    izm1252

    Joined:
    Dec 24, 2015
    Posts:
    7
    @pfc
    thanks for reply! and I looking forward to update :)

    In this asset (current version) , SensorHelper.rotation returns different values between Android and iOS.

    It may be cause from iOS compass behavior. SensorDeviceIPhone.cs may not use "trueHeading" value.

    but I want to get iOS devices "absolute rotation to world" (like android Gyrodroid "Camera as window")

    How Can I get this "absolute" rotation?
     
  33. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Odd Turntable Sensor camera problem with IOS. The 'Use Relative Camera Rotation' (URCR...) option works fine with android but not so much with IOS. Everything works fine within the Unity Editor, but with this option checked the IOS build won't work. Toggling at runtime shows that this is the problem. With the URCR bool checked no movement, unchecked =movement. I do want to have it start out facing the right direction regardless of the phone's initial rotation.

    This is the code...

    Code (CSharp):
    1.         if(useRelativeCameraRotation)
    2.             initialCameraRotation = Quaternion.Euler(0,transform.rotation.eulerAngles.y,0);
    3.         else
    4.             initialCameraRotation = Quaternion.identity;
    Any Ideas? Don't see why IOS would skip setting the camera rotation, it is just zeros... I havn't got around to testing it yet but I think this might be why I couldn't get BB10 to work either...

    Also, yes I updated the scripts to include my current version of Unity

    Edit... ok after playing around with it I'm even more confused... I've messed with it a bunch trying to get the 'URCR' option to work right away on IOS... Part of the problem is it only shows on builds. Within the Unity Editor everything works great, but once I build it in Unity, move it to my Mac, build it in XCode and run it on the phone/tab it's a no go...

    Edit 2, incidently I was able to get it to work the same for BB10 and when I get a Windows Phone 8 with an actual Gyroscope here in a little bit I think that will work as well, however both the BB10 and IOS devices still can't use the UCRC... The way I did this was to use the SensorDeviceIphone, commented out lines 322-346, 363-378, and 424-446, and rename it for BB10 and WP8, and editing line 2 to reflect the correct device.

    I added this to Sensor.Information line 86

    #if !UNITY_WP8

    I edited Sensor.cs lines 188+ to this
    Code (CSharp):
    1.  
    2. #if UNITY_IOS
    3.                 // && !UNITY_EDITOR
    4.                 _singleton = (Sensor)FindObjectOfType(typeof(SensorDeviceIPhone));
    5. #elif UNITY_ANDROID
    6.                 // && !UNITY_EDITOR
    7.                 _singleton = (Sensor)FindObjectOfType(typeof(SensorDeviceAndroid));
    8. #elif UNITY_BLACKBERRY
    9.                 _singleton = (Sensor)FindObjectOfType(typeof(SensorDeviceBB10));
    10. #elif UNITY_WP8
    11.                 _singleton = (Sensor)FindObjectOfType(typeof(SensorDeviceWP8));
    12. #else
    13.                 _singleton = (Sensor)FindObjectOfType(typeof(SensorEditorUnity));
    14. #endif
    15.                 if (_singleton == null)
    16.                 {
    17.                     var go = new GameObject("Singleton::SensorHolder");
    18.  
    19. #if  UNITY_ANDROID && !UNITY_EDITOR
    20.                     _singleton = go.AddComponent<SensorDeviceAndroid>();
    21. #elif UNITY_IOS && !UNITY_EDITOR
    22.                     _singleton = go.AddComponent<SensorDeviceIPhone>();
    23. #elif UNITY_BLACKBERRY && !UNITY_EDITOR
    24.                     _singleton = go.AddComponent<SensorDeviceBB10>();
    25. #elif UNITY_WP8 && !UNITY_EDITOR
    26.                     _singleton = go.AddComponent<SensorDeviceWP8>();
    27. #else
    28.                     _singleton = go.AddComponent<SensorEditorUnity>();
    29. #endif
    Aaaand I think that about did it...
     
    Last edited: Mar 2, 2016
  34. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    Following the advice of izm1252, I managed to solve. In practice it was not working right rotations. But now I find myself a new problem, a "galaxy s5 neo" if I put the app in the background and resume, the sensors do not work anymore (use the minimalsensor script). On a s4 everything works properly. What might be ?? No one has had similar problems or can test with your device if the galaxy s5 neo is not the only case?

    EDIT: https://github.com/KEOpenSource/GyroscopeExplorer @pfc can you use part of this code for your plugin and adds more filter for jitter problems?

    Special Link with code: https://github.com/KEOpenSource/Gyr...orer/activity/filter/MeanFilterSmoothing.java
     
    Last edited: Mar 1, 2016
  35. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Hi, does this offer properly calibrated compass information? On a lot of Android devices the compass information is bad when holding the phone upright. It can flip based on the orientation of the device. Does your code account for the orientation and remap based on this?
     
  36. fermmmm

    fermmmm

    Joined:
    Oct 18, 2013
    Posts:
    129
    Hi @pfc

    We detected a rotation glitch in all devices, and is very strong and easy to reproduce in the Nexus 6 (the one used in the video above). QA guys of my company says also that the glitch is easy to reproduce in the Galaxy S4.
    Rotation is reversed to negative back and forth each frame when the Y rotation is close to a specific value. Seems to be 270, exact west.

    Video showing the glich:
    https://mega.nz/#!swJFQToT!a24l_63TUdA8lnmQTDhG8FnX1Mn2YEYhbVF2xqS4M5M

    Project used to test:
    https://mega.nz/#!5h5VSRSR!jsHjeBV9miTWuMaPPp30yL2IsurEnbc366zMwJkYRaE

    Project used to test built (apk):
    https://mega.nz/#!h14UmL5I!akYBltl3wFGbxXHQj4thptc4JVymL9aiIcCQc1a1MIs

    The project used to test is just a skybox with a component attached to the camara with just the following code:
    Code (CSharp):
    1. public class GyroscopeRotator : MonoBehaviour
    2. {
    3.     void Start ()
    4.     {
    5.         #if !UNITY_EDITOR
    6.         SensorHelper.ActivateRotation();
    7.         #endif
    8.     }
    9.  
    10.     void Update()
    11.     {
    12.         #if !UNITY_EDITOR
    13.         transform.rotation = SensorHelper.rotation;
    14.         #endif
    15.     }
    16. }
    I e-mailed you a copy of this post.
    Can we spect a fix for this and when?
     
    Last edited: Mar 22, 2016
    FaberVi and mimminito like this.
  37. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    Yeah, same problem...... This plugin would need to be updated.
     
    fermmmm and mimminito like this.
  38. taimurahmed93

    taimurahmed93

    Joined:
    Aug 20, 2014
    Posts:
    1
    Hello @pfc is there any way to access the timestamp at which the sensor event occurred ?
     
  39. Brunobaer

    Brunobaer

    Joined:
    Apr 26, 2016
    Posts:
    1
    Hallo, has somebody any experience with the StepDetector? I tried to use it with different Samsung Smartphones (S3, S5, S7 Edge) but got only no results or App crashed when tried to read Values?
     
  40. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    Hey everyone, sorry for the long delay, we were in some long-running external projects and there was no time for support. Sorry about that.
    But, a week ago or so we released a fix version of GyroDroid that includes support for all the recent Unity versions, as well as newest Android and iOS devices.

    @fermmmm Can you take a look whether the error still happens? We tested here with some recent phones (Motorola G4, Galaxy S6, S7) and didn't see it happen.

    @taimurahmed93 No, currently not. Since we pull the sensor data once each frame you always get the "latest" sensor event.

    @Brunobaer Should be fixed! There was an error that prevented the StepCounter to be used on some devices.
     
  41. Goodm86

    Goodm86

    Joined:
    Aug 11, 2016
    Posts:
    1
    @pfc is there any way to detect uncalibrated compass on Android device?

    Randomly occur issue when device keep pointing to the same position (only in Y axis) so I assume it's compass fault. I've read couple articles about it and most of them mentioned uncalibrated compass and recommend to do quick calibration.

    I know that Google Maps sometimes ask for it, but how do define when I should have a popup to which prompt user to do so?
     
  42. AugmentedExistence

    AugmentedExistence

    Joined:
    Dec 10, 2016
    Posts:
    3
    Just installed, first impressions are it does exactly what I need. Awesome.
     
    doq likes this.
  43. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    121
    I'm considering getting this. @pfc How is compatibility with Unity 5.6?
     
  44. gringofxs

    gringofxs

    Joined:
    Oct 14, 2012
    Posts:
    240
    can i use this pakague, to build my vr app, and make it work in android phone without gyroscope? the vr will work in those phone?
     
  45. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
    @gringofxs Not sure what you mean. You can test the GyroDroid android app to check if your phone supports the necessary sensors. If it does, you can use it for Cardboard or whatever similar VR headset you want to use.
     
  46. pfc

    pfc

    Joined:
    Jul 28, 2011
    Posts:
    104
  47. fmparodi

    fmparodi

    Joined:
    Jun 5, 2017
    Posts:
    1
    @pfc How can I transform the demo Turntable scene into a VR Cardboard supported? When I check the Virtual Reality supported and choose "Cardboard", it stops to rotate the camera and works like a fixed object in the middle of the space. If I select "Split Stereo Display" it works well but without the lens distortion.
     
  48. joduffy

    joduffy

    Joined:
    Jul 30, 2011
    Posts:
    34
    Hi,

    I am trying to play around with the sensors in smartphones. Namely the magnetometer that is used for the compass. I am interested in how Google Cardboard Magnet Trigger works for VR.

    From my experiments so far, I noticed that the Input.compass.rawVector and the Gyro sample scene with the magnetField only updates when the phones moves. If you place the phone on a table and move a magnet near it, no update occurs. Is there a way to force a continuous update, not just when the phone is moving?

    I did come across this post where someone ended up writing their own plugin to try and overcome limitations:
    https://answers.unity.com/questions/1238630/need-compass-precision-less-than-1-degree-on-ios.html

    I was hoping I could use GyroDroid to run experiments for Android and iOS

    Note: I haven't tested this on Android yet, only on my iPhone 7.

    Edit: So I have tested this on an Android device (Lenovo Phab 2 - Tango), and I can confirm that it updates continuous with a magnet on a table - unlike the iPhone I was using.

    I have downloaded and played around with an app called phyphox (available for both Android and iOS) which will allow you to see sensor data.

    Both Android and iOS magnetometer will update continuously while on a table with a magnet. So I am guessing this is a limitation on unity for iPhone. Maybe creating a dll to import more of iOS functionality would fix this issue?
     
    Last edited: Mar 4, 2018
  49. manu3lkc

    manu3lkc

    Joined:
    Oct 28, 2018
    Posts:
    4
    Can it pick up the gyroscope/ other sensor data of other devices connected to a phone by Bluetooth such as earphones