6.3.2. Obstacle Experiment

To further show the robot's strong movement ability, we situate the robot in an obstacle environment, as shown in Figure 14, where two obstacles with different height are placed inside. The robot's movement is shown as in Figure 14. For the sake of description, we divide *Leg*1, *Leg*3, and *Leg*5 as the A group and *Leg*2, *Leg*4, and *Leg*6 as the B group.

In Figure 14a–c, we can observe that the A group is in the transfer phase. The *Leg*1 lifts up at the time *t* = 10 s and touches the obstacle at time *t* = 12 s. As the ground's height information changes, there is an adjustment process for *Leg*1 as stated in the control flowchart in Figure 12. From Figure 14d on, the A group is in support phase, and the B group is in the transfer phase. This process finishes in Figure 14f at time *t* = 15 s. In Figure 14g,h, the *Leg*1 moves on the top of obstacle 1. In Figure 14i, *Leg*1 starts to walk down the obstacle. Here, the foot tries to sense where the ground is based on the designed foot sensing structure in Figure 2. At the time *t* = 34 s, the *Leg*1 touches the ground, and landing information is fed back. Figure 14l–p show the process of leaping over obstacle 2. In Figure 14p, all legs and feet are marked to help better understand the robot's movement.

(a) t = 10 s (b) t=11s (c) t = 12 s (d) t = 13 s (e) t = 14 s (f) t = 15 s (g) t = 23 s (h) t = 24 s (i) t = 31 s (j) t = 33 s (k) t = 34 s (l) t = 43 s (m) t = 47 s (n) t = 52 s

In this experiment, we also mark the robot's posture. Results show that, although in a very complex environment, the robot with our trajectory planning method can still maintain horizontal posture.

**Figure 14.** Hexapod robot's movement with obstacles.

(o) t = 63 s (p) t = 69 s

#### **7. Conclusions**

Legged robots have high movement flexibility, which makes them more suitable for various complex terrains. However, the complex control algorithm and trajectory planning also accompany the robot. Reasonable trajectory planning methods will greatly reduce the difficulty of control algorithm designs. Thus, this paper designs a new trajectory planning method for legged robots named the three-element trajectory determination method. Meanwhile, to realize this method's application on a physical robot, this paper creates a new design of the legged robot's foot sensing structure in order to help obtain landing information. To show how the method works, the details of its application in a triangle gait are given. Indicated by the observation of our experiments, this paper makes an improvement of the traditional triangle gait, where an adjustment phase is added at the end of transfer phase to help the robot adjust its foot position when it deviates from the original planned trajectory because of changing terrain. A control flowchart with the introduced adjustment phase is also given. Experiments are carried out in a slope environment and an obstacle environment. The results prove that our method is effective and stable in practice .

Hexapod robots have extensive prospect and are worth studying. In this paper, the improvement of the movement of hexapod robots mainly focuses on the trajectory planning method. In the future, we plan to take attitude information into account in order to develop novel control algorithm designs.

**Author Contributions:** Conceptualization, H.X. and X.Z.; methodology, H.X. and X.Z.; software, H.X.; validation, H.X.; formal analysis, H.X. and X.Z.; investigation, H.X.; resources, H.X. and X.Z.; data curation, H.X. and X.Z.; writing—original draft preparation, X.Z. and H.Z.; writing review and editing, X.Z. and H.Z.; visualization, X.Z.; supervision, X.Z.; project administration, X.Z.; funding acquisition, X.Z. and H.Z. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the National Natural Science Foundation of China grant number 61903006, the Beijing Natural Science Foundation grant number 4204096, the Shaanxi Provincial Natural Science Foundation of China grant number 2021 SF-478, the Beijing Municipal Great Wall Scholar Program grant number CIT&TCD 20190304, the Scientific Research Project of Beijing Educational Committee 201910009008, the Basic Scientific Research Project of Beijing Municipal Education Commission, Youth Yuyou Talent Project of North China University of Technology, and Research Initial Foundation of North China University of Technology.

**Conflicts of Interest:** The authors declare no conflicts of interest.

#### **References**

