Abstract
This paper presents an environment recognition method for bipedal robots using a time-delay neural network. For a robot to walk in a varying terrain, it is desirable that the robot can adapt to any environment encountered in real-time. This paper aims to develop a sensory mapping unit to recognize environment types from the input sensory data based on an artificial neural network approach. With the proposed sensory mapping design, a bipedal walking robot can obtain real-time environment information and select an appropriate walking pattern accordingly. Due to the time-dependent property of sensory data, the sensory mapping is realized by using a time-delay neural network. The sensory data of earlier time sequences combined with current sensory data are sent to the neural network. The proposed method has been implemented on the humanoid robot NAO for verification. Several interesting experiments were carried out to verify the effectiveness of the sensory mapping design. The mapping design is validated for the uphill, downhill and flat surface cases, where three types of environment can be recognized by the NAO robot online.
1. Introduction
A humanoid robot with a bipedal walking gait can behave more flexibly in various kinds of environments. Bipedal walking robotics has gained much attention in recent years. Many bipedal walking mechanisms, gait pattern generation schemes and control laws have been reported in the literature [1-5]. Numerous studies have attempted to work out strategies for the stability, system modelling and dynamics analysis of bipedal walking. Because of the high degrees of freedom (DOF) in bipedal walking, the control system design is complicated and online gait balance control is a challenging topic. Kajita et al. [6] used a three dimensional (3D) linear inverted pendulum model to simplify the calculation of dynamics in their real-time control method for a bipedal robot. Huang et al. [7] presented a walking pattern planning method, which can adapt to ground conditions with different types of foot motion. In [8], an online walking pattern generation method is proposed to consider the trunk effect of a bipedal robot, for reducing the damping effect during robot walking. Park et al. [9] proposed an algorithm for the online trajectory generation of the humanoid robot KHR-3. Wang et al. [10–11] developed a motion planning method for a humanoid robot, which enabled users to generate various motion states without using any reference motion data.
Many attempts have been made to design a robot to adapt to terrains that appear in human living environments. When a bipedal robot walks in the real world, it will face situations where it has to maintain balance in an unknown environment. Kajita et al. [12] proposed a zero moment point (ZMP) control law to allow a robot to walk across an uneven surface. Piao et al. [13] formulated the design of humanoid robot walking movement into a second-order optimization problem and stabilized the robot with ZMP criteria. In [14], a hybrid evolutionary algorithm was proposed based on neural networks to optimize a walking-up stairs movement. Fu et al. [15] applied walking pattern synthesis and sensory feedback control to a bipedal robot for climbing stairs. Yussof et al. [16] presents a contact interaction-based navigation strategy for a bipedal humanoid robot to support visual-based navigation.
It is clear that for a humanoid robot to walk in varying environments, different gait-control schemes are required to adapt to the environment. A pre-assigned walking pattern would not be satisfied for a changing environment. Liu et al. [17] proposed an architecture to generate adaptive workspace trajectories. With their proposed adaptive joint control scheme, a quadruped robot was demonstrated to walk through various terrains. However, in their design the gait parameters for different terrains are not given to the robot automatically. If the environment can be recognized by the robot, it will be able to adapt to the environment autonomously. It is of prime importance that a robot should be able to estimate its situated environment online in order to adapt to the environment spontaneously.
This paper presents a novel design for sensory mapping, which estimates the situated environment for bipedal walking using on-board sensors. Based on the sensory mapping scheme, a bipedal robot can understand the type of environment and adapt to it without knowing it in advance. The rest of this paper is organized as follows. In Section 2, the system architecture of the proposed bipedal walking system is presented. In Section 3, a design for sensory mapping is described. In Section 4, an implementation of the proposed system on the NAO humanoid robot is presented. Interesting experiments were conducted using the NAO robot. The experimental results are presented in Section 5. In Section 6 we conclude the contribution of this paper.
2. System Architecture
For a robot to walk in an unknown environment, the interaction between robot and the environment provides useful information to the robot. The proposed control architecture aims to recognize the situated environment type using sensory information and then select a suitable gait pattern. The situated environment type is recognized by means of a relationship constructed between on-board sensory data and the environment. Figure 1 illustrates the proposed control architecture for bipedal walking using the concept of sensory mapping.

