Keywords

1 Introduction

In recent years, Fukushima nuclear power plant accident and other natural disasters like earthquakes, mudslides have prompted relevant research domains’ awareness of importance and necessity of rescue robots. Compared with wheeled/tracked robots, legged robots only need some discrete footholds for locomotion on the ground, which makes legged robots more suitably operate in complex and rugged environments. In last few years, many legged robots are designed. Generally legged robots can be classified into three categories, biped robots, quadruped robots and hexapod robots. For the famous biped robots, see Petman [1], Atlas [2], ASIMO [3]. For the famous quadruped robots, see BigDog [4], HyQ [5], SILO4 [6]. For the famous hexapod robots, see Ambler [7], Athelete [8], DLR Crawler [9], RHex [10]. The number, the mechanism and the layout of legs need well-designed in order to satisfy the requirements of stability, load capacity, walking velocity, DOFS and control.

In structured environments, legged robots need to build terrain map with the help of necessary vision sensors mounted on them. Then legged robots can plan the gait to adapt various terrain based on the terrain map. Some studies have concerned about terrain adaption for legged robots. Matt zucker and Nathan Ratliff [11] presented a novel optimization method for a quadruped robot, which can walk on challenge terrains. Their method plans a set of footholds and dynamic body motions by thoroughly rooting in optimization. Estremera and Cobano [12] proposed a continuous free-crab gait planning method for a six-legged robot. Their method derived three control modules relying on two heuristic empirical rules. They [13] also presented a method to generate continuous free crab gaits for the quadruped robots on rough terrains. Their experimental results showed the SILO4 quadruped robot could perform stable and omnidirectional locomotion on rough terrains. Hoepflinger and Hutter [14] introduced a method to evaluate and estimate the mechanical robustness of footholds for legged robots in irregular terrain without using the human expert knowledge or human defined criteria. Haynes and Rizzi [15] developed a robust method allowing the specification, control and transition of the stepping pattern for a six-legged robot. Their method generated gaits by merging through controllers that imposed appropriately placed repellors and the torus of relative leg phases.

In this paper, a perception-based walking strategy for the Hexapod-III robot on typical structured terrain is presented. The structure of this paper is organized as follows. In Sect. 2, the system overview and the problem formulation are introduced briefly. Processes of terrain map modeling and structured terrain classifying are described in Sect. 3. In Sect. 4, walking strategies for four typical structured terrain are presented in detail. Motion planning for the legged robot is discussed in Sect. 5. The experimental results are presented in Sect. 6. Section 7 summarizes and concludes the paper.

2 System Overview and Problem Formulation

As Fig. 1 shows, the six-legged robot is called Hexapod-III, which has six legs symmetrically arranged around the body. Its leg is a parallel mechanism having three chains, two of which are constructed by the universal joint, prismatic joint and spherical joint, the other one is constructed by the universal joint and prismatic joint. The linear movement of the prismatic joint is achieved by ball-bearing screw which is actuated by the motor. The control unit is an industrial computer running real-time Linux, which sends planned data to drivers via EtherCAT. The robot is equipped with a stereo camera, a six-axis force/torque sensor and an IMU.

Fig. 1
figure 1

The Hexapod-III robot

As Fig. 2a shows, the robot has 18 inputs \( \left( {q_{i} ,i = 1{-}18} \right) \), which are the prismatic positions. It has 24 outputs, 18 of which are the feet positions \( \left( {x_{{F_{i} }} ,y_{{F_{i} }} ,z_{{F_{i} }} ,i = 1{-}6} \right) \), the other six outputs are the positions and orientations of the body \( \left( {x_{B} ,y_{B} ,z_{B} ,\alpha_{B} ,\beta_{B} ,\gamma_{B} } \right) \).

Fig. 2
figure 2

a Inputs and outputs of the robot, b definition of the coordinate systems

During walking, four coordinate systems, the ground \( O_{G} \), the stereo camera \( O_{C} \), the body \( O_{B} \) and the foot \( O_{F} \), exist all the time. Three transformation relationships \( T_{C}^{R} \), \( T_{R}^{G} \) and \( T_{R}^{F} \) must be obtained. \( T_{C}^{R} \) is the transformation matrix from the stereo camera to the robot. The method of solving \( T_{C}^{R} \) has been presented in our previous work. \( T_{R}^{G} \) is the transformation matrix from the robot to the ground, which can be obtained from the body trajectory of the robot. \( T_{R}^{F} \) is the transformation matrix from the foot to the robot body which can be solved by the robot kinematics.

3 Terrain Map Building and Terrain Classification

Accurate 3D coordinates of the terrain in front of the robot can be obtained from the depth image captured by the stereo camera. The raw terrain data consists of large amounts of point cloud, which spends too much storage space and takes a long time for the computer to process. Taking into account this issue, we decide to use a grid-type map to decrease the data amount and increase the updating and processing rate of the map. The grid-type map describes the terrain by using multiple square-shaped grids, and each grid stores the real height of the terrain.

