1

I don't know how to use dart sensor accelerometer in code to find the value of distance covered.

I don't know where to start

the code is from: https://github.com/flutter/plugins/blob/master/packages/sensors/lib/sensors.dart

it was the link from the sensor plugin from dart

be able to calculate distance traveled with accelerometer data in a loop that pause for a fraction of a second. This is done until the desired distance is covered. Distance could be calculated using time the acceleration data.

Edwin
  • 31
  • 2
  • 7
  • why using accelerometer data? if you want to client distance you should use gps. – Junsu Cho Aug 29 '19 at 04:51
  • I need to know the distance moved to a precision of less than 1 meter. I don't think it is possible with gps. Is it? – Edwin Aug 29 '19 at 14:28
  • gps is impossible. See the Link : https://stackoverflow.com/a/6356253/4997344 – Junsu Cho Aug 30 '19 at 00:20
  • okay the distance traveled in the cases I need is relatively small so even with a bad accuracy I'm pretty sure the double numeric integration of the accelerometer will be more than enough. So would you know how to use the accelerometer in dart in this fashion? – Edwin Aug 30 '19 at 00:39
  • Perhaps you need to convert Java code to dart code. you can use the math function – Junsu Cho Aug 30 '19 at 00:50
  • to be perfectly honest with you its what I've been starting to realize has to happen. out of pure curiosity how would the java math function help me? – Edwin Aug 30 '19 at 00:53
  • I've never used Java before – Edwin Aug 30 '19 at 00:53
  • Functions in Java will also be in flutter. flutter also import 'dart: math' as math; You can use math api with. api's name is similar – Junsu Cho Aug 30 '19 at 01:08
  • I'm still confused what should i use the Java math function or dart: math for? – Edwin Aug 30 '19 at 02:08

0 Answers0