System architecture for bipedal walking based on sensory map
Through its equipped sensors, the robot acquires information from interactions with the environment. The acquired sensory information can then be interpreted to infer the current type of environment. Such an environment recognition module is termed sensory mapping. Based on the recognized environment, a suitable walking pattern is then generated according to a predefined database. The database stores a series of gait patterns which are designed for different environments respectively. In this way, the selected gait pattern will be suitable for the current environment and allow the robot to walk stably in an adaptive manner. The desired joint commands are sent to the robot motion controller for execution, from which updated sensory information is continuously fed back so as to get new sensory mappings.
The purpose of sensory mapping is to estimate the type of environment so that the robot can adjust its walking pattern adaptively. In this scheme, a mechanism is needed to map acquired sensor information to the environment type. Figure 2 depicts the proposed sensory mapping scheme. In general, various kinds of sensors can be used for the desired sensory mapping. In this work, gyroscopes and accelerometers onboard the robot are adopted in the design. The sensory data is pre-processed and then sent to an artificial neural network (ANN) to classify the environment.

System architecture of the sensory mapping design
3. Proposed time-delay sensory mapping (TDSM)
Since the sensory data from multiple sensors of a bipedal robot is conjunctive and very often coupled, it is a challenge to model the environment using multiple sensory data. In particular, the correlation between sensory information and environment types may be even complicated as the number of sensors and environment types increases. As a result, neural network techniques are adopted to design the desired sensory mapping.
Furthermore, with bipedal walking, the sensory data varies dramatically during a gait motion cycle; one neural network cannot fit every sample of the motion cycle. However, we observed from experiments that the sensor data in the same phase of a different motion cycles is similar; we thus designed multiple classifiers to recognize the environment for each phase of a bipedal gait motion cycle.
In designing the sensory mapping, we first decided what type of environment should be classified. Next, we chose those sensors to be used for environment recognition. Bipedal walking experiments would be set up and carried out to obtain the sensory data for training the ANN. After a successful training session, the weight and bias of the ANN were stored for the robot as a database for online use. In this way, the robot could estimate the environment online with the designed sensory mapping procedure.
Due to transient body shaking and the unstable ground reaction forces during bipedal walking, the sensory data is always fluctuating and is difficult to classify. Furthermore, it is observed that the sensory data of certain specific phases varies as well. To reduce the effect of fluctuating sensor values, we propose a time-delay sensory mapping scheme. in considering sensor signals from a time-related sequence, we added some earlier sensory data to the input of the ANN for environment recognition. Such an ANN is termed a time-delay neural network, whose primary purpose is to handle temporal continuous data. In such a classifier, sensor signals from time T0–N+1 to time T0 form the input of the classifier. As shown in Fig. 3, all of the sensor data from time step T0–N+1 to time step T0 is sent to the classifier at one time. Thus, there are K*N signals as inputs of the classifier. This scheme enhances the recognition rate by memorizing the trend of sensory values.

