Giter Club home page Giter Club logo

Comments (6)

Ptosiek avatar Ptosiek commented on June 5, 2024 1

Hey,
Yes it's a file from RideWithGPS
For the record I prevented downsampling, I am getting this instead:
image

So there's still a bug somewhere.

Unfortunately seems there's no required field in tcx/course point format and each file I try are slightly different.
But I will try to handle the case when 'Time' is set, directly in the tcx loader (and then not run part of modify_course_points).

What's the case of adding start and end course points by the way ?

from pizero_bikecomputer.

Ptosiek avatar Ptosiek commented on June 5, 2024 1

Hi,
Yes it's just that downsampling is failing for that file (cf the PR I opened on crdp branch).
That's why I was saying that it's the combination of downsampling and calculation of distance after, that is problematic.
So most likely, we would be better off running modify_course_point before downsampling

from pizero_bikecomputer.

hishizuka avatar hishizuka commented on June 5, 2024

Hi @Ptosiek ,
this is a difficult case, almost like a bug in the course file. (Probably output by RideWithGPS, right?)

The coordinates (latitude) of the first course point is backward from the first coordinates of the course.
Even more unlucky, the goal of the course is located backward from the first coordinates of the 'course', resulting in this behavior. A round-trip course or a course with multiple laps can make it difficult to determine the current distance on the course.

Usually course points are assumed to be on the course. However, it is possible, since Garmin Connect allows course points to be set at remote points not on the course.

A less good workaround is to eliminate the first course point.

However, as long as the course creation program is outputting this course file, I need to make some modifications to the first course point determination.

from pizero_bikecomputer.

hishizuka avatar hishizuka commented on June 5, 2024

Looking more closely, I found that the second point of the original course (Yes, deleted by downsampling) is set back about 1 meter from the starting point.
The first course point is then set against that point.

If the starting point had been moved a few meters to the east and the first course point no longer existed, it would have worked correctly.

from pizero_bikecomputer.

hishizuka avatar hishizuka commented on June 5, 2024

But maybe it's because the inner_p contains negative value ?

Yes, positive values between 0 and 1 indicate the course point is in the 2 close points of course.

We might want to set the course_points distance before downsampling actually, and if possible when files contains time+distance like this one we would be better reading the distance directly from trackpoint rather than recalculating it manually ?

Oh, getting the distance from the original course file is one idea.
I know only json format of RideWithGPS course seems to have distances of course points. (It has full texts and expandable for the future, such as voice reading).

from pizero_bikecomputer.

hishizuka avatar hishizuka commented on June 5, 2024

Hi @Ptosiek ,

As you have probably already noticed, if you include self.distance = self.distance / 1000 # [km] in the try-except block of the downsample, it will be correct.
(Downsampling is executed, but the try block that creates a cond using rdp is not executed.)

downsampling:1969 -> 1969
[ 0.001 0.388 0.546 1.925 3.665 4.186 4.665 5.006 5.084 6.906
7.541 7.759 7.954 8.864 9.025 9.033 10.76 10.777 10.796 10.821
11.474 12.522 14.521 14.553 14.846 15.356 15.87 16.409 17.583 17.726
17.746 18.804 19.387 19.399 19.552 19.912 20.044 20.719 23.058 26.22
26.344 27.861 29.689 30.574 31.723 31.904 35.885 35.987 39.675 61.057
61.078 63.428 63.582 63.592 63.633 63.977 63.981 63.987 64.415 64.795
64.8 65.346 65.479 65.765 66.871 67.058 67.062 67.159 67.691 67.714
87.125 87.283 87.67 87.702 87.733]

However, this is equivalent to not doing downsampling, so this code cannot be adopted.

from pizero_bikecomputer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.