pcolby / bipolar

Free your data from Polar FlowSync
GNU General Public License v3.0
115 stars 16 forks source link

Power data export in hrm and tcx #43

Closed Nickpolar closed 9 years ago

Nickpolar commented 9 years ago

I have been using the V800 downloader for a couple of days now and would like to ask if you have any plans to include power data in those file formats . Currently only cadence seems to be exported .

Polar Flows TCX export is the same - only cadence but no power curve . Power data from the V800 / Keo power bluetooth smart is there in full in Polar Flow webservice though .

pcolby commented 9 years ago

Hi @Nickpolar, Bipolar has "theoretical" support for power, in that its been implemented in a couple of places, but I have no data files to test it with (I don't have a power meter).

If you could provide a couple of data files with power included, I'd be more than happy to test / see why it doesn't work.

Ideally, you would provide data files that you don't mind making public (eg not a ride to/from your house?), in which case I'll include them in Bipolar's unit tests. But I can still use them for testing even if you don't want to make them public.

To provide the data files, pick a session on flow.polar.com, look at the session number in the URL, then find all of the files in export directory (eg C:\Users\Nick\AppData\Local\Polar\PolarFlowSync\export) that match the pattern v2-users-*-training-sessions-<session-id>-*. Either attach those files to a comment here (that will make them public), or email them to me at git at colby dot id dot au. Ideally zip them first, but it shouldn't hurt if you don't.

Cheers.

trimathias commented 9 years ago

Hi, I'm also very intrested in getting this to work as a just got myself a set of keo power bt pedals.

Attaching files for a very short session that should have power included. At least power is presented perfectly in flow. (no GPS route as it was done on a trainer).

Hope this helps. Just get back to me if you want some other files.

PS. Wasn't allowed to attach zipfiles here so I'll drop you an email. Let me know if you don't get it.

pcolby commented 9 years ago

Thanks @trimathias! :smile: That data looks really helpful :+1:

I'll probably have a number of questions such as "what was the min / max power for this activity?". These will be easier for me if you could either make the activity public on the flow website, or make it available to followers only, and allow me to follow you. Otherwise, I'll just ask the questions here and/or via email.

The data appears to be reporting the minimum power as 87, and the max as 287. Does that sound right? (I assume these are in watts)

cat *-statistics | protoc --decode_raw | grep '^5 ' -A3
5 {
  1: 87
  2: 287
}

That, of course, is just summary stats. The more interesting part is the sample data. Looking at the sample data, I can see that your files include three new fields that I've not see before - they are indexed as 22, 24 and 28.

Field 28 appears to be structured data similar to the various other sensor-calibration fields, so I'm going to predict that it's "power-calibration" - either way, it only appears once or twice, so it not per-sample data, and not really interesting.

That's leaves 22 and 24 - both of which look promising... I'll have to play around to predict / guess they're formatting.

BTW, does the flow website report power in whole numbers? ie 200, 201? or does it show decimals such as 200.5?

Thanks again! :smile:

trimathias commented 9 years ago

Hi Paul!

Nice to get a prompt reply from you. I made the session public in flow and you should find it on

https://flow.polar.com/training/analysis/42261903

It's just a very short test of the keo pedals and no real workout. Guess I'm saying this to justify the low watt numbers 😉 You're number seems to be spot on. What I can see in flow it uses integers for the power.

Regarding the two channels you are mentioning. Could it be left and right power? The keo pedals measure booth legs. Or maybe it is total watt and some kind of distribution factor r/l. I'm really just guessing here, better leave that to you the expert.

Don't hesitate to come back to me if I can help with more things. I owe you big time for all the work you put in to the bipolar software!

Thanks! Mathias Den 29 dec 2014 22:35 skrev "Paul Colby" notifications@github.com:

Thanks @trimathias https://github.com/trimathias! [image: :smile:] That data looks really helpful [image: :+1:]

I'll probably have a number of questions such as "what was the min / max power for this activity?". These will be easier for me if you could either make the activity public on the flow website, or make it available to followers only, and allow me to follow you. Otherwise, I'll just ask the questions here and/or via email.

The data appears to be reporting the minimum power as 87, and the max as

  1. Does that sound right? (I assume these are in watts)

cat *-statistics | protoc --decode_raw | grep '^5 ' -A3 5 { 1: 87 2: 287 }

That, of course, is just summary stats. The more interesting part is the sample data. Looking at the sample data, I can see that your files include three new fields that I've not see before - they are indexed as 22, 24 and 28.

Field 28 appears to be structured data similar to the various other sensor-calibration fields, so I'm going to predict that it's "power-calibration" - either way, it only appears once or twice, so it not per-sample data, and not really interesting.

That's leaves 22 and 24 - both of which look promising... I'll have to play around to predict / guess they're formatting.

BTW, does the flow website report power in whole numbers? ie 200, 201? or does it show decimals such as 200.5?

Thanks again! [image: :smile:]

— Reply to this email directly or view it on GitHub https://github.com/pcolby/bipolar/issues/43#issuecomment-68305698.

pcolby commented 9 years ago

I made the session public in flow

Great! I can see there that the 87W, was the average (I said the minimum above).

It's just a very short test of the keo pedals and no real workout. Guess I'm saying this to justify the low watt numbers

Haha. Yeah, I done similarly pointless slow runs and things just to get test data. No judgement here :stuck_out_tongue_winking_eye:

Regarding the two channels you are mentioning. Could it be left and right power? The keo pedals measure booth legs. Or maybe it is total watt and some kind of distribution factor r/l.

Yep, could be either. Once I've decoded the numbers (they appear to be protobuf varints), they'lll hopefully match up to the flow website data.

pcolby commented 9 years ago

That's leaves 22 and 24 - both of which look promising... I'll have to play around to predict / guess they're formatting.

Both appear to be complex embedded protobuf messages... it will take a bit more figure out... :neutral_face:

pcolby commented 9 years ago

@trimathias, are you happy for me to include the test data you sent me in the Bipolar project's unit test data suite?

This would mean that every time someone commits code changes to this repo, the unit tests will verify the parsing and HRM/GPX/TCX generation from your power data automatically, to ensure nothing breaks over time. However, it also means that those files will be publically available from this repo (under the test/polar/v2/testdata directory).

(I can make the code work either way; including your data in the test suite just makes things a little easier for me)

Thanks.

trimathias commented 9 years ago

No, problem. Feel free to include the files in the test suite. Den 2 jan 2015 05:33 skrev "Paul Colby" notifications@github.com:

@trimathias https://github.com/trimathias, are you happy for me to include the test data you sent me in the Bipolar project's unit test data suite?

This would mean that every time someone commits code changes to this repo, the unit tests will verify the parsing and HRM/GPX/TCX generation from your power data automatically, to ensure nothing breaks over time. However, it also means that those files will be publically available from this repo (under the test/polar/v2/testdata directory).

(I can make the code work either way; including your data in the test suite just makes things a little easier for me)

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/pcolby/bipolar/issues/43#issuecomment-68508477.

pcolby commented 9 years ago

Just a quick update: I've got power parsing working now (big thanks to @trimathias and @profanum429). Now I just need to include the parsed data in the relevant output files (HRM, GPX, TCX).

pcolby commented 9 years ago

HRM is done. TCX (via the Garmin Activity Extension) next.

pcolby commented 9 years ago

TCX power support done now too (along with a lot of other TCX and GPX extension data).

Just have to do some clean up, and prep for a new release :smile:

pcolby commented 9 years ago

Included in Bipolar 0.4.0.

davidonribble commented 9 years ago

Hi Paul. Okay brilliant now able to export power data to Golden Cheetah. wished I had your knowledge programming. Don't understand just why I can do this via Bipolar and not directly using the Flowsync export, may be when GC 3.11 is released this might be possible. however well done. Many Thanks

trimathias commented 9 years ago

Great job Paul 👍