Figure 3 shows the process of grid terrain map building. Firstly, the point cloud \( {}^{C}P \) in \( O_{C} \) should be transformed in \( O_{G} \) by the following equation:

Fig. 3
figure 3

Grid terrain map building

$$ {}^{G}P = T_{R}^{G} \cdot T_{C}^{R} \cdot {}^{C}P $$
(1)

Secondly, the point cloud \( {}^{G}P \) is mapped into the corresponding grid by the following formulas:

$$ \begin{aligned} x_{\text{G}} (i,j )& = (i - 60) \times 0.025 \\ z_{\text{G}} (i,j )& = j \times 0.025 \\ y_{\text{G}} (i,j )& = \frac{{\sum\nolimits_{n = 1}^{n(i,j)} {y_{w} (n)} }}{n(i,j)} \\ \end{aligned} $$
(2)

Considering the capacity of Hexapod-III, the grid size is regulated as 0.025 m × 0.025 m, and the grid number is 120 × 120. So the grid map represents the real terrain whose dimension is 3 m × 3 m. The grid height is obtained by calculating the average height of the point cloud which are located in the same grid. Thirdly, two different kinds of wrong grid exists, which maybe influence the correctness of the map. One is the wrong data due to the outer noise and the sensor itself. The other one is the missing portion of the terrain caused by inevitable effect of occlusions in the sensors line of sight. The gird terrain map has to be processed further in order to exclude wrong grids as Fig. 3 shows. The processing algorithms are out of the scope of this article and won’t be discussed here.

In this paper, we mainly focus on the classification of four common terrain in reality, the flat-floor, step-on, ditch, and step down. Based on the grid terrain map, we can extract the geometric features of the four terrain as Fig. 4 shows. For the flat-floor terrain, there is no rising and falling edges in the height direction. For the step-on terrain, there is only a rising edge in the height direction. The position and the height of the step-on terrain are decided by those of the rising edge. For the ditch terrain, there is a falling edge first, subsequently followed by a rising edge. The position of the ditch is decided by that of the falling edge. The length of the ditch is calculated by the differential position of the rising and falling edges. For the step-down terrain, there is only a falling edge in the height direction. The position and the depth of the step-down terrain are decided by those of the falling edge.

Fig. 4
figure 4

Terrain classification

4 Walking Strategies

In this section, walking strategies are discussed in detail. The robot chooses the tripod waling gait, which is the fastest stable gait for the hexapod robot. The tripod walking gait enables the robot to have three nonadjacent feet touching with the ground all the time, the center of mass (COM) can be located in the support triangle easily as Fig. 5 shows.

Fig. 5
figure 5

The tripod walking gait

For different terrain, the robot applies two different gait trajectories, the rectangular trajectory and the ellipse trajectory. The rectangular trajectory is typical but quite useful as shown in Fig. 6a. The determination of the rectangular trajectory only needs three parameters, the step length a, the height of the lifting foot b and the height of the falling foot c, which facilitates the planning process a lot. The rectangular gait is used on step-on and step down terrain, for it is easy to be planned to avoid the collision with the rising and falling edges. Ellipse trajectory is shown in Fig. 6b, which is smooth and has a shorter length compared to the rectangular trajectory. The ellipse trajectory is decided by two parameters the step length b and the step height a. It is used on flat-floor and ditch terrain, for it can satisfy the requirement of high walking speed and large workspace of the foot.

Fig. 6
figure 6

a The rectangular trajectory, b the ellipse trajectory

When the robot passes through the step-on, ditch and step down terrain, the detection error and the motion error may cause the robot to falling down and collision with the terrain. In order to ensure the robot’s safety, it is important for the robot to move to a safe pose. As Fig. 7 shows, the safe pose is defined as a pose where the robot trunk is far from the sides’ edge of the terrain and it is vertical to the front edge of the terrain. When the terrain is not a flat-floor after distinguishing, the edge of the terrain is detected and located. Then the robot will turn an appropriate angle to face the terrain vertically. If any foot of the robot is outside the terrain, it will move left or right to make its foot far away from the sides’ edge of the terrain.

Fig. 7
figure 7

Edge detection and pre-adjustment for safety

The walking strategy on step-on and step-down terrain are substantially similar, the detailed walking process is shown in Fig. 8. The robot will detect the position and the height of the step-on terrain (the position and the depth of the step-down terrain), which has been described in detail above. Then the robot decides to use the rectangular trajectory. The robot will first move close to the step to ensure the position of the next foothold within the leg’s workspace. The robot will lift three nonadjacent feet, move them forward to a specified distance, then fall them down. Then the other three feet are motivated to move in the similar way. The robot will move its front two feet on or down the step, then the middle two feet, at last the back two feet. The step length, the foot lifting height and the foot falling height are calculated using following formulas.

