mru00/crane_gps_watch

Decode lap data

mru00 opened this issue · 6 comments

mru00 commented

The program should also decode and output lap data.

Some information is already known, cf.https://github.com/mru00/GpsWatch/blob/master/image2gpx.pl#L177

Challenge: how to store lap information in tcx file?

According http://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd an activity can have 1 or more laps. Each lap has a track. So based on that info, you could split the single track in your current file in to separate tracks. One track for each lap in the lap table.
With all the track waypoints in a list and the start and end time of each lap known it should not be to difficult to get the waypoints that belong to the track of each lap.

Not sure if this solution will import in RunKeeper but will try a manualy edited tcx file.

I've been working on this over the weekend. I've got some code that pulls the lap data from the watch and then as the samples are pushed to the broadcaster, checks whether the sample time > the end of lap time and if so, splits the lap and starts another. The XML parses as valid against the schema but RunKeeper sadly does nothing with the extra information. MyTourbook puts little markers on the map etc.

I'll figure out how to get the code up today sometime.

I've been thinking about the output of the lap data that I moved into the DebugWriter.

I'm not sure that's such a great place for it. I can see instances where I want that data output, but not the rest of the debug output. In fact, I think that'd be my default mode for using the program:

  1. Go for a run
  2. Pull data from the watch and dump stats
  3. Upload to runkeeper or whatever and use the stats to add commentary to how it went

I was thinking of expanding the stats accumulation to cover everything that GPS Master currently does, so time below/in/above HR target zone, Min, Max, Avg HR, Calories, etc for the workout, plus the per lap stats.

I was wondering if it was worth adding a StatsWriter and a commandline switch for it? I guess the other option is to just encode stats into the elements of the tcx output. Should I raise this as a separate issue? Any thoughts?

mru00 commented

Is the latest and greatest source good enough? can we close this issue?

I've built on your work a little more to make the output a little tidier. I think this can be closed. If I expand on this work more, I'll just make another pull request later.

mru00 commented

Great, thank you for your contribution!