Updated some stuff

This commit is contained in:
Luca Warmenhoven
2024-06-03 14:55:24 +02:00
parent c0d002c46b
commit 627b50f7d5
3 changed files with 36 additions and 39 deletions

View File

@@ -18,12 +18,7 @@ import com.example.fitbot.util.NavigationManager;
import com.example.fitbot.util.processing.IInputHandler;
import com.example.fitbot.util.processing.InputProcessor;
import org.joml.Matrix4f;
import org.joml.Vector2f;
import org.joml.Vector3f;
import org.joml.Vector4f;
import java.util.concurrent.ConcurrentLinkedQueue;
public class ExerciseStatusElement extends View implements IInputHandler {
@@ -87,8 +82,6 @@ public class ExerciseStatusElement extends View implements IInputHandler {
// Handler that is called every time the motion processor receives new data.
}
/**

View File

@@ -92,6 +92,8 @@ public class GesturePath {
*/
public static GesturePath fromString(String input) {
if (input == null)
throw new IllegalArgumentException("Input string cannot be null");
byte[] bytes = input.getBytes();
// Check if the input string contains a valid amount of bytes (12 bytes per vector)

View File

@@ -101,6 +101,7 @@ public class InputProcessor {
if (recording) {
this.secondsPassed = 0.0D;
this.lastTime = System.currentTimeMillis();
this.selfRotationVectorPaths = new Vector3f[2][(int) (duration * this.sampleRate)];
}
}
@@ -179,6 +180,7 @@ public class InputProcessor {
int deviceId = object.get("deviceId").getAsInt();
String type = object.get("type").getAsString();
// Parse the retrieved data
parseRotationVector(rotation, deviceId);
} catch (Exception e) {
Log.i("MotionProcessor", "Failed to parse packet data.");