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, shown in the left of the following figure, is implemented using a Finite State Machine (FSM), shown in the right of the figure, with two states for Left Stance and Right Stance. Note that an edge of the motion graph is represented by a node of the FSM, and vice versa.




The motion graph of the biped
The corresponding finite state machine


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 feet always touch 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 FSM 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 FSM 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