Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Garmin Swim #15

Closed
jerome-labidurie opened this issue Jun 15, 2015 · 3 comments
Closed

Support for Garmin Swim #15

jerome-labidurie opened this issue Jun 15, 2015 · 3 comments

Comments

@jerome-labidurie
Copy link
Contributor

Hello,

I have a Garmin Swim watch. But Garmin only offer web interface to analyse output data. As I'd like to keep my data offline I searched and found poolviwer. It suits my needs quite perfectly.

So I implemented a Proof Of Concept to import Garmin Swim data (.FIT files) into poolviewer. It works quite well for now. Importing data can be done via Download/Load file/Garmin FIT file/Import. A example .fit file is provided in contrib/.

You can find code in my fork (garmin branch / diff) I do not want to create a pull request yet because the code still needs some cleanup and I have a few questions. Eventually I'd like my code to be included mainstream.

I understand that the csv format is done this way to be compatible with poolmate windows software. Is it ?
So up to now I recorded the swim data as a PoolMateLive watch (SwimHR). But this is a bit limiting. See below.

data questions

  • I tried to document ExerciseSet struct, but I'm not entirely sure. Could you please help me with it ? (See question marks)
  • what is efficiency ? Is it SWOLF ?
  • what is rate and which unit is it ?
  • my watch give me the stroke style for each length (freestyle, breaststroke, ...) SwimHR does not provide this functionality. So can I break compatibility by adding a new watch type ? Or do you see another way to do it ?

cleanup to do

  • FIT file parser (FIT.cpp imported from antpm) needs some cleanup/refactoring
  • a new dependency to boost lib shall be removed
  • do you see some modifications needed for a pull request to be accepted ?

Note: I also had setup a TravisCI automatic compilation

Best regards

@ihewitt
Copy link
Owner

ihewitt commented Jun 16, 2015

Cool, that will be awesome!
I'll build and have a play too, let me know when you're happy for me to pull.

Yes the csv file format is compatible with the windows poolmate software, I think there is scope to add custom fields into the end of the string if necessary without breaking compatibility.

OK in order of your question marks:
Unit = "m", although the new file format doesn't seem to include this any more, I need to change to yards and test what happens.
totaldistance = yup, distance in units.
speed = time to cover 100m.
effic = swolf(ish) although poolmate uses a slightly different algorithm to garmin. I was going to change this to a configuration option to toggle the two types. Poolmate uses number of "stroke cycles" i.e. one arm, in the calculation. Garmin uses "stroke count" i.e. both arms. I'll add a detailed comment to the code and look at
rate = strokes per minute.
rest = rest time for this set.

Re stroke style, there is a field in the data for this, currently always "Free", but since that's all I swim and the poolmate doesn't autodetect, I never bothered wiring it through! No reason not to though, I'll check what the set of strings the poolmate software uses and add a comment/enum.
Also this is only per set, not per length, so a bit of creativity might be needed to add per length style data in the same file.

also note/beware - at the moment the software doesn't write out the SwimHR line format correctly, it only reads it, I need to finish that and commit it ASAP.

re the FIT file parser, is that available as a self contained library we can pull in/link against or is embedding the source the best/easiest option?

I wonder if antfs-cli could be launched to automate the synchronization.

Cheers,

@jerome-labidurie
Copy link
Contributor Author

Thanks for the detailed answer.

I will update ExerciseSet doc with your precisions.

For stroke style per length I will try to keep compatibility by sticking to "SwimHR" type and adding fields at the end of the CSV line. As I don't have/use the poolmate software I will rely on your tests to check if it's not breaking the data file.

For the FIT parser, I wish it was a library. Unfortunately the code is really dependent of the antpm-fit2gpx tool. It would need quite work to change that. So it's really the easy/fast way to import it in poolviewer. I might do this work in the future, but ... todo list is already huge :)

For auto synchronization, I'd like to include that in poolviewer too. I wasn't able to use antpm-downloader yet (I have to create an issue) so I'm using antfs-cli for the moment. I surely will create a patch for poolviewer, but only in a second time. For now, FIT import is my priority.

I might be able to get a first version ready to pull next week or so. I will keep you updated.

Best regards

@ihewitt
Copy link
Owner

ihewitt commented Oct 9, 2015

I've tweaked the fileformat for live support slightly, moving the fields to try to maintain compatibility with the windows app. The file format should automatically update itself on save, but probably worth keeping a backup copy of the csv file just in case.

@ihewitt ihewitt closed this as completed Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants