Saturday, December 25, 2010

Garmin FIT decoder

I hope anyone reading this is having a fruitful Christmas. I'm personally in New Jersey, where it's cold by San Francisco standards, but excellent weather for running, which I'm finding I can still do despite months of neglect. I know: patience! It's hard, but last year I learned the hard way that going too hard too quickly is a loan which needs to be paid back at a very high rate of interest...

It is a good day for me -- what a great Christmas present this find was, from Japan: a GARMIN FIT decoder library for Perl. In addition to the library, some sample applications are provided: fitdump and fitsed.

So why am I so pleased with these? Well, many reasons, but one is that when uploading files to Strava, I tend to have two problems: either I forget to reset the unit from one day to the next and I end up with "rides" (or "runs") which span multiple days, or I neglect to shut it off when I get on the train or in a car, and end up with motorized segments (this is really good at scoring KOMs, but is, to put it lightly, cheating).

In the first case, it should now be relatively easy to write s short code to fragment FIT files at time gaps exceeding a certain threshold, for example one hour. And the second case I should be able to deal with: how hard can it be to determine if someone is in a car or train with decent accuracy?

I have an algorithm idea for this, one I've already proposed to Strava, but I think it's best to hold onto it until I've had a chance to code it up with Garmin::FIT and see how well it works.

No comments: