mad-location-manager icon indicating copy to clipboard operation
mad-location-manager copied to clipboard

working without sensor

Open farfromrefug opened this issue 6 years ago • 1 comments

I am working on a port to JS. And i am facing an issue. When not using sensors (comment the registerListener on android) the returned locations in onLocationChangedImp are 0,0. This is not expected. It means the kalman filter does not work when no sensor are used. I suppose it is because the matrices are not initialized correctly. But i am not sure how to initialize them. Can anyone help? Thanks

farfromrefug avatar Sep 19 '19 15:09 farfromrefug

Actually might have solved this. I added this

long now = android.os.SystemClock.elapsedRealtimeNanos();
            long nowMs = Utils.nano2milli(now);
            SensorGpsDataItem sdi = new SensorGpsDataItem(nowMs,
                    SensorGpsDataItem.NOT_INITIALIZED,
                    SensorGpsDataItem.NOT_INITIALIZED,
                    SensorGpsDataItem.NOT_INITIALIZED,
                    0,
                    0,
                    0,
                    SensorGpsDataItem.NOT_INITIALIZED,
                    SensorGpsDataItem.NOT_INITIALIZED,
                    SensorGpsDataItem.NOT_INITIALIZED,
                    SensorGpsDataItem.NOT_INITIALIZED,
                    m_magneticDeclination);
            m_sensorDataQueue.add(sdi);

just after the GPSAccKalmanFilter creation. Hope that's good

farfromrefug avatar Sep 19 '19 15:09 farfromrefug