# Vision-Guided Six-Legged Walking of Little Crabster Using a Kinect Sensor
## 4 Vision-Guided Walking Algorithm
### Landing Position Modification Algorithm  
The walking pattern introduced in Section 4.1 is for the level ground without considering changes in the ground height. Hence, in order to increase the walking stability, it is necessary to adjust foot landing positions through ground information obtained by the vision system. For example, when our robot lands a foot on an obstacle, not on level ground, we have to modify the landing height from the ground information in advance. Furthermore, if the foot lands at the edge of an obstacle, the landing foot can slip on the edge and cause the LCR 200 to fall down; hence, the horizontal landing position must also be modified. For this reason, we propose an algorithm that modifies the landing positions by deciding on the reliability of the depth information and the safety of the landing area. Figure 12 shows a flow chart of the algorithm. First, the vision PC receives the scheduled foot landing position data from the robot PC. Second, the reliability of the depth data at each given landing area is checked. Third, the safety of each given landing area is also checked. If both reliability and safety are verified for the original landing area, the original horizontal position and corresponding vertical ground height are sent back to the robot PC. If the reliability or safety is not verified, the eight alternative landing positions around the original landing position are considered (see Figure 13). In case there is no safe landing area among the alternative landing positions, the safest position among them is selected alternatively. In the worst-case scenario, where all alternative positions are not reliable nor safe, the original landing position with zero vertical ground height is sent back to the robot PC for blind stepping. Figure 11: Example of walking pattern generation of LCR 200 [22] (BC: body center): (**a**) X-trajectories of the six feet in ground-fixed coordinate frame; (**b**) Z-trajectories of the six feet in ground-fixed coordinate frame. To check the reliability of the depth information, we used the collection rate of the depth data in the landing area, which is 30 mm \(\times\) 30 mm square around the landing position. Basically, if the collection rate of the landing area is moderate, as shown in Figure 14a, the depth data would be reliable, whereas if the collection rate is low due to a low data-concentrated section in the landing area, as illustrated in Figure 14b, the reliability would not be secured. It should be noted that if the high data-concentrated section and low data-concentrated section exist together, the collection rate of the landing area can be suitable, even though this landing area is not suitable for foot landing. In order to solve this problem, we divided the landing area into 100 sub-cells, as illustrated in Figure 15, and calculated the collection rate by checking whether a depth value exists or not in each sub-cell. By using this method, the reliability of the depth information of the landing area can be more suitably determined. The 30 mm \(\times\) 30 mm landing area around the landing position is divided into 100 cells, and if the number of the cells containing the depth data is higher than 70%, we can decide that the reliability of the corresponding landing position is secured. Figure 12: Flow chart of landing position modification algorithm. Figure 13: Eight alternative foot landing positions and checking order. Next, to check the safety of the landing area, we consider the degree of ground height change. More specifically, we calculated the standard deviation of ground height in the landing area first and determined the safety by comparing the standard deviation with a predefined threshold. If the standard deviation is higher than the threshold at the landing area, the corresponding landing position is not appropriate for a stable landing. The threshold was determined by considering the edge of a 20 mm-thick block.