ANN for TDSM at time T0
4. Implementation in a NAO robot
To build up the TDSM, we took the following steps:
Select a series of target environments and choose the appropriate sensor(s).
Generate the walking pattern.
Let the robot walk in each environment and record the corresponding sensory data.
Decide the structure of the ANN.
Train the ANN offline and store the weight and bias in the database.
In this work, uphill and downhill sloped environments were chosen to be classified. We choose the appropriate sensor signals for such environment reorganization tasks. In the slope case, robot body angle, angular velocity and acceleration are chosen as input of proposed TDSM. The sensor data used can be different for different environment types. Afterwards, experiments were setup and carried out to obtain the sensory data for training the ANN. The details of the training will be discussed in Section 4.4. After a successful training, the weight and bias of the ANN is stored for the robot as a database. In this way, the robot can estimate the environment online with the sensory mapping.
4.1 Hardware of the NAO robot
The proposed method has been implemented on the humanoid robot NAO so as to verify the effectiveness of the proposed sensory mapping design. The NAO is a bipedal robot of 57.32cm height and 4.7Kg weight [18]. It has 11 motors on two feet, where the HipYawPitch of the left and right use the same motor and is not orthogonal to any other axes. The NAO can calculate its own ZMP using 8 force sensors on the bottom of two feet. A two-axis gyroscope and a three-axis accelerometer are installed in its torso to measure the roll and pitch angles of the robot.
4.2 Walking Pattern Generation
In order to simplify online calculation, we generate the foot trajectory with pendulum functions [19]. The pendulum function can be easily adjusted by changing the two parameters shown in (1). The desired walking pattern can be generated separately in two orthogonal spaces, namely the X-Z and X-Y planes. While X is the direction forwards and Z is the direction upwards, the foot trajectory in the X-Z plane can be written as:
where α1 is the half length of the trajectory, h1 is the height of the trajectory, t is the sample time and T denotes the time of half cycle. The two foot trajectories only differ in their initial timing. Figure 4 shows the simulation results of robot walking pattern, where the black lines represent the waist and the other two colour lines are the gait of the two legs. Since the trajectories in two orthogonal planes are independent, the pendulum functions in the X-Y plane of the waist trajectory are such that:
Simulation of robot walking in (a) the X-Z plane, (b) the 3D space
where α2 is the half length of the trajectory and h2 is the height of the trajectory. The walking pattern can be easily calculated and adjusted by a total of four length parameters and one time parameter.
4.3 Inverse kinematics and control of the NAO
The Denavit-Hatenberg (D-H) model was applied to calculate the inverse kinematics of the NAO. The predefined parameters are listed in Table 1, where the origin is at the bottom of foot and the endpoint is the waist, in order to simplify the calculation. Because the HipYawPitch axes are not orthogonal to the other axes, we define both angles of the left HipYawPitch and the right HipYawPitch equal to zero. As a result, the coupling effect of the HipYawPitch axes can be ignored when calculating the inverse kinematics.
D-H parameters from foot to waist on the NAO
From the walking patterns shown in (1) and (2), the desired joint angles can be obtained after the calculation of the inverse kinematics. With the PC-based control software, these commands are sent to the NAO via a wireless network and then executed by motors so as to move the feet to the desired positions.
4.4 Training of the ANN
The sensory data from a two-axis gyroscope and a three-axis accelerometer is used for slope surface recognition. Fig. 5 shows typical recorded sensory data sets for the robot walking on a flat surface. In each figure, the sensory data of one walking period is recorded and that of three periods are presented in the figure for comparison. The sensory data includes the X-direction rotation angle (AngX), the Y-direction rotation angle (AngY), the X-direction angular velocity (GyrX), the Y-direction angular velocity (GyrY), the X-direction acceleration (AccX), the Y-direction acceleration (AccY) and the Z-direction acceleration (AccZ). In these figures, the units of the X-axes are 0.1 seconds and units of the Y-axes are the radian for the angle, the radian/s for the angular velocity and m/s^2 for the acceleration.

Recorded sensory data during bipedal walking: (a) X-direction acceleration (AccX), (b) Y-direction acceleration (AccY), (c) Z-direction acceleration (AccZ), (d) X-direction rotation angle (AngX), (e) Y-direction rotation angle (AngY), (f) X-direction angular velocity (GyrX), (g) Y-direction angular velocity (GyrY)
The robot walked on each type of environment to record the training data sets for the TDSM. Fig. 6 illustrates the walking cycles to generate the training data sets for bipedal walking. There are 10 periods for one recorded data set. The first five periods are used as the training data for the neural network; the other five periods are used as offline testing data. For this work, one walking period is 12.8 seconds, which is divided into 32 phases of sensory mapping. In other words, we classify the environment every 0.4 seconds in the experiment and there are a total of 32 ANN classifiers for one period of gait motion. The average executing time for one sensory mapping phase is 6.06ms using the python program of the NAO system with a 2.13GHz Intel processor.

Design of the training and testing data for the walking experiments
To fulfil the requirements for successful training, we set a mean square errors (MSE) of 10^-10 as the measure of convergence. All 32 classifiers are trained to obtain the sensory mapping of a complete cycle of bipedal walking. Fig. 7 shows the convergence of the MSE of four classifiers: the 1st, 16th, 17th and 32nd ANN. After 32 classifiers were successfully trained, we obtained 32 sets of weights and biases which were used to estimate the environment online for 32 different phases in one bipedal walking period.

The MSE of four ANNs: (a) 1st classifier, (b) 16th classifier, (c) 17th classifier, (d) 32nd classifier
5. Experimental results
The TDSM has been applied to the bipedal walking of the NAO on a sloped surface to evaluate environment recognition. In this case, five types of environment were determined, namely 4° uphill, 5° uphill, 4° downhill, 5° downhill and flat surface. Fig. 8 illustrates the system block diagram of the experimental setup. For every experiment, the robot is placed on the sloped surface and walks for several periods. The recognition results within these periods are recorded and the recognition rates are calculated. Fig. 9 shows pictures of the robot during the experiment. The parameters of the walking pattern generation are listed in Table 2; the definitions of the parameters are referred to by (1) and (2).
Parameters of the walking pattern

Block diagram of the experimental setup

The NAO robot walks on 3 surfaces: (a) downhill, (b) flat surface, (c) uphill
5.1 Offline simulation results
For the ANN training data, there are 10 sets of training data for three environment types, namely 4° uphill, 4° downhill and flat surface. Each set of data contains 10 periods. Thus, there are a total of 300 periods such that 150 periods of data are used for the ANN training and 150 periods of data are used for the offline testing. Using the training-data acquisition procedure described in Section 4.3, we first tested the proposed method offline. We evaluated the sensory mapping design with a conventional ANN and the proposed TDSM for comparison. Without any pre-processing of the raw sensory data, the average recognition rate of the three environments was 91.35% for the conventional ANN. Table 3 shows the experimental results of the conventional ANN for the three types of environments. In a total of 1600 test samples for uphill motion, the recognition rate is 87.63%. Downhill motion gives a recognition rate of 96.81% in this experiment.
Offline environment recognition results of a conventional ANN
On the other hand, in the offline simulation using the proposed TDSM, the inputs of the neural network is the sensory data at time t-2, t-1 and t. With 21 inputs to the time-delay ANN, the average recognition rate of the TDSM for the three environments is 93.69%. The result of the environment recognition is presented in Table 4. It is clear that the TDSM performs better than the conventional ANN sensory mapping due to its time dependent property. The number of consecutive sensory inputs is a design parameter. It can be chosen according to the varying nature of the signals. In our experiments, 3 consecutive sets of sample data are quiet enough for our desired accuracy.
Offline environment recognition results of the TDSM
5.2 Online experimental results using the NAO
After successful offline simulation, we tested the sensory mapping online using the NAO. The recognition rates of the online experiments are presented in Tables 5 and 6. In 1600 test samples for each environment, the average recognition rate of the TDSM on 4° uphill, 4° uphill and the flat surface is 98.02%, a dramatic improvement over the 69.19% of the conventional ANN in the same environments. With the same ANN database, the recognition rate of a 5° uphill slope is 98.20% and the recognition rate of a 5° downhill slope is 99.56%, which gives almost the same accuracy as those of the 4° slopes. This result shows that the TDSM can estimate not only those environments that have been trained but also similar ones. In the current control structure, the robot can only experiment with up to 5° slopes; the robot will fall on slopes greater than 5° due to a balance problem. However, if the dynamic control is able ensure the mobility of the robot, it is possible that the TDSM could work on other slope angles.
Online experimental results of the conventional ANN
Online experimental results of the TDSM
It is interesting to compare the recognition results of the conventional ANN and the TDSM for each phase of bipedal walking, as shown in Fig. 10. The recognition rates of 32 ANNs for both sensory mappings are depicted in Fig 10. The blue bars denote the conventional ANN while the red ones denote that of the TDSM. It was observed that the recognition rate in the swing phase of the conventional ANN drops sharply due to the fast changing sensory data, which causes estimation errors. On the other hand, the TDSM gives high recognition accuracy even during foot swing phases. As a result, the advantages of the TDSM are validated in this experiment.

Comparison between conventional sensory map and proposed TDSM
It was observed that during the offline test the sensory mapping results of the conventional ANN and the TSDM were not too different. However, during the online experiments, the TDSM outperformed the conventional ANN a great deal. This was mainly due to the data fluctuation in practical bipedal walking on sloped surfaces. The TDSM has the advantage of predicting the trends in the sensory information and thus it can record the motion characteristics better than the conventional ANN.
6. Conclusion
A design methodology to map the sensory data of a bipedal robot into an environment type is presented in this paper. The current sensory map design uses 7 kinds of sensory information in 3 consecutive sample instants as the input data of the time-delay neural network. The TDSM records the trend of the sensor values of a bipedal walking robot. Experimental results show that the TDSM performs satisfactorily for the environment recognition in bipedal walking with a recognition rate of 98.02%. This design can be implemented for any bipedal robot without advance knowledge of the kinematics. With the sensory map, a bipedal robot can recognize the environment type online, giving an opportunity to adapt to it.
The results of this study support the idea that adding time delay data into the input of the classifier for environment recognition can increase the recognition rate due to the time-related property. The current study has only examined three types of environment. However, it is shown that the TDSM can estimate other similar environments if proper sensory data can be provided. It is also desirable to detect the transition of the slope in bipedal walking. In the current design, the robot falls as it walks to the transition slope. Since the timing of foot contact with the ground is uncontrollable, there will be countless situations for the transition and the accompanying sensory data. The transition recognition thus poses an important problem for future sensory mapping design. Further research is being undertaken in the design of a compensation method for adjusting such dynamic walking based on the recognized environment. With the corresponding walking pattern, a bipedal robot will be able to adapt to unknown environments.
Footnotes
7. Acknowledgments
This work was supported by the National Science Council, Taiwan, R.O.C. under Grant NSC-99-2221-E-009-135-MY2.
