From cf7ad0f461373c47e69a8d9adac6585bf1955e93 Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Thu, 25 Apr 2024 13:49:11 +0200 Subject: [PATCH] Tutorial on how to make arms move --- docs/documentation/android/robotmovement.md | 49 +++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 docs/documentation/android/robotmovement.md diff --git a/docs/documentation/android/robotmovement.md b/docs/documentation/android/robotmovement.md new file mode 100644 index 0000000..bfdaed3 --- /dev/null +++ b/docs/documentation/android/robotmovement.md @@ -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. \ No newline at end of file