Complete
over 5 years ago

WERETECH-8574

Bug: Activity.Info.elapsedDistance is way off if playback a .fit file using simulator 3.1.6

Activity.Info.elapsedDistance is way off not only due to lat/lon = [0.0, 0.0]

https://forums.garmin.com/developer/connect-iq/i/bug-reports/initial-values-lat-lon-0-0-if-replaying-a-fit-in-simulator

but rather it seems there are more bugs in the sim.

info.elapsedDistance should be the sum of the distances between the recorded position points lat/lon. So I've calculated the sum of this distance increments and compared it to the value of info.elapsedDistance. I've only used a fast and easy formula to calculate the distances between 2 position points without any smoothing or interpolation. Thus my calculated elapsed distance may differ somewhat to info.elapsedDistance.

By replaying a .fit I get the following values
My sum of distance increments = 125.82m
Activity.info.elapsedDistance = 194.69m
This is a difference of >54% which is well way off.

In the .tcx file of the .fit for the same lat/lon there is stored the value
<DistanceMeters>123.29000091552734</DistanceMeters>

If I don't use the "Playback File" option but instead use the option "Simulate Data" I get this values
My sum of distance increments = 124.67m
Activity.info.elapsedDistance = 129.09m
This is a difference 3.5% that seems to be reasonable to me.

Since "Simulate Data" generates random values the distances are different to the "Playback File" values.

Parents
  • In a CIQ app, you see what that setting is (Sys.getDeviceSettings().distanceUnits for example), and you use that to display statute or metric in your all.  The sim just defines what you see in getDeviceSettings(),  Doing the conversion is all up to you.  This is how a real devices works.

    Ad far as my comment, I was assuming that your app did things like pay attention to the GPS accuracy.  In my apps, I don't actually start recording until after there's a gps lock.  So the actual recording doesn't start until a .fit is being played back, even if the app is started before playback..

Comment
  • In a CIQ app, you see what that setting is (Sys.getDeviceSettings().distanceUnits for example), and you use that to display statute or metric in your all.  The sim just defines what you see in getDeviceSettings(),  Doing the conversion is all up to you.  This is how a real devices works.

    Ad far as my comment, I was assuming that your app did things like pay attention to the GPS accuracy.  In my apps, I don't actually start recording until after there's a gps lock.  So the actual recording doesn't start until a .fit is being played back, even if the app is started before playback..

Children