Skip to content

Commit

Permalink
fix grid distance checking for shimmy
Browse files Browse the repository at this point in the history
  • Loading branch information
democat3457 committed Nov 19, 2024
1 parent 0604e5c commit 9113b97
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/server/robot/path-materializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,12 @@ function findShimmyLocation(
const normalY: number = signedDistY / distHypot;
const orth1: Position = new Position(-normalY, normalX);
const orth2: Position = new Position(normalY, -normalX);
const orthPos1: Position = orth1.addTuple(move.to.toTuple());
const orthPos2: Position = orth2.addTuple(move.to.toTuple());
const orthPos1: Position = orth1.add(
gridIndicesToPosition(move.to),
);
const orthPos2: Position = orth2.add(
gridIndicesToPosition(move.to),
);

// distance calculations :)
const val1: Position = shimmyPos.sub(orthPos1);
Expand Down

0 comments on commit 9113b97

Please sign in to comment.