# Terrain Irregularity Sensing by Evaluating Feet Coordinate Standard Deviation
## 2 \(Sd\) Usage for Terrain Roughness Sensing  
Humans can feel how high their feet are lifted even without looking at them. This helps with climbing stairs or walking through rocky areas without constantly looking at one's feet. This means that the surrounding terrain can be evaluated with a sense of foot displacement. For example, when one leg is higher than the other, we know we are not on a flat surface and can estimate the obstacle's height. This suggests that different methods instead of visual perception can also be used to evaluate terrain roughness. Our goal is to assess if six feet \(z\) coordinate values are sufficient to determine different terrain roughness categories. The idea was first proposed in [30] but never implemented and tested practically. The \(SD\) parameter is obtained very simply and is appropriate for terrain roughness evaluation. The \(SD\) parameter represents point deviations around their mean. It is very easily calculated compared with other terrain roughness evaluation methods, such as vision systems. Usually, the \(SD\) is calculated only for all-terrain profiles when the all-terrain data are known. In our proposed method, the \(SD\) is calculated only at a given moment and only for small terrain areas. This way, the \(SD\) will provide information about the terrain the robot is in. Feet coordinates are always calculated and are known in the robot's control system from leg trajectory calculations. These coordinates are then used to calculate leg motor angles using 3-degrees-of-freedom inverse kinematics. This makes \(SD\) a very convenient method because no other information is needed for terrain evaluation. Terrain roughness is evaluated by calculating the \(SD\) of feet \(z\) coordinates when all the feet touch the ground. The feet coordinates are measured in a feet coordinate frame \(x_{f}y_{f}z_{f}\) (Figure 1) so that a neutral robot stance (Figure 2a) gives feet coordinates all equal to 0. The \(z\) coordinates represent the feet height displacement from a neutral stance. \(z\) is positive when the foot is lifted and negative when lowered. It is presumed that when \(z_{1}=z_{2}=z_{3}=z_{4}=z_{5}=z_{6}\), all the feet are on the same ideally flat surface. Figure 1: Hexapod robot 3D CAD model with shown body and feet coordinate frames. The terrain is evaluated after each step so the robot can sense the terrain roughness in real time. It is accepted that the robot's body always maintains a horizontal position. The \(SD\) is calculated using the sample standard deviation expression:  
\[SD=\sqrt{\frac{1}{n-1}\sum\limits_{i=1}^{6}\left(z_{f}(i)-\bar{z}\right)^{2}}, \tag{7}\]  
where \(n=6\) is the number of data samples, which in our case is the same as the number of legs, 6. \[\bar{z}=\frac{\sum\limits_{i=1}^{6}z_{f}(i)}{6}, \tag{8}\]  
where \(z_{f}(i)\) is the \(i^{th}\) leg's coordinate. In this case, sample standard deviation is used to increase the terrain roughness evaluation accuracy due to a low number of sample points. The complexity of obtaining the \(SD\) is further reduced because all the foot coordinates are known throughout all the walking phases. The downside of this method is the low data point count as fewer points give a less accurate terrain roughness evaluation, and each new review may vary drastically from the previous. Though it is known that the \(SD\) mean would increase as the terrain roughness increases, a higher \(SD\) value will represent higher terrain roughness. To associate terrain roughness with the hexapod robot, we choose the robot's ground clearance. As ground clearance, we consider the height from the ground to the bottom of the robot's body. The hexapod robot's (Figure 1) ground clearance without lifting its body is 87 mm (which is also equal to the leg's tibia length minus half the body thickness) (Figure 1(a)) and 160 mm at the peak body height (Figure 1(b)). The maximum value of  
Figure 2: Robot stances and ground clearance. 160 mm is the absolute maximum and more theoretical and, in practice, should be smaller.