State Estimation and Environment Recognition for Articulated Structures via Proximity Sensors Distributed over the Whole Body