The second is to match the foot trajectory pf with the captured trajectory \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\bf{p}}}_{f}^{\ast }$$\end{document}pf⁎ from the real insect:12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${f}_{t}=\sum _{k}{({{\bf{p}}}_{f}-{{\bf{p}}}_{f}^{\ast })}^{2}$$\end{document}ft=∑k(pf−pf⁎)2By minimizing this objective component, we expect to reproduce the similar gait pattern as the real insects. Ants typically demonstrate the double-tripod gait11,30. The intra-leg coordination between joints on the same leg is achieved by matching the trajectory of the particular leg, while the inter-leg coordination between different legs is enforced by the spatial-temporal information embedded in the trajectories of all legs on real ants. The use of motion trajectories allows the compact representation of the desired gait pattern, as part of the optimization goal.