# Kinematic Tripod (K3P): A New Kinematic Algorithm for Gait Pattern Generation
## 5 Test Results  
In this section, we show the test results of the K3P algorithm when commanding an hexapod robot with a radial base of 0.65 m in a virtual uneven terrain. The numerical values for all physical dimension and parameters are listen in Table 4. The results shown in this section were obtained from computations on Matlab in order to simulate the kinematics of the robot. During the simulation, the speed commands \(\mathbf{v}_{c}\) for the robot were generated so that it describes a lemniscate trajectory. We chose the lemniscate trajectory because it defines two turns in opposite directions and two almost straight segments for the robot to travel. The parametric equations of the lemniscate \(\mathbf{r}_{d}(s)\) is shown in Equation (3):  
\[\mathbf{r}_{d}(s)= \begin{bmatrix}x_{d}(s)\\ y_{d}(s)\\ z_{d}(s)\\ \psi_{d}(s)\end{bmatrix} = \begin{bmatrix}a\sin(\frac{s}{e})\\ b\sin(\frac{2s}{e})\\ c\sin(\frac{3s}{e})\\ \arctan 2(\psi_{d},\psi_{d})\end{bmatrix}  \tag{3}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{3}{c}{**Torque Variables**} \\ \hline \(\mathbf{J}\) & **Reference Frame** & **Link** & **CoG** \\ \hline
1 & \(K\), Knee & Tibia & \([\
icefrac{{1}}{{2}}l_{t},0,0]^{T}\) \\
2 & \(L\), Lift & Femur & \([\
icefrac{{1}}{{2}}l_{f},0,0]^{T}\) \\
3 & \(S\), Swing & Coxa & \([\
icefrac{{1}}{{2}}l_{c},0,0]^{T}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Parameters for torque estimation with respect to listed reference frames. For this numerical example, the robot is commanded to follow a lemniscate covering a rectangular region of 3.5 m long and 2.3 m wide; the values for all parameters of the lemniscate equations are listed in Table 4. For a given speed value \(v_{B}\) and time step \(\Delta_{t}\), we iteratively computed the increment for the parameter \(\Delta_{s}\) that yields an equal incremental displacement \(\Delta_{t_{d}}=v_{B}\Delta_{t}\). This incremental displacement is then used as the input command for the K3P algorithm \(\mathbf{v}_{c}\) (Section 4.2) as  
\[\mathbf{v}_{c}= \begin{bmatrix}v_{x}\\ v_{y}\\ v_{z}\\ \dot{\psi}\end{bmatrix} = \begin{bmatrix}\dot{x}_{d}(s+\Delta_{s})\\ \dot{y}_{d}(s+\Delta_{s})\\ \dot{z}_{d}(s+\Delta_{s})\\ \arctan 2(\dot{y}_{d}+\Delta_{s},\dot{x}_{d}+\Delta_{s})\end{bmatrix} \]  
Figure 5(a) shows how K3P drove the hexapod around the lemniscate trajectory over uneven terrain, as well as the trail of all limbs; the initial state of the robot was  
\[{}^{B}\mathbf{X}_{W,0}=[0,0,0.16,\mathbf{0}_{1\times 9}]^{T}\]  
Figure 5(b) shows the trajectory described by the CoM of the robot, overlapping the desired trajectories in the \(XY_{W}\) plane. Figure 5(c) shows the transient response at the beginning of the trajectory when the hexapod aligns itself with the lemniscate trajectory from its initial state; the shaded areas represent the moments at which the even subsets of legs are at the swing phase of the gait cycle. The reader can verify that after every phase shift is triggered, the desired angle of orientation \(\psi_{d}(t)\) equals \(\psi(t)\); this causes the robot to stop spinning while the swinging tripod lands. Figure 5(d) displays how K3P adapts to the elevation of the terrain \(z_{d}(t)\) as measured from right below \(B\). K3P tries to maintain a constant walking height \(z(t)\) with respect to the surface elevation \(\approx\)0.16 m (Section 4.7). Figure 7 shows several footprints of the hexapod right after a phase shift occurs, and both subsets of legs are touching the ground. The corresponding locations of \(B_{1,2,\ldots,15}\) are shown to display that the gait is stable because \(B\) is within the support polygon of the vehicle. Furthermore, Figure 7 shows where the turning radius is smaller than the threshold \(\rho_{m}=0.8\) m used in the simulation to better determine the desired location \(L\) for the swing tripod, as discussed in Section 4.4.