06-21-2021 13:43
06-21-2021 13:43
Instead of giving out about the Swim App, I am wondering if I can write my own.
I'm really just looking for a data logger while in the pool which sends on the recorded sensor samples over to a companion which can then be analysed post-workout (in Excel?)
I understand the reservations about getting HR data in the pool but by Inspire HR does a pretty good job of tracking HR while swimming (if the strap is tight enough) but I can only use it to get real-time readings and I can't get a profile - especially if it auto-detects Swim activity.
So I'm thinking of upgrading to a Versa 3 and writing an app:
The big issue for me with swim apps is dealing with intervals: so I typically swim a short rep (eg 100m) then take a short rest (eg 10s) and then repeat. If I can use the movement data to detect rest intervals, I'd like to be able to time the rep (time between resting period, whole seconds is enough) and if I can sync to HR data then that would be idea (HR max/average during rep, HR profile during rest interval).
So initially I'd like to just log movement and HR data and analyse post-workout. Potentially this could develop to display 'last rep time' & HR profiling / zoning if I get in to this.
At this stage I'm looking for general advice, experience and encouragement before I upgrade my fitbit.
It looks like I should log to a file on the fitbit and transfer the data with the file transfer API?
Is it worth chunking the data or just wait til the end (up to 60 mins) and send it in one go?
Is the Versa 3 a good choice for this?
06-21-2021 18:32
06-21-2021 18:32
This would be an interesting but difficult project. I've been toying with similar ideas.
I've looked at heart rate data collected while swimming, and I agree that it looks usable.
Data storage, communications and access would require careful thought. I recommend doing some rough calculations on file sizes and transfer times to verify that your proposed approach is realistic. Some considerations:
You can get heart rate data from the Web API, which is easier (except for OAuth), but you can't get accelerometer therefrom.
Accelerometer data can be tricky to interpret, because it always includes gravity (so reads 1g when at rest). Moreover, Versa 3 doesn't know which way up it is, so you can't easily just subtract 1g. Sense (and some older devices) also have an orientation sensor, but the co-ordinate system used may not provide enough information to allow g to be removed. If you're only interested in accelerometer patterns rather than absolute accelerations in earth-oriented directions, this may not matter.
06-22-2021 01:34
06-22-2021 01:34
06-22-2021 02:45
06-22-2021 02:45
I agree that it's probably viable.
I've got a spreadsheet of my own that does similar calculations. It probably raises more questions than it answers, but if interested, holler.
I'm mostly finished an Android app for capturing fetch() files from companion. I'll commit it here when it's cooked (ignore what's there at the moment). But since you've got a server, it would probably be easier to use php on that to do it.
This API might be helpful for analysing the accelerometer data. I think it was used in this app. The gent who wrote that is active in the Fitbit dev discord and may be willing to offer advice. But as you said originally, the first step is to get some data and see what it tells you.
I don't think the web API is going to give you real-time data at all; it's only updated after the watch syncs (ie, every 20 minutes or so on a good day). For your purpose, that's probably fine. The think the Web API behaves the same across devices, except that it has difficulty providing data that your watch doesn't collect. 🙂
I think it would be interesting to provide data on strokes per lap, stroke frequency, and the variation of those over time. It might even be possible to draw conclusions about smoothness of arm entry into water, elbow position, and other stroke shape characteristics. Getting good data for comparison would be a challenge.
06-22-2021 09:39
06-22-2021 09:39
07-09-2021 00:23
07-09-2021 00:23
What what it's worth, I just managed to capture and download a few laps of accelerometer data while swimming. I recorded at about 30 Hz. It's pretty easy to tell by eyeball when I finished each lap, and individual strokes are also easy to see. Finding mathematical expressions to pick out such features could be... interesting.
07-11-2023 15:25
07-11-2023 15:25
For anyone still interested: we have just released an update to our Swim Trainer app for Versa 3 and Sense which now has an open water option. It includes open water tracking based on GPS: