Fixed button ids

This commit is contained in:
SebasKoedam
2024-05-30 10:43:56 +02:00
parent 17f40a7a07
commit 20b75278f0
6 changed files with 67 additions and 36 deletions

View File

@@ -14,7 +14,7 @@ public class EndScreenActivity extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_end_screen); setContentView(R.layout.activity_end_screen);
com.example.fitbot.util.ButtonNavigation.setupButtonNavigation(this, R.id.homeButton, MainActivity.class); com.example.fitbot.util.ButtonNavigation.setupButtonNavigation(this, R.id.homeButtonEndScreen, MainActivity.class);
com.example.fitbot.util.ButtonNavigation.setupButtonNavigation(this, R.id.continueButton, FitnessActivity.class); com.example.fitbot.util.ButtonNavigation.setupButtonNavigation(this, R.id.startButtonEndScreen, FitnessActivity.class);
} }
} }

View File

@@ -39,7 +39,7 @@ public class FitnessActivity extends RobotActivity implements RobotLifecycleCall
FitnessCycle.playVideo(videoView, this); FitnessCycle.playVideo(videoView, this);
ButtonNavigation.setupButtonNavigation(this, R.id.homeButton, MainActivity.class); ButtonNavigation.setupButtonNavigation(this, R.id.homeButtonFitness, MainActivity.class);
// Implement your logic when the robot focus is gained // Implement your logic when the robot focus is gained
GesturePath.Builder gesturePathBuilder = new GesturePath.Builder(); GesturePath.Builder gesturePathBuilder = new GesturePath.Builder();

View File

@@ -13,7 +13,7 @@ public class HelpActivity extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help); setContentView(R.layout.activity_help);
ButtonNavigation.setupButtonNavigation(this, R.id.homeButton, MainActivity.class); ButtonNavigation.setupButtonNavigation(this, R.id.homeButtonHelp, MainActivity.class);
} }
} }

View File

