Skip to content

Commit

Permalink
fixed the errors we get when the logs are over
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnaliam committed Apr 14, 2024
1 parent d6a74a2 commit 5f4b386
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ function initialize(data: object[]) {
// Drawing function for Field2D
draw = () => {
const item = data[i];

if (i >= data.length || item == undefined) {
playing = false;
return;
}

const robotX = Number(item["Robot X"]);
const robotY = Number(item["Robot Y"]);
const robotRotation = degreesToRadians(Number(item["Robot Theta (deg)"]));
Expand Down

0 comments on commit 5f4b386

Please sign in to comment.