Terrain Perception for a Walking Robot with a Low-Cost Structured Light Sensor