# Research on the Posture Control Method of Hexapod Robot for Rugged Terrain
## 2 Adaptive Foot Trajectory Planning for Rugged Terrain
### Adaptive Strategy for Foot Trajectory Planning  
The foot of the hexapod robot is composed of a base joint, a base-femoral joint, and a femoral-tibial joint. A reference coordinate system, \(\sum_{O_{m0}}\), for trajectory planning is established with the center of the base joint axis as the coordinate origin to facilitate gait control, unified planning, and coordination of the trajectory of each leg and foot end. The direction of each axis of the coordinate system is consistent with the trunk coordinate system \(\sum_{O}\), \(Z^{\prime}{}_{m0}\) is perpendicular to the trunk and opposite to gravity, and \(X^{\prime}{}_{m0}\) is the same as the forward velocity, V, of the robot. The model of the planned foot trajectory is shown in Figure 5. The swing phase and support phase in the foot trajectory are planned in the reference coordinate system \(\sum_{O^{\prime}{}_{m0}}\). \(O^{\prime}{}_{m4}\) origin is the projection of the m-th leg and foot endpoint on the \(X^{\prime}{}_{m0}O^{\prime}{}_{m0}Z^{\prime}{}_{m0}\) plane of the corresponding reference coordinate system in the initial pose. Track_A (curve QATBP) is the projection of the swing phase trajectory on the plane \(X^{\prime}{}_{m0}O^{\prime}{}_{m0}Z^{\prime}{}_{m0}\). The trajectory is divided into the ATB section of the guide layer and the adjustment layer CQ and BP. The trajectory of the guidance layer mainly realizes the swing function and has good shape and dynamic characteristics. This layer is divided into an upper guidance layer and a lower guidance layer. The distinction between the upper guidance layer and lower guidance layer is used for the robot's autonomous judgment and selection of pose control strategies. The adjustment layer trajectory is mainly used to realize the adaptation function to the ground. It is divided into upper and lower adjustment layers, and a simple trajectory is used to solve the ups and downs of the foot directly and effectively. The judgment of the foot point needs to combine the force sensing function of the leg and use the joint torque sensor of the base-femoral joint to sense the contact of the foot end with the ground. Then, the foot end is converted from the swing phase trajectory to the support phase trajectory. When the robot is walking on a flat terrain, the swing phase trajectory only contains the guidance layer, starting at point A and ending at point B. When walking on a rugged terrain, the swing phase trajectory can end at any point of the curve TBP section to switch to the support phase trajectory. If the end point is higher than the horizontal position, it ends at the guide layer, and if it is lower than the horizontal position, it ends at the adjustment layer. Track_B (curve) is the trajectory of the swing leg entering the support phase in advance, and this trajectory meets the needs of gait control. The coordination of the trajectory of each foot end of the supporting phase realizes the expected motion of the torso. The motion of the torso is planned in the ground reference coordinate system. The end of the foot in the supporting motion is stationary relative to the ground reference coordinate system without sliding. Thus, the motion of the torso can be converted. The trajectory of each foot end is separately planned for the movement of the end points of each supporting leg relative to the trunk coordinate system. Track_C (line BA) is the projection of the swing phase trajectory on plane X. When the hexapod robot simultaneously adjusts its pose during traveling, the trajectory is shown as Track_D (line B\"JKC\"). The JK segment is the projection of the composite trajectory supporting the forward movement of the torso and the posture change. For foot trajectory based on the above strategic planning, in the case of mildly rugged terrain, while the foot trajectory adapts to the changing terrain, it can ensure that the trunk maintains the same posture based on the initial level of walking during the entire walking process.