Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-4/muupooviixee66
This commit is contained in:
34
code/arduino/Movement-sensor-code/Movement-sensor-code.ino
Normal file
34
code/arduino/Movement-sensor-code/Movement-sensor-code.ino
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "SensorManager.h"
|
||||
|
||||
SensorManager sensorManager;
|
||||
|
||||
void setup() {
|
||||
Wire.setClockStretchLimit(150000L); // Default stretch limit 150mS
|
||||
Serial.begin(9600);
|
||||
Serial.println("startup");
|
||||
delay(10000);
|
||||
sensorManager.sensorSetup();
|
||||
|
||||
}
|
||||
|
||||
void loop() {
|
||||
SensorManager::Rotation rotation = sensorManager.readLoop();
|
||||
|
||||
// Convert quaternion to Euler angles in radians
|
||||
float roll = atan2(2.0f * (rotation.w * rotation.i + rotation.j * rotation.k), 1.0f - 2.0f * (rotation.i * rotation.i + rotation.j * rotation.j));
|
||||
float pitch = asin(2.0f * (rotation.w * rotation.j - rotation.k * rotation.i));
|
||||
float yaw = atan2(2.0f * (rotation.w * rotation.k + rotation.i * rotation.j), 1.0f - 2.0f * (rotation.j * rotation.j + rotation.k * rotation.k));
|
||||
|
||||
// Convert to degrees
|
||||
float rollDegrees = roll * 180.0f / PI;
|
||||
float pitchDegrees = pitch * 180.0f / PI;
|
||||
float yawDegrees = yaw * 180.0f / PI;
|
||||
|
||||
Serial.print(roll);
|
||||
Serial.print(" ");
|
||||
Serial.print(pitch);
|
||||
Serial.print(" ");
|
||||
Serial.print(yaw);
|
||||
|
||||
Serial.println();
|
||||
}
|
52
code/arduino/Movement-sensor-code/SensorManager.cpp
Normal file
52
code/arduino/Movement-sensor-code/SensorManager.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
#include "SensorManager.h"
|
||||
#include <Wire.h>
|
||||
|
||||
SensorManager::SensorManager() {}
|
||||
|
||||
void SensorManager::sensorSetup() {
|
||||
Serial.println();
|
||||
Serial.println("BNO080 Read Example");
|
||||
|
||||
delay(1000); // Wait for BNO to boot
|
||||
|
||||
Wire.begin();
|
||||
|
||||
if (myIMU.begin() == false) {
|
||||
delay(1000);
|
||||
Serial.println(".");
|
||||
}
|
||||
|
||||
Wire.setClock(400000); //Increase I2C data rate to 400kHz
|
||||
myIMU.calibrateAll(); //Turn on cal for Accel, Gyro, and Mag
|
||||
myIMU.enableGyroIntegratedRotationVector(100);
|
||||
myIMU.enableMagnetometer(100); //Send data update every 100ms
|
||||
myIMU.saveCalibration(); //Saves the current dynamic calibration data (DCD) to memory
|
||||
myIMU.requestCalibrationStatus(); //Sends command to get the latest calibration status
|
||||
|
||||
if (myIMU.calibrationComplete() == true) {
|
||||
Serial.println("Calibration data successfully stored");
|
||||
}
|
||||
|
||||
Serial.println(F("magnetometer rotation enabled"));
|
||||
}
|
||||
|
||||
SensorManager::Rotation SensorManager::readLoop() {
|
||||
if (myIMU.dataAvailable() == true) {
|
||||
float i = myIMU.getQuatI();
|
||||
float j = myIMU.getQuatJ();
|
||||
float k = myIMU.getQuatK();
|
||||
float w = myIMU.getQuatReal();
|
||||
|
||||
Rotation rotation = { i, j, k, w };
|
||||
return rotation;
|
||||
}
|
||||
else {
|
||||
float i = myIMU.getQuatI();
|
||||
float j = myIMU.getQuatJ();
|
||||
float k = myIMU.getQuatK();
|
||||
float w = myIMU.getQuatReal();
|
||||
|
||||
Rotation rotation = { i, j, k, w };
|
||||
return rotation;
|
||||
}
|
||||
}
|
22
code/arduino/Movement-sensor-code/SensorManager.h
Normal file
22
code/arduino/Movement-sensor-code/SensorManager.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef SensorManager_h
|
||||
#define SensorManager_h
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "SparkFun_BNO080_Arduino_Library.h"
|
||||
|
||||
class SensorManager {
|
||||
public:
|
||||
SensorManager();
|
||||
void sensorSetup();
|
||||
struct Rotation {
|
||||
float i;
|
||||
float j;
|
||||
float k;
|
||||
float w;
|
||||
};
|
||||
Rotation readLoop();
|
||||
private:
|
||||
BNO080 myIMU;
|
||||
};
|
||||
|
||||
#endif
|
1
code/arduino/Movement-sensor-code/headerFIle.h
Normal file
1
code/arduino/Movement-sensor-code/headerFIle.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "SensorManager.h"
|
0
code/web/database_queries.js
Normal file
0
code/web/database_queries.js
Normal file
0
code/web/incoming_request_handlers.js
Normal file
0
code/web/incoming_request_handlers.js
Normal file
25
code/web/server.js
Normal file
25
code/web/server.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const mariadb = require('mariadb');
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
|
||||
const serverPort = 3000;
|
||||
|
||||
const databaseCredentials = {
|
||||
host: 'localhost',
|
||||
user: 'fitbot',
|
||||
password: 'fitbot123',
|
||||
database: 'fitbot',
|
||||
connectionLimit: 5,
|
||||
allowUnauthorized: true
|
||||
}
|
||||
|
||||
// Create connection pool
|
||||
const pool = mariadb.createPool(databaseCredentials);
|
||||
|
||||
// Register incoming HTTP request handlers
|
||||
require('incoming_request_handlers')(app, pool);
|
||||
|
||||
// Start server
|
||||
app.listen(port, () => {
|
||||
console.log(`Server running on port ${serverPort}`);
|
||||
})
|
BIN
docs/documentation/assets/pcbImage.png
Normal file
BIN
docs/documentation/assets/pcbImage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 944 KiB |
BIN
docs/documentation/brainstorm/bluepalette.png
Normal file
BIN
docs/documentation/brainstorm/bluepalette.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@@ -15,11 +15,31 @@ Colors can be an effective way to influence emotions and feelings. They may infl
|
||||
|
||||
Red is an interesting color because it increases excitement, activity, aggression, bravery, and youthfulness. People associate the color red with boldness, fire, competition, love, energy, speed, power, youth, and so much more. These emotions are useful when developing a fitness app, but even a different shade of red affects emotions and effectiveness. Lighter shades highlight the energetic qualities of red. Darker shades emphasize power. This makes red a powerful color and for us and an interesting option because Strava, a fitness app focused on running, uses the same colors.
|
||||
|
||||