$$ \begin{array}{*{20}l} {Step_{\text{length}} = Step_{\hbox{max} } } \hfill \\ {H_{\text{lifting}} = h_{\hbox{max} } + \delta_{\text{safe}}^{{\prime }} } \hfill \\ {H_{\text{falling}} = H_{\text{lifting}} - h_{current} } \hfill \\ \end{array} $$
(3)

where \( Step_{\text{length}} \) is the step length, \( Step_{\hbox{max} } \) is the maximum step length within the foot’s workspace. \( H_{\text{lifting}} \) is the foot lifting height, \( h_{\hbox{max} } \) is the maximum height of the terrain. For the step-down terrain, \( h_{\hbox{max} } \) is the maximum depth of the terrain. \( {\delta_{\text{safe}}^{{\prime }} } \) is the safety margin avoiding the collision of the terrain. \( H_{\text{falling}} \) is the foot falling height, \( h_{current} \) is the height of the next foothold.

Fig. 8
figure 8

Walking strategy on step-on and step-down terrain

The walking strategy on the ditch terrain is shown in Fig. 9. The robot will detect the position, and the length of the ditch first. Then it decides to use the ellipse trajectory. Before swinging its foot to the other side of the ditch, the robot will come close to the ditch in order to make sure the step length is longer than the ditch length. The robot will lift three nonadjacent feet, swing them to the planned footholds. Then it moves the other three feet in the same way. As Fig. 9 shows, the robot will first swing the front foot 1, 2 to the other side of the ditch. Then it comes close to the ditch and swings the medial foot 3 and 4 to the other side. At last it moves forward again and swings the back foot 5, 6 to the other side. The step length and the step height are calculated from following formulas:

$$ \begin{aligned} step_{\text{length}} & = L_{\text{Ditch}} + 2\delta_{\text{Safe}} \\ step_{\text{height}} & = height_{ \hbox{max} } + \delta_{\text{Safe}}^{{\prime }} \\ \end{aligned} $$
(4)

where \( L_{\text{Ditch}} \) is the length of the ditch, \( height_{ \hbox{max} } \) is the maximum height value of terrain within the ellipse trajectory. \( \delta_{\text{Safe}} \) is the safe margin along the longitudinal direction, \( {\delta_{\text{safe}}^{\prime } } \) is the safe margin along the height direction.

Fig. 9
figure 9

Walking strategy on ditch terrain

Walking strategy on the flat-floor is basically the same to that on the ditch. The robot uses ellipse trajectory gait. The robot can walk with a high speed on the flat-floor. So the step length can reach the maximum length within its workspace. And the step height can be obtained by adding a small safe margin to avoid little terrain bumps.

5 Motion Planning

After obtaining the gait trajectory, prismatic positions should be computed to control the robot to walk along the planned trajectory. Inverse kinematics is needed, and our previous work have finished the kinematics model of the robot [16].

Figure 10 shows the kinematic model of single leg. The position of spherical joint \( S_{f} \) connecting the leg with the foot is obtained from the above section. \( U_{1} ,U_{2} ,U_{3} \) are three universal joints connecting the leg with the body. \( S_{1} ,S_{2} \) are two spherical joints, which connects links with ankle joints. \( P_{1} ,P_{2} ,P_{3} \) denote three prismatic joints, whose lengths are \( l_{1} ,l_{2} ,l_{3} \). The geometric constraint equation of inverse kinematics is represented as follows,

$$ \left[ {\begin{array}{*{20}c} x \\ y \\ z \\ 1 \\ \end{array} } \right] = {}^{L}A\left[ {\begin{array}{*{20}c} {S_{{f_{x} }} } \\ {S_{{f_{y} }} } \\ {S_{{f_{z} }} } \\ 1 \\ \end{array} } \right] $$
(5)

where \( {}^{L}A \) is the transformation matrix from the ankle coordinate system (ACS) to the leg coordinate system (LCS). \( S_{{f_{x} }} ,S_{{f_{y} }} ,S_{{f_{z} }} \) are coordinates of \( S_{f} \) with respect to ACS. \( (x,y,z) \) denotes the coordinates of \( S_{f} \) with respect to LCS. Formula (6) is the detailed expression of \( {}^{L}A \),

$$ {}^{L}A{ = }\left[ {\begin{array}{*{20}c} {\cos \alpha_{1} \cos \beta_{1} } & { - \cos \alpha_{1} \sin \beta_{1} } & {\sin \alpha_{1} } & {l_{1} \cos \alpha_{1} \cos \beta_{1} } \\ {\sin \beta_{1} } & {\cos \beta_{1} } & 0 & {l_{1} \sin \beta_{1} } \\ { - \sin \alpha_{1} \cos \beta_{1} } & {\sin \alpha_{1} \sin \beta_{1} } & {\cos \alpha_{1} } & { - l_{1} \sin \alpha_{1} \cos \beta_{1} } \\ 0 & 0 & 0 & 1 \\ \end{array} } \right] $$
(6)

