TrackMyIndoorWorkout / TrackMyIndoorWorkout

Indoor fitness machine (bike, treadmill, rower, kayak / canoe / swim ergometer, elliptical) companion app to record virtual workouts with synthetic GPS track of simply circling on a track shape route
https://TrackMyIndoorWorkout.github.io
Apache License 2.0
30 stars 9 forks source link

Run recording seems to sync double spms to Strava and MapMyFitness / UA #465

Open MrCsabaToth opened 5 months ago

MrCsabaToth commented 5 months ago

Screenshots later. I need to debug this.

MrCsabaToth commented 5 months ago

Screenshot_2023-12-07-01-22-49-78_3bb53944894d9646ec5754b62cc2584b Screenshot_2023-12-07-01-22-04-32_9d9ac189c5e8aeef639e5273d2b2b316 Screenshot_2023-12-07-01-21-08-64_9d9ac189c5e8aeef639e5273d2b2b316

MrCsabaToth commented 5 months ago

FTMS Treadmill Data doesn't have cadence, so it is provided by a separate Running Cadence sensor endpoint https://github.com/oesmith/gatt-xml/blob/master/org.bluetooth.characteristic.rsc_measurement.xml That data doesn't have any multiplier: "Unit is in 1/minute (or RPM) with a resolutions of 1 1/min (or 1 RPM)", and I can confirm while I'm running the cadence is in a sane range (160-180 range). It seems to double on Strava and even on Under Armour. Strava upload uses FIT format while Under Armour has it's specific JSON format. It'd be weird if both would double the cadence, so maybe the common exporter class does something. Maybe it's just with the total average SPM?

MrCsabaToth commented 5 months ago

The TCX, JSON and CSV exports look fine Activity_12-6-2023_17-55-42.zip

MrCsabaToth commented 5 months ago

I examined the code, the StatisticsAccumulator, and all the export code, and I don't have any evidence that I'd either divide or multiply cadences. One bug source could be if the accumulator doesn't divide the summation by the proper count, but that's also not the case.

MrCsabaToth commented 5 months ago

Note that average calculation currently summates. I was wondering if overflow could occur, for example with a cycling avg power of 400-500W for a TdF cyclist after a long workout. But integer is 64 bit on mobile and desktop, and 53 bit on web, so it won't likely overflow. https://stackoverflow.com/questions/50429660/is-there-a-constant-for-max-min-int-double-value-in-dart

MrCsabaToth commented 5 months ago

Closing for now and will reopen if needed

MrCsabaToth commented 6 days ago

This still bothers me. Maybe it's that rpm can be interpreted differently: the number of steps could be double of the cadence - a full turnaround which would be two steps?