Terrain classification and adaptive locomotion for a hexapod robot Qingzhui