Merge remote-tracking branch 'origin/main'
# Conflicts: # code/src/Fitbot/app/src/main/java/com/example/fitbot/MainActivity.java # code/src/Fitbot/app/src/main/java/com/example/fitbot/ui/activities/MainActivity.java # code/src/Fitbot/app/src/main/java/com/example/fitbot/util/processing/MotionProcessor.java
This commit is contained in:
23
code/arduino/Movement-sensor-code/Connectivity.cpp
Normal file
23
code/arduino/Movement-sensor-code/Connectivity.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "Connectivity.h"
|
||||
|
||||
void Connectivity::connectWiFi(char* ssid, char* pass){
|
||||
WiFi.mode(WIFI_STA);
|
||||
WiFi.begin(ssid, pass);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
Serial.println("connecting to wifi");
|
||||
delay(1000);
|
||||
}
|
||||
Serial.println(WiFi.localIP());
|
||||
}
|
||||
|
||||
void Connectivity::websocketSetup(){
|
||||
//ws server address, port and URL
|
||||
webSocket.begin("192.168.137.1", 8001, "");
|
||||
// try every 500 again if connection has failed
|
||||
webSocket.setReconnectInterval(500);
|
||||
}
|
||||
|
||||
void Connectivity::sendData(float roll, float pitch, float yaw){
|
||||
String message = "{\"Sensor\": 1, \"roll\":\"" + String(roll) + "\",\"pitch\":\"" + String(pitch) + "\",\"yaw\":\"" + String(yaw) + "\"}";
|
||||
webSocket.sendTXT(message);
|
||||
}
|
30
code/arduino/Movement-sensor-code/Connectivity.h
Normal file
30
code/arduino/Movement-sensor-code/Connectivity.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef Connectivity_h
|
||||
#define Connectivity_h
|
||||
|
||||
#include "Arduino.h"
|
||||
#include <WebSocketsClient.h>
|
||||
#include <ArduinoWiFiServer.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266WiFiGeneric.h>
|
||||
#include <ESP8266WiFiGratuitous.h>
|
||||
#include <ESP8266WiFiMulti.h>
|
||||
#include <ESP8266WiFiSTA.h>
|
||||
#include <ESP8266WiFiScan.h>
|
||||
#include <ESP8266WiFiType.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <WiFiServer.h>
|
||||
#include <WiFiServerSecure.h>
|
||||
#include <WiFiUdp.h>
|
||||
|
||||
class Connectivity {
|
||||
public:
|
||||
void connectWiFi(char* ssid, char* pass);
|
||||
void websocketSetup();
|
||||
void sendData(float roll, float pitch, float yaw);
|
||||
|
||||
private:
|
||||
ESP8266WiFiMulti wifi;
|
||||
WebSocketsClient webSocket;
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,22 +1,26 @@
|
||||
#include "headerFile.h"
|
||||
|
||||
SensorManager sensorManager;
|
||||
ESP8266WiFiMulti wifi;
|
||||
WebSocketsClient webSocket;
|
||||
#define USE_SERIAL Serial
|
||||
SensorManager::Rotation offset;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Serial.println("startup");
|
||||
delay(5000);
|
||||
connectWiFi();
|
||||
|
||||
connectivity.connectWiFi(ssid, pass);
|
||||
sensorManager.sensorSetup();
|
||||
websocketSetup();
|
||||
connectivity.websocketSetup();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
SensorManager::Rotation rotation = sensorManager.readLoop();
|
||||
|
||||
// Subtract offset
|
||||
rotation.i -= offset.i;
|
||||
rotation.j -= offset.j;
|
||||
rotation.k -= offset.k;
|
||||
rotation.w -= offset.w;
|
||||
|
||||
// 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));
|
||||
@@ -32,34 +36,19 @@ void loop() {
|
||||
Serial.print(pitch);
|
||||
Serial.print(" ");
|
||||
Serial.print(yaw);
|
||||
sendData(roll, pitch, yaw);
|
||||
connectivity.sendData(roll, pitch, yaw);
|
||||
|
||||
Serial.println();
|
||||
webSocket.loop();
|
||||
}
|
||||
|
||||
|
||||
void connectWiFi(){
|
||||
|
||||
WiFi.mode(WIFI_STA);
|
||||
wifi.addAP(ssid, pass);
|
||||
WiFi.begin();
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
Serial.println("connecting to wifi");
|
||||
delay(1000);
|
||||
if (Serial.available()) {
|
||||
String command = Serial.readStringUntil('\n');
|
||||
command.trim(); // remove any trailing whitespace
|
||||
if (command == "setZeroPoint") {
|
||||
setZeroPoint();
|
||||
}
|
||||
}
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
}
|
||||
|
||||
void websocketSetup(){
|
||||
//ws server address, port and URL
|
||||
webSocket.begin("192.168.178.118", 8001, "");
|
||||
// try every 500 again if connection has failed
|
||||
webSocket.setReconnectInterval(500);
|
||||
void setZeroPoint() {
|
||||
offset = sensorManager.readLoop();
|
||||
}
|
||||
|
||||
void sendData(float roll, float pitch, float yaw){
|
||||
String message = "{\"Sensor\": 1, \"roll\":\"" + String(roll) + "\",\"pitch\":\"" + String(pitch) + "\",\"yaw\":\"" + String(yaw) + "\"}";
|
||||
webSocket.sendTXT(message);
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
#include "SensorManager.h"
|
||||
#include <Wire.h>
|
||||
|
||||
|
||||
SensorManager::SensorManager() {}
|
||||
|
||||
void SensorManager::sensorSetup() {
|
||||
|
@@ -1,20 +1,13 @@
|
||||
#include <WebSocketsClient.h>
|
||||
//classes
|
||||
#include "SensorManager.h"
|
||||
#include "Connectivity.h"
|
||||
|
||||
#include <ArduinoWiFiServer.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <ESP8266WiFiGeneric.h>
|
||||
#include <ESP8266WiFiGratuitous.h>
|
||||
#include <ESP8266WiFiMulti.h>
|
||||
#include <ESP8266WiFiSTA.h>
|
||||
#include <ESP8266WiFiScan.h>
|
||||
#include <ESP8266WiFiType.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <WiFiServer.h>
|
||||
#include <WiFiServerSecure.h>
|
||||
#include <WiFiUdp.h>
|
||||
//define
|
||||
SensorManager sensorManager;
|
||||
Connectivity connectivity;
|
||||
WebSocketsClient webSocket;
|
||||
#define USE_SERIAL Serial
|
||||
|
||||
#define ssid "ObsidianAmstelveen"
|
||||
#define pass "drijversstraatmaastricht"
|
||||
|
||||
//custom classes
|
||||
#include "SensorManager.h"
|
||||
#define ssid "1235678i"
|
||||
#define pass "12345678"
|
||||
|
@@ -11,24 +11,12 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Fitbot" >
|
||||
<activity
|
||||
android:name=".Completion_Screen"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.SportMenuActivity"
|
||||
android:exported="true">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".BicepVideo"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".PowerScreen"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true" />
|
||||
<activity
|
||||
android:name=".MainScreen"
|
||||
android:name=".ui.activities.MainActivity"
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.builder.AnimateBuilder;
|
||||
import com.aldebaran.qi.sdk.builder.AnimationBuilder;
|
||||
|
@@ -1,59 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.widget.Button;
|
||||
import android.widget.MediaController;
|
||||
import android.widget.VideoView;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.builder.AnimateBuilder;
|
||||
import com.aldebaran.qi.sdk.builder.AnimationBuilder;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animate;
|
||||
import com.aldebaran.qi.sdk.object.actuation.Animation;
|
||||
|
||||
public class BicepVideo extends AppCompatActivity {
|
||||
|
||||
// private QiContext qiContext;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_bicepvideo);
|
||||
setupButtons();
|
||||
}
|
||||
|
||||
public void Video(QiContext qiContext) {
|
||||
VideoView videoView = findViewById(R.id.videoView);
|
||||
videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.bicepvideo));
|
||||
|
||||
MediaController mediaController = new MediaController(this);
|
||||
videoView.setMediaController(mediaController);
|
||||
videoView.setOnCompletionListener(mp -> videoView.start());
|
||||
videoView.start();
|
||||
|
||||
Animation animation = AnimationBuilder.with(qiContext)
|
||||
.withResources(R.raw.bicepcurl)
|
||||
.build();
|
||||
|
||||
Animate animate = AnimateBuilder.with(qiContext)
|
||||
.withAnimation(animation)
|
||||
.build();
|
||||
|
||||
|
||||
animate.async().run();
|
||||
|
||||
}
|
||||
private void setupButtons() {
|
||||
Button backButton = findViewById(R.id.buttonback);
|
||||
backButton.setOnClickListener(v -> finish());
|
||||
|
||||
Button completeButton = findViewById(R.id.buttoncomplete);
|
||||
completeButton.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(BicepVideo.this, Completion_Screen.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
public class Completion_Screen extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_completion_screen);
|
||||
}
|
||||
}
|
@@ -1,87 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.QiSDK;
|
||||
import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
||||
import com.aldebaran.qi.sdk.builder.SayBuilder;
|
||||
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
||||
import com.aldebaran.qi.sdk.object.conversation.Phrase;
|
||||
import com.aldebaran.qi.sdk.object.conversation.Say;
|
||||
import com.aldebaran.qi.sdk.object.locale.Language;
|
||||
import com.aldebaran.qi.sdk.object.locale.Locale;
|
||||
import com.aldebaran.qi.sdk.object.locale.Region;
|
||||
import com.example.fitbot.ui.SportMenuActivity;
|
||||
|
||||
public class MainActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// Register the RobotLifecycleCallbacks to this Activity.
|
||||
Button button = findViewById(R.id.menu_switch_btn);
|
||||
button.setOnClickListener(v -> {
|
||||
startActivity(new Intent(MainActivity.this, SportMenuActivity.class));
|
||||
});
|
||||
QiSDK.register(this, this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// Unregister the RobotLifecycleCallbacks for this Activity.
|
||||
QiSDK.unregister(this, this);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
Locale locale = new Locale(Language.DUTCH, Region.NETHERLANDS);
|
||||
|
||||
// Create a new say action.
|
||||
Say say = SayBuilder.with(qiContext) // Create the builder with the context.
|
||||
.withText("Hallo hoe gaat het?") // Set the text to say.
|
||||
.build(); // Build the say action.
|
||||
|
||||
String locationName = ("de hogeschool van amsterdam");
|
||||
String locationDescription = ("0 bitches");
|
||||
|
||||
Phrase namePhrase = new Phrase("Deze locatie is " + locationName);
|
||||
Say sayName = SayBuilder.with(qiContext)
|
||||
.withPhrase(namePhrase)
|
||||
.withLocale(locale)
|
||||
.build();
|
||||
|
||||
Phrase descriptionPhrase = new Phrase(locationDescription);
|
||||
Say sayDescription = SayBuilder.with(qiContext)
|
||||
.withPhrase(descriptionPhrase)
|
||||
.withLocale(locale)
|
||||
.build();
|
||||
|
||||
sayName.run();
|
||||
sayDescription.run();
|
||||
|
||||
// Create a new BicepVideo with the qiContext
|
||||
// BicepVideo BicepVideo = new BicepVideo();
|
||||
//
|
||||
// // Call the videoPlayer method
|
||||
// BicepVideo.Video(qiContext);
|
||||
|
||||
// Execute the action.
|
||||
say.run();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onRobotFocusLost() {
|
||||
// Nothing here.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusRefused(String reason) {
|
||||
// The robot focus is refused.
|
||||
}
|
||||
}
|
@@ -1,43 +0,0 @@
|
||||
package com.example.fitbot;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
public class PowerScreen extends AppCompatActivity {
|
||||
ImageButton openBicepVideo;
|
||||
ImageButton openSquatVideo;
|
||||
ImageButton openTricepVideo;
|
||||
ImageButton goToHome;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_power_screen);
|
||||
|
||||
openBicepVideo = findViewById(R.id.open_BicepVideo);
|
||||
openSquatVideo = findViewById(R.id.open_SquatVideo);
|
||||
openTricepVideo = findViewById(R.id.open_TricepVideo);
|
||||
goToHome = findViewById(R.id.GoToHome);
|
||||
|
||||
openBicepVideo.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(PowerScreen.this, BicepVideo.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
// openSquatVideo.setOnClickListener(v -> {
|
||||
// Intent intent = new Intent(PowerScreen.this, SquatVideo.class);
|
||||
// startActivity(intent);
|
||||
// });
|
||||
//
|
||||
// openTricepVideo.setOnClickListener(v -> {
|
||||
// Intent intent = new Intent(PowerScreen.this, TricepVideo.class);
|
||||
// startActivity(intent);
|
||||
// });
|
||||
|
||||
goToHome.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(PowerScreen.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
public class CompletionActivity {
|
||||
}
|
@@ -11,7 +11,10 @@ import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.example.fitbot.ui.SportMenuActivity;
|
||||
import com.example.fitbot.R;
|
||||
import com.example.fitbot.util.processing.GesturePath;
|
||||
import com.example.fitbot.util.processing.MotionProcessor;
|
||||
import com.example.fitbot.util.processing.Vector3;
|
||||
|
||||
public class MainScreen extends AppCompatActivity {
|
||||
|
@@ -0,0 +1,24 @@
|
||||
package com.example.fitbot.ui.activities;
|
||||
|
||||
import com.aldebaran.qi.sdk.QiContext;
|
||||
import com.aldebaran.qi.sdk.RobotLifecycleCallbacks;
|
||||
import com.aldebaran.qi.sdk.design.activity.RobotActivity;
|
||||
|
||||
public class SportPreviewActivity extends RobotActivity implements RobotLifecycleCallbacks {
|
||||
|
||||
|
||||
@Override
|
||||
public void onRobotFocusGained(QiContext qiContext) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusLost() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRobotFocusRefused(String reason) {
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
package com.example.fitbot.ui.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Path;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.fitbot.util.processing.GesturePath;
|
||||
import com.example.fitbot.util.processing.MotionData;
|
||||
import com.example.fitbot.util.processing.MotionProcessor;
|
||||
import com.example.fitbot.util.processing.Vector3;
|
||||
|
||||
public class PersonalMotionPreviewElement extends View {
|
||||
|
||||
private GesturePath path;
|
||||
private double pathTime = 0.0D; // The timestamp at which the path is currently at.
|
||||
private MotionProcessor motionProcessor;
|
||||
private Path targetPath, personalPath;
|
||||
|
||||
/**
|
||||
* Method that calculates the path that will be drawn on the
|
||||
* canvas. This method will be called every time new motion data is received.
|
||||
*/
|
||||
private void calculateDrawingPath(Vector3 transformedVector, MotionData motionData, int sampleIndex, double sampleRate) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public PersonalMotionPreviewElement(Context context, GesturePath path) {
|
||||
super(context);
|
||||
this.path = path;
|
||||
this.motionProcessor = new MotionProcessor();
|
||||
this.motionProcessor.startListening();
|
||||
this.motionProcessor.setMotionDataEventHandler(this::calculateDrawingPath);
|
||||
this.targetPath = new Path();
|
||||
this.personalPath = new Path();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas canvas) {
|
||||
// Draw the sport preview canvas
|
||||
}
|
||||
}
|
@@ -9,7 +9,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class MotionProcessor {
|
||||
@@ -20,7 +19,7 @@ public class MotionProcessor {
|
||||
private final List<Vector3> relativePath = new ArrayList<>(); // Relative path of the motion data
|
||||
private Vector3 ZERO = new Vector3(0, 0, 0);
|
||||
private double sampleRate = 1.0D; // samples/second
|
||||
private Consumer<Vector3> motionDataConsumer = (data) -> {};
|
||||
private DataConsumer motionDataConsumer = (p1, p2, p3, p4) -> {};
|
||||
private GesturePath path;
|
||||
private WebSocket socket;
|
||||
|
||||
@@ -108,7 +107,7 @@ public class MotionProcessor {
|
||||
Vector3 previous = this.relativePath.isEmpty() ? ZERO : this.relativePath.get(this.relativePath.size() - 1);
|
||||
Vector3 relativeVector = getRelativeVector(data).add(previous);
|
||||
this.relativePath.add(relativeVector);
|
||||
motionDataConsumer.accept(relativeVector);
|
||||
motionDataConsumer.accept(relativeVector, data, this.relativePath.size(), this.sampleRate);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +124,7 @@ public class MotionProcessor {
|
||||
* Function for setting the motion data receiver.
|
||||
* @param consumer The consumer to set.
|
||||
*/
|
||||
public void setMotionDataEventHandler(Consumer<Vector3> consumer) {
|
||||
public void setMotionDataEventHandler(DataConsumer consumer) {
|
||||
if ( consumer != null)
|
||||
this.motionDataConsumer = consumer;
|
||||
}
|
||||
@@ -242,5 +241,18 @@ public class MotionProcessor {
|
||||
Log.i("MotionProcessor", "Sample rate: " + sampleRate);
|
||||
Log.i("MotionProcessor", "Calibration point: " + ZERO.toString());
|
||||
|
||||
/**
|
||||
* Interface that accepts motion data and the transformed vector.
|
||||
*/
|
||||
public interface DataConsumer {
|
||||
|
||||
/**
|
||||
* Function for accepting motion data and the transformed vector.
|
||||
* @param transformedVector The transformed vector.
|
||||
* @param motionData The input motion data.
|
||||
* @param sampleIndex The index of the current sample
|
||||
* @param sampleRate The sample rate.
|
||||
*/
|
||||
void accept(Vector3 transformedVector, MotionData motionData, int sampleIndex, double sampleRate);
|
||||
}
|
||||
}
|
||||
|
@@ -5,8 +5,8 @@
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
android:fillColor="#FF0000"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
|
@@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".BicepVideo">
|
||||
|
||||
<VideoView
|
||||
android:id="@+id/videoView"
|
||||
android:layout_width="1142dp"
|
||||
android:layout_height="515dp"
|
||||
android:layout_marginTop="64dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonback"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="back"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttoncomplete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:text="complete"
|
||||
app:layout_constraintBottom_toTopOf="@+id/videoView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.093" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="1074dp"
|
||||
android:layout_height="197dp"
|
||||
android:layout_marginStart="122dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginEnd="122dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Uitleg text"
|
||||
android:textSize="32sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/videoView" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Completion_Screen">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -6,7 +6,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="#232323"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".MainActivity"
|
||||
tools:context=".ui.activities.MainActivity"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<LinearLayout
|
||||
@@ -39,7 +39,7 @@
|
||||
android:textSize="32sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:id="@+id/startButton"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_marginStart="490dp"
|
||||
@@ -51,7 +51,7 @@
|
||||
android:background="@drawable/red_button_gradient"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/button3"
|
||||
android:id="@+id/helpButton"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="560dp"
|
||||
|
@@ -1,84 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".PowerScreen">
|
||||
|
||||
<!-- <Button-->
|
||||
<!-- android:id="@+id/open_BicepVideo"-->
|
||||
<!-- android:layout_width="215dp"-->
|
||||
<!-- android:layout_height="64dp"-->
|
||||
<!-- android:layout_marginStart="108dp"-->
|
||||
<!-- android:layout_marginTop="341dp"-->
|
||||
<!-- android:layout_marginEnd="108dp"-->
|
||||
<!-- android:layout_marginBottom="342dp"-->
|
||||
<!-- android:text="Bicep Oefening"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintVertical_bias="1.0" />-->
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_BicepVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="120dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="190dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/open_SquatVideo"
|
||||
app:layout_constraintEnd_toStartOf="@+id/open_TricepVideo"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/noun_bicep_499185"
|
||||
android:contentDescription="Open bicep exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_SquatVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="120dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="190dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/GoToHome"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/open_BicepVideo"
|
||||
app:srcCompat="@drawable/squatlogo"
|
||||
android:contentDescription="Open squad exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/open_TricepVideo"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="190dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="120dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/GoToHome"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/open_BicepVideo"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/triceplogo"
|
||||
android:contentDescription="Open tricep exercise video" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/GoToHome"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="300dp"
|
||||
android:layout_marginStart="190dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="120dp"
|
||||
android:layout_marginBottom="60dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/open_SquatVideo"
|
||||
app:layout_constraintTop_toBottomOf="@+id/open_TricepVideo"
|
||||
app:srcCompat="@drawable/house_3"
|
||||
android:contentDescription="Go to Home Screen" />
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:context=".ui.SportMenuActivity">
|
||||
|
||||
<com.example.fitbot.ui.SportMenuItem
|
||||
android:id="@+id/sportMenuItem1"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
Binary file not shown.
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
@@ -27,14 +27,18 @@ Welke ethische dilemma's kunnen er vormen bij het gebruik van robotica in de oud
|
||||
**I. VRAAGSTELLING 2 - De deelvragen van mijn onderzoek zijn:**
|
||||
|
||||
|
||||
# Hoofdvraag
|
||||
|
||||
Welke ethische dilemma's kunnen er vormen bij het gebruik van robotica in de ouderenzorg.
|
||||
|
||||
# Deelvragen
|
||||
|
||||
|
||||
Wat is de impact van robots op de emotionele en sociale welzijn van ouderen?
|
||||
Wat zijn de mogelijke effecten van robots op het emotionele en sociale welzijn van ouderen?
|
||||
|
||||
Kan het gebruik van robots in de ouderezorg ervoor zorgen dat de zorg minder menselijk wordt?
|
||||
Kan het gebruik van robots in de ouderenzorg leiden tot een gevoel van dehumanisering of verminderde menselijke interactie voor ouderen?
|
||||
|
||||
Hoe worden de veiligheid en persoonlijke gegevens van ouderen Beschermd bij het gebruik van robots?
|
||||
Welke risico's zijn er op het gebied van veiligheid en privacy voor ouderen bij het gebruik van robots in de zorg?
|
||||
|
||||
# Bronnen
|
||||
Design issues for assistive robotics for the elderly
|
||||
@@ -59,4 +63,29 @@ Socially facilitative robots for older adults to alleviate social isolation: A p
|
||||
https://www.frontiersin.org/journals/psychology/articles/10.3389/fpsyg.2022.904019/full
|
||||
|
||||
Ethical Design and Use of Robotic Care of the Elderly
|
||||
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8936033/
|
||||
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8936033/
|
||||
|
||||
# inleiding
|
||||
|
||||
De vergrijzing van de samenleving zet druk op de ouderenzorg. Er is een tekort aan zorgverleners, terwijl de vraag naar zorg toeneemt. Robotica wordt gezien als een mogelijke oplossing om dit probleem optelossen. Robots kunnen taken overnemen van verpleegsters, zoals medicatie toedienen, lichaamsverzorging en gezelschap bieden. Maar de inzet van robots in de ouderenzorg roept ook ethische dilemma's op. Ik ga onderzoeken welke etische dillemas er kunnen ontstaan in de zorg. Om dit doel te bereiken, zullen we de volgende deelvragen beantwoorden:
|
||||
|
||||
- Wat zijn de mogelijke effecten van het gebruik van robots op het emotionele en sociale welzijn van ouderen?
|
||||
|
||||
- Leidt robotisering in de ouderenzorg tot onpersoonlijke en mechanische zorg?
|
||||
|
||||
- Welke risico's zijn er over de veiligheid en privacy voor ouderen bij het gebruik van robots in de zorg?
|
||||
|
||||
Deze vragen behandelen allerei verschillende aspecten van robotica in de ouderzorg. na het beantwoorden van de deelvragen kunnen wij een concusie trekken en kijken naar welke dillemas er kunnen ontstaan.
|
||||
|
||||
## Wat zijn de mogelijke effecten van het gebruik van robots op het emotionele en sociale welzijn van ouderen?
|
||||
|
||||
Het sociale welzijn van ouderen is een belangrijk onderwerp. Ouderen kunnen zich vaak enzaam of afgesloten voelen van de samenleving. Dit is een groot probleem binnen in de ouderzorg omdat je niet wilt dat ouderen zich nog eenzamer gaan voelen nadat zij worden verzorgd door een robot. Daarom wil ik weten wat de effecten zijn van het gebruik van robotica in de ouderzorg, Zodat ik daaruit kan bepalen wat voor een dillema het met zich mee zou brengen.
|
||||
|
||||
Er zijn al veel onderzoeken geweest naar dit onderwerp. Onderzoek wijst uit dat robots zowel positieve als negatieve effecten kunnen hebben. Een postief effect ervan is dat ouderen zich minder eenzaam voelen. 17 onderzoeken met 4 verschillende type robots wijsen erop dat Uit de meeste onderzoeken bleek dat gezelschapsrobots een positieve invloed hadden op (socio)psychologische (bijv. humeur, eenzaamheid, sociale connecties en communicatie) en fysiologische (bijv. stressverlaging) variabelen. De methodologische kwaliteit van de studies was over het algemeen laag.[1] Dit laat zien dat het helpt om eenzaamheid bij ouderen tegentegaan. Ze kunnen ook worden gebruikt om ouderen te helpen in contact te blijven met vrienden en familie. Dit is handig iets omdat ouderen dan dichter bij hun familie zijn wat voor de meeste ouderen heel belangrijk is om eenzaamheid tegen te gaan. Bovendien kunnen robots worden gebruikt om ouderen te motiveren om actief en betrokken te blijven bij hun leven. Fitness is niet alleen iets om fit te blijven maar brengt ook socialen aspecten met zich mee. Ik ben nu persoonlijk bezig met een project waarmee wij ouderen willen stimuleren meer te bewegen zodat zij ook wat vaker naar buiten kunnen en potentieel ook samen workouts kunnen doen.
|
||||
|
||||
Over het algemeen zijn de mogelijke effecten van robots op het emotionele en sociale welzijn van ouderen complex. Er zijn zowel mogelijke Voordelen en nadelen, en de impact van robots zal waarschijnlijk van persoon tot persoon verschillen. Het is belangrijk om deze factoren zorgvuldig af te wegen bij het beslissen of robots wel of niet in de ouderzorg te implementeren.
|
||||
|
||||
## Kan het gebruik van robots in de ouderenzorg leiden tot een gevoel van dehumanisering of verminderde menselijke interactie voor ouderen?
|
||||
|
||||
|
||||
(Socially Assistive Robots in Elderly Care: A Systematic Review into Effects and Effectiveness https://www.sciencedirect.com/science/article/abs/pii/S1525861010003476)[1]
|
||||
|
Reference in New Issue
Block a user