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

Repeated set of samples in the SML export #1

Closed
leonardomaccari opened this issue Sep 15, 2017 · 4 comments
Closed

Repeated set of samples in the SML export #1

leonardomaccari opened this issue Sep 15, 2017 · 4 comments

Comments

@leonardomaccari
Copy link

Hi, I just bought an M200 and would like to export traces to be used with my local applications, my workflow is:

  1. sync data
  2. extract last trace to sml
  3. use ambit2gpx to convert to gpx
  4. import in anything else

In step 2 I have an sml file with two repeated sets of data, with the same time reference, but with different data:

     <GPSAltitude>40</GPSAltitude>
     <NumberOfSatellites>5</NumberOfSatellites>
     <Latitude>0.7640528739120203</Latitude>
     <Longitude>0.19599337732667174</Longitude>
     <Time>1.0</Time>
     <UTC>2017-09-14T17:27:51Z</UTC>
     <SampleType>gps-base</SampleType>

against:

      <Cadence>0.0</Cadence>
     <HR>1.2166666666666666</HR>
     <Altitude>0.0</Altitude>
     <Speed>0</Speed>
     <Time>1.0</Time>
     <SampleType>periodic</SampleType>
     <UTC>2017-09-14T17:27:51Z</UTC>

And this goes on for every sample. When converting to gpx, things gets messed up, with some of the data being rewritten. I am not familiar with suunto, is this an intended behaviour of the suunto format? in this case the blame would be on ambit2gpx that does not merge the two sets of samples. But why there two set of samples corresponding to the same time with different SampleType?

@cmaion
Copy link
Owner

cmaion commented Sep 15, 2017

Hi,

I've never seen a spec for the SML file format so I don't know if it's allowed to have separate events from different sources at the same timestamp.

The GPX file format is not complex IIRC, so I guess that it would be much more efficient and robust to directly output a GPX file without having to go through ambit2gpx. One less step!

If you are not afraid of writing a few lines of Ruby code, you can create polar_training2gpx by copying
https://github.com/cmaion/polar/blob/master/polar_training2sml and adapt to match the GPX format ;) (as you can see, the SML exporter is quite small and simple)

And to know what the final GPX file should look like, an easy way would be to export the training session from Polar Flow as a GPX file, or try https://github.com/pcolby/bipolar.

If you go this way: pull request welcome!

@leonardomaccari
Copy link
Author

Hi there, thanks.
I am on a linux box so I can't use Polar Flow on PC (the app does not seem to export anything). Does it happen to you to have separate sets of data for the same trace?
I see three ways:

  1. it's a bug and should not be like this
  2. original data is like this and we can merge data directly in polar
  3. sml must be like that, and we can merge in gpx

Maybe I can share some data with you to verify it's not a bug and exclude 1? what would you need?

unfortunately, i am not a ruby programmer (that's why I was hoping it was it was something I could fix in python :-)) so i may not help with a new exporter...

@cmaion
Copy link
Owner

cmaion commented Sep 15, 2017

If you know Python, you should be able to adapt to Ruby ;)

BTW, you can sync to Polar Flow through the Android/iOS app, no need for Windows or macOS.

I gave it a very quick shot (15 min!) : c632f80

This exports the training session track to GPX -- I get the exact same result as the GPX export performed from Polar Flow.

Give it a try.

@leonardomaccari
Copy link
Author

Thanks!
you have a pull request for adding HR data.

@cmaion cmaion closed this as completed Oct 3, 2017
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