A new algorithm is allowing researchers to develop soft robots that are better able to collect useful information about their surroundings.