@@ -39,7 +39,7 @@ public class MainActivity extends AppCompatActivity {
// Hide system UI // Hide system UI
hideSystemUI(); hideSystemUI();
startButton = findViewById(R.id.startButton); startButton = findViewById(R.id.startButtonMain);
startButton.setOnClickListener(v -> { startButton.setOnClickListener(v -> {
Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo); Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo);
Intent intent = new Intent(MainActivity.this, FitnessActivity.class); Intent intent = new Intent(MainActivity.this, FitnessActivity.class);
@@ -55,14 +55,14 @@ public class MainActivity extends AppCompatActivity {
drawerLayout = findViewById(R.id.drawer_layout); drawerLayout = findViewById(R.id.drawer_layout);
navigationView = findViewById(R.id.nav_view); navigationView = findViewById(R.id.nav_view);
toolbar = findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
startButton = findViewById(R.id.startButton); startButton = findViewById(R.id.startButtonMain);
// Hide the action bar // Hide the action bar
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
getSupportActionBar().hide(); getSupportActionBar().hide();
} }
ButtonNavigation.setupButtonNavigation(this, R.id.startButton, FitnessActivity.class); ButtonNavigation.setupButtonNavigation(this, R.id.startButtonMain, FitnessActivity.class);
ButtonNavigation.setupButtonNavigation(this, R.id.helpButton, HelpActivity.class); ButtonNavigation.setupButtonNavigation(this, R.id.helpButtonMain, HelpActivity.class);
/*---Tool Bar---*/ /*---Tool Bar---*/
setSupportActionBar(toolbar); // Make the toolbar act as the action bar setSupportActionBar(toolbar); // Make the toolbar act as the action bar

View File

@@ -2,25 +2,34 @@
## Introduction ## Introduction
For this project we want to design an embedded system that can track a users position. We want to track their current position on the ground and see how they are shifting their weight. This system will be used to track their position to determine if a user is doing the exercises correctly. For this project we want to design an embedded system that can track a users position. We want to track their current position on the ground. This system will be used to track their position to determine if a user is doing the exercises correctly.
## Objectives ## Objectives
* Design an embedded system that can track user position. - Design an embedded system that can track user position.
* Develop an algorithm to process the data from the Wii Fit Board and determine the user's position. - Develop an algorithm to process the data from the sensor and determine the user's position.
- Sync the code to the current task for the user.
## Research and Analysis ## Research and Analysis
### Choosing the Wii Fit Board ### Choosing the sensor
For this project we have chosen the Wii Fit Board as our primary sensor. The Wii Fit Board is a balance board that can measure a user's weight and center of balance. It is a low-cost sensor that is easy to interface with a microcontroller. The Wii Fit Board communicates over Bluetooth, which makes it easy to connect to a microcontroller with Bluetooth capabilities. For this project we have chosen LDR's as our primary sensor. The LDR's will be placed on the ground in a board and the user will stand on top of the board. The LDR's will be used to track the user's position. The LDR's will be connected to the esp32s3 microcontroller and the data will be processed to determine the user's position.
We have chosen this sensor since it's one of the easiest and cheapest solutions to our problem. Other sensors like pressure sensors, accelerometers, and Wii Balance Board are either too expensive, not the most optimal for the task, or hard to integrate with other systems.
### Alternative Solutions ### Alternative Solutions
There are other sensors that can be used for position tracking, such as pressure sensors or accelerometers. However, these sensors are more expensive and may require additional processing to determine the user's position. The Wii Fit Board provides a simple and cost-effective solution for position tracking. There are other sensors that can be used for position tracking, such as pressure sensors, Wii Balance Board or accelerometers. However, these sensors are either too expensive, not the most optimal for the task or hard to integrate with other systems.
Example of other sensors that can be used for position tracking: Example of other sensors that can be used for position tracking:
Wii Balance Board:
- Description: The Wii Balance Board is a balance board that can measure a user's weight and center of balance.
- Pros: Low-cost.
- Cons: Very hard to intergrate with other systems.
- Cost: ~ 20 euros (https://www.amazon.nl/Nintendo-Wii-Balance-Board-Wii/dp/B0013E9HP6)
Pressure sensors: Pressure sensors:
- Description: Pressure sensors can be used to measure the force applied by the user on the ground. By measuring the pressure distribution, the user's position can be determined. - Description: Pressure sensors can be used to measure the force applied by the user on the ground. By measuring the pressure distribution, the user's position can be determined.
- Pros: High accuracy, can measure force applied by the user. - Pros: High accuracy, can measure force applied by the user.
@@ -42,36 +51,31 @@ To be added
### Hardware ### Hardware
The hardware of the system will consist of the following components: The hardware of the system will consist of the following components:
- Wii Fit Board: The primary sensor for position tracking. - LDR: The sensor that will be used to track the user's position based on the light intensity.
- Pepper: The controller that will process the data from the Wii Fit Board. - ESP32S3: The microcontroller that will process the data from the LDR.
- Pepper: The controller that will recieve the processed data from the ESP32S3 and will sync the data to the current task for the user.
#### Connection diagram
To be added
### Software ### Software
The software of the system will consist of the following: To be added
- Wiiboard-simple: A library that will be used to transfer data from the Wii Fit Board to pepper.
- Position Tracking Algorithm: An algorithm that will process the sensor data and determine the user's position.
### Integration ### Integration
The Wii Fit Board will be connected to Pepper using the Wiiboard-simple library. The library will be used to read the sensor data from the Wii Fit Board and transfer it to Pepper. The position tracking algorithm will process the sensor data and determine the user's position. To be added
Challenge:
- Connecting to the wii fit board. It is not possible to connect directly to the Wii Fit Board, it is necessary to use a library that can interpret the data sent by the Wii Fit Board.
- The Wii Fit Balance Board sends data in a specific format. To interpret this data, it's necessary to understand the format and how to convert it to a usable format.
- The Wii Fit Balance Board uses Bluetooth 2.0 to communicate. Pepper uses Bluetooth 4.0 this means that there might be compatibility issues/latancy issues.
## Implementation ## Implementation
### Prototyping ### Prototyping
To start the implementation of the system, we will create a prototype that will read the sensor data from the Wii Fit Board and send it to your computer. Once we have the data, we will develop the position tracking algorithm to determine the user's position. After that, the algorithm will be integrated with pepper. To be added
### Testing and Validation ### Testing and Validation
Tests: To be added
- Test the prototype to ensure that it can read the sensor data from the Wii Fit Board.
- Test the position tracking algorithm to ensure that it can determine the user's position accurately.
- Test the integrated system to ensure that it can track the user's position in real-time.
## Conclusion ## Conclusion
@@ -79,9 +83,8 @@ To be added
## References ## References
[Wiiboard lib](https://code.google.com/archive/p/wiiboard-simple/wikis/Documentation.wiki) [Bluetooth Discovery](https://developer.android.com/develop/connectivity/bluetooth/find-bluetooth-devices)
[BlueSoil](https://advanti-lab.sb.dfki.de/?page_id=64)
[FitScales](https://github.com/paulburton/fitscales) ## Appendices
[WiiRemoteJ](https://github.com/micromu/WiiRemoteJ)
[Wiibrew Wiimote](https://wiibrew.org/wiki/Wiimote) To be added
[Wiibrew Balance Board](https://wiibrew.org/wiki/Wii_Balance_Board)

View File

@@ -0,0 +1,28 @@
# Expert 3 Sprint 3
---
## K1: Je hebt object georiënteerde software gemaakt die samenwerkt met een database.
Voor het bewijs van algemene kennis over K1 zie [Expert review 2 K1](../expertReview/expert2sprint2.md#K1:-Je-hebt-object-georiënteerde-software-gemaakt-die-samenwerkt-met-een-database.).
Deze sprint ben ik bezig geweest met:
- Functionaliteit van de database
- Functionaliteit van de server
- Data ophalen uit de database en weergeven in de app
---
## K3: Je hebt een infrastructuur ontworpen en gebouwd volgens zelf-gedefinieerde vereisten.
Feedback verwerkt (diagrammen)
Infrastructuur beschreven met problemen en oplossingen [Infrastuctuur](https://muupooviixee66-propedeuse-hbo-ict-onderwijs-2023-178fb5f296aa35.dev.hihva.nl/documentation/database/infrastructure/)
---
## K4: Je ontwerpt een embedded systeem op basis van gegeven hardware. & K5: Je kan software schrijven voor een intelligente controller voorzien van actuatoren en sensoren.
Research naar hardware en software voor de controller