Skip to content

How to make the robot moveΒΆ

Getting startedΒΆ

First make a animation file in the /res folder.

alt text

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

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

alt text

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

alt text

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// 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.

Additional stuffΒΆ

every 25 is 1 second so 100 is 4 seconds. alt text