Skip to content

Kalman location service started location random coords #130

Open
@isamirkhaan1

Description

@isamirkhaan1

Hey,

I am using the Kalman Service to draw a route, in parallel, I'm also using the fucedlocation to draw another route. The purpose is to compare both paths and see which is more accurate.
For the last few hours, I've been getting weird random locations from the Kalman Service, which can be seen below.

Screenshot 2023-10-05 at 16 02 00

Here is the implementation

internal class MadLocationManager(
    private val context: Context
) : LocationServiceInterface {
    private lateinit var geoHashRTFilter: GeohashRTFilter

    init {
        ServicesHelper.addLocationServiceInterface(this)
    }

    override fun locationChanged(location: Location?) {
        location ?: return
        Log.i(TAG, "locationChanged: $location")

            RxBus.send(location)
        }
  
}

edit:
The issue doesn't happen on default settings. But if I change onlyGpsSensor from true to false and set provider to Settings.LocationProvider.FUSED

Settings(
        /* accelerationDeviation = */ Utils.ACCELEROMETER_DEFAULT_DEVIATION,
        /* gpsMinDistance = */ LOCATION_UPDATE_MIN_DISTANCE,
        /* gpsMinTime = */ X,
        /* positionMinTime = */ Utils.SENSOR_POSITION_MIN_TIME,
        /* geoHashPrecision = */ Utils.GEOHASH_DEFAULT_PREC,
        /* geoHashMinPointCount = */ Utils.GEOHASH_DEFAULT_MIN_POINT_COUNT,
        /* sensorFrequencyHz = */ Utils.SENSOR_DEFAULT_FREQ_HZ,
        /* logger = */ null,
        /* filterMockGpsCoordinates = */ true,
        /* onlyGpsSensor = */ true,
        /* useGpsSpeed = */ false,
        /* velFactor = */ Utils.DEFAULT_VEL_FACTOR,
        /* posFactor = */ Utils.DEFAULT_POS_FACTOR,
        /* provider = */ Settings.LocationProvider.GPS
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions