A Walking Biped

This work is an introduction to keyframe animation and behavioral control.

The program

Download and decompress the archive bipedwalk.zip
Compile the program and run it.
You can experiment character parameterization and user interaction. Details are given by command run -h

question Program structure Explain where the scene is initialized and where it is updated in the main program.

The character

The character is animated using its member method update repeatedly triggered by a timer sensor in the main program. The walking cycle is governed by a standard automat with two states associated with two behaviors, respectively moving the left leg forwards and the right leg forwards as illustrated below. The boxes and the annotated arrows respectively represent the behaviors and the transitions.

question Arms Add shoulder animation to move the arms of the character.

question Height Perform the automatic adjustment of the height of the character so that the support foot always touches the ground. 

Keyframes

The foot moving forward should not touch the ground. However due to symmetry its is always at the same height as the other. To solve this problem we can add keyframes so that the knee is bended when the associated "flying" foot is vertically aligned with the body.

question Keyframes Draw a figure of the new automat and implement the new keyframe animation

Behaviors

We want the character to stop/restart when we press key S. To do this we need another keyframe where the legs are parallel and vertically aligned with the body.

question StartStop Draw a figure of the new automat and implement the new keyframe animation

Walking direction

We want the character to smoothly turn to the left or to the right while we press keys L and M respectively. To do this we can add to the character a member variable defining its direction on the plane.

question Direction Explain how to do this and implement it