|
||||
|
||||
<span style="color:yellow">
|
||||
<strong> YELLOW: </strong>
|
||||
</span>
|
||||
|
||||
Yellow belongs in the same park as red because they are both warm colors. Yellow boosts emotions such as warmth, cheerfulness, happiness, energy, clarity, and attention, making it a good choice for us to look at. People associate the color or yellow with. Sunshine, creativity, imagination, hope, joy, the future, and spirituality. The various shades affect yellow in different ways, and bright sharp yellows can be tiring and cause headaches. Lighter shades appeal to the happiness aspect, reminding users of summer and the sun. Darker shades, such as gold, add weight. This makes yellow an interesting color option for our app.
|
||||
|
||||

|
||||
|
||||
<span style="color:green">
|
||||
<strong> GREEN: </strong>
|
||||
</span>
|
||||
|
||||
Green is on the opposite side of the spectrum from red and yellow. Green is a colder color, which gives it a different effect. Green enhances emotions such as restful, natural, stable, healthy, and prosperity. This can make it a viable option, especially because it gives people a sense of good health. People associate color green with. Freshness, ecology, nature, health, balance, fertility, growth, renewal, healing, money, and good luck. This is interesting because it not only provides people with the feeling of being healthy, but also of being outside in nature, which may help elderly people feel less isolated. However, the shades of green also make people feel different. Pale greens are soothing. Dark greens can improve concentration. However, because we do not rely on concetration, it will have little impact on our project.
|
||||
|
||||
|
||||

|
||||
<span style="color:BLUE">
|
||||
<strong> BLUE: </strong>
|
||||
</span>
|
||||
|
||||
Blue is also a colder color, so it takes the same path as green, giving it a more calming effect. However, it is not comparable to green because they influnce other emotions. Blue enhances emotions like calm, security, peace, patience, loyalty, trust, and sadness. It has the same soothing effect as green, but it does not give people the feeling of being healthy. It gives people trust and peace, which are interesting emotions, but they are not beneficial to us. People associate the color blue with stability, protection, trust, loyalty, patience, perseverance, security, peace, loyalty, sadness and depression, and masculinity. This further confirms that blue gives people a sense of security, which is not important for us because we want people to start exercising. Pale blue is cooling and relaxing, but it should not be used inappropriately because it can make people feel sad and depressed. Indigo is useful in situations where fear prevents activity. Indigo may be useful for a cool-down exercise or if someone is afraid of exercising.
|
||||
|
||||

|
||||
### Conclusion
|
||||
We decided to go for
|
||||
|
||||
@@ -27,4 +47,6 @@ We decided to go for
|
||||
|
||||
# Source
|
||||
|
||||
https://eldertech.org/color-in-designing-technology-for-seniors/
|
||||
https://eldertech.org/color-in-designing-technology-for-seniors/
|
||||
|
||||
https://decode.agency/article/choose-color-palette-for-apps/
|
BIN
docs/documentation/brainstorm/greenpalette.png
Normal file
BIN
docs/documentation/brainstorm/greenpalette.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
docs/documentation/brainstorm/redpalette.png
Normal file
BIN
docs/documentation/brainstorm/redpalette.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
docs/documentation/brainstorm/yellowpalette.png
Normal file
BIN
docs/documentation/brainstorm/yellowpalette.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
24
docs/documentation/hardware/pcb.md
Normal file
24
docs/documentation/hardware/pcb.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# PCB
|
||||
|
||||
## Headerpins
|
||||
```
|
||||
#define PIN_IMU_SDA D2
|
||||
#define PIN_IMU_SCL D1
|
||||
#define PIN_IMU_INT D5
|
||||
#define PIN_IMU_INT_2 D6
|
||||
```
|
||||
## What does the pcb do
|
||||
The pcb on itself is a espd1mini with no sensors or battery. You need to manual solder a battery and sensor of your choice to the pcb.
|
||||
|
||||
## Original usage
|
||||
These pcb's where originally designed for virtual reality fullbody tracking. They are basicly movement trackers that can be used to track the movement of the body. We can also use this really well for our project.
|
||||
|
||||
## Why did we choose this pcb
|
||||
We chose this pcb because its really small and it has a socket for a sensor and it also has a build in bms for the battery.
|
||||
|
||||
## Usage in our project
|
||||
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.
|
||||

|
||||
|
||||
### Sources
|
||||
* https://github.com/Sorakage033/SlimeVR-CheeseCake
|
@@ -1,7 +1,7 @@
|
||||
# Hoofd en deelvragen met bronnen
|
||||
|
||||
## Hoofdvraag
|
||||
Wat zijn de gevolgen op ouderen door menselijke communicatie vervangen met robots in de ouderenzorg?
|
||||
Wat zijn de gevolgen op ouderen van menselijke communicatie voor een deel te vervangen met robots in de ouderenzorg?
|
||||
|
||||
## Deelvragen
|
||||
1. Wat zijn de voor en nadelen van robots in de ouderenzorg?
|
||||
|
Reference in New Issue
Block a user