Adaptive and sensory machines : active foam and swimming rheometers