2024-06-05 13:28:27 +02:00
4 changed files with 7 additions and 13 deletions

View File

@@ -269,7 +269,7 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
public void incrementProgress(View view) { public void incrementProgress(View view) {
if (progress < maxProgress) { if (progress < maxProgress) {
progress++; progress++;
triggerColorBurst(false); triggerColorBurst(true);
updateProgress(); updateProgress();
} }
} }
@@ -283,8 +283,10 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
if (isGoodRep) { if (isGoodRep) {
progressCircle.setProgressDrawable(ContextCompat.getDrawable(this, R.drawable.progress_circle_good)); progressCircle.setProgressDrawable(ContextCompat.getDrawable(this, R.drawable.progress_circle_good));
new MediaPlayer().create(this, R.raw.good_sound).start();
} else { } else {
progressCircle.setProgressDrawable(ContextCompat.getDrawable(this, R.drawable.progress_circle_bad)); progressCircle.setProgressDrawable(ContextCompat.getDrawable(this, R.drawable.progress_circle_bad));
new MediaPlayer().create(this, R.raw.wrong_sound).start();
} }
ObjectAnimator animator = ObjectAnimator.ofFloat(progressCircle, "alpha", 1f, 0f, 1f); ObjectAnimator animator = ObjectAnimator.ofFloat(progressCircle, "alpha", 1f, 0f, 1f);

View File

@@ -130,7 +130,7 @@ public class InputProcessor {
*/ */
public void onAdequateRepetition() { public void onAdequateRepetition() {
ExerciseManager.TOTAL_REPETITIONS_PERFORMED++; ExerciseManager.TOTAL_REPETITIONS_PERFORMED++;
// TODO: Play sound // TODO: Add animation for correct repetition
} }
/** /**
@@ -138,6 +138,7 @@ public class InputProcessor {
*/ */
public void onInadequateRepetition() { public void onInadequateRepetition() {
// TODO: Add animation for wrong repetition
} }
/** /**
@@ -344,16 +345,6 @@ public class InputProcessor {
return jsonArray.toString(); return jsonArray.toString();
} }
/**
* Method for getting the current progress of the exercise.
* The return value will range between 0.0 and 1.0.
*
* @return The current progress of the exercise.
*/
public double getCurrentProgress() {
return secondsPassed / exerciseDurationInSeconds;
}
/** /**
* Function for getting the combined (average) error value of both sensors. * Function for getting the combined (average) error value of both sensors.
public double getCombinedError() public double getCombinedError()
@@ -373,9 +364,10 @@ public class InputProcessor {
*/ */
public double getError(int sensorId, float time) { public double getError(int sensorId, float time) {
/*// Ensure the sensor ID is within the bounds of the array // Ensure the sensor ID is within the bounds of the array
if (sensorId < 0 || sensorId >= selfRotationVectorPaths.length) if (sensorId < 0 || sensorId >= selfRotationVectorPaths.length)
return 0.0d; return 0.0d;
/*
// Index of the current rotation vector // Index of the current rotation vector
int targetIndex = (int) ((this.exerciseDurationInSeconds / this.targetRotationVectorPaths[sensorId].length) * time); int targetIndex = (int) ((this.exerciseDurationInSeconds / this.targetRotationVectorPaths[sensorId].length) * time);

Binary file not shown.

Binary file not shown.