Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model loader cannot find GPS location #10

Open
janionano opened this issue Sep 29, 2013 · 9 comments
Open

Model loader cannot find GPS location #10

janionano opened this issue Sep 29, 2013 · 9 comments

Comments

@janionano
Copy link

Every time the ModelLoader application is launched from my phone, it keeps trying to find the GPS location, but never ends, both for the demo .apk and the git code (I had to make code changes to be able to run DroidAR with updated lib GDX). I can skip the location detection, but then the model is always rendered flat at position (0,0,0).

@simon-heinen
Copy link
Owner

And you are sure you have a valid GPS signal? Skipping the gps detection will skip calculating the correct virtual position but of course not the proper rotation and scaling of the virtual object. If you want to, it would be great if you could submit the improvments for the libgdx support, its always hard to keep up with the latest version and if you already did this you can push back the changes

@janionano
Copy link
Author

Yes, have a valid GPS signal, Google Maps and GeoPosTestSetup test works fine. I will try to commit the changes :)

@janionano
Copy link
Author

Reading the logs, in de.rwth, ConcreteSimpleLocationManager just keep spamming the messages:
Calculating average of 15 locations
Average is: Location[mProvider=AveragePosition,mTime=0,mLatitude=-29.x,mLongitude=-51.x,mHasAltitude=true,mAltitude=5.746666666666667,mHasSpeed=false,mSpeed=0.0,mHasBearing=false,mBearing=0.0,mHasAccuracy=true,mAccuracy=2.7466664,mExtras=null]

And in general log:
10-02 18:46:44.169: E/JavaBinder(183): Transact on 0x8d13c8 in Java object 0x4094da28 with code 1 failed
10-02 18:46:44.259: E/JavaBinder(183): !!! FAILED BINDER TRANSACTION !!!
10-02 18:46:44.269: E/BinderProxy(183): android.os.BinderProxy.callback(Binder.java:369)]
10-02 18:46:44.649: E/BinderProxy(183): android.os.BinderProxy.transact(Native Method)]
10-02 18:46:44.719: E/BinderProxy(183): android.location.ILocationListener$Stub$Proxy.onLocationChanged(ILocationListener.java:124)]
10-02 18:46:44.729: E/BinderProxy(183): com.android.server.LocationManagerService$Receiver.callLocationChangedLocked(LocationManagerService.java:306)]
10-02 18:46:44.729: E/BinderProxy(183): com.android.server.LocationManagerService.handleLocationChangedLocked(LocationManagerService.java:1813)]
10-02 18:46:44.729: E/BinderProxy(183): com.android.server.LocationManagerService.access$2000(LocationManagerService.java:91)]
10-02 18:46:44.729: E/BinderProxy(183): com.android.server.LocationManagerService$LocationWorkerHandler.handleMessage(LocationManagerService.java:1872)]
10-02 18:46:44.729: E/BinderProxy(183): android.os.Handler.dispatchMessage(Handler.java:99)]
10-02 18:46:44.729: E/BinderProxy(183): android.os.Looper.loop(Looper.java:130)]
10-02 18:46:44.729: E/BinderProxy(183): com.android.server.LocationManagerService.run(LocationManagerService.java:557)]
10-02 18:46:44.829: E/BinderProxy(183): java.lang.Thread.run(Thread.java:1019)]
10-02 18:46:45.029: E/GPSD(107): SecLBS_update_location:

@janionano
Copy link
Author

Any clue? Hum, sometimes the exception is not fired, but the application does not work even then.

@janionano
Copy link
Author

I think I've found the problem, ConcreteSimpleLocationManager.calcFromLastPositions is calculating wrong values for latitude and longitude and setting in Location target, it's far away from where I am.

@simon-heinen
Copy link
Owner

Hm ok yes it might use the wrong position first but as soon as the right one is received the objects should be at the correct position because then the camera position is moved to the correct position (in a buffered way but still it should then move to the correct position

@janionano
Copy link
Author

Ok, the purpose of this is to take the user's position as near as possible?
I found the problem, the class ModelLoaderSetup was calling the clear() method, clearing the list named onLocationChangedList in EventManager. After I commented out this line, worked fine.

@simon-heinen
Copy link
Owner

Ah that might be it, I think I might have removed the gps positioning code in the model loader setup for better testing of model loading ;) Sorry for that

@janionano
Copy link
Author

Thanks to that, now I understand better how DroidAR works.
Taking the cue, there is implemented some sort of occlusion for the models in the environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants