Tutorial on how to make arms move
This commit is contained in:
49
docs/documentation/android/robotmovement.md
Normal file
49
docs/documentation/android/robotmovement.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# How to make the robot move
|
||||
|
||||
## Getting started
|
||||
First make a animation file in the /res folder.
|
||||
|
||||

|
||||
|
||||
Then right click it and click edit animation
|
||||
|
||||
## Making keyframes
|
||||
|
||||
Once you click edit animation you can click a bodypart and rotate it.
|
||||
|
||||

|
||||
|
||||
Once you have positioned the robot into your preffered position you can click the keyframe button.
|
||||
|
||||

|
||||
|
||||
You can grab and shift the keyframes around the timelines until you get something like this.
|
||||
|
||||

|
||||
|
||||
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.
|
Reference in New Issue
Block a user