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:
Niels
2024-04-25 15:44:42 +02:00
13 changed files with 163 additions and 9 deletions

View File

@@ -7,7 +7,6 @@
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_completion_screen.xml" value="0.10078125" />
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_main.xml" value="0.1" />
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_main_screen.xml" value="0.15" />
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_power_screen.xml" value="0.1" />
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_sport_item.xml" value="0.16336633663366337" />
<entry key="..\:/Users/31687/muupooviixee66-1/code/src/Fitbot/app/src/main/res/layout/activity_sport_menu.xml" value="0.16" />
<entry key="..\:/Users/sebas/Documents/HvA/Reposetories/muupooviixee66/code/src/Fitbot/app/src/main/res/layout/activity_main.xml" value="0.1" />

View File

@@ -0,0 +1,33 @@
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;
import com.aldebaran.qi.sdk.object.actuation.Animate;
import com.aldebaran.qi.sdk.object.actuation.Animation;
public class Animations extends AppCompatActivity {
public static void Animate(String AnimationFile, QiContext ctx)
{
PlayAnimation(AnimationFile, ctx);
}
public static void PlayAnimation(String AnimationFile, QiContext ctx)
{
int resId = ctx.getResources().getIdentifier(AnimationFile, "raw", ctx.getPackageName());
Animation animation = AnimationBuilder.with(ctx)
.withResources(resId)
.build();
Animate animate = AnimateBuilder.with(ctx)
.withAnimation(animation)
.build();
animate.async().run();
}
}

View File

@@ -16,6 +16,9 @@ import com.aldebaran.qi.sdk.object.actuation.Animate;
import com.aldebaran.qi.sdk.object.actuation.Animation;
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;
public class MainActivity extends RobotActivity implements RobotLifecycleCallbacks {
@@ -36,12 +39,17 @@ public class MainActivity extends RobotActivity implements RobotLifecycleCallbac
@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.
Phrase namePhrase = new Phrase("This location is " + locationName);
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)
@@ -57,10 +65,10 @@ public class MainActivity extends RobotActivity implements RobotLifecycleCallbac
sayDescription.run();
// Create a new BicepVideo with the qiContext
bicepvideo BicepVideo = new bicepvideo();
// Call the videoPlayer method
BicepVideo.Video(qiContext);
// BicepVideo BicepVideo = new BicepVideo();
//
// // Call the videoPlayer method
// BicepVideo.Video(qiContext);
// Execute the action.
say.run();

View File

@@ -16,5 +16,7 @@ nav:
- 📚 Documentation:
- 🧠 Brianstorm:
- Ideas: documentation/brianstorm/ideas
- 📱Andriod:
- 📱 Andriod:
- Andriod Studio: documentation/andriod/androidStudio
- 🤖 Pepper:
- Pepper Setup: documentation/pepper/pepper

View File

@@ -0,0 +1,49 @@
# How to make the robot move
## Getting started
First make a animation file in the /res folder.
![alt text](../assets/image.png)
Then right click it and click edit animation
## Making keyframes
Once you click edit animation you can click a bodypart and rotate it.
![alt text](../assets/imageAnimation.png)
Once you have positioned the robot into your preffered position you can click the keyframe button.
![alt text](../assets/keyframebutton.png)
You can grab and shift the keyframes around the timelines until you get something like this.
![alt text](../assets/exampleAnimation.png)
Make sure to save it under the File tab once it is done.
You can test it by clicking the play button in the top right.
## Making the robot move
Once you have made the animation file you can go to the robot movement script.
```java
// create the animation
Animation animation = AnimationBuilder.with(qiContext)
//change bicepcurl to the name of your animation file
.withResources(R.raw.bicepcurl)
.build()
// create the animate object
Animate animate = AnimateBuilder.with(qiContext)
.withAnimation(animation)
.build()
// play the animation
animate.async().run();
```
If you run this on the robot the animation should play.

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@@ -0,0 +1,60 @@
# How to setup android studio for pepper
This is a guide on pepper setup for android studio. This guide will show you how to setup android studio for pepper. To start off we will follow the provided guide on the [softbank website](https://qisdk.softbankrobotics.com/sdk/doc/pepper-sdk/ch1_gettingstarted/installation.html). This guide will only help with certain parts of the setup
It is important to note that multiple combinations of android studio and pepper sdk can work together. This guide will show you how to setup android studio for pepper sdk with the versions that worked for us.
## Installing the Pepper SDK plug-in
### Install Android Studio
To start off you need to install android studio. QiSDK recommends installing the latest stable version (version 3.4 or higher). In this guide we recommend using version 2021.1.1 You can download android studio [here](https://developer.android.com/studio/archive). It is recommended to always start up android studio as an administrator. This can be done by right clicking on the android studio icon and selecting `Run as administrator`.
### Get Android SDK and Build-Tools
Follow the first step on the QiSDK guide. Here are a few pointers to help you with this step:
- Android 6.0 (API level 23) is the minimum version required for the Pepper SDK. But it is not the version that will be used.
- The recommended version is Android 10.0 (API level 29). This is not shown as API 29 but as Android 10.0. This is the version that worked for us.
![Android 10](../assets/android10.png)
After this you can follow the rest of the guide on the QiSDK website.
### Robot SDK Manager
The option to simulate pepper and the tablet won't work. We have yet to find a solution for this. You can still create a device and run the app on the device. But you won't be able to simulate the robot.
## Creating a robot application
### Creating a project
To create a project you need to follow the steps on the QiSDK website. Here are a few pointers to help you with this step:
- Make sure to select a template that works for you. We recommend using the `Empty Activity` template. This will give you a blank project to start with.
- On step 5 of the guide make sure that the interface looks the following image, if it does not look the same gradle doens't recognize the project as an android project:
![Project structure interface](../assets/interfaceModules.png)
### Implementing QiSDK Design & the Robot Life Cycle
On this step the QiSDK guide provides you with a code snippet. This code snippet is used to make the robot do something. But the provided snipped makes use of the pepper library. This library is not included in the guide. To make use of the library you need to add the following line to the `settings.gradle` file:
```gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url 'https://qisdk.softbankrobotics.com/sdk/maven/'
}
}
}
```
After this you should be able to make use of the pepper library. The imports of classes will show up red to solve this right click the imported class, there will be a option to import the class. Do this for all imports that are red. After this restart android studio and the imports should be fixed.
### Conclusion
The guide on the QiSDK website is a good guide to follow. But it is not complete. This guide is meant to help you with the parts that are not covered in the QiSDK guide. Once all steps from both guides are followed you should be able to run the app on the robot.

View File

@@ -107,13 +107,16 @@ To do
Done
-
- Start app design
- Start working on pepper
**25 April**
To do
-
- Make navigation menu for the app
- Make documentation for pepper with andriod studio
- Fix notedpad
Done