Index>Robot Kit>Alter All in One Kit for RPi>Lesson 34 Diagonal Gait Generation Method (Dog)
No related product information!

Lesson 34 Diagonal Gait Generation Method (Dog)

994

       In this lesson, we will learn the function calls of the Alter Dog robot's servo linkage. You need to prepare the installed Alter Dog robot.

image.png

image.png


    There is no code program in this course.We only introduce the principle. The specific code program will be introduced in the following courses.


34.1 Principle and purpose of Diagonal gait generation

The diagonal gait is the gait for most quadrupeds move at a faster speed. The two diagonal legs are in the supporting or swinging pair at the same time. For a quadruped robot, the diagonal gait is relative to the triangular gait. For the servo, the tuning requirements are lower and the implementation is more convenient.

In order to be more intuitive, we divide the position of each leg of the robot into 12, which are represented by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 respectively. Positions 11 and 12 are swing pairs, and the rest are support pairs. 1 and 10 represent the front and back end points of the support pair respectively. 2, 3, 4, 5, 6, 7, 8, and 9 are the interpolation values between the two support pairs.The actual position spacing represented by adjacent numbers is the same.

Taking the forward direction of the robot as the front.The left front leg is coded I.The left back leg is coded II.The right front leg is coded III, and the right back leg is coded IV.

In order to coordinate the gait of the four legs, we introduce a global gait parameter, which is used to coordinate the position of the four legs at a certain moment, as shown in the following table.

image.png

For example, when the global gait is 3, leg I is in the 3 position; leg II is in the 9 position; leg III is in the 9 position; leg IV is in the 3 position.

When the global gait change trend is 1, 2, 3, 4, 5, 6, 7, 8..., the robot moves forward.When the global gait change trend is 8, 7, 6, 5, 4, 3, 2, 1..., the robot walks backward.


34.2Related API calls of the Diagonal gait generation program

moveD(command)

1. Calling the moveD(command) function will calculate the next target point and store it in goalPos. The command parameter can be passed into the command: "forward", "backward", "left", "right".

2. Calling the moveD() function does not make the robot move, you need to call smove() to make the servo move to goalPos.

Routine, let the robot move forward: 


image.png