Motion trajectory prediction of quadruped robots in complex terrain by improving the transformer temporal modeling algorithm
摘要
In complex terrain, quadruped robot trajectories are susceptible to foot-to-ground contact transients and multi-scale temporal dependencies. Traditional Transformers struggle to simultaneously characterize short-term impacts and long-range gait patterns under real-time constraints. To address this, this paper proposes an improved Transformer temporal modeling algorithm for motion prediction in complex terrain. It systematically integrates multi-scale hybrid attention mechanisms for quadruped trajectory prediction, validating the potential advantages of Transformers in modeling contact transients. The method uses a local-sparse global hybrid attention to capture short-term ground-touching impacts and long-range gait dependencies, adapts non-uniform sampling with relative temporal encoding, and highlights key transient features and fuses information from different time domains in parallel through a dynamic gated feedforward network and a multi-scale temporal encoder. Experiments show that the proposed method achieves a short-term FDE of 0.018 m, a reduction of 0.017 m compared to the traditional Transformer, and reaches 0.095 m and 0.130 m in gravel and sloping terrains, respectively, while maintaining an inference latency of 12.45 ms. The results show that the proposed framework balances real-time performance and high accuracy in complex terrain and can significantly improve the stability and reliability of future trajectory prediction for quadruped robots.