simon-heinen / droidar

DroidAR Mobile Locationbased Augmented Reality Framework for Android
GNU General Public License v3.0
225 stars 275 forks source link

Model loader cannot find GPS location #10

Open janionano opened 10 years ago

janionano commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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

janionano commented 10 years ago

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 commented 10 years ago

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

janionano commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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?