5.3.14

Alice3 Programming: Program the Walk Cycle Precisely - Shoulder Movement

Previously I have a post about how I programmed a walk cycle (4 Frames), the walk procedure (for "person" class) according to an image I found in the internet. However, after using this procedure for several figures, I realized the code is far from good - the arm movement forward and backward are not equal, and with some figures, the arm is too close to the body.

1. How to make the backward and forward movement of the arm equal.

I will skip the details of the leg movement and simply focus on the arm(the shoulder). First thing to keep in mind is that the starting posture is not the Alice3 default posture. So there are some codes before entering the "While" loop. 

Rotation Intro
Angle to correct

                     Default posture 

As we can see from the image above, by default posture, there are angles between the forearms and the body middle line, to correct those angles, the right shoulder should turn left 0.04, left shoulder should turn right 0.04. 

Cycle 1


To get to the first posture (as the initial for the cycle), as shown above, the right arm should turn forward of the body(right shoulder turns left) and the left arm should turn backward (left shoulder turns right). For my code, I have set the angle to be 0.07. 

So for my entire program, the should movement is finally re-programmed as follows:

Before entering the cycle:

Right should turn left 0.07+0.04 (angle correction)
Left should turn right 0.07-0.04 (angle correction)

Cycle 1: Right shoulder turns right 0.07x2
              Left shoulder turns left 0.07x2
Cycle 3: Right should turns left 0.07x2
              Left shoulder turns right 0.07x2