flutter_background_geolocation
flutter_background_geolocation copied to clipboard
Wrong odometer
Your Environment
- Plugin version: 4.7.0
- Platform: Android
- OS version: 11
- Device manufacturer / model: samsung a20
- Flutter info (
flutter doctor
): [√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.18362.30], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.7) [√] Android Studio (version 2021.2) [√] VS Code [√] Connected device (2 available) - Plugin config:
Future<void> configTracking() async {
try {
await bg.BackgroundGeolocation.ready(bg.Config(
desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
distanceFilter: 2.0,
stopOnTerminate: false,
startOnBoot: true,
debug: true,
logLevel: bg.Config.LOG_LEVEL_VERBOSE,
reset: true,
)).then((value) {
isEnabled = value.enabled;
});
bg.BackgroundGeolocation.onLocation(_onLocation);
bg.BackgroundGeolocation.onMotionChange(_onMotionChange);
bg.BackgroundGeolocation.onActivityChange(_onActivityChange);
bg.BackgroundGeolocation.onProviderChange(_onProviderChange);
bg.BackgroundGeolocation.onConnectivityChange(_onConnectivityChange);
} catch (e) {
rethrow;
}
}
Future<void> startTracking() async {
try {
await bg.BackgroundGeolocation.start().then((value) {
bg.BackgroundGeolocation.changePace(true);
});
} catch (e) {
rethrow;
}
}
Expected Behavior
Get an approximate odometer of 3.3 km
Actual Behavior
The package worked fine in storing the location points, but when trying to get the total route odometer it showed a distance of 2.2 km I determined the same route on Google Maps, and the distance appeared approximately 3.3 km. There is an error in calculating the odometer as much as 1 km
Context
We are developing a taxi application, so we need the process of tracking the location, and calculating the distance accurately because the price of the ride depends on the distance traveled. How can I get the exact distance?
This is the path traveled
I took the points and then displayed them on Google Maps
Go do 10 tests of similar length and post the results here
Go do 10 tests of similar length and post the results here
I have tried it 7 times so far, all experiments have been successful except this one
I have no idea what happened in one of your tests.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.
@mhdkadi same thing happen to me , if you got anything related to it then pls let me know