2024-04-25 21:29:37 +02:00
38 changed files with 483 additions and 61 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,23 @@
# VideoView
We wanted to show the different exercises in a video that anybody could replicate. For this we didn't want to implement a youtube function we wanted to have our own videos so that we don't rely on youtube. Ti start we need an emoty activity file you can create one in the android studio IDE. Then you need to head to the XML file you just created and the go to widgets and the add the VideoView element
![VideoView](VideoViewWidget.png)
If you drag that in to your activity you can edit the layout of it but it will not function directly. To Let it play videos we need to write a java code. First start by coding what you want to view.
```java
VideoView videoView = findViewById(R.id.videoView);
videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.videofile));
```
replace the video file with the name of the video. Then you need to code the media player aswell.
```java
MediaController mediaController = new MediaController(this);
videoView.setMediaController(mediaController);
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
videoView.start(); // Restart video on completion
}
});`
```
Since we have short videos we will have a auto replay function if you want it can go to a completion screen after the video ended.

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.