#2089 GPX exports 0 HR points

Open
opened 2 weeks ago by peter.kraus · 10 comments

Before reporting a bug, please confirm the following:

I got Gadgetbridge from:

If you got it from Google Play, please note that version is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can.

Your issue is:

The export function on my Amazfit Bip S exports points with <gpxtpx:TrackPointExtension><gpxtpx:hr>0</gpxtpx:hr></gpxtpx:TrackPointExtension> instead of the nearest HR value, even though includeHeartRateOfNearestSample ought to be set to True based on 498bf1af1f/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/export/GPXExporter.java (L51). Perhaps it would be better to simply drop the HR point if hr == 0 after 498bf1af1f/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/export/GPXExporter.java (L170) ?

Your wearable device is:

Amazfit Bip S 2.1.0.14

Your android version is:

version 9, Lineage OS 16.0

Your Gadgetbridge version is:

0.48.0

New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.

#### Before reporting a bug, please confirm the following: - [x] I have read the [wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki), and I didn't find a solution to my problem / an answer to my question. - [x] I have searched the [issues](https://codeberg.org/Freeyourgadget/Gadgetbridge/issues), and I didn't find a solution to my problem / an answer to my question. - [ ] If you upload an image or other content, please make sure you have read and understood the [Codeberg Terms of Use](https://codeberg.org/codeberg/org/src/branch/master/TermsOfUse.md) ### I got Gadgetbridge from: * [x] F-Droid * [ ] I built it myself from source code (specify tag / commit) If you got it from Google Play, please note [that version](https://github.com/TaaviE/Gadgetbridge) is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can. #### Your issue is: The export function on my Amazfit Bip S exports points with `<gpxtpx:TrackPointExtension><gpxtpx:hr>0</gpxtpx:hr></gpxtpx:TrackPointExtension>` instead of the nearest HR value, even though `includeHeartRateOfNearestSample` ought to be set to True based on https://codeberg.org/Freeyourgadget/Gadgetbridge/src/commit/498bf1af1f50e91376dedc269d7535953bb7057c/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/export/GPXExporter.java#L51. Perhaps it would be better to simply drop the HR point if `hr == 0` after https://codeberg.org/Freeyourgadget/Gadgetbridge/src/commit/498bf1af1f50e91376dedc269d7535953bb7057c/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/export/GPXExporter.java#L170 ? #### Your wearable device is: Amazfit Bip S 2.1.0.14 #### Your android version is: version 9, Lineage OS 16.0 #### Your Gadgetbridge version is: 0.48.0 *New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.*
Poster

Actually, I've just noticed the isValidHeartRateValue(hr) check should do that, but of course when one sets the HR charts to be between 0 and a high number, 0 becomes a valid number to export.

498bf1af1f/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/HeartRateUtils.java (L66)

Actually, I've just noticed the `isValidHeartRateValue(hr)` check should do that, but of course when one sets the HR charts to be between 0 and a high number, 0 becomes a valid number to export. https://codeberg.org/Freeyourgadget/Gadgetbridge/src/commit/498bf1af1f50e91376dedc269d7535953bb7057c/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/HeartRateUtils.java#L66
vanous commented 2 weeks ago
Poster
Collaborator

Do yu have both min/max HR set to 0? Then yes, no HR will be valid. With great power...

Do yu have both min/max HR set to 0? Then yes, no HR will be valid. With great power...
Poster

No, I only have "Chart" min HR set to 0. It's not obvious the "Chart" setting affects exports, and even then I think zero points should be discarded and not exported.

No, I only have "Chart" min HR set to 0. It's not obvious the "Chart" setting affects exports, and even then I think zero points should be discarded and not exported.
vanous commented 2 weeks ago
Poster
Collaborator

@peter.kraus

No, I only have "Chart" min HR set to 0. It's not obvious the "Chart" setting affects exports,

Yes, agree. one way to solve this is to use autoscaling in charts based on min/max values in the current data. Sleep chart will do this in the upcoming release, actually.

Maybe we should move HR min/max to About you...

and even then I think zero points should be discarded and not exported.

I am not sure about this one.

What is your Max HR set to?

@peter.kraus >No, I only have "Chart" min HR set to 0. It's not obvious the "Chart" setting affects exports, Yes, agree. one way to solve this is to use autoscaling in charts based on min/max values in the current data. Sleep chart will do this in the upcoming release, actually. Maybe we should move HR min/max to About you... >and even then I think zero points should be discarded and not exported. I am not sure about this one. What is your Max HR set to?
Poster

