Skip to content

Commit

Permalink
Hopefully fix track width regression
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrott committed Dec 7, 2022
1 parent b44d5e0 commit 7c9fd6c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ <h1>RR Drive Encoder Angular Ramp Regression</h1>
document.getElementById('trackWidthChart'),
angVels,
angVels.map((_, i) =>
(leftEncVels.reduce((acc, vs) => acc - vs[i], 0)
+ rightEncVels.reduce((acc, vs) => acc + vs[i], 0))
/ (data.leftEncVels.length + data.rightEncVels.length)
* (data.type === 'mecanum' ? 1 : 2)
(leftEncVels.reduce((acc, vs) => acc - vs[i], 0) / data.leftEncVels.length
+ rightEncVels.reduce((acc, vs) => acc + vs[i], 0) / data.rightEncVels.length)
* (data.type === 'mecanum' ? 0.5 : 1)
),
{title: 'Track Width Regression', slope: 'track width'}
);
Expand Down

0 comments on commit 7c9fd6c

Please sign in to comment.