From 902cc184ee6d9bcb158adf5384fa52b496bbe16f Mon Sep 17 00:00:00 2001 From: Niels Gras Date: Mon, 3 Jun 2024 14:47:51 +0200 Subject: [PATCH 1/3] added arm circle movement --- .../app/src/main/res/raw/armcircle.qianim | 275 ++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 code/src/Fitbot/app/src/main/res/raw/armcircle.qianim diff --git a/code/src/Fitbot/app/src/main/res/raw/armcircle.qianim b/code/src/Fitbot/app/src/main/res/raw/armcircle.qianim new file mode 100644 index 0000000..5d8005b --- /dev/null +++ b/code/src/Fitbot/app/src/main/res/raw/armcircle.qianim @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9639d6ba3bd64b4e1bfd6eb5a2fbed5b37435eb1 Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Mon, 3 Jun 2024 14:48:18 +0200 Subject: [PATCH 2/3] hardware docs update --- docs/documentation/hardware/pcb.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/documentation/hardware/pcb.md b/docs/documentation/hardware/pcb.md index 2142df2..80c28a0 100644 --- a/docs/documentation/hardware/pcb.md +++ b/docs/documentation/hardware/pcb.md @@ -20,5 +20,9 @@ We chose this pcb because its really small and it has a socket for a sensor and We are going to rotational data from the sensor and use that to give feedback to the user based on how well they did the exercise. ![alt text](../assets/pcbImage.png) +## How can i program this ESP? + +To program this you need to use the Arduino IDE. You need to install the ESP8266 board in the board manager. You need to go to File -> prefrences -> additional board manager url's. Then you need to add this link `https://arduino.esp8266.com/stable/package_esp8266com_index.json`. Then you can find the LOLIN(WEMOS) D1 mini lite. Thats the board you need to select. When compiling you will see a lot of warnings but you can ignore them. + ### Sources * https://github.com/Sorakage033/SlimeVR-CheeseCake \ No newline at end of file From 85c6e4e918673e53c10c9efb0154daedaf60c944 Mon Sep 17 00:00:00 2001 From: SebasKoedam Date: Mon, 3 Jun 2024 14:55:13 +0200 Subject: [PATCH 3/3] feat: Add short description field to Exercise class --- .../java/com/example/fitbot/exercise/Exercise.java | 4 +++- .../com/example/fitbot/exercise/ExerciseManager.java | 5 +++-- .../example/fitbot/ui/activities/FitnessActivity.java | 11 +++++++++++ .../app/src/main/res/layout/activity_fitness.xml | 2 +- .../Fitbot/app/src/main/res/layout/dialog_info.xml | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/exercise/Exercise.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/exercise/Exercise.java index f0a1e7a..d0c4dc9 100644 --- a/code/src/Fitbot/app/src/main/java/com/example/fitbot/exercise/Exercise.java +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/exercise/Exercise.java @@ -8,6 +8,7 @@ public class Exercise { public final GesturePath leftPath; public final GesturePath rightPath; public final String name; + public final String shortDescription; public final String description; public final String imageUrl; public final String videoUrl; @@ -24,9 +25,10 @@ public class Exercise { * @param imageUrl The URL of the image. * @param videoUrl The URL of the video. */ - public Exercise(EMuscleGroup muscleGroup, String name, String description, String imageUrl, String videoUrl, GesturePath leftPath, GesturePath rightPath, float exerciseTimeInSeconds) { + public Exercise(EMuscleGroup muscleGroup, String name,String shortDescription, String description, String imageUrl, String videoUrl, GesturePath leftPath, GesturePath rightPath, float exerciseTimeInSeconds) { this.name = name; this.muscleGroup = muscleGroup; + this.shortDescription = shortDescription; this.description = description; this.leftPath = leftPath; this.rightPath = rightPath; diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/exercise/ExerciseManager.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/exercise/ExerciseManager.java index 613eb36..94450be 100644 --- a/code/src/Fitbot/app/src/main/java/com/example/fitbot/exercise/ExerciseManager.java +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/exercise/ExerciseManager.java @@ -21,10 +21,10 @@ public class ExerciseManager { private static final String PROPERTY_EXERCISE_DURATION = "duration"; private static final String PROPERTY_EXERCISE_ID = "exerciseId"; private static final String PROPERTY_MUSCLE_GROUP = "muscleGroup"; - private static final String PROPERTY_SHORT_DESC = "shortDescription"; private static final String PROPERTY_IMAGE_URL = "imageUrl"; private static final String PROPERTY_VIDEO_URL = "videoUrl"; private static final String PROPERTY_DESC = "description"; + private static final String PROPERTY_SHORT_DESC = "shortDescription"; private static final String PROPERTY_PATH = "path"; private static final String PROPERTY_NAME = "name"; @@ -34,7 +34,7 @@ public class ExerciseManager { public static final int SENSOR_COUNT = 2; private static final String[] REQUIRED_PROPERTIES = { - PROPERTY_MUSCLE_GROUP, PROPERTY_DESC, PROPERTY_IMAGE_URL, + PROPERTY_MUSCLE_GROUP, PROPERTY_DESC,PROPERTY_SHORT_DESC, PROPERTY_IMAGE_URL, PROPERTY_VIDEO_URL, PROPERTY_NAME, PROPERTY_PATH, PROPERTY_EXERCISE_DURATION, PROPERTY_EXERCISE_ID, PROPERTY_SHORT_DESC @@ -112,6 +112,7 @@ public class ExerciseManager { EMuscleGroup.parse(content.get(PROPERTY_MUSCLE_GROUP).getAsString()), content.get(PROPERTY_NAME).getAsString(), content.get(PROPERTY_DESC).getAsString(), + content.get(PROPERTY_SHORT_DESC).getAsString(), content.get(PROPERTY_IMAGE_URL).getAsString(), content.get(PROPERTY_VIDEO_URL).getAsString(), GesturePath.fromString(leftRightData[0]), diff --git a/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java b/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java index 1d74427..67d4d31 100644 --- a/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java +++ b/code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/FitnessActivity.java @@ -33,7 +33,12 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall private ExerciseStatusElement exerciseStatusElement; private InputProcessor motionProcessor; private Exercise currentExercise; + + // Exercise status element data + private TextView exerciseMuscleGroupTextView; private TextView exerciseNameTextView; + private TextView exerciseShortDescriptionTextView; + private TextView exerciseDescriptionTextView; // Some nice little messages for the user private static final String[] EXERCISE_NOT_FOUND_MESSAGES = new String[]{ @@ -58,7 +63,11 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall // Remove the ugly ass bar on top of the view setSpeechBarDisplayStrategy(SpeechBarDisplayStrategy.IMMERSIVE); + + // Fill empty objects with exercise data this.exerciseNameTextView = findViewById(R.id.textViewFitnessTitle); + this.exerciseDescriptionTextView = findViewById(R.id.textViewDialogDescription); + this.exerciseShortDescriptionTextView = findViewById(R.id.textViewFitnessShortDescription); // Find the VideoView by its ID VideoView videoView = findViewById(R.id.videoView); @@ -128,6 +137,8 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall onFailedFetch.handle(null); } else { exerciseNameTextView.setText(exercise.name); + exerciseShortDescriptionTextView.setText(exercise.shortDescription); + exerciseDescriptionTextView.setText(exercise.description); onSuccessfulFetch.handle(exercise); } })).start(); diff --git a/code/src/Fitbot/app/src/main/res/layout/activity_fitness.xml b/code/src/Fitbot/app/src/main/res/layout/activity_fitness.xml index d72d83c..1eb25a3 100644 --- a/code/src/Fitbot/app/src/main/res/layout/activity_fitness.xml +++ b/code/src/Fitbot/app/src/main/res/layout/activity_fitness.xml @@ -84,7 +84,7 @@ android:layout_gravity="center_horizontal">