Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mayarajan3 committed Nov 21, 2024
2 parents 1d68981 + 47af9cf commit 9c8e848
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions extensions/src/doodlebot/LineFollowing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,18 @@ export function followLine(previousLine: Point[], pixels: Point[], next: Point[]
if (test) {
x3 = spline.xs[0];
} else {
x3 = start;
x3 = spline.xs[0];
}
const splineValue = spline.at(x3);
if (typeof splineValue === 'undefined') {
// Handle the error case - either return early or use a default value
return {
motorCommands: [],
bezierPoints: [],
line: []
};
}
const point3 = { x: spline.at(x3), y: x3 }
const point3 = { x: splineValue, y: x3 };

// Find the x offset to correct
const reference1 = [spline.at(spline.xs[0]), 0] // First point should be very close to 0
Expand Down

0 comments on commit 9c8e848

Please sign in to comment.