Location example issues

0 votes
asked Jan 5, 2016 by Daniele Suppo (210 points)
Hello, I've tested "Location example", and I've experienced some issues.

I've picked (from Goggle Maps) longitude, latitude and height of 3 locations near my office, and I went out for a walk. I've closed and opened the app some times to better test the behavior.

- On Samsung Galaxy S5 Mini, Android 4.4.2, GPS with "high precision" option active.

1) Some times WEST and EAST are totally wrong (rotated of 90 degrees).

2) Initially the 3 objects (cube, sphere and cylinder) seemed to be in the right position, but as I get close to the 1st location its placeholder was moving away... it was more and more far from the right position and I couldn't reach it. At the same time the other 2 locations moved away from their initially right position.

3) I walked a bit from the initial position, and after 300 meters all 3 placeholders where very wrong (also if WEST and EAST where right).

4) It seemed to me that with the device in vertical position sometimes I could'nt see some placeholders, and some text (WEST or EAST)... Is it possible?

5) Very high battery consumption: in 15 mins from 25% to 2%


- On Samsung Galaxy A3, Android 5.0.2, GPS with "high precision" option active.

1) I couldn't see anything. Only the camera




1 Answer

0 votes
answered Jan 5, 2016 by Andrea (1,010 points)

Hi Daniele,

Some things you can do to improve accuracy:


1) 2) 3) 4)

Try to:

- Calibrate the device compass - https://support.google.com/gmm/answer/6145351?hl=en

- Test right compass calibration with App like this : https://play.google.com/store/apps/details?id=com.gn.android.compass



- The battery consumption is high like other gps navigator.



The Galaxy A3 does not have a gyroscope. In this example (only Unity version) is necessary for the 3d models positioning.

In the next release of SDK for Unity, we will enable the accelerometer like we alredy do in non-Unity ARMedia SDK.




commented Jan 7, 2016 by Daniele Suppo (210 points)
edited Jan 7, 2016 by Daniele Suppo
Thank-you Andrea,
I calibrated the compass as you suggested me and I've tested with the compass app, but still the Unity app is not working as it should: initially it's a bit more precise, but as I move the placeholders does not move and rotate as them should. I can walk around a GPS target location (about 30 meters from the target), and the placeholders still remain in the same place (and the closest place holder is not big as it should), or they seem to move/rotate in a totally arbitrary way, also if WEST and EAST are "quite" right (but they loose precision very quickly, despite the Compass App is right). Also, I've noticed that rotating the device (from vertical to horizontal) cause the WEST and EAST often change their position, and the place holders too. Also, if I close and open the Unity app I get different positions...

P.S. I did a test of Gyroscope, Accelerometer and Magnetic Sensors (by dialing *#0*# in the phone dialer) and everything work fine - Also, the Magnetic Sensor is much more accurate that with Compass App.

Could it be a Unity issue?


commented Jan 8, 2016 by Daniele Suppo (210 points)
Is it possible to expose the GPS data (Longitude and Latitude) revealed by the app? It's my idea that could be a device GPS issue, that is not correct (I've used 3 differents app on the same device to get GPS data, and each one give me different result).
commented Jan 8, 2016 by Andrea (1,010 points)
Hi Daniele,

In general, you can use this function:

public static extern void getLocation(double[] location_coordinates);

for obtain the last know position.

This function is used in:

UpdateTracker() ( Scripts->ARMedia->Trackers->ARMediaLocationTracker.cs - line 192)

Quickly, you can add a debug print here, ore use getLocation where do you want.



We found problems of location update with some devices, an update will be released early next week.

commented Jan 9, 2016 by Daniele Suppo (210 points)
Many thanks Andrea,
in fact I've noticed that, closing and opening the Unity app, most times the locations have very different positions from the previous one.

2 questions more:

1) About orientation:
I've calibrated the compass, and I've tested it with a few apps ("Compass", "GPS Status & Toolbox", and internal compass), and all of them show the NORTH in the right direction.

But, despite of this, the "Location example" Unity app most of times show the NORTH in the wrong direction: sometimes rotated clockwise (from 30 to 90 degrees), sometimes rotated counter clockwise (from 30 to 90 degrees).

I've experienced also 180 degrees wrong NORTH rotation, expecially after a long time that I don't use any GPS related app ("Compass", etc). In this case, usually, if I open and close any GPS related app on my device the Unity app give me a better (but almost never exact) NORTH orientation.

Could it be a Unity SDK issue?

2) About GPS position:
I've tested on my device (always the same device, Galaxy S5 Mini) some Android apps to get the right GPS Longitude and Latitude data of my established locations ("Compass", "Altimeter", "GPS Status & Toolbox"), but none of them gave the right data (hundreds of meters, or kilometers far away from the right GPS data from Google Maps). And, more, each of them show different data from the other one, on the same location (and always on the same device!).
So, how is possible to use GPS Locations if it seem that there's no app able to get the right data?
Is it a my device problem?

Device: Samsung Galaxy S5 Mini - Android 4.4.2

commented Jan 12, 2016 by Andrea (1,010 points)
Hi Daniele,

1)The value of the compass is read when the application starts.
- Compass in close proximity to a laptop computer, an iPad, or another electronic device can cause interference;
- When you start the example, try to place the device parallel to the ground (right position for read compass data).

2)The different value of the location depends on:
- Which type of service is used by the application ( in therms of Android API ) .
- Which type of location methods are integrated or active in that moment.
- The minimum GPS error in smartphones is 10 -15 meters.

Do not forget that an update for Unity SDK will be released soon, this update solve the problem of the location update.
Welcome to Developer Portal Q&A, where you can ask questions and receive answers from other members of the community.