Skip to content

Commit

Permalink
Fit file import - Interpolate lrbalance between valid values only
Browse files Browse the repository at this point in the history
Fixes #4117
  • Loading branch information
amtriathlon committed Aug 23, 2022
1 parent 700f855 commit 0108a05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FileIO/FitRideFile.cpp
Expand Up @@ -2085,7 +2085,7 @@ struct FitFileReaderState
double deltaLat = lat - prevPoint->lat;
// double deltaHeadwind = headwind - prevPoint->headwind;
double deltaSlope = slope - prevPoint->slope;
double deltaLeftRightBalance = (lrbalance>=0?lrbalance:50.0) - (prevPoint->lrbalance?prevPoint->lrbalance:50.0);
double deltaLeftRightBalance = lrbalance - prevPoint->lrbalance;
double deltaLeftTE = leftTorqueEff - prevPoint->lte;
double deltaRightTE = rightTorqueEff - prevPoint->rte;
double deltaLeftPS = leftPedalSmooth - prevPoint->lps;
Expand Down Expand Up @@ -2126,7 +2126,7 @@ struct FitFileReaderState
0.0, // headwind
prevPoint->slope + (deltaSlope * weight),
temperature,
prevPoint->lrbalance + (deltaLeftRightBalance * weight),
(lrbalance!=RideFile::NA && prevPoint->lrbalance!=RideFile::NA) ? prevPoint->lrbalance + (deltaLeftRightBalance * weight) : RideFile::NA, // interpolate between valid values only
prevPoint->lte + (deltaLeftTE * weight),
prevPoint->rte + (deltaRightTE * weight),
prevPoint->lps + (deltaLeftPS * weight),
Expand Down

0 comments on commit 0108a05

Please sign in to comment.