@peter.kraus

No, I only have "Chart" min HR set to 0. It's not obvious the "Chart" setting affects exports,

Yes, agree. one way to solve this is to use autoscaling in charts based on min/max values in the current data. Sleep chart will do this in the upcoming release, actually.

I don't know about that - I always think charts should start at 0, unless there's a very good reason not to.

Maybe we should move HR min/max to About you...

and even then I think zero points should be discarded and not exported.

I am not sure about this one.

What is your Max HR set to?

180, which is not really my "Max HR", but it's what I'd like to see on the charts.

> @peter.kraus > > >No, I only have "Chart" min HR set to 0. It's not obvious the "Chart" setting affects exports, > > Yes, agree. one way to solve this is to use autoscaling in charts based on min/max values in the current data. Sleep chart will do this in the upcoming release, actually. I don't know about that - I always think charts should start at 0, unless there's a very good reason not to. > > Maybe we should move HR min/max to About you... > > >and even then I think zero points should be discarded and not exported. > > I am not sure about this one. > > What is your Max HR set to? 180, which is not really my "Max HR", but it's what I'd like to see on the charts.
vanous commented 2 weeks ago
Poster
Collaborator

I don’t know about that - I always think charts should start at 0, unless there’s a very good reason not to.

The amount of information value, given the small screen estate, can be very different and can even give you different perception:

image

image

But, obviously, different people have different needs. This is under a setting ("Show averages in the chart").

So you can set you HR Min/Max as you prefer. Feel free to document in wiki the effect on GPX export.

>I don’t know about that - I always think charts should start at 0, unless there’s a very good reason not to. The amount of information value, given the small screen estate, can be very different and can even give you different perception: ![image](/attachments/182ed6c0-57ac-42f4-803d-73aa9f3168c6) ![image](/attachments/b84978cc-ab3a-4f86-8906-ea412093e239) But, obviously, different people have different needs. This is under a setting ("Show averages in the chart"). So you can set you HR Min/Max as you prefer. Feel free to document in wiki the effect on GPX export.
vanous commented 2 weeks ago
Poster
Collaborator

One more though... if i was to draw the values, i would actually need the zeros to be present, because you cannot just interpolate from one value to the next if there were wrong values in between, so one would typically add zeros in those spots anyways. Having said this, i have not checked what the GPX spec says and if it has an opinion about this. @peter.kraus what do you think?

One more though... if i was to draw the values, i would actually need the zeros to be present, because you cannot just interpolate from one value to the next if there were wrong values in between, so one would typically add zeros in those spots anyways. Having said this, i have not checked what the GPX spec says and if it has an opinion about this. @peter.kraus what do you think?
Poster

The HR of zero values are clearly nonsense. Whether they come directly from the watch, or from gadgetbridge, they should in my opinion be filtered out.

I think the values are artifically added by gadgetbridge, as the GPS time resolution is higher than the HR time resolution. Gadgetbridge incorrectly fills the missing HR data in the GPS-only points by zeroes (even though the nearest-neighbor extrapolation should prevent that).

I have just checked, and the chart min/max setting does not prevent the export of zeros, but I am not sure how changing the min/max chart setting affects activities that are already synced from the watch.

The HR of zero values are clearly nonsense. Whether they come directly from the watch, or from gadgetbridge, they should in my opinion be filtered out. I think the values are artifically added by gadgetbridge, as the GPS time resolution is higher than the HR time resolution. Gadgetbridge incorrectly fills the missing HR data in the GPS-only points by zeroes (even though the nearest-neighbor extrapolation should prevent that). I have just checked, and the chart min/max setting does not prevent the export of zeros, but I am not sure how changing the min/max chart setting affects activities that are already synced from the watch.
vanous commented 2 weeks ago
Poster
Collaborator

My GPX contains no HR with 0 values.

My GPX contains no HR with 0 values.
vanous commented 2 weeks ago
Poster
Collaborator

You can set HR Min to 1, reset fetch time, re-fetch the sports activity and see if the GPX now has the 0s or not. I am not sure if you have to erase the existing GPX first, you would need to try.

You can set HR Min to 1, reset fetch time, re-fetch the sports activity and see if the GPX now has the 0s or not. I am not sure if you have to erase the existing GPX first, you would need to try.
vanous added the
enhancement
label 2 weeks ago
vanous added the
activity post processing
label 2 weeks ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.