# Terrain Irregularity Sensing by Evaluating Feet Coordinate Standard Deviation
## 5 Experimental Terrain Roughness Evaluation  
During movement over irregular terrain, using an adaptive gait, the foot coordinates will not necessarily coincide with the terrain roughness heights. These variances may appear due to the robot construction's mechanical inaccuracies (part stiffness, actuator reducer freedom, limit switch pretravel, etc. ), feet slippage, etc. These inaccuracies are not known and are considered as disturbances. To ensure correct terrain roughness, recognition deviations must be assessed and compensated. These deviations make the robot's body tilt and descend with each step. And because leg coordinate frames are associated with the body's coordinate frame, the legs are seemingly placed at higher \(z\) coordinates. Therefore, the coordinates of most legs increase with each step, and a correlation between the robot body tilt and feet \(z\) coordinate deviations could be noticed. So, foot coordinate deviations can be compensated according to the robot's inclinations. The robot's body inclinations along the \(x\) and \(y\) axes are measured using an accelerometer. The feet \(z\) coordinate deviations according to the body's inclina  
Figure 8: Hexapod gait diagram shows leg transfer sequences for (**a**) tripod, (**b**) tetrapod, (**c**) wave, and (**d**) ripple. Here: LF—left front, LM—left middle, LH—left hind, RF—right front, RM—right middle, and RH—right hind legs. Figure 9: Feet trajectory for adaptive locomotion projection in \(yz\) plane. \(h\) is step height; \(l\) is step length. tions can be calculated using Equations (9)-(14). These equations are derived by applying forward kinematics for the robot's body. The input for the calculations was the body inclination \(\alpha_{x}\) and \(\alpha_{y}\) and the output is all the feet \(z\) coordinate compensation coefficients. \[z_{e,\mathrm{RF}}=z+\frac{L1\cdot\sin(\alpha_{x})}{2}-\frac{L2\cdot\cos(\alpha_{ x})\cdot\sin(\alpha_{y})}{2}, \tag{9}\]  
\[z_{e,\mathrm{RM}}=z-\frac{L2\cdot\cos(\alpha_{x})\cdot\sin(\alpha_{y})}{2}, \tag{10}\]  
\[z_{e,\mathrm{RH}}=z-\frac{L1\cdot\sin(\alpha_{x})}{2}-\frac{L2\cdot\cos( \alpha_{x})\cdot\sin(\alpha_{y})}{2}, \tag{11}\]  
\[z_{e,\mathrm{LF}}=\bar{z}+\frac{L1\cdot\sin(\alpha_{x})}{2}+\frac{L2\cdot\cos (\alpha_{x})\cdot\sin(\alpha_{y})}{2}, \tag{12}\]  
\[z_{e,\mathrm{LM}}=\bar{z}+\frac{L2\cdot\cos(\alpha_{x})\cdot\sin(\alpha_{y})} {2}, \tag{13}\]  
\[z_{e,\mathrm{LH}}=z-\frac{L1\cdot\sin(\alpha_{x})}{2}+\frac{L2\cdot\cos( \alpha_{x})\cdot\sin(\alpha_{y})}{2}, \tag{14}\]  
where \(z_{e,\mathit{leg}}\) is the \(z\) coordinate compensation coefficient; \(\overline{z}\) is the feet \(z\) coordinate mean, recalculated after each step; and \(\alpha_{x},\alpha_{y}\) is the robot body's inclinations along the \(x\) and \(y\) axes, measured with an accelerometer. After each step, the body's inclinations are measured, and the feet \(z\) coordinate mean is calculated. Then, using Equations (9)-(14), the compensation coefficients are calculated and added to the current corresponding feet \(z\) coordinates, thus correcting the robot's tilt and descent. The terrain roughness evaluation method was tested. The experiments were carried out with a robot walking over an obstacle of a given length and height (rectangular shape obstacle with 400 mm length and 40 mm height) using four different gaits: tripod, tetrapod, wave, and ripple (see Figure 8). The step length \(l\) was set to 30 mm during the experiments, and the step height \(h\) was set to 60 mm. Each experiment was repeated five times with each gait. During the experiments, each foot's \(z\) coordinates are stored in external EEPROM memory after each step and later used to plot the obtained terrain profile. These experiments aimed to test how the robot's feet coordinates and \(SD\) change when the robot walks over an obstacle and how different gaits influence terrain roughness estimation using the \(SD\) parameter. Figure 10 shows the averaged data from five experiments for each gait. The black line shows the real terrain profile.