From 913dc74fd64a37c30e61bba7356fe13fe7c3ead0 Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 5 Apr 2023 23:01:51 -0500 Subject: [PATCH] Fixed all processing related errors --- SLAM-Sim.iml | 5 ++--- src/Car.java | 5 +++-- src/SLAM.java | 8 +++++--- src/View.java | 4 ++-- src/Wall.java | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/SLAM-Sim.iml b/SLAM-Sim.iml index b35c339..36e1ef0 100644 --- a/SLAM-Sim.iml +++ b/SLAM-Sim.iml @@ -7,14 +7,13 @@ - + - + - diff --git a/src/Car.java b/src/Car.java index 8194e28..8e3c209 100644 --- a/src/Car.java +++ b/src/Car.java @@ -1,11 +1,12 @@ -import processing.core.*; import java.util.ArrayList; import static java.lang.Math.PI; import static processing.core.PApplet.degrees; import static processing.core.PApplet.radians; +import processing.core.PVector; +import processing.core.PApplet; -public class Car{ +public class Car extends PApplet{ PVector pose = new PVector(0,0); // the car's x, y position float angle = 0; // the current angle that the car is at. int carLength = 50; diff --git a/src/SLAM.java b/src/SLAM.java index fcf151c..4d47bc7 100644 --- a/src/SLAM.java +++ b/src/SLAM.java @@ -2,7 +2,9 @@ import processing.core.*; import java.util.ArrayList; -public class SLAM{ +import static processing.core.PApplet.pow; + +public class SLAM extends PApplet{ ArrayList points = new ArrayList(); SLAM(){ @@ -39,7 +41,7 @@ class Line{ for(PVector point : points){ mean.add(point); } - mean.div(points.size()) + mean.div(points.size()); // this section calculates the direction vector of the line of best fit PVector direction = new PVector(); @@ -50,7 +52,7 @@ class Line{ } this.position = mean; - this.direction = direciton; + this.direction = direction; } public PVector getSlopeIntForm(){ diff --git a/src/View.java b/src/View.java index 06a147e..feb6c4d 100644 --- a/src/View.java +++ b/src/View.java @@ -4,7 +4,7 @@ import java.util.Objects; import static processing.core.PApplet.*; -public class View{ +public class View extends PApplet{ PVector pose; float angle = 0; float FOV; @@ -77,7 +77,7 @@ public class View{ } } -class Ray{ +class Ray extends PApplet{ PVector pose; int rayLength; int defaultRayLength; diff --git a/src/Wall.java b/src/Wall.java index 962ae2d..cfc47f7 100644 --- a/src/Wall.java +++ b/src/Wall.java @@ -2,7 +2,7 @@ import processing.core.*; import static processing.core.PApplet.*; -public class Wall{ +public class Wall extends PApplet{ PVector pos; float angle; int wallLength;