Cockroaches live in a wide range of environments around the world. Pest species of cockroaches adapt readily to a variety of environments, but prefer warm conditions found within buildings. Many tropical species prefer even warmer environments and do not fare well in the average household.
The spines on the legs were earlier considered to be sensory, but observations of their locomotion on sand and wire meshes have demonstrated that they help in locomotion on difficult terrain. The structures have been used as inspiration for robotic legs.