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

Add cadence data to recorder app #3068

Merged
merged 12 commits into from Nov 3, 2023
Merged

Conversation

Mineinjava
Copy link
Contributor

@Mineinjava Mineinjava commented Oct 31, 2023

Hi
This is my first contribution to this repository. If there is anything I missed, please let me know.
This PR adds cadence data to the GPX output file

@bobrippling
Copy link
Collaborator

Great first contribution :) Let us know when you're happy with the remaining items on your list and we can re-review

@gfwilliams
Copy link
Member

Thanks! I guess my only concern with this is the CSV file already stores steps and time, so it should be easy to work Cadence out from what's in the stored CSV data already - basically just looking at the difference between the last timestamp and this one and doing steps * 60000 / timeDifference?

So we could just have the changes you made to apps/recorder/interface.html, but with a bit of extra code in there to work out the Cadence at the time the file was read back?

@Mineinjava
Copy link
Contributor Author

Thanks! I guess my only concern with this is the CSV file already stores steps and time, so it should be easy to work Cadence out from what's in the stored CSV data already - basically just looking at the difference between the last timestamp and this one and doing steps * 60000 / timeDifference?

So we could just have the changes you made to apps/recorder/interface.html, but with a bit of extra code in there to work out the Cadence at the time the file was read back?

That sounds like a better solution. I will revert and reimplement. Thanks

@Mineinjava
Copy link
Contributor Author

oops didn't mean to close it

@Mineinjava Mineinjava reopened this Nov 2, 2023
@Mineinjava
Copy link
Contributor Author

I got the cadence log in the gpx output to work. However, it appears that Strava doubles the cadence value. This is probably because gpx cadence for bikes is rotations/min whereas for running it is steps/min, and two steps is one cycle.

Source: Garmin GPX schema:

<xsd:element name="cad" type="RevolutionsPerMinute_t" minOccurs="0"/>

I believe the standard is one revolution is two steps (one step per foot)

I will update the source code to divide by two as that appears to be the standard. I don't believe this will cause a problem on bicycles because step count while cycling is irrelevant.

@thyttan
Copy link
Collaborator

thyttan commented Nov 2, 2023

Off topic:

Hi! Once you're done with this would you be interested in working on gpx-stuff in Gadgetbridge for implementing the 'Activity Tracks' feature for Bangle.js?

https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3153#issuecomment-1314419

@gfwilliams
Copy link
Member

This looks great - thanks for your work!

Are you happy to merge this now? I know there are some items in the original PR note you haven't marked complete but even so the changes here seem useful

@Mineinjava
Copy link
Contributor Author

Off topic:

Hi! Once you're done with this would you be interested in working on gpx-stuff in Gadgetbridge for implementing the 'Activity Tracks' feature for Bangle.js?

Sorry, I don't use gadgetbridge (I have an iphone) and I'm not sure I understand what that feature is.

@Mineinjava Mineinjava marked this pull request as ready for review November 2, 2023 16:54
@thyttan
Copy link
Collaborator

thyttan commented Nov 2, 2023

Ah! Thanks anyways then 😉

@Mineinjava
Copy link
Contributor Author

This looks great - thanks for your work!

Are you happy to merge this now? I know there are some items in the original PR note you haven't marked complete but even so the changes here seem useful

Just tested this and it works as intended. I am ready to merge.

@gfwilliams
Copy link
Member

Great - thanks!

@gfwilliams gfwilliams merged commit c68a892 into espruino:master Nov 3, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

4 participants