A terrain analysis method with a scanning laser range finder was proposed. For five typical kinds of terrain, including flat ground, vertical wall, slope, step and cuboid obstacle, the method can distinguish them successfully. Comparing with some methods used cameras, it's more simple and has less calculation. For the uneven terrain like slope, step, cuboid obstacle and so on, a leg joint adjustment unit was proposed. Based on the locomotion control method with a central pattern generator (CPG), the leg joint adjustment unit can adjust each foot position individually. It can also adjust the height of the center of robot's gravity independently to adapt different uneven terrain. Experiment have proved the rationality and validity of the methods above.