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

Lesson 33 Triangular Gait Generation Method (Dog)

1001

       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.


33.1 Principle and purpose of triangular gait generation

For a quadruped robot, the gait generation method is almost the most complicated part of the program, because it has to coordinate with more than a dozen servos to move at the same time.And when walking forwards and backwards, it is necessary to keep the robot at least three legs on the ground at all times, that is to say, only one leg can be in the swing pair at any time, and at least three legs are in the support pair.

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 12 position; leg III is in the 9 position; leg IV is in the 6 position.

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

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.


33.2 Related API calls of the triangular gait generation program

move(command)。

1. Calling the move(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 move() function does not make the robot move, you need to call move() to make the servo move to goalPos.

Routine, let the robot move forward:

image.png