Kotlin Shared Library for Android, IOS that provides implementations for Kalman filters and geohash filters for increase accuracy of Geolocations
It use the Kalman filter algorithm to predict the correction. (Not Extended Kalman Filter, because it's too hard to me >.<)
This library use Kotlin Multiplatform for Kotlin/JVM(Android) and Kotlin/Native(IOS).
- Add 'KalmanKt-Jvm-1.0.0.jar' into libs folder. Download here
- Sync Project with Gradle.
Because of lack support of Kotlin Multiplatform, This library provide pure implementations for Kalman filters and geohash filters.
So, This library provide 'KalmanProcessor' to handle predict using KalmanFilter.
- Download this code and put into your project.
- Generate instance of KalmanProcessor by
private val kalmanProcessor = KalmanProcessor()
. - Reset processor before start
LocationManager.requestLocationUpdates
. bykalmanProcessor.reset(8, 2)
- Receive predicted result by
kalmanProcessor.setLocationCallback(1000) {}
- When
onLocationChanged
is called, callkalmanProcessor.process(location)
- Add KalmanKt.framework into XCode project. Download arm64 for real device, x86_64 for simulator. Download here
- Add KalmanKt.framework to Embeed Binaries, Linked Frameworks and Libraries.
- Disable bitcode by Build Settings > 'Enable Bitcode' to false. Kotlin/Native produces the fully native binaries, not the LLVM bitcode.
TBD.
(I had no experience developing IOS myself, so I asked a friend for help. It will be updated soon.)
- Ver 1.0.0 (2019-01-20) Initial Release
MIT License.