where \( \alpha_{1} ,\beta_{1} \) are rotation angles of \( U_{1} \) along two vertical directions, we can get the solution of the inverse kinematics by solving Eq. (5),

$$ \begin{aligned} l_{1} & = \sqrt {x^{2} + y^{2} + z^{2} - S_{{f_{y} }}^{2} - S_{{f_{z} }}^{2} } - S_{{f_{x} }} \\ \beta _{1} & = \arcsin \left( {\frac{y}{{\sqrt {\left( {l_{1} + S_{{f_{x} }} } \right)} ^{2} + S_{{f_{y} }} ^{2} }}} \right) - \arcsin \left( {\frac{{S_{{f_{y} }} }}{{\sqrt {\left( {l_{1} + S_{{f_{x} }} } \right)} ^{2} + S_{{f_{y} }} ^{2} }}} \right) \\ \alpha _{1} & = \arctan \left( {\frac{{S_{{f_{x} }} x - \left[ {\left( {l_{1} + S_{{f_{x} }} } \right)\cos \beta _{1} - S_{{f_{y} }} \cos \beta _{1} } \right]z}}{{\left[ {\left( {1 + S_{{f_{x} }} } \right)\cos \beta _{1} - S_{{f_{y} }} \sin \beta } \right]x + S_{{f_{z} }} }}} \right) \\ \end{aligned} $$
(7)

\( {}^{L}A \) can be calculated by substituting \( \alpha_{1} ,\beta_{1} ,l_{1} \) into Eq. (6), and lengths \( l_{2} ,l_{3} \) of prismatic joints \( P_{2} ,P_{3} \) can be obtained from following equations,

$$ \begin{aligned} l_{2} = \left| {\overrightarrow {{{}^{L}U_{2} {}^{L}S_{2} }} } \right| & = \left| {{}^{L}A \cdot {}^{A}S_{2} - {}^{L}U_{2} } \right| \\ l_{3} = \left| {\overrightarrow {{{}^{L}U_{3} {}^{L}S_{3} }} } \right| & = \left| {{}^{L}A \cdot {}^{A}S_{3} - {}^{L}U_{3} } \right| \\ \end{aligned} $$
(8)

where \( {}^{L}U_{2} ,{}^{L}U_{3} ,{}^{L}S_{2} ,{}^{L}S_{3} \) are positions of joints \( U_{2} ,U_{3} ,S_{2} ,S_{3} \) with respect to LCS respectively, and \( {}^{A}S_{2} ,{}^{A}S_{3} \) are positions of joints \( S_{2} ,S_{3} \) with respect to ACS respectively.

Fig. 10
figure 10

Kinematic model of single leg

6 Experiments

In this section, experimental results are presented. Figure 11 shows the process of walking on the stair. The robot correctly detects the position and the height of the stair. Then it moves to the safe pose to guarantee safety. Before placing the feet on the stair, it moves close to the stair to ensure that next footholds are within the workspace. And the robot trunk moves forward horizontally because of the accurate foot falling height.

Fig. 11
figure 11

Snapshots of walking on step-on terrain

Figure 12 shows the process of walking down the stair. The position and the depth of the stair are detected correctly. Then the robot moves to the safe pose. Before placing the feet on the ground, it moves close to the stair to ensure next footholds are within the workspace. From Fig. 12, we can see that the robot trunk maintains horizontally, which validates the walking strategy on step-down terrain.

Fig. 12
figure 12

Snapshots of walking on step-down terrain

Figure 13 shows the process of passing through the ditch. The position and the length of the ditch are calculated correctly. The robot uses the ellipse trajectory gait. Before swinging the feet to the other side of the ditch, it moves close to the nearer edge of the ditch to ensure the next step length is longer enough to pass the ditch safely. From Fig. 13, we can see that the robot passes through the ditch successfully.

Fig. 13
figure 13

Snapshots of passing through ditch

7 Conclusions

In this paper, we have presented a perception-based walking strategy for a hexapod robot on typical structured terrain. The walking strategy is based on the grid-type terrain map, which is modeled from point cloud captured by a stereo camera. The geometric feature of four typical structured terrain, the flat-floor, step-on, step-down and ditch are abstracted and detected from the grid-type map. In order to guarantee the robot safety, the pre-adjustment strategy is proposed. Then four walking strategies for different terrain are presented in detail. The motion planning method based on the robot kinematics is discussed too. At last, a serial of experiments are carried out and the results validate the practicability and theoretically of the proposed strategy.