Search Unity

Unity for PSM does not support Input.compass API?

Discussion in 'PSM' started by mohammedari, Jun 3, 2014.

  1. mohammedari

    mohammedari

    Joined:
    Jun 3, 2014
    Posts:
    3
    Hello,
    I have a problem about Input.compass API.

    Input.compass values are always zero, however Input.acceleration and Input.gyro values are acquired correctly at the same time.

    More precisely, these APIs values are in problem.
    - Input.compass.rawVector
    - Input.compass.magneticHeading
    - Input.compass.trueHeading

    Compass APIs are not supported int Unity for PSM?
     
  2. PeterD

    PeterD

    Joined:
    Feb 6, 2013
    Posts:
    120
    Have you enabled location in the Publishing Utility?
     
  3. mohammedari

    mohammedari

    Joined:
    Jun 3, 2014
    Posts:
    3
    Thank you for quick reply.

    I craeted psdp package manually with app.xml file in which Location option is enabled.
    Then I deployed the package to Vita.
    However, compass sensor values are still zero.

    Is my procedure that deploying with original app.xml file is wrong?
    Is there any way to load original app.xml with Unity Editor?

    For more detail information, I paste screen shot and the code I wrote.



    GUI.Box(new Rect(Screen.width - 260, Screen.height + boxOffset, 250, 130), "Sensor Values");
    GUI.Label(new Rect(...), "acc : " + Input.acceleration.ToString());
    GUI.Label(new Rect(...), "gyr : " + Input.gyro.rotationRate.ToString());
    GUI.Label(new Rect(...), "mag raw vector : " + Input.compass.rawVector.ToString());
    GUI.Label(new Rect(...), "mag heading : " + Input.compass.magneticHeading.ToString());
    GUI.Label(new Rect(...), "mag true heading : " + Input.compass.trueHeading.ToString());

    Note that motion option is also disabled in default app.xml, but sensor values are shown correctly.
     
  4. PeterD

    PeterD

    Joined:
    Feb 6, 2013
    Posts:
    120
    Have you done all the initialisation steps i.e.

    Compass.enable and Input.location.Start()

    I don't think the compass returns any valid values without the location.Start() call.
     
  5. Spidyy

    Spidyy

    Joined:
    Mar 6, 2011
    Posts:
    184
    Quote from the PSM Forum :
    Meaning only the 3G version MIGHT have a compass, not even sure and it won't really be that efficient.

    If you want to use the Vita's movements, just stay with the gyroscope and accelerometer.
     
  6. PeterD

    PeterD

    Joined:
    Feb 6, 2013
    Posts:
    120
    Ah yes I had assumed this was the 3G version we were talking about. Yes I don't think the new vita or the wifi only version ever had the aGPS unit.
     
  7. eriQue

    eriQue

    Unity Technologies

    Joined:
    May 25, 2010
    Posts:
    595
    Hi all,

    I think that the Compass support might be missing in the Public Preview version you're currently using.
    Fear not though - Compass support will be available in the next version.
     
    mohammedari likes this.
  8. mohammedari

    mohammedari

    Joined:
    Jun 3, 2014
    Posts:
    3
    I thank you all,

    I will start developing from functions that does not require compass APIs, and I am looking for the next version :)